Skip to content

Commit

Permalink
v0.4.19
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Jan 11, 2024
1 parent 38e6140 commit 06a88d5
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 102 deletions.
2 changes: 1 addition & 1 deletion DarkMode.toc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Interface-Wrath: 30403
## Interface: 100200

## Version: 0.4.18
## Version: 0.4.19
## 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_TBC.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 20504
## Version: 0.4.18
## Version: 0.4.19
## 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: 11500
## Version: 0.4.18
## Version: 0.4.19
## 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.4.18
## Version: 0.4.19
## 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
213 changes: 117 additions & 96 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -655,125 +655,132 @@ function DarkMode:SearchAddons()
end
end

function DarkMode:SearchUi()
function DarkMode:SearchUi(from)
local raidOnly = from == "raid"
for index, tab in pairs(DarkMode:GetUiTable()) do
if index == "ActionButtons" then
for i, name in pairs(tab) do
local max = 12
--[[ Bar Addons ]]
if name == "BT4Button" or name == "DominosActionButton" then
max = 200
end

for x = 1, max do
local btnTexture = _G[name .. x .. "NormalTexture"]
if name == "BT4StanceButton" and _G[name .. x] and _G[name .. x .. "BorderFix"] == nil then
local sw, sh = _G[name .. x]:GetSize()
sw = DarkMode:MathR(sw)
sh = DarkMode:MathR(sh)
local scale = 1.1
_G[name .. x .. "BorderFix"] = _G[name .. x]:CreateTexture(name .. x .. "BorderFix", "OVERLAY")
local border = _G[name .. x .. "BorderFix"]
border:SetDrawLayer("OVERLAY", 3)
border:SetSize(sw * scale, sh * scale)
border:SetTexture("Interface\\AddOns\\DarkMode\\media\\default")
border:SetPoint("CENTER", _G[name .. x], "CENTER", 0, 0)
DarkMode:UpdateColor(border, "actionbuttons")
elseif btnTexture then
DarkMode:UpdateColor(btnTexture, "actionbuttons")
if raidOnly and index == "UnitFrames" then
for i, v in pairs(tab) do
DarkMode:FindTexturesByName(v, "uf")
end
else
if index == "ActionButtons" then
for i, name in pairs(tab) do
local max = 12
--[[ Bar Addons ]]
if name == "BT4Button" or name == "DominosActionButton" then
max = 200
end

local MSQ = LibStub("Masque", true)
if MSQ then
local btn = _G[name .. x]
if btn then
if btn.__MSQ_Mask then
DarkMode:UpdateColor(btn.__MSQ_Mask, "actionbuttons")
for x = 1, max do
local btnTexture = _G[name .. x .. "NormalTexture"]
if name == "BT4StanceButton" and _G[name .. x] and _G[name .. x .. "BorderFix"] == nil then
local sw, sh = _G[name .. x]:GetSize()
sw = DarkMode:MathR(sw)
sh = DarkMode:MathR(sh)
local scale = 1.1
_G[name .. x .. "BorderFix"] = _G[name .. x]:CreateTexture(name .. x .. "BorderFix", "OVERLAY")
local border = _G[name .. x .. "BorderFix"]
border:SetDrawLayer("OVERLAY", 3)
border:SetSize(sw * scale, sh * scale)
border:SetTexture("Interface\\AddOns\\DarkMode\\media\\default")
border:SetPoint("CENTER", _G[name .. x], "CENTER", 0, 0)
DarkMode:UpdateColor(border, "actionbuttons")
elseif btnTexture then
DarkMode:UpdateColor(btnTexture, "actionbuttons")
end

local MSQ = LibStub("Masque", true)
if MSQ then
local btn = _G[name .. x]
if btn then
if btn.__MSQ_Mask then
DarkMode:UpdateColor(btn.__MSQ_Mask, "actionbuttons")
end

