Skip to content

Commit

Permalink
v0.5.48
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Jun 18, 2024
1 parent eecb93e commit e12da23
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 25 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: 100207, 110000

## Version: 0.5.47
## Version: 0.5.48
## 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.47
## Version: 0.5.48
## 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.47
## Version: 0.5.48
## 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: 11502
## Version: 0.5.47
## Version: 0.5.48
## 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.47
## Version: 0.5.48
## 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
65 changes: 48 additions & 17 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@ function DarkMode:SearchUi(from)

for x = 1, max do
local btn = _G[name .. x]
local btnTexture = _G[name .. x .. "NormalTexture"]
local btnTexture2 = _G[name .. x .. "FloatingBG"]
local btnTextureNormalTexture = _G[name .. x .. "NormalTexture"]
local btnTextureFloatingBG = _G[name .. x .. "FloatingBG"]
if name == "BT4StanceButton" and btn and _G[name .. x .. "BorderFix"] == nil and DarkMode:IsEnabled("MASKACTIONBUTTONS", true) and DarkMode:GV("COLORMODEAB", 1) ~= "Off" and DarkMode:GV("COLORMODEAB", 1) ~= "Default" then
local sw, sh = btn:GetSize()
sw = DarkMode:MathR(sw)
Expand All @@ -639,8 +639,8 @@ function DarkMode:SearchUi(from)
border:SetTexture("Interface\\AddOns\\DarkMode\\media\\default")
border:SetPoint("CENTER", btn, "CENTER", 0, 0)
DarkMode:UpdateColor(border, "actionbuttons")
elseif btnTexture then
DarkMode:UpdateColor(btnTexture, "actionbuttons")
elseif btnTextureNormalTexture then
DarkMode:UpdateColor(btnTextureNormalTexture, "actionbuttons")
end

local MSQ = LibStub("Masque", true)
Expand All @@ -659,8 +659,8 @@ function DarkMode:SearchUi(from)
end
end
else
if btnTexture2 then
DarkMode:UpdateColor(btnTexture2, "actionbuttons")
if btnTextureFloatingBG then
DarkMode:UpdateColor(btnTextureFloatingBG, "actionbuttons")
end

if btn and btn["SlotBackground"] then
Expand All @@ -679,12 +679,34 @@ function DarkMode:SearchUi(from)
local icon = _G[name .. x .. "Icon"]
if icon then
local br = 0.075
if name == "PetActionButton" then
br = 0.038
end

icon:SetTexCoord(br, 1 - br, br, 1 - br)
end

if btnTexture then
if name == "PetActionButton" then
local border = _G[name .. x .. "NormalTexture2"]
if border then
hooksecurefunc(
border,
"SetAlpha",
function(sel, ...)
if sel.dm_setalpha then return end
sel.dm_setalpha = true
sel:SetAlpha(0)
sel.dm_setalpha = false
end
)

border:SetAlpha(0)
end
end

if btnTextureNormalTexture then
hooksecurefunc(
btnTexture,
btnTextureNormalTexture,
"SetVertexColor",
function(sel, ...)
if sel.dm_setalpha then return end
Expand All @@ -694,12 +716,12 @@ function DarkMode:SearchUi(from)
end
)

btnTexture:SetAlpha(0)
btnTextureNormalTexture:SetAlpha(0)
end

if btnTexture2 then
if btnTextureFloatingBG then
hooksecurefunc(
btnTexture2,
btnTextureFloatingBG,
"SetVertexColor",
function(sel, ...)
if sel.dm_setalpha then return end
Expand All @@ -709,9 +731,9 @@ function DarkMode:SearchUi(from)
end
)

btnTexture2:SetAlpha(0.5)
btnTextureFloatingBG:SetAlpha(0.5)
hooksecurefunc(
btnTexture2,
btnTextureFloatingBG,
"SetScale",
function(sel)
if sel.dm_setscale then return end
Expand All @@ -721,21 +743,30 @@ function DarkMode:SearchUi(from)
end
)

