Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions BetterCooldownManager.toc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,5 @@ Locales/koKR.lua
# Load Modules
Modules/Init.xml

# Load Custom Viewers
CustomViewers/Init.xml

# Load Core
Core/Init.xml
6 changes: 2 additions & 4 deletions Core/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ end
function BetterCooldownManager:OnEnable()
BCDM:CheckAddOns()
BCDM:Init()
BCDM:MigrateCustomViewerData()
BCDM:SetupEventManager()
BCDM:SkinCooldownManager()
BCDM:DisableAuraOverlay()
Expand All @@ -24,11 +25,8 @@ function BetterCooldownManager:OnEnable()
BCDM:CreateSecondaryPowerBar()
BCDM:CreateCastBar()
C_Timer.After(0.1, function()
BCDM:SetupCustomCooldownViewer()
BCDM:SetupAdditionalCustomCooldownViewer()
BCDM:SetupCustomItemBar()
BCDM:SetupCustomViewer()
BCDM:SetupTrinketBar()
BCDM:SetupCustomItemsSpellsBar()
BCDM:CreateCooldownViewerOverlays()
end)
BCDM:SetupEditModeManager()
Expand Down
33 changes: 0 additions & 33 deletions Core/Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -564,22 +564,6 @@ local RACIALS = {
[1237885] = { isActive = true, layoutIndex = 25 }, -- Thorn Bloom
}

function BCDM:AddRecommendedItems()
local CooldownManagerDB = BCDM.db.profile
if not CooldownManagerDB then return end

local CustomDB = CooldownManagerDB.CooldownManager.Item
if not ITEMS or type(ITEMS) ~= "table" then return end
if not CustomDB then CustomDB = {} CooldownManagerDB.CooldownManager.Item = CustomDB end
if not CustomDB.Items then CustomDB.Items = {} end

for itemId, data in pairs(ITEMS) do
if itemId and data and not CustomDB.Items[itemId] then
CustomDB.Items[itemId] = data
end
end
end

function BCDM:FetchData(options)
options = options or {}
local includeSpells = options.includeSpells
Expand Down Expand Up @@ -630,23 +614,6 @@ function BCDM:FetchData(options)
return dataList
end

function BCDM:AddRecommendedSpells(customDB)
local CooldownManagerDB = BCDM.db.profile
local CustomDB = CooldownManagerDB.CooldownManager[customDB]
local _, playerClass = UnitClass("player")
local specIndex = GetSpecialization()
local specID, specName = specIndex and GetSpecializationInfo(specIndex)
local playerSpecialization = BCDM:NormalizeSpecToken(specName, specID, specIndex)
if DEFENSIVE_SPELLS[playerClass] and DEFENSIVE_SPELLS[playerClass][playerSpecialization] then
for spellId, data in pairs(DEFENSIVE_SPELLS[playerClass][playerSpecialization]) do
if not CustomDB.Spells[playerClass] then CustomDB.Spells[playerClass] = {} end
if not CustomDB.Spells[playerClass][playerSpecialization] then CustomDB.Spells[playerClass][playerSpecialization] = {} end
if not CustomDB.Spells[playerClass][playerSpecialization][spellId] then
CustomDB.Spells[playerClass][playerSpecialization][spellId] = data
end
end
end
end

