From 6723f995fded81407dc35dcce3c491ca14c1faee Mon Sep 17 00:00:00 2001 From: fuba Date: Thu, 4 Dec 2025 03:26:31 +0100 Subject: [PATCH 1/2] fix for TWW Version 11.2.7 --- OrderHallCommander.lua | 16 +++++++++++++--- OrderHallCommander.toc | 2 +- OrderHallCommander.xml | 27 ++++++++++++++++++++++++++- cache.lua | 14 +++++++++----- missionlist.lua | 7 +++++-- 5 files changed, 54 insertions(+), 12 deletions(-) diff --git a/OrderHallCommander.lua b/OrderHallCommander.lua index 3707c17..f1784c7 100644 --- a/OrderHallCommander.lua +++ b/OrderHallCommander.lua @@ -462,9 +462,19 @@ function MixinFollowerIcon:ShowTooltip() return --@end-non-debug@]===] end - local link = C_Garrison.GetFollowerLink(self.followerID); - if link then - local garrisonFollowerID=select(2,strsplit(":", link)) + -- fix by fuba + local garrisonFollowerID = self.followerID + + local link = C_Garrison.GetFollowerLink(self.followerID) + if link then + local _, dbID, id3 = strsplit(":", link) + + if id3 and id3 ~= "" then + garrisonFollowerID = id3 + elseif dbID and dbID ~= "" then + garrisonFollowerID = dbID + end + local data=GarrisonFollowerTooltipTemplate_BuildDefaultDataForID(garrisonFollowerID) data.levelxp=G.GetFollowerLevelXP(self.followerID) data.xp=G.GetFollowerXP(self.followerID) diff --git a/OrderHallCommander.toc b/OrderHallCommander.toc index c46afe0..c6cf075 100644 --- a/OrderHallCommander.toc +++ b/OrderHallCommander.toc @@ -1,4 +1,4 @@ -## Interface: 110200, 110205 +## Interface: 110200, 110205, 110207 ## Title: OrderHallCommander ## IconTexture: 134414 ## Category-enUS: Expansion Features diff --git a/OrderHallCommander.xml b/OrderHallCommander.xml index 1ac5ea6..f00b9fc 100644 --- a/OrderHallCommander.xml +++ b/OrderHallCommander.xml @@ -103,7 +103,32 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cache.lua b/cache.lua index 9eb07c0..b2303ab 100644 --- a/cache.lua +++ b/cache.lua @@ -701,7 +701,9 @@ function module:GARRISON_LANDINGPAGE_SHIPMENTS() end function module:Refresh(event,...) if (event == "CURRENCY_DISPLAY_UPDATE") then - resources = C_CurrencyInfo.GetCurrencyInfo(currency)['quantity'] + if currency then -- fix by fuba + resources = C_CurrencyInfo.GetCurrencyInfo(currency)['quantity'] + end return elseif event=="GARRISON_FOLLOWER_REMOVED" or event=="GARRISON_FOLLOWER_ADDED" then @@ -716,10 +718,12 @@ end function module:OnInitialized() C_AddOns.LoadAddOn("Blizzard_OrderHallUI") currency, _ = C_Garrison.GetCurrencyTypes(garrisonType); - currencyName, resources, currencyTexture = addon:GetCurrencyInfo(currency) ---@debug@ + if currency then + currencyName, resources, currencyTexture = addon:GetCurrencyInfo(currency) +--[==[@debug@ print("Currency init",currencyName, resources, currencyTexture) ---@end-debug@ +--@end-debug@]==] + end addon.resourceFormat=COSTS_LABEL .." %d" self:ParseFollowers() end @@ -742,7 +746,7 @@ end ---- Public Interface -- function addon:GetResources(refresh) - if refresh then + if refresh and currency then -- fix by fuba resources = C_CurrencyInfo.GetCurrencyInfo(currency)['quantity'] end return resources,currencyName,currencyTexture diff --git a/missionlist.lua b/missionlist.lua index 9ba2e0e..82a183d 100644 --- a/missionlist.lua +++ b/missionlist.lua @@ -1,4 +1,5 @@ -local __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- Always check line number in regexp and file, must be 1 +--local faction,_,level=GetFactionInfoByID(factionID) + __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- Always check line number in regexp and file, must be 1 --@debug@ print('Loaded',__FILE__) --@end-debug@ @@ -318,7 +319,9 @@ function module:RewardWarning(this) end local factionID=addon.allReputationGain[this.itemID] if factionID then - local faction,_,level=GetFactionInfoByID(factionID) + local factionData = C_Reputation.GetFactionDataByID(factionID) + local faction = factionData and factionData.name or "" + local level = factionData and factionData.currentStanding or nil if level then level=_G['FACTION_STANDING_LABEL' .. level] tip:AddLine(FACTION_STANDING_CHANGED:format(C(level,"GREEN"),C(faction,"GREEN")),C.Orange()) From fb30ea260df664e675d73c1d1d23283e978b6362 Mon Sep 17 00:00:00 2001 From: fuba Date: Thu, 4 Dec 2025 03:46:58 +0100 Subject: [PATCH 2/2] dirty fix for missing "OnEnter" sadly the code is VERY broken on all edges and need a complete review! --- cache.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cache.lua b/cache.lua index b2303ab..c5feb0a 100644 --- a/cache.lua +++ b/cache.lua @@ -630,8 +630,10 @@ function module:DrawTroopStatus(main) frame:SetScript("OnDragStop",function(frame) OHF:StopMovingOrSizing() end) frame:SetScript("OnClick",function(frame) local value=not addon:GetBoolean(frame.key) addon:SetVar(frame.key,value) paintCat(frame) addon:Apply(frame.key,value) end) frame.OnEnter=frame:GetScript("OnEnter") - frame:SetScript("OnEnter",function(frame) - frame:OnEnter() + frame:SetScript("OnEnter",function(f) + if f.OnEnter then + f:OnEnter() + end if addon:GetBoolean(frame.key) then GameTooltip:AddLine(KEY_BUTTON1 .. " " .. C(ENABLE,"green")) else