Skip to content

Commit

Permalink
v0.5.84
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Aug 20, 2024
1 parent 5a0fb9f commit 3a94388
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 28 deletions.
2 changes: 1 addition & 1 deletion DarkMode.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_Cata.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_TBC.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_Vanilla.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_Wrath.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
43 changes: 24 additions & 19 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down
12 changes: 10 additions & 2 deletions libs/D4Lib/D4Lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,23 @@ 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

return tab
end

if GetSpellInfo then return GetSpellInfo(spellID) end
D4:MSG("[D4][GetSpellInfo] FAILED")

return nil
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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3a94388

Please sign in to comment.