Skip to content

Commit

Permalink
v0.5.49
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Jun 19, 2024
1 parent e12da23 commit 17fe28a
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 10 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.48
## Version: 0.5.49
## 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.48
## Version: 0.5.49
## 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.48
## Version: 0.5.49
## 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.48
## Version: 0.5.49
## 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.48
## Version: 0.5.49
## 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
29 changes: 27 additions & 2 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ end

local DMTexturesUi = {}
local DMTexturesUF = {}
local DMTexturesNP = {}
local DMTexturesTT = {}
local DMTexturesFrames = {}
local DMTexturesActionButtons = {}
Expand Down Expand Up @@ -52,6 +53,15 @@ function DarkMode:UpdateColor(texture, typ, show)
a = texture:GetAlpha()
end

texture:SetColorTexture(r, g, b, a)
end
elseif typ == "np" then
local r, g, b, a = DarkMode:GetNPColor()
if r ~= nil and g ~= nil and b ~= nil then
if texture:GetAlpha() < 1 then
a = texture:GetAlpha()
end

texture:SetColorTexture(r, g, b, a)
end
elseif typ == "tt" then
Expand Down Expand Up @@ -113,6 +123,11 @@ function DarkMode:UpdateColor(texture, typ, show)
if r ~= nil and g ~= nil and b ~= nil then
sel:SetVertexColor(r, g, b, a)
end
elseif typ == "np" then
local r, g, b, a = DarkMode:GetNPColor()
if r ~= nil and g ~= nil and b ~= nil then
sel:SetVertexColor(r, g, b, a)
end
elseif typ == "tt" then
local r, g, b, a = DarkMode:GetTTColor()
if r ~= nil and g ~= nil and b ~= nil then
Expand Down Expand Up @@ -150,6 +165,11 @@ function DarkMode:UpdateColor(texture, typ, show)
if r ~= nil and g ~= nil and b ~= nil then
texture:SetVertexColor(r, g, b, a)
end
elseif typ == "np" then
local r, g, b, a = DarkMode:GetNPColor()
if r ~= nil and g ~= nil and b ~= nil then
texture:SetVertexColor(r, g, b, a)
end
elseif typ == "tt" then
local r, g, b, a = DarkMode:GetTTColor()
if r ~= nil and g ~= nil and b ~= nil then
Expand Down Expand Up @@ -180,6 +200,10 @@ function DarkMode:UpdateColor(texture, typ, show)
if not tContains(DMTexturesUF, texture) then
tinsert(DMTexturesUF, texture)
end
elseif typ == "np" then
if not tContains(DMTexturesNP, texture) then
tinsert(DMTexturesNP, texture)
end
elseif typ == "tt" then
if not tContains(DMTexturesTT, texture) then
tinsert(DMTexturesTT, texture)
Expand Down Expand Up @@ -1037,6 +1061,7 @@ npf:RegisterEvent("NAME_PLATE_UNIT_ADDED")
npf:SetScript(
"OnEvent",
function(self, event, name, ...)
if DarkMode:GV("COLORMODENP", 1) == "Off" then return end
local id = string.sub(name, 10)
if nameplateIds[id] == nil then
C_Timer.After(
Expand All @@ -1046,7 +1071,7 @@ npf:SetScript(
if nameplateIds[id] == nil then
nameplateIds[id] = true
DarkMode:Debug(4, "#8 added")
DarkMode:FindTexturesByName("NamePlate" .. id .. ".UnitFrame.healthBar.border", "uf")
DarkMode:FindTexturesByName("NamePlate" .. id .. ".UnitFrame.healthBar.border", "np")
end
end
)
Expand Down Expand Up @@ -1287,7 +1312,7 @@ function DarkMode:Event(event, ...)
)
end

if DarkMode:IsEnabled("MASKBUFFSANDEBUFFS", true) then
if DarkMode:IsEnabled("MASKBUFFSANDDEBUFFS", true) then
if AuraFrameMixin and AuraFrameMixin.Update then
hooksecurefunc(
AuraFrameMixin,
Expand Down
6 changes: 6 additions & 0 deletions data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ function DarkMode:GetUFColor()
return r, g, b, a
end

function DarkMode:GetNPColor()
local r, g, b, a = DarkMode:GetColor(DarkMode:GV("COLORMODENP", 1), "CUSTOMNPC")

return r, g, b, a
end

function DarkMode:GetTTColor()
local r, g, b, a = DarkMode:GetColor(DarkMode:GV("COLORMODETT", 1), "CUSTOMTTC")

Expand Down
2 changes: 2 additions & 0 deletions locale/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ function DarkMode:Lang_deDE()
["MASKBUFFSANDDEBUFFS"] = "Zusätzlichen Rand für Buffs und Debuffs hinzufügen",
["MASKMINIMAPBUTTONS"] = "Zusätzlichen Rand für Minimapknöpfe hinzufügen",
["THINBORDERS"] = "Dünne Ränder",
["COLORMODENP"] = "Farbmodus Namensplaketten",
["CUSTOMNPC"] = "Benutzerdefinierte Namensplaketten Farbe",
}

DarkMode:UpdateLanguageTab(tab)
Expand Down
2 changes: 2 additions & 0 deletions locale/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ function DarkMode:Lang_enUS()
["MASKBUFFSANDDEBUFFS"] = "Add additional Border to Buffs and Debuffs",
["MASKMINIMAPBUTTONS"] = "Add additional Border to Minimapbuttons",
["THINBORDERS"] = "Thin Borders",
["COLORMODENP"] = "Color Mode Nameplates",
["CUSTOMNPC"] = "Custom Nameplates Color",
}

