This commit is contained in:
Sumsebrum 2022-01-11 00:29:30 +01:00
parent 59da6f34c6
commit 114c0ac96d
5 changed files with 19 additions and 90 deletions

View File

@ -136,7 +136,7 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
else
unitClass = Gladdy.buttons[srcUnit].race
end
Cooldowns:CooldownUsed(srcUnit, unitClass, spellId, spellName)
Cooldowns:CooldownUsed(srcUnit, unitClass, spellId)
Gladdy:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
end
end

View File

@ -42,7 +42,7 @@ local function getDefaultCooldown()
if spellName then
cooldowns[tostring(spellId)] = true
else
Gladdy:Print("spellid does not exist " .. spellId)
Gladdy:Debug("ERROR", "spellid does not exist " .. spellId)
end
end
end
@ -79,7 +79,7 @@ function Cooldowns:Initialize()
self.cooldownSpellIds[spellName] = spellId
self.spellTextures[spellId] = texture
else
Gladdy:Print("spellid does not exist " .. spellId)
Gladdy:Debug("ERROR", "spellid does not exist " .. spellId)
end
end
end
@ -373,7 +373,6 @@ function Cooldowns:DetectSpec(unit, spec)
end
end
end
--end
end
----------------------
--- RACE FUNCTIONALITY

View File

@ -72,6 +72,7 @@ importButton:SetCallback("OnClick", function(widget)
Gladdy:Reset()
Gladdy:HideFrame()
Gladdy:ToggleFrame(3)
LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
end)
import:AddChild(importButton)
import.button = importButton
@ -117,7 +118,7 @@ local function checkIsDeletedOption(k, str, msg, errorFound, errorMsg)
for key, _ in pairs(deletedOptions) do
if str_match(k, key) then
isDeleted = true
Gladdy:Warn("found deleted option =", str .. "." .. k)
Gladdy:Debug("WARN", "found deleted option =", str .. "." .. k)
end
end
if errorFound then
@ -231,7 +232,7 @@ function ExportImport:ApplyImport(t, table, str)
if (table[k] ~= nil) then
ExportImport:ApplyImport(v, table[k], str .. "." .. k)
else
Gladdy:Warn("ApplyImport failed for", str .. "." .. k)
Gladdy:Debug("ERROR", "ApplyImport failed for", str .. "." .. k)
end
else

View File

@ -251,7 +251,7 @@ function Healthbar:ENEMY_SPOTTED(unit)
healthBar.hp:SetValue(health)
Healthbar:SetHealthText(healthBar, health, healthMax)
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)
end
@ -504,20 +504,6 @@ function Healthbar:GetOptions()
width = "full",
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({
type = "toggle",
name = L["Show health percentage"],

View File

@ -4,74 +4,17 @@ local L = Gladdy.L
local XiconProfiles = Gladdy:NewModule("XiconProfiles", nil, {
})
function XiconProfiles:ApplyKlimp()
local deserialized = Gladdy.modules["Export Import"]:Decode(Gladdy:GetKlimpProfile())
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())
local function applyProfile(profileString)
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)
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
function XiconProfiles:GetOptions()
@ -85,7 +28,7 @@ function XiconProfiles:GetOptions()
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
XiconProfiles:ApplyBlizz()
applyProfile(Gladdy:GetBlizzardProfile())
end,
name = " ",
desc = "Blizzard " .. L["Profile"],
@ -104,7 +47,7 @@ function XiconProfiles:GetOptions()
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
XiconProfiles:ApplyClassic()
applyProfile(Gladdy:GetClassicProfile())
end,
name = " ",
desc = "Classic " .. L["Profile"],
@ -123,7 +66,7 @@ function XiconProfiles:GetOptions()
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
XiconProfiles:ApplyClassicNoPet()
applyProfile(Gladdy:GetClassicProfileNoPet())
end,
name = " ",
desc = "Classic " .. L["Profile"] .. L[" No Pet"],
@ -142,7 +85,7 @@ function XiconProfiles:GetOptions()
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
XiconProfiles:ApplyKnall()
applyProfile(Gladdy:GetKnallProfile())
end,
name = " ",
desc = "Knall's " .. L["Profile"],
@ -161,7 +104,7 @@ function XiconProfiles:GetOptions()
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
XiconProfiles:ApplyKlimp()
applyProfile(Gladdy:GetKlimpProfile())
end,
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Klimp1.blp",
imageWidth = 350,
@ -180,7 +123,7 @@ function XiconProfiles:GetOptions()
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
XiconProfiles:ApplyRukk()
applyProfile(Gladdy:GetRukkProfile())
end,
name = " ",
desc = "Rukk1's " .. L["Profile"],
@ -199,7 +142,7 @@ function XiconProfiles:GetOptions()
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
XiconProfiles:ApplyMir()
applyProfile(Gladdy:GetMirProfile())
end,
name = " ",
desc = "Mir's " .. L["Profile"],