From 3a943881e38c89f506615c58f7fa1644c7de88cd Mon Sep 17 00:00:00 2001 From: D4KiR <23246564+d4kir92@users.noreply.github.com> Date: Tue, 20 Aug 2024 09:47:45 +0200 Subject: [PATCH] v0.5.84 --- DarkMode.toc | 2 +- DarkMode_Cata.toc | 2 +- DarkMode_TBC.toc | 2 +- DarkMode_Vanilla.toc | 2 +- DarkMode_Wrath.toc | 2 +- core.lua | 43 ++++++++++++++++++++++++------------------- libs/D4Lib/D4Lib.lua | 12 ++++++++++-- settings.lua | 4 ++-- 8 files changed, 41 insertions(+), 28 deletions(-) diff --git a/DarkMode.toc b/DarkMode.toc index aa4d7be..b191593 100644 --- a/DarkMode.toc +++ b/DarkMode.toc @@ -4,7 +4,7 @@ ## Interface-Cata: 40400 ## Interface: 110002 -## Version: 0.5.83 +## Version: 0.5.84 ## Title: DarkMode by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/DarkMode_Cata.toc b/DarkMode_Cata.toc index b2380e0..f9199d7 100644 --- a/DarkMode_Cata.toc +++ b/DarkMode_Cata.toc @@ -1,5 +1,5 @@ ## Interface: 40400 -## Version: 0.5.83 +## Version: 0.5.84 ## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/DarkMode_TBC.toc b/DarkMode_TBC.toc index fb899a4..3c1b142 100644 --- a/DarkMode_TBC.toc +++ b/DarkMode_TBC.toc @@ -1,5 +1,5 @@ ## Interface: 20504 -## Version: 0.5.83 +## Version: 0.5.84 ## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/DarkMode_Vanilla.toc b/DarkMode_Vanilla.toc index e235855..839fbb3 100644 --- a/DarkMode_Vanilla.toc +++ b/DarkMode_Vanilla.toc @@ -1,5 +1,5 @@ ## Interface: 11503 -## Version: 0.5.83 +## Version: 0.5.84 ## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/DarkMode_Wrath.toc b/DarkMode_Wrath.toc index 673aa27..c4b7ede 100644 --- a/DarkMode_Wrath.toc +++ b/DarkMode_Wrath.toc @@ -1,5 +1,5 @@ ## Interface: 30403 -## Version: 0.5.83 +## Version: 0.5.84 ## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/core.lua b/core.lua index 1e7ec37..7ef94ec 100644 --- a/core.lua +++ b/core.lua @@ -1132,6 +1132,7 @@ npf:SetScript( nameplateIds[id] = true DarkMode:Debug(4, "#8 added") DarkMode:FindTexturesByName("NamePlate" .. id .. ".UnitFrame.healthBar.border", "np") + DarkMode:FindTexturesByName("NamePlate" .. id .. ".UnitFrame.CastBar.Border", "np") end end ) @@ -1220,8 +1221,10 @@ function DarkMode:Event(event, ...) } local chatSpecialButtons = { - ["ChatFrameMenuButton"] = {0.77, 0, 0}, - ["ChatFrameChannelButton"] = {0.94, 0, 0} + ["ChatFrameMenuButton"] = {0.8, 0.77, 0, 0}, + ["ChatFrameChannelButton"] = {0.94, 0.94, 0, 0}, + ["FriendsMicroButton"] = {0.76, 0.98, -1, 0}, + ["QuickJoinToastButton"] = {0.76, 0.98, -1, 0}, } if ChatFrame1ButtonFrameBottomButton then @@ -1255,23 +1258,25 @@ function DarkMode:Event(event, ...) end end end + end - for btnName, btnTab in pairs(chatSpecialButtons) do - local btn = _G[btnName] - if btn then - local scale = btnTab[1] - local px = btnTab[2] - local py = btnTab[3] - local _, sh = btn:GetSize() - sh = DarkMode:MathR(sh) - btn.border = btn:CreateTexture(btnName .. ".border", "OVERLAY") - local border = btn.border - border:SetDrawLayer("OVERLAY", 3) - border:SetSize(sh * scale, sh * scale) - border:SetTexture("Interface\\AddOns\\DarkMode\\media\\default") - border:SetPoint("CENTER", btn, "CENTER", px, py) - DarkMode:UpdateColor(border, "frames") - end + for btnName, btnTab in pairs(chatSpecialButtons) do + local btn = _G[btnName] + if btn then + local scalew = btnTab[1] + local scaleh = btnTab[2] + local px = btnTab[3] + local py = btnTab[4] + local sw, sh = btn:GetSize() + sw = DarkMode:MathR(sw) + sh = DarkMode:MathR(sh) + btn.border = btn:CreateTexture(btnName .. ".border", "OVERLAY") + local border = btn.border + border:SetDrawLayer("OVERLAY", 3) + border:SetSize(sw * scalew, sh * scaleh) + border:SetTexture("Interface\\AddOns\\DarkMode\\media\\default") + border:SetPoint("CENTER", btn, "CENTER", px, py) + DarkMode:UpdateColor(border, "frames") end end @@ -1612,7 +1617,7 @@ function DarkMode:Event(event, ...) ["name"] = "DarkMode", ["icon"] = 136122, ["dbtab"] = DMTAB, - ["vTT"] = {{"DarkMode |T136122:16:16:0:0|t", "v|cff3FC7EB0.5.83"}, {DarkMode:Trans("LEFTCLICK"), DarkMode:Trans("MMBTNLEFT")}, {DarkMode:Trans("RIGHTCLICK"), DarkMode:Trans("MMBTNRIGHT")}}, + ["vTT"] = {{"DarkMode |T136122:16:16:0:0|t", "v|cff3FC7EB0.5.84"}, {DarkMode:Trans("LEFTCLICK"), DarkMode:Trans("MMBTNLEFT")}, {DarkMode:Trans("RIGHTCLICK"), DarkMode:Trans("MMBTNRIGHT")}}, ["funcL"] = function() DarkMode:ToggleSettings() end, diff --git a/libs/D4Lib/D4Lib.lua b/libs/D4Lib/D4Lib.lua index cb899c1..917b838 100644 --- a/libs/D4Lib/D4Lib.lua +++ b/libs/D4Lib/D4Lib.lua @@ -97,7 +97,6 @@ end function D4:GetSpellInfo(spellID) if spellID == nil then return nil end - if GetSpellInfo then return GetSpellInfo(spellID) end if C_Spell and C_Spell.GetSpellInfo then local tab = C_Spell.GetSpellInfo(spellID) if tab then return tab.name, tab.rank, tab.iconID, tab.castTime, tab.minRange, tab.maxRange, tab.spellID end @@ -105,6 +104,7 @@ function D4:GetSpellInfo(spellID) return tab end + if GetSpellInfo then return GetSpellInfo(spellID) end D4:MSG("[D4][GetSpellInfo] FAILED") return nil @@ -112,8 +112,8 @@ end function D4:IsSpellInRange(spellID, spellType, unit) if spellID == nil then return nil end - if IsSpellInRange then return IsSpellInRange(spellID, spellType, unit) end if C_Spell and C_Spell.IsSpellInRange then return C_Spell.IsSpellInRange(spellID, spellType, unit) end + if IsSpellInRange then return IsSpellInRange(spellID, spellType, unit) end D4:MSG("[D4][IsSpellInRange] FAILED") return nil @@ -127,6 +127,14 @@ function D4:GetMouseFocus() return nil end +function D4:UnitAura(...) + if C_UnitAuras and C_UnitAuras.GetAuraDataByIndex then return C_UnitAuras.GetAuraDataByIndex(...) end + if UnitAura then return UnitAura(...) end + D4:MSG("[D4][UnitAura] FAILED") + + return nil +end + function D4:LoadAddOn(name) if C_AddOns and C_AddOns.LoadAddOn then return C_AddOns.LoadAddOn(name) end if LoadAddOn then return LoadAddOn(name) end diff --git a/settings.lua b/settings.lua index 0221d79..15e8944 100644 --- a/settings.lua +++ b/settings.lua @@ -289,8 +289,8 @@ function DarkMode:InitDMSettings() DMSettings:Hide() end - DarkMode:SetVersion(AddonName, 136122, "0.5.83") - DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.5.83")) + DarkMode:SetVersion(AddonName, 136122, "0.5.84") + DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.5.84")) DMSettings.CloseButton:SetScript( "OnClick", function()