DarkMode:UpdateLanguageTab(tab)
Expand Down
23 changes: 20 additions & 3 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ local function AddSlider(x, key, val, func, vmin, vmax, steps)
end

function DarkMode:ShowColorPicker(r, g, b, a, changedCallback)
ColorPickerFrame.func, ColorPickerFrame.opacityFunc = changedCallback, changedCallback
print(ColorPickerFrame.swatchFunc)
ColorPickerFrame.func = changedCallback
ColorPickerFrame.opacityFunc = changedCallback
ColorPickerFrame.swatchFunc = changedCallback
ColorPickerFrame.hasOpacity, ColorPickerFrame.opacity = a ~= nil, 1 - a
ColorPickerFrame.previousValues = {r, g, b, a}
ColorPickerFrame:SetColorRGB(r, g, b)
Expand Down Expand Up @@ -287,8 +290,8 @@ function DarkMode:InitDMSettings()
DMSettings:Hide()
end

D4:SetVersion(AddonName, 136122, "0.5.48")
DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.5.48"))
D4:SetVersion(AddonName, 136122, "0.5.49")
DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.5.49"))
DMSettings.CloseButton:SetScript(
"OnClick",
function()
Expand Down Expand Up @@ -319,6 +322,7 @@ function DarkMode:InitDMSettings()
)

sCM:SetText(DarkMode:GT("COLORMODE") .. ": " .. DarkMode:GetColorModes()[DarkMode:GV("COLORMODE", 1)])
--UF
DarkMode:AddColorPicker("CUSTOMUIC", DMSettings.SC, 0, 0)
local sCMUF = AddSlider(
4,
Expand All @@ -332,6 +336,19 @@ function DarkMode:InitDMSettings()

sCMUF:SetText(DarkMode:GT("COLORMODEUF") .. ": " .. DarkMode:GetColorModes()[DarkMode:GV("COLORMODEUF", 1)])
DarkMode:AddColorPicker("CUSTOMUFC", DMSettings.SC, 0, 0)
--NP
local sCMNP = AddSlider(
4,
"COLORMODENP",
DarkMode:GV("COLORMODENP", 1),
function(sel, val)
sel:SetText(DarkMode:GT("COLORMODENP") .. ": " .. DarkMode:GetColorModes()[val])
DarkMode:UpdateColors()
end, 1, getn(DarkMode:GetColorModes()), 1
)

sCMNP:SetText(DarkMode:GT("COLORMODENP") .. ": " .. DarkMode:GetColorModes()[DarkMode:GV("COLORMODENP", 1)])
DarkMode:AddColorPicker("CUSTOMNPC", DMSettings.SC, 0, 0)
--TT
local sCMTT = AddSlider(
4,
Expand Down

0 comments on commit 17fe28a

Please sign in to comment.