Skip to content

Commit

Permalink
v0.5.113
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Oct 2, 2024
1 parent 4e45f49 commit cc362f6
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 32 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.112
## Version: 0.5.113
## 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.112
## Version: 0.5.113
## 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.112
## Version: 0.5.113
## 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.112
## Version: 0.5.113
## 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.112
## Version: 0.5.113
## 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.112"}, {DarkMode:Trans("LEFTCLICK"), DarkMode:Trans("MMBTNLEFT")}, {DarkMode:Trans("RIGHTCLICK"), DarkMode:Trans("MMBTNRIGHT")}},
["vTT"] = {{"DarkMode |T136122:16:16:0:0|t", "v|cff3FC7EB0.5.113"}, {DarkMode:Trans("LEFTCLICK"), DarkMode:Trans("MMBTNLEFT")}, {DarkMode:Trans("RIGHTCLICK"), DarkMode:Trans("MMBTNRIGHT")}},
["funcL"] = function()
DarkMode:ToggleSettings()
end,
Expand Down
6 changes: 3 additions & 3 deletions data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ function DarkMode:GetDMRepeatingFrames2()
end

local DMUi = {
["ActionButtons"] = {"PetActionButton", "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", "MultiBarBottomLeftActionButton", "MultiBarBottomRightActionButton", "MultiBarLeftActionButton", "MultiBarRightActionButton", "MultiBarBottomRightActionButton", "MultiBar5ActionButton", "MultiBar6ActionButton", "MultiBar7ActionButton"},
["Minimap"] = {"CalendarButtonFrame", "MiniMapBattlefieldBorder", "MinimapBorder", "MinimapBorderTop", "TimeManagerClockButton", "MinimapCompassTexture", "MinimapCluster.BorderTop",},
["UnitFrames"] = {"FocusFrameToT", "TargetFrameToT", "ArenaEnemyFrame1Texture", "ArenaEnemyFrame2Texture", "ArenaEnemyFrame3Texture", "ArenaEnemyFrame4Texture", "ArenaEnemyFrame5Texture", "PlayerFrameAlternateManaBarBorder", "Boss1TargetFrameTextureFrame", "Boss2TargetFrameTextureFrame", "Boss3TargetFrameTextureFrame", "Boss4TargetFrameTextureFrame", "Boss5TargetFrameTextureFrame", "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"},
["UnitFrames"] = {"FocusFrameToT", "TargetFrameToT", "CompactArenaFrame.PreMatchFramesContainer.PreMatchFrame1.SpecPortraitBorderTexture", "CompactArenaFrame.PreMatchFramesContainer.PreMatchFrame2.SpecPortraitBorderTexture", "CompactArenaFrame.PreMatchFramesContainer.PreMatchFrame3.SpecPortraitBorderTexture", "CompactArenaFrame.PreMatchFramesContainer.PreMatchFrame4.SpecPortraitBorderTexture", "CompactArenaFrame.PreMatchFramesContainer.PreMatchFrame5.SpecPortraitBorderTexture", "ArenaPrepFrame1Texture", "ArenaPrepFrame2Texture", "ArenaPrepFrame3Texture", "ArenaPrepFrame4Texture", "ArenaPrepFrame5Texture", "ArenaEnemyFrame1Texture", "ArenaEnemyFrame2Texture", "ArenaEnemyFrame3Texture", "ArenaEnemyFrame4Texture", "ArenaEnemyFrame5Texture", "PlayerFrameAlternateManaBarBorder", "Boss1TargetFrameTextureFrame", "Boss2TargetFrameTextureFrame", "Boss3TargetFrameTextureFrame", "Boss4TargetFrameTextureFrame", "Boss5TargetFrameTextureFrame", "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"},
["Artworks"] = {"PaladinPowerBarFrame", "PaladinPowerBarFrame.ActiveTexture", "PaladinPowerBarFrame.Background", "TimerTrackerTimer1StatusBarBorder", "TimerTrackerTimer2StatusBarBorder", "MirrorTimer1", "MirrorTimer2", "MirrorTimer3", "MainMenuBar.BorderArt", "MainMenuBarTextureExtender", "StanceBarLeft", "StanceBarMiddle", "StanceBarRight", "StanceButton1NormalTexture2", "StanceButton2NormalTexture2", "StanceButton3NormalTexture2", "StanceButton4NormalTexture2", "StanceButton5NormalTexture2", "StanceButton6NormalTexture2", "StanceButton7NormalTexture2", "StanceButton8NormalTexture2", "SlidingActionBarTexture0", "SlidingActionBarTexture1", "MainMenuBarTexture0", "MainMenuBarTexture1", "MainMenuBarTexture2", "MainMenuBarTexture3", "MainMenuExpBar", "ReputationWatchBar.StatusBar", "MainStatusTrackingBarContainer.BarFrameTexture", "SecondaryStatusTrackingBarContainer.BarFrameTexture", "MainMenuBarMaxLevelBar", "BT4BarBlizzardArt", "BT4BarBlizzardArt.nineSliceParent", "BlizzardArtLeftCap", "BlizzardArtRightCap", "CompactRaidFrameManager", "CharacterReagentBag0SlotNormalTexture", "CharacterBag0SlotNormalTexture", "CharacterBag1SlotNormalTexture", "CharacterBag2SlotNormalTexture", "CharacterBag3SlotNormalTexture", "MainMenuBarBackpackButtonNormalTexture"},
["Gryphons"] = {"MA_LeftEndCap", "MA_RightEndCap", "MainMenuBar.EndCaps", "MainMenuBarLeftEndCap", "MainMenuBarRightEndCap"},
Expand All @@ -155,7 +155,7 @@ function DarkMode:GetUiTable()
return DMUi
end

local DMUiAddons = {"TimerTrackerTimer1StatusBarBorder", "TimerTrackerTimer2StatusBarBorder", "FocusFrame.FocusFrameContainer.FrameTexture"}
local DMUiAddons = {"TimerTrackerTimer1StatusBarBorder", "TimerTrackerTimer2StatusBarBorder", "FocusFrame.FocusFrameContainer.FrameTexture", "ArenaPrepFrame1Texture", "ArenaPrepFrame2Texture", "ArenaPrepFrame3Texture", "ArenaPrepFrame4Texture", "ArenaPrepFrame5Texture", "ArenaEnemyFrame1Texture", "ArenaEnemyFrame2Texture", "ArenaEnemyFrame3Texture", "ArenaEnemyFrame4Texture", "ArenaEnemyFrame5Texture",}
function DarkMode:GetUiAddonsTable()
return DMUiAddons
end
Expand Down
76 changes: 55 additions & 21 deletions libs/D4Lib/D4Frames.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local _, D4 = ...
local X = 0
local Y = 0
local PARENT = nil
local TAB = nil
Expand All @@ -14,7 +15,11 @@ function D4:AddCategory(tab)
tab.parent.f:SetText(D4:Trans(tab.name))
end

function D4:CreateCheckbox(tab)
function D4:CreateCheckbox(tab, text)
if text == nil then
text = true
end

tab.sw = tab.sw or 25
tab.sh = tab.sh or 25
tab.parent = tab.parent or UIParent
Expand All @@ -31,9 +36,11 @@ function D4:CreateCheckbox(tab)
end
)

