clean up
This commit is contained in:
parent
59da6f34c6
commit
114c0ac96d
@ -136,7 +136,7 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
|
|||||||
else
|
else
|
||||||
unitClass = Gladdy.buttons[srcUnit].race
|
unitClass = Gladdy.buttons[srcUnit].race
|
||||||
end
|
end
|
||||||
Cooldowns:CooldownUsed(srcUnit, unitClass, spellId, spellName)
|
Cooldowns:CooldownUsed(srcUnit, unitClass, spellId)
|
||||||
Gladdy:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
|
Gladdy:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -42,7 +42,7 @@ local function getDefaultCooldown()
|
|||||||
if spellName then
|
if spellName then
|
||||||
cooldowns[tostring(spellId)] = true
|
cooldowns[tostring(spellId)] = true
|
||||||
else
|
else
|
||||||
Gladdy:Print("spellid does not exist " .. spellId)
|
Gladdy:Debug("ERROR", "spellid does not exist " .. spellId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -79,7 +79,7 @@ function Cooldowns:Initialize()
|
|||||||
self.cooldownSpellIds[spellName] = spellId
|
self.cooldownSpellIds[spellName] = spellId
|
||||||
self.spellTextures[spellId] = texture
|
self.spellTextures[spellId] = texture
|
||||||
else
|
else
|
||||||
Gladdy:Print("spellid does not exist " .. spellId)
|
Gladdy:Debug("ERROR", "spellid does not exist " .. spellId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -373,7 +373,6 @@ function Cooldowns:DetectSpec(unit, spec)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--end
|
|
||||||
end
|
end
|
||||||
----------------------
|
----------------------
|
||||||
--- RACE FUNCTIONALITY
|
--- RACE FUNCTIONALITY
|
||||||
|
@ -72,6 +72,7 @@ importButton:SetCallback("OnClick", function(widget)
|
|||||||
Gladdy:Reset()
|
Gladdy:Reset()
|
||||||
Gladdy:HideFrame()
|
Gladdy:HideFrame()
|
||||||
Gladdy:ToggleFrame(3)
|
Gladdy:ToggleFrame(3)
|
||||||
|
LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
|
||||||
end)
|
end)
|
||||||
import:AddChild(importButton)
|
import:AddChild(importButton)
|
||||||
import.button = importButton
|
import.button = importButton
|
||||||
@ -117,7 +118,7 @@ local function checkIsDeletedOption(k, str, msg, errorFound, errorMsg)
|
|||||||
for key, _ in pairs(deletedOptions) do
|
for key, _ in pairs(deletedOptions) do
|
||||||
if str_match(k, key) then
|
if str_match(k, key) then
|
||||||
isDeleted = true
|
isDeleted = true
|
||||||
Gladdy:Warn("found deleted option =", str .. "." .. k)
|
Gladdy:Debug("WARN", "found deleted option =", str .. "." .. k)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if errorFound then
|
if errorFound then
|
||||||
@ -231,7 +232,7 @@ function ExportImport:ApplyImport(t, table, str)
|
|||||||
if (table[k] ~= nil) then
|
if (table[k] ~= nil) then
|
||||||
ExportImport:ApplyImport(v, table[k], str .. "." .. k)
|
ExportImport:ApplyImport(v, table[k], str .. "." .. k)
|
||||||
else
|
else
|
||||||
Gladdy:Warn("ApplyImport failed for", str .. "." .. k)
|
Gladdy:Debug("ERROR", "ApplyImport failed for", str .. "." .. k)
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@ -251,7 +251,7 @@ function Healthbar:ENEMY_SPOTTED(unit)
|
|||||||
healthBar.hp:SetValue(health)
|
healthBar.hp:SetValue(health)
|
||||||
Healthbar:SetHealthText(healthBar, health, healthMax)
|
Healthbar:SetHealthText(healthBar, health, healthMax)
|
||||||
end
|
end
|
||||||
if Gladdy.db.healthName and not Gladdy.db.healthNameToArenaId then
|
if button.name and Gladdy.db.healthName and not Gladdy.db.healthNameToArenaId then
|
||||||
healthBar.nameText:SetText(button.name)
|
healthBar.nameText:SetText(button.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -504,20 +504,6 @@ function Healthbar:GetOptions()
|
|||||||
width = "full",
|
width = "full",
|
||||||
disabled = function() return not Gladdy.db.healthName end
|
disabled = function() return not Gladdy.db.healthName end
|
||||||
}),
|
}),
|
||||||
healthActual = option({
|
|
||||||
type = "toggle",
|
|
||||||
name = L["Show the actual health"],
|
|
||||||
desc = L["Show the actual health on the health bar"],
|
|
||||||
order = 4,
|
|
||||||
width = "full",
|
|
||||||
}),
|
|
||||||
healthMax = option({
|
|
||||||
type = "toggle",
|
|
||||||
name = L["Show max health"],
|
|
||||||
desc = L["Show max health on the health bar"],
|
|
||||||
order = 5,
|
|
||||||
width = "full",
|
|
||||||
}),
|
|
||||||
healthPercentage = option({
|
healthPercentage = option({
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
name = L["Show health percentage"],
|
name = L["Show health percentage"],
|
||||||
|
@ -4,74 +4,17 @@ local L = Gladdy.L
|
|||||||
local XiconProfiles = Gladdy:NewModule("XiconProfiles", nil, {
|
local XiconProfiles = Gladdy:NewModule("XiconProfiles", nil, {
|
||||||
})
|
})
|
||||||
|
|
||||||
function XiconProfiles:ApplyKlimp()
|
local function applyProfile(profileString)
|
||||||
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetKlimpProfile())
|
local deserialized = Gladdy.modules["Export Import"]:Decode(profileString)
|
||||||
if deserialized then
|
|
||||||
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
|
|
||||||
end
|
|
||||||
Gladdy:Reset()
|
|
||||||
Gladdy:HideFrame()
|
|
||||||
Gladdy:ToggleFrame(3)
|
|
||||||
end
|
|
||||||
|
|
||||||
function XiconProfiles:ApplyKnall()
|
|
||||||
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetKnallProfile())
|
|
||||||
if deserialized then
|
|
||||||
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
|
|
||||||
end
|
|
||||||
Gladdy:Reset()
|
|
||||||
Gladdy:HideFrame()
|
|
||||||
Gladdy:ToggleFrame(3)
|
|
||||||
end
|
|
||||||
|
|
||||||
function XiconProfiles:ApplyClassic()
|
|
||||||
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetClassicProfile())
|
|
||||||
if deserialized then
|
|
||||||
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
|
|
||||||
end
|
|
||||||
Gladdy:Reset()
|
|
||||||
Gladdy:HideFrame()
|
|
||||||
Gladdy:ToggleFrame(3)
|
|
||||||
end
|
|
||||||
|
|
||||||
function XiconProfiles:ApplyClassicNoPet()
|
|
||||||
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetClassicProfileNoPet())
|
|
||||||
if deserialized then
|
|
||||||
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
|
|
||||||
end
|
|
||||||
Gladdy:Reset()
|
|
||||||
Gladdy:HideFrame()
|
|
||||||
Gladdy:ToggleFrame(3)
|
|
||||||
end
|
|
||||||
|
|
||||||
function XiconProfiles:ApplyBlizz()
|
|
||||||
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetBlizzardProfile())
|
|
||||||
if deserialized then
|
|
||||||
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
|
|
||||||
end
|
|
||||||
Gladdy:Reset()
|
|
||||||
Gladdy:HideFrame()
|
|
||||||
Gladdy:ToggleFrame(3)
|
|
||||||
end
|
|
||||||
|
|
||||||
function XiconProfiles:ApplyRukk()
|
|
||||||
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetRukkProfile())
|
|
||||||
if deserialized then
|
|
||||||
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
|
|
||||||
end
|
|
||||||
Gladdy:Reset()
|
|
||||||
Gladdy:HideFrame()
|
|
||||||
Gladdy:ToggleFrame(3)
|
|
||||||
end
|
|
||||||
|
|
||||||
function XiconProfiles:ApplyMir()
|
|
||||||
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetMirProfile())
|
|
||||||
if deserialized then
|
if deserialized then
|
||||||
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
|
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
|
||||||
end
|
end
|
||||||
Gladdy:Reset()
|
Gladdy:Reset()
|
||||||
Gladdy:HideFrame()
|
Gladdy:HideFrame()
|
||||||
Gladdy:ToggleFrame(3)
|
Gladdy:ToggleFrame(3)
|
||||||
|
Gladdy.options.args.lock.name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"]
|
||||||
|
Gladdy.options.args.showMover.name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"]
|
||||||
|
LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
|
||||||
end
|
end
|
||||||
|
|
||||||
function XiconProfiles:GetOptions()
|
function XiconProfiles:GetOptions()
|
||||||
@ -85,7 +28,7 @@ function XiconProfiles:GetOptions()
|
|||||||
type = "execute",
|
type = "execute",
|
||||||
func = function()
|
func = function()
|
||||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||||
XiconProfiles:ApplyBlizz()
|
applyProfile(Gladdy:GetBlizzardProfile())
|
||||||
end,
|
end,
|
||||||
name = " ",
|
name = " ",
|
||||||
desc = "Blizzard " .. L["Profile"],
|
desc = "Blizzard " .. L["Profile"],
|
||||||
@ -104,7 +47,7 @@ function XiconProfiles:GetOptions()
|
|||||||
type = "execute",
|
type = "execute",
|
||||||
func = function()
|
func = function()
|
||||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||||
XiconProfiles:ApplyClassic()
|
applyProfile(Gladdy:GetClassicProfile())
|
||||||
end,
|
end,
|
||||||
name = " ",
|
name = " ",
|
||||||
desc = "Classic " .. L["Profile"],
|
desc = "Classic " .. L["Profile"],
|
||||||
@ -123,7 +66,7 @@ function XiconProfiles:GetOptions()
|
|||||||
type = "execute",
|
type = "execute",
|
||||||
func = function()
|
func = function()
|
||||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||||
XiconProfiles:ApplyClassicNoPet()
|
applyProfile(Gladdy:GetClassicProfileNoPet())
|
||||||
end,
|
end,
|
||||||
name = " ",
|
name = " ",
|
||||||
desc = "Classic " .. L["Profile"] .. L[" No Pet"],
|
desc = "Classic " .. L["Profile"] .. L[" No Pet"],
|
||||||
@ -142,7 +85,7 @@ function XiconProfiles:GetOptions()
|
|||||||
type = "execute",
|
type = "execute",
|
||||||
func = function()
|
func = function()
|
||||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||||
XiconProfiles:ApplyKnall()
|
applyProfile(Gladdy:GetKnallProfile())
|
||||||
end,
|
end,
|
||||||
name = " ",
|
name = " ",
|
||||||
desc = "Knall's " .. L["Profile"],
|
desc = "Knall's " .. L["Profile"],
|
||||||
@ -161,7 +104,7 @@ function XiconProfiles:GetOptions()
|
|||||||
type = "execute",
|
type = "execute",
|
||||||
func = function()
|
func = function()
|
||||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||||
XiconProfiles:ApplyKlimp()
|
applyProfile(Gladdy:GetKlimpProfile())
|
||||||
end,
|
end,
|
||||||
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Klimp1.blp",
|
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Klimp1.blp",
|
||||||
imageWidth = 350,
|
imageWidth = 350,
|
||||||
@ -180,7 +123,7 @@ function XiconProfiles:GetOptions()
|
|||||||
type = "execute",
|
type = "execute",
|
||||||
func = function()
|
func = function()
|
||||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||||
XiconProfiles:ApplyRukk()
|
applyProfile(Gladdy:GetRukkProfile())
|
||||||
end,
|
end,
|
||||||
name = " ",
|
name = " ",
|
||||||
desc = "Rukk1's " .. L["Profile"],
|
desc = "Rukk1's " .. L["Profile"],
|
||||||
@ -199,7 +142,7 @@ function XiconProfiles:GetOptions()
|
|||||||
type = "execute",
|
type = "execute",
|
||||||
func = function()
|
func = function()
|
||||||
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
|
||||||
XiconProfiles:ApplyMir()
|
applyProfile(Gladdy:GetMirProfile())
|
||||||
end,
|
end,
|
||||||
name = " ",
|
name = " ",
|
||||||
desc = "Mir's " .. L["Profile"],
|
desc = "Mir's " .. L["Profile"],
|
||||||
|
Loading…
Reference in New Issue
Block a user