Skip to content

Commit

Permalink
v0.5.111
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Sep 22, 2024
1 parent 9d0aa2f commit 13954de
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 9 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.110
## Version: 0.5.111
## 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.110
## Version: 0.5.111
## 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.110
## Version: 0.5.111
## 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: 11503
## Version: 0.5.110
## Version: 0.5.111
## 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.110
## Version: 0.5.111
## 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 core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ function DarkMode:Event(event, ...)
["name"] = "DarkMode",
["icon"] = 136122,
["dbtab"] = DMTAB,
["vTT"] = {{"DarkMode |T136122:16:16:0:0|t", "v|cff3FC7EB0.5.110"}, {DarkMode:Trans("LEFTCLICK"), DarkMode:Trans("MMBTNLEFT")}, {DarkMode:Trans("RIGHTCLICK"), DarkMode:Trans("MMBTNRIGHT")}},
["vTT"] = {{"DarkMode |T136122:16:16:0:0|t", "v|cff3FC7EB0.5.111"}, {DarkMode:Trans("LEFTCLICK"), DarkMode:Trans("MMBTNLEFT")}, {DarkMode:Trans("RIGHTCLICK"), DarkMode:Trans("MMBTNRIGHT")}},
["funcL"] = function()
DarkMode:ToggleSettings()
end,
Expand Down
7 changes: 6 additions & 1 deletion data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ function DarkMode:GetTextColor(r, g, b, a)
return 1, 1, 1, 1
end

local DMRepeatingFrames = {"", ".Background", ".Bg", ".Bg.TopSection", ".Bg.BottomEdge", "Inset", "Inset.Bg", "Inset.NineSlice", "Inset.NineSlice.TopEdge", "Inset.NineSlice.RightEdge", "Inset.NineSlice.LeftEdge", "Inset.NineSlice.BottomEdge", "Inset.NineSlice.TopRightCorner", "Inset.NineSlice.TopLeftCorner", "Inset.NineSlice.BottomRightCorner", "Inset.NineSlice.BottomLeftCorner", ".NineSlice", ".NineSlice.TopEdge", ".NineSlice.RightEdge", ".NineSlice.LeftEdge", ".NineSlice.BottomEdge", ".NineSlice.TopRightCorner", ".NineSlice.TopLeftCorner", ".NineSlice.BottomRightCorner", ".NineSlice.BottomLeftCorner", "ScrollFrame", ".Begin", ".Middle", ".End", ".ScrollBar.Background",}
local DMRepeatingFrames = {"", ".Bg.TopSection", ".Bg.BottomEdge", "Inset", "Inset.Bg", "Inset.NineSlice", "Inset.NineSlice.TopEdge", "Inset.NineSlice.RightEdge", "Inset.NineSlice.LeftEdge", "Inset.NineSlice.BottomEdge", "Inset.NineSlice.TopRightCorner", "Inset.NineSlice.TopLeftCorner", "Inset.NineSlice.BottomRightCorner", "Inset.NineSlice.BottomLeftCorner", ".NineSlice", ".NineSlice.TopEdge", ".NineSlice.RightEdge", ".NineSlice.LeftEdge", ".NineSlice.BottomEdge", ".NineSlice.TopRightCorner", ".NineSlice.TopLeftCorner", ".NineSlice.BottomRightCorner", ".NineSlice.BottomLeftCorner", "ScrollFrame", ".Begin", ".Middle", ".End", ".ScrollBar.Background",}
if DarkMode:GetWoWBuild() ~= "RETAIL" then
table.insert(DMRepeatingFrames, ".Background")
table.insert(DMRepeatingFrames, ".Bg")
end

function DarkMode:GetDMRepeatingFrames()
return DMRepeatingFrames
end
Expand Down
60 changes: 60 additions & 0 deletions libs/D4Lib/D4Frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,63 @@ function D4:AppendSlider(key, value, min, max, steps, decimals, func, lstr)
D4:CreateSlider(slider)
Y = Y - 30
end

function D4:CreateDropdown(key, value, choices, parent)
if TAB[key] == nil then
TAB[key] = value
end

local text = parent:CreateFontString(nil, nil, "GameFontNormal")
text:SetPoint("TOPLEFT", 10, Y)
text:SetText(D4:Trans(key))
Y = Y - 18
if D4:GetWoWBuild() == "RETAIL" then
local Dropdown = CreateFrame("DropdownButton", key, parent, "WowStyle1DropdownTemplate")
Dropdown:SetDefaultText(choices[TAB[key]])
Dropdown:SetPoint("TOPLEFT", 10, Y)
Dropdown:SetWidth(200)
Dropdown:SetupMenu(
function(dropdown, rootDescription)
rootDescription:CreateTitle(D4:Trans(key))
for i, v in pairs(choices) do
rootDescription:CreateButton(
i,
function()
TAB[key] = v
Dropdown:SetDefaultText(i)
end
)
end
end
)
else
local dropDown = CreateFrame("Frame", "WPDemoDropDown", PARENT, "UIDropDownMenuTemplate")
dropDown:SetPoint("TOPLEFT", -10, Y)
UIDropDownMenu_SetWidth(dropDown, 200)
function WPDropDownDemo_Menu(frame, level, menuList)
local info = UIDropDownMenu_CreateInfo()
if level == 1 then
for i, v in pairs(choices) do
info.text = v
info.arg1 = i
info.checked = v == choices[TAB[key]]
info.func = dropDown.SetValue
UIDropDownMenu_AddButton(info)
end
end
end

UIDropDownMenu_Initialize(dropDown, WPDropDownDemo_Menu)
UIDropDownMenu_SetText(dropDown, choices[TAB[key]])
function dropDown:SetValue(newValue)
TAB[key] = newValue
UIDropDownMenu_SetText(dropDown, newValue)
CloseDropDownMenus()
end
end
end

function D4:AppendDropdown(key, value, choices)
D4:CreateDropdown(key, value, choices, PARENT)
Y = Y - 30
end
4 changes: 2 additions & 2 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ function DarkMode:InitDMSettings()
DMSettings:Hide()
end

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

0 comments on commit 13954de

Please sign in to comment.