From ab38b7abfb8602964bc52f616ba37bd305f987be Mon Sep 17 00:00:00 2001 From: Kyle Buller Date: Thu, 15 Aug 2024 17:52:12 -0500 Subject: [PATCH] LuaTexts: Force update reputation texts using old APIs Fixes WA-1444 --- Modules/LuaTexts/LuaTexts.lua | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/Modules/LuaTexts/LuaTexts.lua b/Modules/LuaTexts/LuaTexts.lua index ba867b8f..90e6f63f 100755 --- a/Modules/LuaTexts/LuaTexts.lua +++ b/Modules/LuaTexts/LuaTexts.lua @@ -780,30 +780,6 @@ end -- update pre-mop/pre-dragonflight default rep text for friendships local function fix_rep_std_text() - local OLD_CODE1 = [[ -local name,_,min,max,value = GetWatchedFactionInfo() -if IsMouseOver() then - return name or ConfigMode() -else - local bar_cur,bar_max = value-min,max-min - return "%d/%d (%s%%)",bar_cur,bar_max,Percent(bar_cur,bar_max) -end]] - local OLD_CODE2 = [[ -local name, _, min, max, value, id = GetWatchedFactionInfo() -if IsMouseOver() then - return name or ConfigMode() -else - local fs_id, fs_rep, _, _, _, _, _, fs_threshold, next_fs_threshold = GetFriendshipReputation(id) - if fs_id then - if next_fs_threshold then - min, max, value = fs_threshold, next_fs_threshold, fs_rep - else - min, max, value = 0, 1, 1 - end - end - local bar_cur,bar_max = value-min,max-min - return "%d/%d (%s%%)",bar_cur,bar_max,Percent(bar_cur,bar_max) -end]] local sv = PitBull4.db:GetNamespace("LuaTexts").profiles for _, profile in next, sv do local layouts = profile.layouts @@ -812,7 +788,7 @@ end]] local elements = layout.elements if elements then for _, text in next, elements do - if text.code == OLD_CODE1 or text.code == OLD_CODE2 then + if text.code:find("GetWatchedFactionInfo", nil, true) or text.code:find("GetFriendshipReputation", nil, true) then text.code = PROVIDED_CODES[L["Reputation"]][L["Standard"]].code end end