if btn.__MSQ_Normal then
DarkMode:UpdateColor(btn.__MSQ_Normal, "actionbuttons")
end

if btn.__MSQ_NewNormal then
DarkMode:UpdateColor(btn.__MSQ_NewNormal, "actionbuttons")
end
end
else
local btnTexture2 = _G[name .. x .. "FloatingBG"]
if btnTexture2 then
DarkMode:UpdateColor(btnTexture2, "actionbuttons")
end

if btn.__MSQ_Normal then
DarkMode:UpdateColor(btn.__MSQ_Normal, "actionbuttons")
if _G[name .. x] and _G[name .. x]["SlotBackground"] then
DarkMode:UpdateColor(_G[name .. x]["SlotBackground"], "actionbuttons")
end

if btn.__MSQ_NewNormal then
DarkMode:UpdateColor(btn.__MSQ_NewNormal, "actionbuttons")
if _G[name .. x] and _G[name .. x]["RightDivider"] then
DarkMode:UpdateColor(_G[name .. x]["RightDivider"]["TopEdge"], "actionbuttons")
DarkMode:UpdateColor(_G[name .. x]["RightDivider"]["Center"], "actionbuttons")
DarkMode:UpdateColor(_G[name .. x]["RightDivider"]["BottomEdge"], "actionbuttons")
end
end
else
local btnTexture2 = _G[name .. x .. "FloatingBG"]
if btnTexture2 then
DarkMode:UpdateColor(btnTexture2, "actionbuttons")
end

if _G[name .. x] and _G[name .. x]["SlotBackground"] then
DarkMode:UpdateColor(_G[name .. x]["SlotBackground"], "actionbuttons")
end
if DarkMode:GetWoWBuild() ~= "RETAIL" and DarkMode:IsEnabled("MASKACTIONBUTTONS", true) then
local icon = _G[name .. x .. "Icon"]
if icon then
local br = 0.01
icon:SetTexCoord(br, 1 - br, br, 1 - br)
end

if _G[name .. x] and _G[name .. x]["RightDivider"] then
DarkMode:UpdateColor(_G[name .. x]["RightDivider"]["TopEdge"], "actionbuttons")
DarkMode:UpdateColor(_G[name .. x]["RightDivider"]["Center"], "actionbuttons")
DarkMode:UpdateColor(_G[name .. x]["RightDivider"]["BottomEdge"], "actionbuttons")
if _G[name .. x] and _G[name .. x .. "BorderDM"] == nil then
local sw, sh = _G[name .. x]:GetSize()
sw = DarkMode:MathR(sw)
sh = DarkMode:MathR(sh)
local scale = 1.1
_G[name .. x .. "BorderDM"] = _G[name .. x]:CreateTexture(name .. x .. "BorderDM", "OVERLAY")
local border = _G[name .. x .. "BorderDM"]
border:SetDrawLayer("OVERLAY", 3)
border:SetSize(sw * scale, sh * scale)
border:SetTexture("Interface\\AddOns\\DarkMode\\media\\defaultEER")
border:SetPoint("CENTER", _G[name .. x], "CENTER", 0, 0)
DarkMode:UpdateColor(border, "actionbuttons")
end
end
end

if DarkMode:GetWoWBuild() ~= "RETAIL" and DarkMode:IsEnabled("MASKACTIONBUTTONS", true) then
local icon = _G[name .. x .. "Icon"]
if icon then
local br = 0.01
icon:SetTexCoord(br, 1 - br, br, 1 - br)
end
elseif index == "Minimap" or index == "Artworks" or index == "Chat" or index == "Castbar" then
for ind, name in pairs(tab) do
if index == "Artworks" and name == "BT4BarBlizzardArt.nineSliceParent" then
local frame = DarkMode:GetFrame(name)
if frame then
for i, v in pairs({frame:GetChildren()}) do
if i == 1 then
DarkMode:FindTextures(v, "ui") -- Bartender Border in BlizzardArt
end
end
end
end