cb.f = cb:CreateFontString(nil, nil, "GameFontNormal")
cb.f:SetPoint("LEFT", cb, "RIGHT", 0, 0)
cb.f:SetText(D4:Trans(tab.name))
if text then
cb.f = cb:CreateFontString(nil, nil, "GameFontNormal")
cb.f:SetPoint("LEFT", cb, "RIGHT", 0, 0)
cb.f:SetText(D4:Trans(tab.name))
end

return cb
end
Expand Down Expand Up @@ -62,6 +69,22 @@ function D4:CreateCheckboxForCVAR(tab)
return cb
end

function D4:CreateSliderForCVAR(tab)
tab.sw = tab.sw or 25
tab.sh = tab.sh or 25
tab.parent = tab.parent or UIParent
tab.pTab = tab.pTab or "CENTER"
tab.value = tab.value or nil
local cb = D4:CreateCheckbox(tab, false)
tab.sw = 460
tab.value = tab.value2
tab.key = tab.key or tab.name or ""
tab.pTab = {tab.pTab[1], tab.pTab[2] + 32, tab.pTab[3] - 18}
D4:CreateSlider(tab)

return cb
end

function D4:CreateEditBox(tab)
tab.sw = tab.sw or 200
tab.sh = tab.sh or 25
Expand Down Expand Up @@ -91,7 +114,7 @@ function D4:CreateSlider(tab)
D4:MSG("[D4][CreateSlider] Missing format string:", tab.key, tab.value)

