From 0d25b3780fa290b4547a6b429d06d02796ed57d9 Mon Sep 17 00:00:00 2001 From: D4KiR <23246564+d4kir92@users.noreply.github.com> Date: Sat, 28 Sep 2024 11:25:01 +0200 Subject: [PATCH] v0.9.103 --- ImproveAny.toc | 2 +- ImproveAny_Cata.toc | 2 +- ImproveAny_TBC.toc | 2 +- ImproveAny_Vanilla.toc | 2 +- ImproveAny_Wrath.toc | 2 +- core.lua | 2 +- ele/minimap.lua | 2 +- libs/D4Lib/D4Frames.lua | 36 ++++++++++++++++++++++++++++++------ settings.lua | 4 ++-- 9 files changed, 39 insertions(+), 15 deletions(-) diff --git a/ImproveAny.toc b/ImproveAny.toc index fd01309..50f88ce 100644 --- a/ImproveAny.toc +++ b/ImproveAny.toc @@ -4,7 +4,7 @@ ## Interface-Cata: 40400 ## Interface: 110002 -## Version: 0.9.102 +## Version: 0.9.103 ## Title: ImproveAny by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/ImproveAny_Cata.toc b/ImproveAny_Cata.toc index 6c5bc69..801b2d3 100644 --- a/ImproveAny_Cata.toc +++ b/ImproveAny_Cata.toc @@ -1,5 +1,5 @@ ## Interface: 40400 -## Version: 0.9.102 +## Version: 0.9.103 ## Title: ImproveAny |T136033:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/ImproveAny_TBC.toc b/ImproveAny_TBC.toc index 230ea96..9311f65 100644 --- a/ImproveAny_TBC.toc +++ b/ImproveAny_TBC.toc @@ -1,5 +1,5 @@ ## Interface: 20504 -## Version: 0.9.102 +## Version: 0.9.103 ## Title: ImproveAny |T136033:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/ImproveAny_Vanilla.toc b/ImproveAny_Vanilla.toc index dee7c42..69bd8ab 100644 --- a/ImproveAny_Vanilla.toc +++ b/ImproveAny_Vanilla.toc @@ -1,5 +1,5 @@ ## Interface: 11504 -## Version: 0.9.102 +## Version: 0.9.103 ## Title: ImproveAny |T136033:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t ## Notes: Improve Any Ui or Frame ## Author: D4KiR diff --git a/ImproveAny_Wrath.toc b/ImproveAny_Wrath.toc index bc6a491..23d1b09 100644 --- a/ImproveAny_Wrath.toc +++ b/ImproveAny_Wrath.toc @@ -1,5 +1,5 @@ ## Interface: 30403 -## Version: 0.9.102 +## Version: 0.9.103 ## Title: ImproveAny |T136033: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 01ba940..c49cfe6 100644 --- a/core.lua +++ b/core.lua @@ -268,7 +268,7 @@ function ImproveAny:Event(event, ...) ["icon"] = 136033, ["var"] = mmbtn, ["dbtab"] = IATAB, - ["vTT"] = {{"ImproveAny |T136033:16:16:0:0|t", "v|cff3FC7EB0.9.102"}, {ImproveAny:GT("LEFTCLICK"), ImproveAny:GT("MMBTNLEFT")}, {ImproveAny:GT("RIGHTCLICK"), ImproveAny:GT("MMBTNRIGHT")}}, + ["vTT"] = {{"ImproveAny |T136033:16:16:0:0|t", "v|cff3FC7EB0.9.103"}, {ImproveAny:GT("LEFTCLICK"), ImproveAny:GT("MMBTNLEFT")}, {ImproveAny:GT("RIGHTCLICK"), ImproveAny:GT("MMBTNRIGHT")}}, ["funcL"] = function() ImproveAny:ToggleSettings() end, diff --git a/ele/minimap.lua b/ele/minimap.lua index 74d59a1..779a642 100644 --- a/ele/minimap.lua +++ b/ele/minimap.lua @@ -505,7 +505,7 @@ function ImproveAny:InitMinimap() for x, w in pairs(mmBtnsNames) do if strfind(child:GetName(), w) and not tContains(mmbtns, child) and not strfind(child:GetName(), "Peggle") then tinsert(mmbtns, child) - ImproveAny:ConvertToMinimapButton(child:GetName(), strfind(child:GetName(), "ImproveAnyMMBtns") ~= nil) + ImproveAny:ConvertToMinimapButton(child:GetName(), strfind(child:GetName(), "ImproveAnyMMBtns") ~= nil or strfind(child:GetName(), "BugSack") ~= nil or strfind(child:GetName(), "AutoQueueWA") ~= nil) end end end diff --git a/libs/D4Lib/D4Frames.lua b/libs/D4Lib/D4Frames.lua index 45ecc0d..a217a98 100644 --- a/libs/D4Lib/D4Frames.lua +++ b/libs/D4Lib/D4Frames.lua @@ -14,7 +14,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 @@ -31,9 +35,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 @@ -62,6 +68,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 @@ -91,7 +113,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 @@ -154,7 +176,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 diff --git a/settings.lua b/settings.lua index bd600cc..78d5cba 100644 --- a/settings.lua +++ b/settings.lua @@ -441,8 +441,8 @@ function ImproveAny:InitIASettings() IASettings:Hide() end - ImproveAny:SetVersion(AddonName, 136033, "0.9.102") - IASettings.TitleText:SetText(format("ImproveAny |T136033:16:16:0:0|t v|cff3FC7EB%s", "0.9.102")) + ImproveAny:SetVersion(AddonName, 136033, "0.9.103") + IASettings.TitleText:SetText(format("ImproveAny |T136033:16:16:0:0|t v|cff3FC7EB%s", "0.9.103")) IASettings.CloseButton:SetScript( "OnClick", function()