From 7e0a0d6256f937e01cd11906d72b2bcce8700ceb Mon Sep 17 00:00:00 2001 From: Peter Yu <49627468+Peterodox@users.noreply.github.com> Date: Wed, 24 Jun 2026 15:20:33 +0800 Subject: [PATCH 01/12] Added a /reload helper - Disabling certain modules requires /reload. - Create a clickable FontString on the modified UI for easy /reload. --- .luacheckrc | 9 +++++ API.lua | 7 ++++ Locales/enUS.lua | 3 ++ Locales/zhCN.lua | 3 ++ Modules/Shared/SharedWidgets.lua | 12 ++++++- Modules/Shared/SharedWidgets.xml | 24 +++++++++++++ Modules/Shared/SharedWidgets_Helpers.lua | 45 ++++++++++++++++++++++++ 7 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 Modules/Shared/SharedWidgets_Helpers.lua diff --git a/.luacheckrc b/.luacheckrc index 5bd56ca..2b1cefb 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -780,6 +780,7 @@ stds.wow = { "GetCurrentHouseLevelFavor", "GetCurrentNeighborhoodGUID", "GetHouseLevelFavorForLevel", + "GetOthersOwnedHouses", "GetPlayerOwnedHouses", "GetUIMapIDForNeighborhood", "GetVisitCooldownInfo", @@ -1318,6 +1319,12 @@ stds.wow = { }, }, + C_UIWidgetManager = { + fields = { + "Reload", + }, + }, + C_UIWidgetManager = { fields = { "GetAllWidgetsBySetID", @@ -1776,6 +1783,7 @@ stds.wow = { "EQUIPMENTFLYOUT_FIRST_SPECIAL_LOCATION", "ERR_ACHIEVEMENT_WATCH_COMPLETED", "ERR_COSMETIC_KNOWN", + "ERR_HOUSING_RESULT_LOCKED_BY_COMBAT", "ERR_ITEM_NOT_FOUND", "ERR_LFG_PROPOSAL_FAILED", "EXPANSION_NAME10", @@ -1891,6 +1899,7 @@ stds.wow = { "UNIT_SKINNABLE_HERB", "UNIT_YOU", "UNUSED", + "VIEW_HOUSES_TITLE", "WEEKLY_REWARDS_CLICK_TO_PREVIEW_INSTRUCTIONS", "WEEKLY_REWARDS_COMPLETE_WORLD", "WEEKLY_REWARDS_CURRENT_REWARD", diff --git a/API.lua b/API.lua index 2037041..bc2da72 100644 --- a/API.lua +++ b/API.lua @@ -4039,6 +4039,11 @@ do -- Custom Hyperlink ItemRef local args = {...}; local link = "|Haddon:plumber:"..typeName; + if #args == 0 then + -- There must be at least 1 arg + args = {0}; + end + for i, v in ipairs(args) do link = link..":"..v; end @@ -4048,6 +4053,8 @@ do -- Custom Hyperlink ItemRef return link end end + + API.AddCustomLinkType("ReloadUI", C_UI.Reload); end do -- 11.0 Menu Formatter diff --git a/Locales/enUS.lua b/Locales/enUS.lua index fbfe85f..5fcdc8a 100755 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -47,6 +47,9 @@ L["Return To Module List"] = "Return to List"; L["Generic Addon Conflict"] = "This module might be incompatible with addons of similar functionalities:"; L["Work In Progress Tag"] = "[WIP]"; L["Colon With Space"] = ": "; +L["Disabled Module Requires Reload Format"] = "You must %s to apply the changes."; --We'll replace %s with a clickable "reload the UI" +L["Reload The UI"] = "reload the UI"; +L["Click To Reload UI"] = "Click to reload the UI."; --Settings Category diff --git a/Locales/zhCN.lua b/Locales/zhCN.lua index a703da6..330d193 100755 --- a/Locales/zhCN.lua +++ b/Locales/zhCN.lua @@ -47,6 +47,9 @@ L["Return To Module List"] = "返回模块列表"; L["LootUI Addon Conflict"] = "此模块可能与以下功能类似的插件不兼容:"; L["Work In Progress Tag"] = "[施工中]"; L["Colon With Space"] = ":"; +L["Disabled Module Requires Reload Format"] = "你必须%s才能使改变生效。"; --We'll replace %s with a clickable "reload the UI" +L["Reload The UI"] = "重载界面"; +L["Click To Reload UI"] = "左键单击以重载界面。"; --Settings Category diff --git a/Modules/Shared/SharedWidgets.lua b/Modules/Shared/SharedWidgets.lua index 96ed7d0..67b4860 100644 --- a/Modules/Shared/SharedWidgets.lua +++ b/Modules/Shared/SharedWidgets.lua @@ -2113,6 +2113,15 @@ do --(In)Secure Button Pool self:RegisterForClicks("AnyDown", "AnyUp"); end + function SecureButtonMixin:SetVisitHouse(neighborhoodGUID, houseGUID, plotID) + self:SetAttribute("type", "visithouse"); + self:SetAttribute("house-neighborhood-guid", neighborhoodGUID); + self:SetAttribute("house-guid", houseGUID); + self:SetAttribute("house-plot-id", plotID); + self:SetAttribute("useOnKeyDown", false); + self:RegisterForClicks("AnyUp"); + end + local function CreateSecureActionButton() if InCombatLockdown() then return end; local index = #SecureButtons + 1; @@ -2132,7 +2141,7 @@ do --(In)Secure Button Pool return button end - local function AcquireSecureActionButton(privateKey, propagateMouseMotion) + local function AcquireSecureActionButton(privateKey, propagateMouseMotion, propagateMouseClicks) if InCombatLockdown() then return end; local button; @@ -2160,6 +2169,7 @@ do --(In)Secure Button Pool if button then button.isActive = true; button:SetPropagateMouseMotion(propagateMouseMotion or false); + button:SetPropagateMouseClicks(propagateMouseClicks or false); SecureButtonContainer:RegisterEvent("PLAYER_REGEN_DISABLED"); if GetCVarBool("ActionButtonUseKeyDown") then diff --git a/Modules/Shared/SharedWidgets.xml b/Modules/Shared/SharedWidgets.xml index 14ac14b..0ea9d7a 100644 --- a/Modules/Shared/SharedWidgets.xml +++ b/Modules/Shared/SharedWidgets.xml @@ -2,6 +2,7 @@