-- Event check for equipped trinkets; trinket icons are driven directly from slots 13/14.
local trinketCheckEvent = CreateFrame("Frame")
Expand Down
264 changes: 32 additions & 232 deletions Core/Defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ local Defaults = {
[Enum.PowerType.SoulShards] = { 0.58, 0.51, 0.79, 1.0 },
[Enum.PowerType.Runes] = { 0.77, 0.12, 0.23, 1.0 },
[Enum.PowerType.Maelstrom] = { 0.25, 0.50, 0.80, 1.0},
SOUL = { 0.29, 0.42, 1.00, 1.0},
SOUL = { 0.00, 0.80, 0.00, 1.0},
DEVOURER_SOUL = { 0.11, 0.34, 0.71, 1.0},
STAGGER = { 0.00, 1.00, 0.59, 1.0 },
RUNE_RECHARGE = { 0.5, 0.5, 0.5, 1.0 },
ESSENCE_RECHARGE = { 0.5, 0.5, 0.5, 1.0 },
Expand Down Expand Up @@ -188,222 +189,41 @@ local Defaults = {
},
}
},
Custom = {
IconSize = 38,
IconWidth = 38,
IconHeight = 38,
KeepAspectRatio = true,
FrameStrata = "LOW",
Layout = {"CENTER", "NONE", "CENTER", 0, 0},
Spacing = 1,
GrowthDirection = "RIGHT",
Columns = 0,
Text = {
FontSize = 12,
Colour = {1, 1, 1},
Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}
},
Spells = {
-- Monk
["MONK"] = {
["BREWMASTER"] = {},
["WINDWALKER"] = {},
["MISTWEAVER"] = {},
},
-- Demon Hunter
["DEMONHUNTER"] = {
["HAVOC"] = {},
["VENGEANCE"] = {},
["DEVOURER"] = {},
},
-- Death Knight
["DEATHKNIGHT"] = {
["BLOOD"] = {},
["UNHOLY"] = {},
["FROST"] = {}
},
-- Mage
["MAGE"] = {
["FROST"] = {},
["FIRE"] = {},
["ARCANE"] = {},
},
-- Paladin
["PALADIN"] = {
["RETRIBUTION"] = {},
["HOLY"] = {},
["PROTECTION"] = {}
},
-- Shaman
["SHAMAN"] = {
["ELEMENTAL"] = {},
["ENHANCEMENT"] = {},
["RESTORATION"] = {}
},
-- Druid
["DRUID"] = {
["GUARDIAN"] = {},
["FERAL"] = {},
["RESTORATION"] = {},
["BALANCE"] = {},
},
-- Evoker
["EVOKER"] = {
["DEVASTATION"] = {},
["AUGMENTATION"] = {},
["PRESERVATION"] = {}
},
-- Warrior
["WARRIOR"] = {
["ARMS"] = {},
["FURY"] = {},
["PROTECTION"] = {},
},
-- Priest
["PRIEST"] = {
["SHADOW"] = {},
["DISCIPLINE"] = {},
["HOLY"] = {},
CustomViewer = {
ActiveViewerID = 1,
NextViewerID = 2,
Viewers = {
{
ViewerID = 1,
Name = "Custom Viewer 1",
FrameName = "BCDM_CustomViewer",
IconSize = 38,
IconWidth = 38,
IconHeight = 38,
KeepAspectRatio = true,
FrameStrata = "LOW",
Layout = {"CENTER", "NONE", "CENTER", 0, 0},
Spacing = 1,
GrowthDirection = "LEFT",
Columns = 0,
OffsetByParentHeight = true,
HideZeroCharges = false,
ShowItemQualityBorder = true,
AutoDetectUsableTrinkets = false,
Text = {
FontSize = 12,
Colour = {1, 1, 1},
Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}
},
ItemsSpells = {},
},
-- Warlock
["WARLOCK"] = {
["DESTRUCTION"] = {},
["AFFLICTION"] = {},
["DEMONOLOGY"] = {},
},
-- Hunter
["HUNTER"] = {
["SURVIVAL"] = {},
["MARKSMANSHIP"] = {},
["BEASTMASTERY"] = {},
},
-- Rogue
["ROGUE"] = {
["OUTLAW"] = {},
["ASSASSINATION"] = {},
["SUBTLETY"] = {},
}
},
},
AdditionalCustom = {
IconSize = 38,
IconWidth = 38,
IconHeight = 38,
KeepAspectRatio = true,
FrameStrata = "LOW",
Layout = {"CENTER", "NONE", "CENTER", 0, 0},
Spacing = 1,
GrowthDirection = "RIGHT",
Columns = 0,
Text = {
FontSize = 12,
Colour = {1, 1, 1},
Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}
},
Spells = {
-- Monk
["MONK"] = {
["BREWMASTER"] = {},
["WINDWALKER"] = {},
["MISTWEAVER"] = {},
},
-- Demon Hunter
["DEMONHUNTER"] = {
["HAVOC"] = {},
["VENGEANCE"] = {},
["DEVOURER"] = {},
},
-- Death Knight
["DEATHKNIGHT"] = {
["BLOOD"] = {},
["UNHOLY"] = {},
["FROST"] = {}
},
-- Mage
["MAGE"] = {
["FROST"] = {},
["FIRE"] = {},
["ARCANE"] = {},
},
-- Paladin
["PALADIN"] = {
["RETRIBUTION"] = {},
["HOLY"] = {},
["PROTECTION"] = {}
},
-- Shaman
["SHAMAN"] = {
["ELEMENTAL"] = {},
["ENHANCEMENT"] = {},
["RESTORATION"] = {}
},
-- Druid
["DRUID"] = {
["GUARDIAN"] = {},
["FERAL"] = {},
["RESTORATION"] = {},
["BALANCE"] = {},
},
-- Evoker
["EVOKER"] = {
["DEVASTATION"] = {},
["AUGMENTATION"] = {},
["PRESERVATION"] = {}
},
-- Warrior
["WARRIOR"] = {
["ARMS"] = {},
["FURY"] = {},
["PROTECTION"] = {},
},
-- Priest
["PRIEST"] = {
["SHADOW"] = {},
["DISCIPLINE"] = {},
["HOLY"] = {},
},
-- Warlock
["WARLOCK"] = {
["DESTRUCTION"] = {},
["AFFLICTION"] = {},
["DEMONOLOGY"] = {},
},
-- Hunter
["HUNTER"] = {
["SURVIVAL"] = {},
["MARKSMANSHIP"] = {},
["BEASTMASTERY"] = {},
},
-- Rogue
["ROGUE"] = {
["OUTLAW"] = {},
["ASSASSINATION"] = {},
["SUBTLETY"] = {},
}
},
},
Item = {
IconSize = 38,
IconWidth = 38,
IconHeight = 38,
KeepAspectRatio = true,
FrameStrata = "LOW",
Layout = {"CENTER", "NONE", "CENTER", 0, 0},
Spacing = 1,
GrowthDirection = "LEFT",
Columns = 0,
OffsetByParentHeight = true,
HideZeroCharges = false,
ShowItemQualityBorder = true,
Text = {
FontSize = 12,
Colour = {1, 1, 1},
Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}
},
Items = {},
},
Trinket = {
Enabled = true,
ShowPassive = true,
AppendTo = "NONE",
AppendSide = "RIGHT",
IconSize = 38,
IconWidth = 38,
IconHeight = 38,
Expand All @@ -414,26 +234,6 @@ local Defaults = {
GrowthDirection = "LEFT",
OffsetByParentHeight = true,
},
ItemSpell = {
IconSize = 38,
IconWidth = 38,
IconHeight = 38,
KeepAspectRatio = true,
FrameStrata = "LOW",
Layout = {"CENTER", "NONE", "CENTER", 0, 0},
Spacing = 1,
GrowthDirection = "LEFT",
Columns = 0,
OffsetByParentHeight = true,
HideZeroCharges = false,
ShowItemQualityBorder = true,
Text = {
FontSize = 12,
Colour = {1, 1, 1},
Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}
},
ItemsSpells = {},
},
},
PowerBar = {
Enabled = true,
Expand Down
10 changes: 6 additions & 4 deletions Core/EventManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ local function HidePetBattleFrames()
HideFrameForPetBattle(BCDM.PowerBar)
HideFrameForPetBattle(BCDM.SecondaryPowerBar)
HideFrameForPetBattle(BCDM.CastBar)
HideFrameForPetBattle(BCDM.AdditionalCustomCooldownViewerContainer)
HideFrameForPetBattle(BCDM.CustomCooldownViewerContainer)
HideFrameForPetBattle(BCDM.CustomItemBarContainer)
HideFrameForPetBattle(BCDM.CustomItemSpellBarContainer)
HideFrameForPetBattle(BCDM.CustomViewerContainer)
if BCDM.CustomViewerContainers then
for _, container in pairs(BCDM.CustomViewerContainers) do
HideFrameForPetBattle(container)
end
end
HideFrameForPetBattle(BCDM.TrinketBarContainer)
end

Expand Down
Loading