diff --git a/DarkMode.toc b/DarkMode.toc index 991f8b7..1189a58 100644 --- a/DarkMode.toc +++ b/DarkMode.toc @@ -3,7 +3,7 @@ ## Interface-Wrath: 30403 ## Interface: 100200 -## Version: 0.3.41 +## Version: 0.4.0 ## Title: DarkMode 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 f38b1f5..066f90a 100644 --- a/DarkMode_TBC.toc +++ b/DarkMode_TBC.toc @@ -1,5 +1,5 @@ ## Interface: 20504 -## Version: 0.3.41 +## Version: 0.4.0 ## 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 9439af4..393df26 100644 --- a/DarkMode_Vanilla.toc +++ b/DarkMode_Vanilla.toc @@ -1,5 +1,5 @@ ## Interface: 11500 -## Version: 0.3.41 +## Version: 0.4.0 ## 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 03b23d9..85da760 100644 --- a/DarkMode_Wrath.toc +++ b/DarkMode_Wrath.toc @@ -1,5 +1,5 @@ ## Interface: 30403 -## Version: 0.3.41 +## Version: 0.4.0 ## 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 8367993..2cfce3e 100644 --- a/core.lua +++ b/core.lua @@ -47,6 +47,8 @@ local DMTexturesUi = {} local DMTexturesUF = {} local DMTexturesTT = {} local DMTexturesFrames = {} +local DMTexturesActionButtons = {} +local DMTexturesBuffsAndDebuffs = {} function DarkMode:UpdateColor(texture, typ) if not DarkMode:IsValidTexture(texture) then return false end if texture == nil then @@ -88,6 +90,24 @@ function DarkMode:UpdateColor(texture, typ) a = texture:GetAlpha() end + texture:SetColorTexture(r, g, b, a) + end + elseif typ == "actionbuttons" then + local r, g, b, a = DarkMode:GetActionButtonsColor() + 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 == "buffsanddebuffs" then + local r, g, b, a = DarkMode:GetBuffsAndDebuffsColor() + 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 else @@ -127,6 +147,16 @@ function DarkMode:UpdateColor(texture, typ) if r ~= nil and g ~= nil and b ~= nil then sel:SetVertexColor(r, g, b, a) end + elseif typ == "actionbuttons" then + local r, g, b, a = DarkMode:GetActionButtonsColor() + if r ~= nil and g ~= nil and b ~= nil then + sel:SetVertexColor(r, g, b, a) + end + elseif typ == "buffsanddebuffs" then + local r, g, b, a = DarkMode:GetBuffsAndDebuffsColor() + if r ~= nil and g ~= nil and b ~= nil then + sel:SetVertexColor(r, g, b, a) + end else local r, g, b, a = DarkMode:GetFrameColor() if r ~= nil and g ~= nil and b ~= nil then @@ -154,6 +184,16 @@ function DarkMode:UpdateColor(texture, typ) if r ~= nil and g ~= nil and b ~= nil then texture:SetVertexColor(r, g, b, a) end + elseif typ == "actionbuttons" then + local r, g, b, a = DarkMode:GetActionButtonsColor() + if r ~= nil and g ~= nil and b ~= nil then + texture:SetVertexColor(r, g, b, a) + end + elseif typ == "buffsanddebuffs" then + local r, g, b, a = DarkMode:GetBuffsAndDebuffsColor() + if r ~= nil and g ~= nil and b ~= nil then + texture:SetVertexColor(r, g, b, a) + end else local r, g, b, a = DarkMode:GetFrameColor() if r ~= nil and g ~= nil and b ~= nil then @@ -173,6 +213,14 @@ function DarkMode:UpdateColor(texture, typ) if not tContains(DMTexturesTT, texture) then tinsert(DMTexturesTT, texture) end + elseif typ == "actionbuttons" then + if not tContains(DMTexturesActionButtons, texture) then + tinsert(DMTexturesActionButtons, texture) + end + elseif typ == "buffsanddebuffs" then + if not tContains(DMTexturesBuffsAndDebuffs, texture) then + tinsert(DMTexturesBuffsAndDebuffs, texture) + end else if not tContains(DMTexturesFrames, texture) then tinsert(DMTexturesFrames, texture) @@ -612,24 +660,24 @@ function DarkMode:SearchUi() 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, "ui") + DarkMode:UpdateColor(border, "actionbuttons") elseif btnTexture then - DarkMode:UpdateColor(btnTexture, "ui") + DarkMode:UpdateColor(btnTexture, "actionbuttons") end local btnTexture2 = _G[name .. x .. "FloatingBG"] if btnTexture2 then - DarkMode:UpdateColor(btnTexture2, "ui") + DarkMode:UpdateColor(btnTexture2, "actionbuttons") end if _G[name .. x] and _G[name .. x]["SlotBackground"] then - DarkMode:UpdateColor(_G[name .. x]["SlotBackground"], "ui") + DarkMode:UpdateColor(_G[name .. x]["SlotBackground"], "actionbuttons") end if _G[name .. x] and _G[name .. x]["RightDivider"] then - DarkMode:UpdateColor(_G[name .. x]["RightDivider"]["TopEdge"], "ui") - DarkMode:UpdateColor(_G[name .. x]["RightDivider"]["Center"], "ui") - DarkMode:UpdateColor(_G[name .. x]["RightDivider"]["BottomEdge"], "ui") + 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 if DarkMode:GetWoWBuild() ~= "RETAIL" and DarkMode:IsEnabled("MASKACTIONBUTTONS", true) then @@ -650,7 +698,7 @@ function DarkMode:SearchUi() 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, "ui") + DarkMode:UpdateColor(border, "actionbuttons") end end end @@ -939,73 +987,75 @@ function DarkMode:Event(event, ...) ) end - if AuraFrameMixin and AuraFrameMixin.Update then - hooksecurefunc( - AuraFrameMixin, - "Update", - function(sel) - for index, bf in pairs(sel.auraFrames) do - if bf and _G["Buff" .. index .. "BorderDM"] == nil then - local _, sh = bf.Icon:GetSize() - sh = DarkMode:MathR(sh) - local scale = 1 - _G["Buff" .. index .. "BorderDM"] = bf:CreateTexture("Buff" .. index .. "BorderDM", "OVERLAY") - local border = _G["Buff" .. index .. "BorderDM"] - border:SetDrawLayer("OVERLAY", 3) - border:SetSize(sh * scale, sh * scale) - border:SetTexture("Interface\\AddOns\\DarkMode\\media\\default") - border:SetPoint("CENTER", bf.Icon, "CENTER", 0, 0) - DarkMode:UpdateColor(border, "ui") + if DarkMode:IsEnabled("MASKBUFFSANDEBUFFS", true) then + if AuraFrameMixin and AuraFrameMixin.Update then + hooksecurefunc( + AuraFrameMixin, + "Update", + function(sel) + for index, bf in pairs(sel.auraFrames) do + if bf and _G["Buff" .. index .. "BorderDM"] == nil then + local _, sh = bf.Icon:GetSize() + sh = DarkMode:MathR(sh) + local scale = 1 + _G["Buff" .. index .. "BorderDM"] = bf:CreateTexture("Buff" .. index .. "BorderDM", "OVERLAY") + local border = _G["Buff" .. index .. "BorderDM"] + border:SetDrawLayer("OVERLAY", 3) + border:SetSize(sh * scale, sh * scale) + border:SetTexture("Interface\\AddOns\\DarkMode\\media\\default") + border:SetPoint("CENTER", bf.Icon, "CENTER", 0, 0) + DarkMode:UpdateColor(border, "buffsanddebuffs") + end end end - end - ) - elseif BuffFrame_UpdateAllBuffAnchors then - hooksecurefunc( - "BuffFrame_UpdateAllBuffAnchors", - function() - local buttonName = "BuffButton" - for index = 1, BUFF_ACTUAL_DISPLAY do - if _G[buttonName .. index] and _G[buttonName .. index .. "BorderDM"] == nil then - local sw, sh = _G[buttonName .. index]:GetSize() - sw = DarkMode:MathR(sw) - sh = DarkMode:MathR(sh) - local scale = 1.1 - _G[buttonName .. index .. "BorderDM"] = _G[buttonName .. index]:CreateTexture(buttonName .. index .. "BorderDM", "OVERLAY") - local border = _G[buttonName .. index .. "BorderDM"] - border:SetDrawLayer("OVERLAY", 3) - border:SetSize(sw * scale, sh * scale) - border:SetTexture("Interface\\AddOns\\DarkMode\\media\\default") - border:SetPoint("CENTER", _G[buttonName .. index], "CENTER", 0, 0) - DarkMode:UpdateColor(border, "ui") + ) + elseif BuffFrame_UpdateAllBuffAnchors then + hooksecurefunc( + "BuffFrame_UpdateAllBuffAnchors", + function() + local buttonName = "BuffButton" + for index = 1, BUFF_ACTUAL_DISPLAY do + if _G[buttonName .. index] and _G[buttonName .. index .. "BorderDM"] == nil then + local sw, sh = _G[buttonName .. index]:GetSize() + sw = DarkMode:MathR(sw) + sh = DarkMode:MathR(sh) + local scale = 1.1 + _G[buttonName .. index .. "BorderDM"] = _G[buttonName .. index]:CreateTexture(buttonName .. index .. "BorderDM", "OVERLAY") + local border = _G[buttonName .. index .. "BorderDM"] + border:SetDrawLayer("OVERLAY", 3) + border:SetSize(sw * scale, sh * scale) + border:SetTexture("Interface\\AddOns\\DarkMode\\media\\default") + border:SetPoint("CENTER", _G[buttonName .. index], "CENTER", 0, 0) + DarkMode:UpdateColor(border, "buffsanddebuffs") + end end end - end - ) - end + ) + end - if TargetFrame_UpdateAuras then - hooksecurefunc( - "TargetFrame_UpdateAuras", - function(frame) - local buttonName = frame:GetName() .. "Buff" - for index = 1, BUFF_ACTUAL_DISPLAY do - if _G[buttonName .. index] and _G[buttonName .. index .. "BorderDM"] == nil then - local sw, sh = _G[buttonName .. index]:GetSize() - sw = DarkMode:MathR(sw) - sh = DarkMode:MathR(sh) - local scale = 1.1 - _G[buttonName .. index .. "BorderDM"] = _G[buttonName .. index]:CreateTexture(buttonName .. index .. "BorderDM", "OVERLAY") - local border = _G[buttonName .. index .. "BorderDM"] - border:SetDrawLayer("OVERLAY", 3) - border:SetSize(sw * scale, sh * scale) - border:SetTexture("Interface\\AddOns\\DarkMode\\media\\default") - border:SetPoint("CENTER", _G[buttonName .. index], "CENTER", 0, 0) - DarkMode:UpdateColor(border, "ui") + if TargetFrame_UpdateAuras then + hooksecurefunc( + "TargetFrame_UpdateAuras", + function(frame) + local buttonName = frame:GetName() .. "Buff" + for index = 1, BUFF_ACTUAL_DISPLAY do + if _G[buttonName .. index] and _G[buttonName .. index .. "BorderDM"] == nil then + local sw, sh = _G[buttonName .. index]:GetSize() + sw = DarkMode:MathR(sw) + sh = DarkMode:MathR(sh) + local scale = 1.1 + _G[buttonName .. index .. "BorderDM"] = _G[buttonName .. index]:CreateTexture(buttonName .. index .. "BorderDM", "OVERLAY") + local border = _G[buttonName .. index .. "BorderDM"] + border:SetDrawLayer("OVERLAY", 3) + border:SetSize(sw * scale, sh * scale) + border:SetTexture("Interface\\AddOns\\DarkMode\\media\\default") + border:SetPoint("CENTER", _G[buttonName .. index], "CENTER", 0, 0) + DarkMode:UpdateColor(border, "buffsanddebuffs") + end end end - end - ) + ) + end end C_Timer.After( diff --git a/data.lua b/data.lua index 809c3de..9eaea7a 100644 --- a/data.lua +++ b/data.lua @@ -66,6 +66,18 @@ function DarkMode:GetTTColor() return r, g, b, a end +function DarkMode:GetActionButtonsColor() + local r, g, b, a = DarkMode:GetColor(DarkMode:GV("COLORMODEAB", 1), "CUSTOMABC") + + return r, g, b, a +end + +function DarkMode:GetBuffsAndDebuffsColor() + local r, g, b, a = DarkMode:GetColor(DarkMode:GV("COLORMODEBAD", 1), "CUSTOMBADC") + + return r, g, b, a +end + function DarkMode:GetFrameColor() local r, g, b, a = DarkMode:GetColor(DarkMode:GV("COLORMODEF", 1), "CUSTOMFRC") diff --git a/locale/deDE.lua b/locale/deDE.lua index d3a01f7..9bb7269 100644 --- a/locale/deDE.lua +++ b/locale/deDE.lua @@ -1,6 +1,5 @@ -- deDE German Deutsch local _, DarkMode = ... - function DarkMode:Lang_deDE() local tab = { ["MMBTNLEFT"] = "Linksklick => Optionen", @@ -10,13 +9,18 @@ function DarkMode:Lang_deDE() ["COLORMODE"] = "Farbmodus Ui", ["COLORMODEUF"] = "Farbmodus Einheitenfenster", ["COLORMODETT"] = "Farbmodus Tooltips", + ["COLORMODEAB"] = "Farbmodus Aktionsknöpfe", + ["COLORMODEBAD"] = "Farbmodus Buffs und Debuffs", ["COLORMODEF"] = "Farbmodus Fenster", ["CUSTOMUIC"] = "Benutzerdefinierte Ui Farbe", ["CUSTOMUFC"] = "Benutzerdefinierte Einheitenfenster Farbe", ["CUSTOMTTC"] = "Benutzerdefinierte Tooltip Farbe", + ["CUSTOMABC"] = "Benutzerdefinierte Aktionsknöpfe Farbe", + ["CUSTOMBADC"] = "Benutzerdefinierte Buffs und Debuffs Farbe", ["CUSTOMFRC"] = "Benutzerdefinierte Fenster Farbe", ["MASKACTIONBUTTONS"] = "Aktionsknöpfe maskieren", ["GRYPHONS"] = "Greifen maskieren", + ["MASKBUFFSANDDEBUFFS"] = "Buffs und Debuffs maskieren", } DarkMode:UpdateLanguageTab(tab) diff --git a/locale/enUS.lua b/locale/enUS.lua index ad9a55c..8645450 100644 --- a/locale/enUS.lua +++ b/locale/enUS.lua @@ -1,9 +1,7 @@ -- enUS English local _, DarkMode = ... - function DarkMode:UpdateLanguageTab(tab) local lang = DarkMode:GetLangTab() - for i, v in pairs(tab) do lang[i] = v end @@ -18,13 +16,18 @@ function DarkMode:Lang_enUS() ["COLORMODE"] = "Color Mode Ui", ["COLORMODEUF"] = "Color Mode UnitFrames", ["COLORMODETT"] = "Color Mode Tooltips", + ["COLORMODEAB"] = "Color Mode Actionbuttons", + ["COLORMODEBAD"] = "Color Mode Buffs and Debuffs", ["COLORMODEF"] = "Color Mode Windows", ["CUSTOMUIC"] = "Custom Ui Color", ["CUSTOMUFC"] = "Custom UnitFrames Color", ["CUSTOMTTC"] = "Custom Tooltip Color", + ["CUSTOMABC"] = "Custom Actionbuttons Color", + ["CUSTOMBADC"] = "Custom Buffs and Debuffs Color", ["CUSTOMFRC"] = "Custom Windows Color", ["MASKACTIONBUTTONS"] = "Mask Actionbuttons", ["GRYPHONS"] = "Mask Gryphons", + ["MASKBUFFSANDDEBUFFS"] = "Mask Buffs and Debuffs", } DarkMode:UpdateLanguageTab(tab) diff --git a/settings.lua b/settings.lua index 0be3f14..2d87d67 100644 --- a/settings.lua +++ b/settings.lua @@ -1,6 +1,6 @@ local _, DarkMode = ... local config = { - ["title"] = format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.3.41") + ["title"] = format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.4.0") } local searchStr = "" @@ -138,7 +138,6 @@ local function AddSlider(x, key, val, func, vmin, vmax, steps) posy = posy - 10 DMSetPos(sls[key], key, x) - posy = posy - 10 return sls[key] end @@ -185,7 +184,7 @@ function DarkMode:AddColorPicker(name, parent, x, y) end DMSetPos(cps[name], name, x) - posy = posy - 10 + posy = posy - 40 return cps[name] end @@ -239,10 +238,8 @@ function DarkMode:InitDMSettings() posy = -8 AddCategory("GENERAL") AddCheckBox(4, "SHOWMINIMAPBUTTON", true, DarkMode.UpdateMinimapButton) - if DarkMode:GetWoWBuild() ~= "RETAIL" then - AddCheckBox(4, "MASKACTIONBUTTONS", true) - end - + AddCheckBox(4, "MASKACTIONBUTTONS", true) + AddCheckBox(4, "MASKBUFFSANDDEBUFFS", true) AddCheckBox(4, "GRYPHONS", true) local sCM = AddSlider( 4, @@ -268,6 +265,7 @@ function DarkMode:InitDMSettings() sCMUF.Text:SetText(DarkMode:GT("COLORMODEUF") .. ": " .. DarkMode:GetColorModes()[DarkMode:GV("COLORMODEUF", 1)]) DarkMode:AddColorPicker("CUSTOMUFC", DMSettings.SC, 0, 0) + --TT local sCMTT = AddSlider( 4, "COLORMODETT", @@ -280,6 +278,33 @@ function DarkMode:InitDMSettings() sCMTT.Text:SetText(DarkMode:GT("COLORMODETT") .. ": " .. DarkMode:GetColorModes()[DarkMode:GV("COLORMODETT", 1)]) DarkMode:AddColorPicker("CUSTOMTTC", DMSettings.SC, 0, 0) + --AB + local sCMAB = AddSlider( + 4, + "COLORMODEAB", + DarkMode:GV("COLORMODEAB", 1), + function(sel, val) + sel.Text:SetText(DarkMode:GT("COLORMODEAB") .. ": " .. DarkMode:GetColorModes()[val]) + DarkMode:UpdateColors() + end, 1, getn(DarkMode:GetColorModes()), 1 + ) + + sCMAB.Text:SetText(DarkMode:GT("COLORMODEAB") .. ": " .. DarkMode:GetColorModes()[DarkMode:GV("COLORMODEAB", 1)]) + DarkMode:AddColorPicker("CUSTOMABC", DMSettings.SC, 0, 0) + --BAD + local sCMBAD = AddSlider( + 4, + "COLORMODEBAD", + DarkMode:GV("COLORMODEBAD", 1), + function(sel, val) + sel.Text:SetText(DarkMode:GT("COLORMODEBAD") .. ": " .. DarkMode:GetColorModes()[val]) + DarkMode:UpdateColors() + end, 1, getn(DarkMode:GetColorModes()), 1 + ) + + sCMBAD.Text:SetText(DarkMode:GT("COLORMODEBAD") .. ": " .. DarkMode:GetColorModes()[DarkMode:GV("COLORMODEBAD", 1)]) + DarkMode:AddColorPicker("CUSTOMBADC", DMSettings.SC, 0, 0) + --Frames local sCMF = AddSlider( 4, "COLORMODEF",