Utilize SetFormattedText

This change updates several text setters to use `SetFormattedText` instead of passing `string.format(...)` into `SetText`. It also switches a few regex captures from `string.find` to `string.match` for cleaner capture handling, and replaces explicit width/height setters with `SetSize` in the first-run dialog for consistency.
This commit is contained in:
Brues
2026-08-21 14:42:40 -05:00
parent 82c74c2db5
commit ad13e6ace3
13 changed files with 49 additions and 55 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ pfUI:RegisterModule("castbar", function ()
if not cb.tradeskillTotal or not cb.activeName or not cb.showname then return end if not cb.tradeskillTotal or not cb.activeName or not cb.showname then return end
local remaining = cb.tradeskillTotal - (cb.tradeskillCompleted or 0) local remaining = cb.tradeskillTotal - (cb.tradeskillCompleted or 0)
if remaining > 1 then if remaining > 1 then
cb.bar.left:SetText(string.format("%s (%d)", cb.activeName, remaining)) cb.bar.left:SetFormattedText("%s (%d)", cb.activeName, remaining)
else else
cb.bar.left:SetText(cb.activeName) cb.bar.left:SetText(cb.activeName)
end end
+6 -11
View File
@@ -127,7 +127,7 @@ pfUI:RegisterModule("firstrun", function ()
-- welcome dialog -- welcome dialog
pfUI.firstrun:AddStep("init", function() pfUI.firstrun:AddStep("init", function()
local f = CreateFirstRunPage() local f = CreateFirstRunPage()
f.text:SetText(string.format(T["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."], GetAddOnMetadata(pfUI.name, "X-Website"))) f.text:SetFormattedText(T["Welcome to |cff33ffccpf|cffffffffUI|r!\n\nI'm the first run wizard that will guide you through some basic configuration. If you're lazy, feel free to hit the \"Defaults\" button. If you wish to run this dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\nVisit |cff33ffcc%s|r to check for the latest version."], GetAddOnMetadata(pfUI.name, "X-Website"))
return f return f
end) end)
@@ -137,8 +137,7 @@ pfUI:RegisterModule("firstrun", function ()
f.text:SetText(T["A new installation of |cff33ffccpf|rUI ships with 4 prebuilt design profiles. Click below if you wish to load one of these profiles."]) f.text:SetText(T["A new installation of |cff33ffccpf|rUI ships with 4 prebuilt design profiles. Click below if you wish to load one of these profiles."])
f.Modern = CreateFrame("Button", nil, f, "UIPanelButtonTemplate") f.Modern = CreateFrame("Button", nil, f, "UIPanelButtonTemplate")
f.Modern:SetWidth(120) f.Modern:SetSize(120, 20)
f.Modern:SetHeight(20)
f.Modern:SetPoint("BOTTOM", -65, 100) f.Modern:SetPoint("BOTTOM", -65, 100)
f.Modern:SetTextColor(1,1,1) f.Modern:SetTextColor(1,1,1)
f.Modern:SetText("Modern") f.Modern:SetText("Modern")
@@ -151,8 +150,7 @@ pfUI:RegisterModule("firstrun", function ()
SkinButton(f.Modern) SkinButton(f.Modern)
f.Nostalgia = CreateFrame("Button", nil, f, "UIPanelButtonTemplate") f.Nostalgia = CreateFrame("Button", nil, f, "UIPanelButtonTemplate")
f.Nostalgia:SetWidth(120) f.Nostalgia:SetSize(120, 20)
f.Nostalgia:SetHeight(20)
f.Nostalgia:SetPoint("BOTTOM", 65, 100) f.Nostalgia:SetPoint("BOTTOM", 65, 100)
f.Nostalgia:SetTextColor(1,1,1) f.Nostalgia:SetTextColor(1,1,1)
f.Nostalgia:SetText("Nostalgia") f.Nostalgia:SetText("Nostalgia")
@@ -165,8 +163,7 @@ pfUI:RegisterModule("firstrun", function ()
SkinButton(f.Nostalgia) SkinButton(f.Nostalgia)
f.Legacy = CreateFrame("Button", nil, f, "UIPanelButtonTemplate") f.Legacy = CreateFrame("Button", nil, f, "UIPanelButtonTemplate")
f.Legacy:SetWidth(120) f.Legacy:SetSize(120, 20)
f.Legacy:SetHeight(20)
f.Legacy:SetPoint("BOTTOM", 65, 75) f.Legacy:SetPoint("BOTTOM", 65, 75)
f.Legacy:SetTextColor(1,1,1) f.Legacy:SetTextColor(1,1,1)
f.Legacy:SetText("Legacy") f.Legacy:SetText("Legacy")
@@ -179,8 +176,7 @@ pfUI:RegisterModule("firstrun", function ()
SkinButton(f.Legacy) SkinButton(f.Legacy)
f.Slim = CreateFrame("Button", nil, f, "UIPanelButtonTemplate") f.Slim = CreateFrame("Button", nil, f, "UIPanelButtonTemplate")
f.Slim:SetWidth(120) f.Slim:SetSize(120, 20)
f.Slim:SetHeight(20)
f.Slim:SetPoint("BOTTOM", -65, 75) f.Slim:SetPoint("BOTTOM", -65, 75)
f.Slim:SetTextColor(1,1,1) f.Slim:SetTextColor(1,1,1)
f.Slim:SetText("Slim") f.Slim:SetText("Slim")
@@ -197,8 +193,7 @@ pfUI:RegisterModule("firstrun", function ()
f.Slider.text:SetPoint("TOP", f.Slider, "BOTTOM", 0, 2) f.Slider.text:SetPoint("TOP", f.Slider, "BOTTOM", 0, 2)
f.Slider.text:SetText(T["Scale"]) f.Slider.text:SetText(T["Scale"])
f.Slider:SetWidth(240) f.Slider:SetSize(240, 20)
f.Slider:SetHeight(20)
f.Slider:SetPoint("BOTTOM", 0, 50) f.Slider:SetPoint("BOTTOM", 0, 50)
f.Slider:SetOrientation('HORIZONTAL') f.Slider:SetOrientation('HORIZONTAL')
f.Slider:SetMinMaxValues(0.5, 2.0) f.Slider:SetMinMaxValues(0.5, 2.0)
+1 -1
View File
@@ -181,7 +181,7 @@ pfUI:RegisterModule("map", function ()
end end
if mx and my and MouseIsOver(WorldMapButton) then if mx and my and MouseIsOver(WorldMapButton) then
WorldMapButton.coords.text:SetText(string.format('%.1f / %.1f', mx, my)) WorldMapButton.coords.text:SetFormattedText('%.1f / %.1f', mx, my)
else else
WorldMapButton.coords.text:SetText("") WorldMapButton.coords.text:SetText("")
end end
+1 -1
View File
@@ -138,7 +138,7 @@ pfUI:RegisterModule("minimap", function ()
local coord = pfUI.minimapCoordinates local coord = pfUI.minimapCoordinates
coord.posX, coord.posY = GetPlayerMapPosition("player") coord.posX, coord.posY = GetPlayerMapPosition("player")
if coord.posX ~= 0 and coord.posY ~= 0 then if coord.posX ~= 0 and coord.posY ~= 0 then
coord.text:SetText(string.format("%.1f, %.1f", round(coord.posX * 100, 1), round(coord.posY * 100, 1))) coord.text:SetFormattedText("%.1f, %.1f", round(coord.posX * 100, 1), round(coord.posY * 100, 1))
else else
coord.text:SetText("|cffffaaaaN/A") coord.text:SetText("|cffffaaaaN/A")
end end
+10 -10
View File
@@ -1151,7 +1151,7 @@ nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
if plate.cache.level ~= level or plate.cache.elite ~= elite then if plate.cache.level ~= level or plate.cache.elite ~= elite then
plate.cache.level = level plate.cache.level = level
plate.cache.elite = elite plate.cache.elite = elite
plate.level:SetText(string.format("%s%s", level, (elitestrings[elite] or ""))) plate.level:SetFormattedText("%s%s", level, (elitestrings[elite] or ""))
end end
-- Set level color from GetDifficultyColor when using DB level. -- Set level color from GetDifficultyColor when using DB level.
@@ -1212,21 +1212,21 @@ nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
local hasdata = ( rhp and rhpmax ) or estimated or hpmax > 100 or (round(hpmax/100*hp) ~= hp) local hasdata = ( rhp and rhpmax ) or estimated or hpmax > 100 or (round(hpmax/100*hp) ~= hp)
if setting == "curperc" and hasdata and rhp then if setting == "curperc" and hasdata and rhp then
plate.health.text:SetText(string.format("%s | %s%%", Abbreviate(rhp), ceil(hp/hpmax*100))) plate.health.text:SetFormattedText("%s | %s%%", Abbreviate(rhp), ceil(hp/hpmax*100))
elseif setting == "cur" and hasdata and rhp then elseif setting == "cur" and hasdata and rhp then
plate.health.text:SetText(string.format("%s", Abbreviate(rhp))) plate.health.text:SetFormattedText("%s", Abbreviate(rhp))
elseif setting == "curmax" and hasdata and rhp then elseif setting == "curmax" and hasdata and rhp then
plate.health.text:SetText(string.format("%s - %s", Abbreviate(rhp), Abbreviate(rhpmax))) plate.health.text:SetFormattedText("%s - %s", Abbreviate(rhp), Abbreviate(rhpmax))
elseif setting == "curmaxs" and hasdata and rhp then elseif setting == "curmaxs" and hasdata and rhp then
plate.health.text:SetText(string.format("%s / %s", Abbreviate(rhp), Abbreviate(rhpmax))) plate.health.text:SetFormattedText("%s / %s", Abbreviate(rhp), Abbreviate(rhpmax))
elseif setting == "curmaxperc" and hasdata and rhp then elseif setting == "curmaxperc" and hasdata and rhp then
plate.health.text:SetText(string.format("%s - %s | %s%%", Abbreviate(rhp), Abbreviate(rhpmax), ceil(hp/hpmax*100))) plate.health.text:SetFormattedText("%s - %s | %s%%", Abbreviate(rhp), Abbreviate(rhpmax), ceil(hp/hpmax*100))
elseif setting == "curmaxpercs" and hasdata and rhp then elseif setting == "curmaxpercs" and hasdata and rhp then
plate.health.text:SetText(string.format("%s / %s | %s%%", Abbreviate(rhp), Abbreviate(rhpmax), ceil(hp/hpmax*100))) plate.health.text:SetFormattedText("%s / %s | %s%%", Abbreviate(rhp), Abbreviate(rhpmax), ceil(hp/hpmax*100))
elseif setting == "deficit" and rhp then elseif setting == "deficit" and rhp then
plate.health.text:SetText(string.format("-%s" .. (hasdata and "" or "%%"), Abbreviate(rhpmax - rhp))) plate.health.text:SetFormattedText("-%s" .. (hasdata and "" or "%%"), Abbreviate(rhpmax - rhp))
else -- "percent" as fallback else -- "percent" as fallback
plate.health.text:SetText(string.format("%s%%", ceil(hp/hpmax*100))) plate.health.text:SetFormattedText("%s%%", ceil(hp/hpmax*100))
end end
else else
plate.health.text:SetText() plate.health.text:SetText()
@@ -1697,7 +1697,7 @@ nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
rounded = floor(remaining * 100) rounded = floor(remaining * 100)
if castbar.lastTextTick ~= rounded then if castbar.lastTextTick ~= rounded then
castbar.lastTextTick = rounded castbar.lastTextTick = rounded
castbar.text:SetText(string.format("%.2f", remaining)) castbar.text:SetFormattedText("%.2f", remaining)
end end
end end
end end
+4 -4
View File
@@ -119,7 +119,7 @@ pfUI:RegisterModule("screenshot", function ()
end end
function pfUI.screenshot:CHAT_MSG_SYSTEM() function pfUI.screenshot:CHAT_MSG_SYSTEM()
local _,_, standing, rep = string.find(arg1, FACTION_STANDING_CHANGEDregex) local standing, rep = string.match(arg1, FACTION_STANDING_CHANGEDregex)
if standing and rep then if standing and rep then
local dt = date("%a, %b %d, %Y %X") local dt = date("%a, %b %d, %Y %X")
local loc = string.format("%s - %s",GetRealZoneText(),GetSubZoneText()) local loc = string.format("%s - %s",GetRealZoneText(),GetSubZoneText())
@@ -150,13 +150,13 @@ pfUI:RegisterModule("screenshot", function ()
end end
function pfUI.screenshot:CHAT_MSG_LOOT() function pfUI.screenshot:CHAT_MSG_LOOT()
local _,_, item, amount = string.find(arg1, LOOT_ITEM_SELF_MULTIPLEregex) local item, amount = string.match(arg1, LOOT_ITEM_SELF_MULTIPLEregex)
if amount then -- ignore stacks if amount then -- ignore stacks
return return
else else
_,_, item = string.find(arg1, LOOT_ITEM_SELFregex) item = string.match(arg1, LOOT_ITEM_SELFregex)
if item then if item then
local _, _, itemColor, itemString, itemName = string.find(item, "^(|c%x+)|H(.+)|h(%[.+%])") local itemColor, itemString, itemName = string.match(item, "^(|c%x+)|H(.+)|h(%[.+%])")
local quality = color2quality[itemColor] local quality = color2quality[itemColor]
if quality and quality >= tonumber(C.screenshot.loot) then if quality and quality >= tonumber(C.screenshot.loot) then
local dt = date("%a, %b %d, %Y %X") local dt = date("%a, %b %d, %Y %X")
+8 -8
View File
@@ -97,20 +97,20 @@ pfUI:RegisterModule("socialmod", function ()
if friendName then if friendName then
friendName:SetText(cname) friendName:SetText(cname)
friendLoc:SetText(format(TEXT(FRIENDS_LIST_TEMPLATE), zone, status)) friendLoc:SetFormattedText(TEXT(FRIENDS_LIST_TEMPLATE), zone, status)
else else
friendLoc:SetText(format(TEXT(FRIENDS_LIST_TEMPLATE), cname, zone, status)) friendLoc:SetFormattedText(TEXT(FRIENDS_LIST_TEMPLATE), cname, zone, status)
end end
friendInfo:SetText(format(TEXT(FRIENDS_LEVEL_TEMPLATE), info.level, info.className)) friendInfo:SetFormattedText(TEXT(FRIENDS_LEVEL_TEMPLATE), info.level, info.className)
caption:SetVertexColor(1,1,1,.9) caption:SetVertexColor(1,1,1,.9)
friendInfo:SetVertexColor(1,1,1,.9) friendInfo:SetVertexColor(1,1,1,.9)
else else
if playerdb[name] and playerdb[name].cname and playerdb[name].level and playerdb[name].lastseen then if playerdb[name] and playerdb[name].cname and playerdb[name].level and playerdb[name].lastseen then
caption:SetText(format(TEXT(FRIENDS_LIST_OFFLINE_TEMPLATE), playerdb[name].cname)) caption:SetFormattedText(TEXT(FRIENDS_LIST_OFFLINE_TEMPLATE), playerdb[name].cname)
friendInfo:SetText(format(TEXT(FRIENDS_LEVEL_TEMPLATE), playerdb[name].level, playerdb[name].lastseen)) friendInfo:SetFormattedText(TEXT(FRIENDS_LEVEL_TEMPLATE), playerdb[name].level, playerdb[name].lastseen)
else else
caption:SetText(format(TEXT(FRIENDS_LIST_OFFLINE_TEMPLATE), name.."|r")) caption:SetFormattedText(TEXT(FRIENDS_LIST_OFFLINE_TEMPLATE), name.."|r")
friendInfo:SetText(TEXT(UNKNOWN)) friendInfo:SetText(TEXT(UNKNOWN))
end end
@@ -131,9 +131,9 @@ pfUI:RegisterModule("socialmod", function ()
local playerguild = GetGuildInfo("player") local playerguild = GetGuildInfo("player")
if num + 1 >= MAX_WHOS_FROM_SERVER then if num + 1 >= MAX_WHOS_FROM_SERVER then
WhoFrameTotals:SetText("|cffffffff" .. format(GetText("WHO_FRAME_TOTAL_TEMPLATE", nil, num), max).." |cffaaaaaa"..format(WHO_FRAME_SHOWN_TEMPLATE, MAX_WHOS_FROM_SERVER)) WhoFrameTotals:SetFormattedText("|cffffffff" .. GetText("WHO_FRAME_TOTAL_TEMPLATE", nil, num) .. " |cffaaaaaa" .. WHO_FRAME_SHOWN_TEMPLATE, max, MAX_WHOS_FROM_SERVER)
else else
WhoFrameTotals:SetText("|cffffffff" .. format(GetText("WHO_FRAME_TOTAL_TEMPLATE", nil, num), num).." |cffaaaaaa"..format(WHO_FRAME_SHOWN_TEMPLATE, num)) WhoFrameTotals:SetFormattedText("|cffffffff" .. GetText("WHO_FRAME_TOTAL_TEMPLATE", nil, num) .. " |cffaaaaaa" .. WHO_FRAME_SHOWN_TEMPLATE, num, num)
end end
for i=1, WHOS_TO_DISPLAY do for i=1, WHOS_TO_DISPLAY do
+8 -8
View File
@@ -592,10 +592,10 @@ pfUI:RegisterModule("swingtimer", function ()
end end
pfUI.swingtimer.mainhand:SetStatusBarColor(curR, curG, curB, mhA) pfUI.swingtimer.mainhand:SetStatusBarColor(curR, curG, curB, mhA)
if sw_showtext then if sw_showtext then
pfUI.swingtimer.mainhand.text:SetText(string.format("%.1f", math.floor(S.mhTimer * 10) / 10)) pfUI.swingtimer.mainhand.text:SetFormattedText("%.1f", math.floor(S.mhTimer * 10) / 10)
end end
if sw_showspeed and S.mhSpeed > 0 then if sw_showspeed and S.mhSpeed > 0 then
pfUI.swingtimer.mainhand.speed:SetText(string.format("%.2f", S.mhSpeed)) pfUI.swingtimer.mainhand.speed:SetFormattedText("%.2f", S.mhSpeed)
end end
anyActive = true anyActive = true
end end
@@ -626,10 +626,10 @@ pfUI:RegisterModule("swingtimer", function ()
end end
end end
if sw_showtext then if sw_showtext then
pfUI.swingtimer.offhand.text:SetText(string.format("%.1f", math.floor(S.ohTimer * 10) / 10)) pfUI.swingtimer.offhand.text:SetFormattedText("%.1f", math.floor(S.ohTimer * 10) / 10)
end end
if sw_showspeed and S.ohSpeed > 0 then if sw_showspeed and S.ohSpeed > 0 then
pfUI.swingtimer.offhand.speed:SetText(string.format("%.2f", S.ohSpeed)) pfUI.swingtimer.offhand.speed:SetFormattedText("%.2f", S.ohSpeed)
end end
anyActive = true anyActive = true
elseif not sw_showoh then elseif not sw_showoh then
@@ -668,9 +668,9 @@ pfUI:RegisterModule("swingtimer", function ()
end end
if sw_showtext then if sw_showtext then
if remaining <= 0.5 then if remaining <= 0.5 then
pfUI.swingtimer.ranged.text:SetText(string.format("%.1f", math.floor(remaining * 10) / 10)) pfUI.swingtimer.ranged.text:SetFormattedText("%.1f", math.floor(remaining * 10) / 10)
else else
pfUI.swingtimer.ranged.text:SetText(string.format("%.1f", math.floor((remaining - 0.5) * 10) / 10)) pfUI.swingtimer.ranged.text:SetFormattedText("%.1f", math.floor((remaining - 0.5) * 10) / 10)
end end
end end
else else
@@ -683,11 +683,11 @@ pfUI:RegisterModule("swingtimer", function ()
pfUI.swingtimer.ranged.right:Hide() pfUI.swingtimer.ranged.right:Hide()
pfUI.swingtimer.ranged.warn:Hide() pfUI.swingtimer.ranged.warn:Hide()
if sw_showtext then if sw_showtext then
pfUI.swingtimer.ranged.text:SetText(string.format("%.1f", math.floor(remaining * 10) / 10)) pfUI.swingtimer.ranged.text:SetFormattedText("%.1f", math.floor(remaining * 10) / 10)
end end
end end
if sw_showspeed and S.raSpeed > 0 then if sw_showspeed and S.raSpeed > 0 then
pfUI.swingtimer.ranged.speed:SetText(string.format("%.2f", S.raSpeed)) pfUI.swingtimer.ranged.speed:SetFormattedText("%.2f", S.raSpeed)
end end
local raProgress = 1 - (S.raTimer / S.raTimerMax) local raProgress = 1 - (S.raTimer / S.raTimerMax)
local raMarkerX = raProgress * sw_width local raMarkerX = raProgress * sw_width
+2 -2
View File
@@ -166,9 +166,9 @@ pfUI:RegisterModule("tooltip", function ()
end end
if C.tooltip.alwaysperc == "0" and ( estimated or hpmax > 100 or round(hpmax/100*hp) ~= hp ) then if C.tooltip.alwaysperc == "0" and ( estimated or hpmax > 100 or round(hpmax/100*hp) ~= hp ) then
pfUI.tooltipStatusBar.HP:SetText(string.format("%s / %s", Abbreviate(rhp), Abbreviate(rhpmax))) pfUI.tooltipStatusBar.HP:SetFormattedText("%s / %s", Abbreviate(rhp), Abbreviate(rhpmax))
elseif hpmax > 0 then elseif hpmax > 0 then
pfUI.tooltipStatusBar.HP:SetText(string.format("%s%%", ceil(hp/hpmax*100))) pfUI.tooltipStatusBar.HP:SetFormattedText("%s%%", ceil(hp/hpmax*100))
else else
pfUI.tooltipStatusBar.HP:SetText("") pfUI.tooltipStatusBar.HP:SetText("")
end end
+2 -2
View File
@@ -134,7 +134,7 @@ pfUI:RegisterModule("unitxp", function ()
end end
this.text:SetTextColor(r, g, b, 1) this.text:SetTextColor(r, g, b, 1)
this.text:SetText(string.format("%.1f%s", distance, suffix)) this.text:SetFormattedText("%.1f%s", distance, suffix)
this.text:Show() this.text:Show()
end) end)
@@ -206,7 +206,7 @@ pfUI:RegisterModule("unitxp", function ()
end end
f.text:SetTextColor(r, g, b, 1) f.text:SetTextColor(r, g, b, 1)
f.text:SetText(string.format("%.1f%s", distance, suffix)) f.text:SetFormattedText("%.1f%s", distance, suffix)
end) end)
end end
pfUI.uf.target.distanceIndicator = pfRangeDisplay pfUI.uf.target.distanceIndicator = pfRangeDisplay
+3 -3
View File
@@ -236,7 +236,7 @@ end
local xpperc = round(xp / xpmax * 100) local xpperc = round(xp / xpmax * 100)
local experc = ex and round(ex / xpmax * 100) or 0 local experc = ex and round(ex / xpmax * 100) or 0
if ex then text = "%s: %s%% (%s%% %s)" end if ex then text = "%s: %s%% (%s%% %s)" end
self.bar.text:SetText(string.format(text, T["Experience"], xpperc, experc, T["Rested"])) self.bar.text:SetFormattedText(text, T["Experience"], xpperc, experc, T["Rested"])
self.tick = GetTime() + self.timeout self.tick = GetTime() + self.timeout
if event == "UPDATE_EXHAUSTION" and GameTooltip:IsOwned(self) then if event == "UPDATE_EXHAUSTION" and GameTooltip:IsOwned(self) then
@@ -254,7 +254,7 @@ end
local text = "%s: %s%%" local text = "%s: %s%%"
local xpperc = nextXP and nextXP ~= 0 and round(currXP / nextXP * 100) or 0 local xpperc = nextXP and nextXP ~= 0 and round(currXP / nextXP * 100) or 0
self.bar.text:SetText(string.format(text, T["Pet Experience"], xpperc)) self.bar.text:SetFormattedText(text, T["Pet Experience"], xpperc)
self.tick = GetTime() + self.timeout self.tick = GetTime() + self.timeout
return return
@@ -282,7 +282,7 @@ end
local text = "%s: %s%% (%s)" local text = "%s: %s%% (%s)"
local perc = round(barValue / barMax * 100) local perc = round(barValue / barMax * 100)
local standing = GetText("FACTION_STANDING_LABEL"..standingID, gender) local standing = GetText("FACTION_STANDING_LABEL"..standingID, gender)
self.bar.text:SetText(string.format(text, name, perc, standing)) self.bar.text:SetFormattedText(text, name, perc, standing)
self.tick = GetTime() + self.timeout self.tick = GetTime() + self.timeout
return return
+2 -3
View File
@@ -295,9 +295,8 @@ pfUI:RegisterSkin("Character", function ()
if faction and faction.reaction and faction.reaction < 8 then if faction and faction.reaction and faction.reaction < 8 then
local repLeft = faction.nextReactionThreshold - faction.currentStanding local repLeft = faction.nextReactionThreshold - faction.currentStanding
if repLeft > 1 then if repLeft > 1 then
local text = standing:GetText() .. string.format(" (%d)", repLeft) standing:SetFormattedText("%s (%d)", standing:GetText(), repLeft)
standing:SetText(text) standing:GetParent().standingText = standing:GetText()
standing:GetParent().standingText = text
end end
end end
end end
+1 -1
View File
@@ -125,7 +125,7 @@ pfUI:RegisterSkin("Inspect", function ()
local guild, title = GetGuildInfo(InspectFrame.unit) local guild, title = GetGuildInfo(InspectFrame.unit)
if guild then if guild then
InspectGuildText:SetPoint("TOP", InspectLevelText, "BOTTOM", 0, -1) InspectGuildText:SetPoint("TOP", InspectLevelText, "BOTTOM", 0, -1)
InspectGuildText:SetText(format(TEXT(GUILD_TITLE_TEMPLATE), title, guild)) InspectGuildText:SetFormattedText(TEXT(GUILD_TITLE_TEMPLATE), title, guild)
InspectGuildText:Show() InspectGuildText:Show()
else else
InspectGuildText:SetText("") InspectGuildText:SetText("")