if _G[name .. x] and _G[name .. x .. "BorderDM"] == nil then
local sw, sh = _G[name .. x]:GetSize()
sw = DarkMode:MathR(sw)
sh = DarkMode:MathR(sh)
local scale = 1.1
_G[name .. x .. "BorderDM"] = _G[name .. x]:CreateTexture(name .. x .. "BorderDM", "OVERLAY")
local border = _G[name .. x .. "BorderDM"]
border:SetDrawLayer("OVERLAY", 3)
border:SetSize(sw * scale, sh * scale)
border:SetTexture("Interface\\AddOns\\DarkMode\\media\\defaultEER")
border:SetPoint("CENTER", _G[name .. x], "CENTER", 0, 0)
DarkMode:UpdateColor(border, "actionbuttons")
end
if name ~= "MainMenuBarBackpackButtonNormalTexture" or DarkMode:GetWoWBuild() ~= "RETAIL" then
DarkMode:FindTexturesByName(name, "ui")
end
end
end
elseif index == "Minimap" or index == "Artworks" or index == "Chat" or index == "Castbar" then
for ind, name in pairs(tab) do
if index == "Artworks" and name == "BT4BarBlizzardArt.nineSliceParent" then
local frame = DarkMode:GetFrame(name)
if frame then
for i, v in pairs({frame:GetChildren()}) do
if i == 1 then
DarkMode:FindTextures(v, "ui") -- Bartender Border in BlizzardArt
end
end
elseif index == "Gryphons" then
if DarkMode:IsEnabled("GRYPHONS", true) then
for i, v in pairs(tab) do
DarkMode:FindTexturesByName(v, "ui")
end
end

if name ~= "MainMenuBarBackpackButtonNormalTexture" or DarkMode:GetWoWBuild() ~= "RETAIL" then
DarkMode:FindTexturesByName(name, "ui")
elseif index == "Tooltips" then
for i, v in pairs(tab) do
DarkMode:FindTexturesByName(v, "tt")
end
end
elseif index == "Gryphons" then
if DarkMode:IsEnabled("GRYPHONS", true) then
elseif type(tab) == "string" then
DarkMode:FindTexturesByName(tab, "ui")
elseif index == "UnitFrames" then
for i, v in pairs(tab) do
DarkMode:FindTexturesByName(v, "ui")
DarkMode:FindTexturesByName(v, "uf")
end
else
print("Missing Ui index:", index, tab)
end
elseif index == "Tooltips" then
for i, v in pairs(tab) do
DarkMode:FindTexturesByName(v, "tt")
end
elseif type(tab) == "string" then
DarkMode:FindTexturesByName(tab, "ui")
elseif index == "UnitFrames" then
for i, v in pairs(tab) do
DarkMode:FindTexturesByName(v, "uf")
end
else
print("Missing Ui index:", index, tab)
end
end

Expand Down Expand Up @@ -913,6 +920,20 @@ function DarkMode:SearchUi()
end
end

local rf = CreateFrame("FRAME")
rf:RegisterEvent("RAID_ROSTER_UPDATE")
rf:SetScript(
"OnEvent",
function(self, event, name, ...)
C_Timer.After(
0.1,
function()
DarkMode:SearchUi("raid")
end
)
end
)

local npf = CreateFrame("FRAME")
npf:RegisterEvent("NAME_PLATE_UNIT_ADDED")
npf:SetScript(
Expand Down
4 changes: 2 additions & 2 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ function DarkMode:InitDMSettings()
DMSettings:Hide()
end

D4:SetVersion(AddonName, 136122, "0.4.18")
DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.4.18"))
D4:SetVersion(AddonName, 136122, "0.4.19")
DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.4.19"))
DMSettings.CloseButton:SetScript(
"OnClick",
function()
Expand Down

0 comments on commit 06a88d5

Please sign in to comment.