btnTexture2:SetScale(0.9)
btnTexture2:ClearAllPoints()
btnTexture2:SetPoint("CENTER", btn, "CENTER", 0, 0)
btnTextureFloatingBG:SetScale(0.9)
btnTextureFloatingBG:ClearAllPoints()
btnTextureFloatingBG:SetPoint("CENTER", btn, "CENTER", 0, 0)
end

if btn and _G[name .. x .. "BorderDM"] == nil then
local sw, sh = btn:GetSize()
sw = DarkMode:MathR(sw)
sh = DarkMode:MathR(sh)
local scale = 1
if name == "PetActionButton" then
scale = 1.2
end

_G[name .. x .. "BorderDM"] = btn: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\\border_thin")
if name == "PetActionButton" then
border:SetTexture("Interface\\AddOns\\DarkMode\\media\\defaultEER")
else
border:SetTexture("Interface\\AddOns\\DarkMode\\media\\border_thin")
end

border:SetPoint("CENTER", btn, "CENTER", 0, 0)
DarkMode:UpdateColor(border, "actionbuttons")
end
Expand Down
2 changes: 1 addition & 1 deletion data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function DarkMode:GetDMRepeatingFrames2()
end

local DMUi = {
["ActionButtons"] = {"ActionButton", "MultiBarBottomLeftButton", "MultiBarBottomRightButton", "MultiBarLeftButton", "MultiBarRightButton", "ActionBar7Button", "ActionBar8Button", "ActionBar9Button", "ActionBar10Button", "MultiBar5Button", "MultiBar6Button", "MultiBar7Button", "StanceButton", "PetActionButton", "BT4Button", "BT4StanceButton", "BT4PetButton", "DominosActionButton"},
["ActionButtons"] = {"PetActionButton", "ActionButton", "MultiBarBottomLeftButton", "MultiBarBottomRightButton", "MultiBarLeftButton", "MultiBarRightButton", "ActionBar7Button", "ActionBar8Button", "ActionBar9Button", "ActionBar10Button", "MultiBar5Button", "MultiBar6Button", "MultiBar7Button", "StanceButton", "PetActionButton", "BT4Button", "BT4StanceButton", "BT4PetButton", "DominosActionButton"},
["Minimap"] = {"CalendarButtonFrame", "MiniMapBattlefieldBorder", "MinimapBorder", "MinimapBorderTop", "TimeManagerClockButton", "MinimapCompassTexture", "MinimapCluster.BorderTop",},
["UnitFrames"] = {"PlayerFrameAlternateManaBar", "PlayerFrameTexture", "TargetFrameTextureFrameTexture", "FocusFrameTextureFrameTexture", "TargetFrameToTTextureFrameTexture", "FocusFrameToTTextureFrameTexture", "PetFrameTexture", "PlayerFrame.PlayerFrameContainer.AlternatePowerFrameTexture", "PlayerFrame.PlayerFrameContainer.FrameTexture", "TargetFrame.TargetFrameContainer.FrameTexture", "FocusFrame.TargetFrameContainer.FrameTexture", "PartyMemberFrame1Texture", "PartyMemberFrame2Texture", "PartyMemberFrame3Texture", "PartyMemberFrame4Texture", "PartyFrame.MemberFrame1.Texture", "PartyFrame.MemberFrame2.Texture", "PartyFrame.MemberFrame3.Texture", "PartyFrame.MemberFrame4.Texture"},
["Tooltips"] = {"DropDownList1MenuBackdrop.NineSlice", "DropDownList2MenuBackdrop.NineSlice", "DropDownList3MenuBackdrop.NineSlice", "DropDownList4MenuBackdrop.NineSlice", "GameTooltip.NineSlice", "ItemRefTooltip.NineSlice", "ShoppingTooltip1.NineSlice", "ShoppingTooltip2.NineSlice", "WhatsTrainingTooltip.NineSlice"},
Expand Down
4 changes: 2 additions & 2 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ function DarkMode:InitDMSettings()
DMSettings:Hide()
end

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

0 comments on commit e12da23

Please sign in to comment.