return
elseif tab.value == nil then
elseif tab.value == nil or type(tonumber(tab.value)) ~= "number" then
D4:MSG("[D4][CreateSlider] Missing value:", tab.key, tab.value)

return
Expand Down Expand Up @@ -154,7 +177,9 @@ function D4:CreateSlider(tab)
TAB[tab.key] = val
end

if tab.funcV then
if tab.funcV2 then
tab:funcV2(val)
elseif tab.funcV then
tab:funcV(val)
end

Expand Down Expand Up @@ -218,6 +243,14 @@ function D4:CreateFrame(tab)
return fra
end

function D4:SetAppendX(newX)
X = newX
end

function D4:GetAppendX()
return X
end

function D4:SetAppendY(newY)
Y = newY
end
Expand Down Expand Up @@ -249,7 +282,7 @@ function D4:AppendCategory(name, x, y)
{
["name"] = name,
["parent"] = PARENT,
["pTab"] = {"TOPLEFT", x or 5, y or Y},
["pTab"] = {"TOPLEFT", x or X, y or Y},
}
)

Expand All @@ -260,7 +293,7 @@ end

function D4:AppendCheckbox(key, value, func, x, y)
value = value or false
x = x or 5
x = x or X
if TAB == nil then
if TABIsNil == false then
TABIsNil = true
Expand All @@ -279,7 +312,7 @@ function D4:AppendCheckbox(key, value, func, x, y)
{
["name"] = key,
["parent"] = PARENT,
["pTab"] = {"TOPLEFT", x, y or Y},
["pTab"] = {"TOPLEFT", x or X, y or Y},
["value"] = val,
["funcV"] = function(sel, checked)
TAB[key] = checked
Expand Down Expand Up @@ -331,7 +364,7 @@ function D4:AppendSlider(key, value, min, max, steps, decimals, func, lstr)
slider.decimals = decimals
slider.color = {0, 1, 0, 1}
slider.func = func
slider.pTab = {"TOPLEFT", 10, Y}
slider.pTab = {"TOPLEFT", X + 5, Y}
D4:CreateSlider(slider)
Y = Y - 30
end
Expand All @@ -342,23 +375,23 @@ function D4:CreateDropdown(key, value, choices, parent)
end

local text = parent:CreateFontString(nil, nil, "GameFontNormal")
text:SetPoint("TOPLEFT", 10, Y)
text:SetPoint("TOPLEFT", X + 5, 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:SetDefaultText(D4:Trans(choices[TAB[key]]))
Dropdown:SetPoint("TOPLEFT", X + 5, Y)
Dropdown:SetWidth(200)
Dropdown:SetupMenu(
function(dropdown, rootDescription)
rootDescription:CreateTitle(D4:Trans(key))
for i, v in pairs(choices) do
for data, name in pairs(choices) do
rootDescription:CreateButton(
i,
D4:Trans(name),
function()
TAB[key] = v
Dropdown:SetDefaultText(i)
TAB[key] = data
Dropdown:SetDefaultText(D4:Trans(name))
end
)
end
Expand All @@ -371,10 +404,10 @@ function D4:CreateDropdown(key, value, choices, parent)
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]]
for data, name in pairs(choices) do
info.text = D4:Trans(name)
info.arg1 = data
info.checked = name == choices[TAB[key]]
info.func = dropDown.SetValue
UIDropDownMenu_AddButton(info)
end
Expand All @@ -392,6 +425,7 @@ function D4:CreateDropdown(key, value, choices, parent)
end

function D4:AppendDropdown(key, value, choices)
Y = Y - 10
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 @@ -372,8 +372,8 @@ function DarkMode:InitDMSettings()
DMSettings:Hide()
end

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

0 comments on commit cc362f6

Please sign in to comment.