Skip to content

Commit

Permalink
v0.5.117
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Oct 14, 2024
1 parent 842b2be commit 2f4b29f
Show file tree
Hide file tree
Showing 11 changed files with 3,217 additions and 35 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.116
## Version: 0.5.117
## 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.116
## Version: 0.5.117
## 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.116
## Version: 0.5.117
## 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: 11504
## Version: 0.5.116
## Version: 0.5.117
## 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.116
## Version: 0.5.117
## 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: 19 additions & 24 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1611,32 +1611,27 @@ function DarkMode:Event(event, ...)
end

if UIParent.SetFixedFrameStrata then
C_Timer.After(
1,
function()
DarkMode:CreateMinimapButton(
{
["name"] = "DarkMode",
["icon"] = 136122,
["dbtab"] = DMTAB,
["vTT"] = {{"DarkMode |T136122:16:16:0:0|t", "v|cff3FC7EB0.5.116"}, {DarkMode:Trans("LEFTCLICK"), DarkMode:Trans("MMBTNLEFT")}, {DarkMode:Trans("RIGHTCLICK"), DarkMode:Trans("MMBTNRIGHT")}},
["funcL"] = function()
DarkMode:ToggleSettings()
end,
["funcR"] = function()
DarkMode:SetEnabled("MMBTN", false)
DarkMode:HideMMBtn("DarkMode")
end,
}
)

if DarkMode:IsEnabled("MMBTN", DarkMode:GetWoWBuild() ~= "RETAIL") then
DarkMode:ShowMMBtn("DarkMode")
else
DarkMode:CreateMinimapButton(
{
["name"] = "DarkMode",
["icon"] = 136122,
["dbtab"] = DMTAB,
["vTT"] = {{"DarkMode |T136122:16:16:0:0|t", "v|cff3FC7EB0.5.117"}, {DarkMode:Trans("LEFTCLICK"), DarkMode:Trans("MMBTNLEFT")}, {DarkMode:Trans("RIGHTCLICK"), DarkMode:Trans("MMBTNRIGHT")}},
["funcL"] = function()
DarkMode:ToggleSettings()
end,
["funcR"] = function()
DarkMode:SetEnabled("MMBTN", false)
DarkMode:HideMMBtn("DarkMode")
end
end
end,
}
)

if DarkMode:IsEnabled("MMBTN", DarkMode:GetWoWBuild() ~= "RETAIL") then
DarkMode:ShowMMBtn("DarkMode")
else
DarkMode:HideMMBtn("DarkMode")
end
end
end
elseif event == "ADDON_LOADED" then
Expand Down
12 changes: 9 additions & 3 deletions libs/D4Lib/D4Frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ function D4:AppendSlider(key, value, min, max, steps, decimals, func, lstr)
Y = Y - 30
end

function D4:CreateDropdown(key, value, choices, parent)
function D4:CreateDropdown(key, value, choices, parent, func)
if TAB[key] == nil then
TAB[key] = value
end
Expand All @@ -392,6 +392,9 @@ function D4:CreateDropdown(key, value, choices, parent)
function()
TAB[key] = data
Dropdown:SetDefaultText(D4:Trans(name))
if func then
func(data)
end
end
)
end
Expand Down Expand Up @@ -420,12 +423,15 @@ function D4:CreateDropdown(key, value, choices, parent)
TAB[key] = newValue
UIDropDownMenu_SetText(dropDown, newValue)
CloseDropDownMenus()
if func then
func(newValue)
end
end
end
end

function D4:AppendDropdown(key, value, choices)
function D4:AppendDropdown(key, value, choices, func)
Y = Y - 10
D4:CreateDropdown(key, value, choices, PARENT)
D4:CreateDropdown(key, value, choices, PARENT, func)
Y = Y - 30
end
2 changes: 1 addition & 1 deletion libs/D4Lib/D4Lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function D4:GetName(frameOrTexture)
return nil
end

local function FixIconChat(self, event, message, author, ...)
local function FixIconChat(sel, event, message, author, ...)
if ICON_LIST then
for tag in string.gmatch(message, "%b{}") do
local term = strlower(string.gsub(tag, "[{}]", ""))
Expand Down
3 changes: 3 additions & 0 deletions libs/D4Lib/D4Lib.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<Script file="D4MinimapButtons.lua"/>
<Script file="D4SlashCmds.lua"/>
<Script file="D4Translations.lua"/>

<Script file="D4Versions.lua"/>

<Script file="D4Realms.lua"/>

</Ui>
Loading

0 comments on commit 2f4b29f

Please sign in to comment.