From ab087a64bd4a73611e061e925ad6cdb7a9c11e6f Mon Sep 17 00:00:00 2001 From: D4KiR <23246564+d4kir92@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:17:00 +0200 Subject: [PATCH] v0.9.104 --- ImproveAny.toc | 2 +- ImproveAny_Cata.toc | 2 +- ImproveAny_TBC.toc | 2 +- ImproveAny_Vanilla.toc | 2 +- ImproveAny_Wrath.toc | 2 +- core.lua | 39 +++++++++++++++++++++++++-------------- libs/D4Lib/D4Frames.lua | 40 +++++++++++++++++++++++++--------------- settings.lua | 4 ++-- 8 files changed, 57 insertions(+), 36 deletions(-) diff --git a/ImproveAny.toc b/ImproveAny.toc index 50f88ce..855ded7 100644 --- a/ImproveAny.toc +++ b/ImproveAny.toc @@ -4,7 +4,7 @@ ## Interface-Cata: 40400 ## Interface: 110002 -## Version: 0.9.103 +## Version: 0.9.104 ## 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 801b2d3..075326c 100644 --- a/ImproveAny_Cata.toc +++ b/ImproveAny_Cata.toc @@ -1,5 +1,5 @@ ## Interface: 40400 -## Version: 0.9.103 +## Version: 0.9.104 ## 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 9311f65..30addbc 100644 --- a/ImproveAny_TBC.toc +++ b/ImproveAny_TBC.toc @@ -1,5 +1,5 @@ ## Interface: 20504 -## Version: 0.9.103 +## Version: 0.9.104 ## 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 69bd8ab..3803a71 100644 --- a/ImproveAny_Vanilla.toc +++ b/ImproveAny_Vanilla.toc @@ -1,5 +1,5 @@ ## Interface: 11504 -## Version: 0.9.103 +## Version: 0.9.104 ## 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 23d1b09..262ca1f 100644 --- a/ImproveAny_Wrath.toc +++ b/ImproveAny_Wrath.toc @@ -1,5 +1,5 @@ ## Interface: 30403 -## Version: 0.9.103 +## Version: 0.9.104 ## 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 c49cfe6..b78fd1f 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.103"}, {ImproveAny:GT("LEFTCLICK"), ImproveAny:GT("MMBTNLEFT")}, {ImproveAny:GT("RIGHTCLICK"), ImproveAny:GT("MMBTNRIGHT")}}, + ["vTT"] = {{"ImproveAny |T136033:16:16:0:0|t", "v|cff3FC7EB0.9.104"}, {ImproveAny:GT("LEFTCLICK"), ImproveAny:GT("MMBTNLEFT")}, {ImproveAny:GT("RIGHTCLICK"), ImproveAny:GT("MMBTNRIGHT")}}, ["funcL"] = function() ImproveAny:ToggleSettings() end, @@ -1010,19 +1010,30 @@ function ImproveAny:Event(event, ...) DetailsInset:SetSize(302, 339 + tall) DetailsInset:SetPoint("TOPLEFT", _G["ClassTrainerFrame"], "TOPLEFT", 348, -72) DetailsInset:SetTexture("Interface\\ACHIEVEMENTFRAME\\UI-GuildAchievement-Parchment-Horizontal-Desaturated") - _G["ClassTrainerTrainButton"]:ClearAllPoints() - _G["ClassTrainerTrainButton"]:SetPoint("RIGHT", _G["ClassTrainerCancelButton"], "LEFT", -1, 0) - _G["ClassTrainerCancelButton"]:SetSize(80, 22) - _G["ClassTrainerCancelButton"]:SetText(CLOSE) - _G["ClassTrainerCancelButton"]:ClearAllPoints() - _G["ClassTrainerCancelButton"]:SetPoint("BOTTOMRIGHT", _G["ClassTrainerFrame"], "BOTTOMRIGHT", -42, 54) - _G["ClassTrainerFrameCloseButton"]:ClearAllPoints() - _G["ClassTrainerFrameCloseButton"]:SetPoint("TOPRIGHT", _G["ClassTrainerFrame"], "TOPRIGHT", -30, -8) - ClassTrainerFrameFilterDropDown:ClearAllPoints() - ClassTrainerFrameFilterDropDown:SetPoint("TOPLEFT", ClassTrainerFrame, "TOPLEFT", 501, -40) - ClassTrainerMoneyFrame:ClearAllPoints() - ClassTrainerMoneyFrame:SetPoint("TOPLEFT", _G["ClassTrainerFrame"], "TOPLEFT", 143, -49) - ClassTrainerGreetingText:Hide() + if _G["ClassTrainerTrainButton"] and _G["ClassTrainerCancelButton"] and _G["ClassTrainerFrameCloseButton"] then + _G["ClassTrainerTrainButton"]:ClearAllPoints() + _G["ClassTrainerTrainButton"]:SetPoint("RIGHT", _G["ClassTrainerCancelButton"], "LEFT", -1, 0) + _G["ClassTrainerCancelButton"]:SetSize(80, 22) + _G["ClassTrainerCancelButton"]:SetText(CLOSE) + _G["ClassTrainerCancelButton"]:ClearAllPoints() + _G["ClassTrainerCancelButton"]:SetPoint("BOTTOMRIGHT", _G["ClassTrainerFrame"], "BOTTOMRIGHT", -42, 54) + _G["ClassTrainerFrameCloseButton"]:ClearAllPoints() + _G["ClassTrainerFrameCloseButton"]:SetPoint("TOPRIGHT", _G["ClassTrainerFrame"], "TOPRIGHT", -30, -8) + end + + if ClassTrainerFrameFilterDropDown then + ClassTrainerFrameFilterDropDown:ClearAllPoints() + ClassTrainerFrameFilterDropDown:SetPoint("TOPLEFT", ClassTrainerFrame, "TOPLEFT", 501, -40) + end + + if ClassTrainerMoneyFrame then + ClassTrainerMoneyFrame:ClearAllPoints() + ClassTrainerMoneyFrame:SetPoint("TOPLEFT", _G["ClassTrainerFrame"], "TOPLEFT", 143, -49) + end + + if ClassTrainerGreetingText then + ClassTrainerGreetingText:Hide() + end end if ImproveAny:IsAddOnLoaded("Blizzard_TrainerUI") then diff --git a/libs/D4Lib/D4Frames.lua b/libs/D4Lib/D4Frames.lua index a217a98..ec0b40c 100644 --- a/libs/D4Lib/D4Frames.lua +++ b/libs/D4Lib/D4Frames.lua @@ -1,4 +1,5 @@ local _, D4 = ... +local X = 0 local Y = 0 local PARENT = nil local TAB = nil @@ -242,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 @@ -273,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}, } ) @@ -284,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 @@ -303,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 @@ -355,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 @@ -366,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 @@ -395,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 @@ -416,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 diff --git a/settings.lua b/settings.lua index 78d5cba..11e71c0 100644 --- a/settings.lua +++ b/settings.lua @@ -441,8 +441,8 @@ function ImproveAny:InitIASettings() IASettings:Hide() end - ImproveAny:SetVersion(AddonName, 136033, "0.9.103") - IASettings.TitleText:SetText(format("ImproveAny |T136033:16:16:0:0|t v|cff3FC7EB%s", "0.9.103")) + ImproveAny:SetVersion(AddonName, 136033, "0.9.104") + IASettings.TitleText:SetText(format("ImproveAny |T136033:16:16:0:0|t v|cff3FC7EB%s", "0.9.104")) IASettings.CloseButton:SetScript( "OnClick", function()