From 8506f5ffbf7162cabedd2313d78164c7f03dff32 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:13:53 -0500 Subject: [PATCH] Localize the totem tooltip click hints Add a Left Click / Right Click hint to the totem icon tooltip via AddDoubleLine, matching the panel.lua convention. Reuses the existing "Left Click" / "Right Click" strings and adds "Recast Totem" / "Target Totem" as new translation keys (stubbed across all locales; they fall back to English until translated). Also drop the now-orphaned "Range Check Interval" string from every locale manifest -- the setting was removed when librange stopped scanning, but its translation stubs were left behind. --- env/translations_deDE.lua | 3 ++- env/translations_enUS.lua | 3 ++- env/translations_esES.lua | 3 ++- env/translations_frFR.lua | 3 ++- env/translations_koKR.lua | 3 ++- env/translations_ruRU.lua | 3 ++- env/translations_zhCN.lua | 3 ++- env/translations_zhTW.lua | 3 ++- modules/totems.lua | 39 ++++++++++++++------------------------- 9 files changed, 30 insertions(+), 33 deletions(-) diff --git a/env/translations_deDE.lua b/env/translations_deDE.lua index 9677fac2..087cc342 100644 --- a/env/translations_deDE.lua +++ b/env/translations_deDE.lua @@ -619,8 +619,8 @@ pfUI_translation["deDE"] = { ["Random Roll Announcement Rarity"] = nil, ["Random Rolling"] = nil, ["Range Based Hunter Paging"] = nil, - ["Range Check Interval"] = nil, ["Rank"] = nil, + ["Recast Totem"] = nil, ["Red Border On Enemy Units"] = nil, ["Red Name Text On Infight Units"] = nil, ["Regional Settings"] = nil, @@ -782,6 +782,7 @@ pfUI_translation["deDE"] = { ["Target Castbar"] = nil, ["Target Debuff Bar"] = nil, ["Target Nameplate Zoom Factor"] = nil, + ["Target Totem"] = nil, ["Target-Target"] = nil, ["Target-Target-Target"] = nil, ["Text"] = nil, diff --git a/env/translations_enUS.lua b/env/translations_enUS.lua index e64092be..873a786a 100644 --- a/env/translations_enUS.lua +++ b/env/translations_enUS.lua @@ -627,8 +627,8 @@ pfUI_translation["enUS"] = { ["Random Roll Announcement Rarity"] = nil, ["Random Rolling"] = nil, ["Range Based Hunter Paging"] = nil, - ["Range Check Interval"] = nil, ["Rank"] = nil, + ["Recast Totem"] = nil, ["Red Border On Enemy Units"] = nil, ["Red Name Text On Infight Units"] = nil, ["Regional Settings"] = nil, @@ -795,6 +795,7 @@ pfUI_translation["enUS"] = { ["Target Castbar"] = nil, ["Target Debuff Bar"] = nil, ["Target Nameplate Zoom Factor"] = nil, + ["Target Totem"] = nil, ["Target-Target"] = nil, ["Target-Target-Target"] = nil, ["Text"] = nil, diff --git a/env/translations_esES.lua b/env/translations_esES.lua index 641761e0..53c5dc9b 100644 --- a/env/translations_esES.lua +++ b/env/translations_esES.lua @@ -619,8 +619,8 @@ pfUI_translation["esES"] = { ["Random Roll Announcement Rarity"] = "Anuncio para tirar los dados aleatoriamente", ["Random Rolling"] = "Tirar los dados aleatoriamente", ["Range Based Hunter Paging"] = "Paginado de alcance para cazadores", - ["Range Check Interval"] = "Intervalo de comprobación de alcance", ["Rank"] = "Rango", + ["Recast Totem"] = nil, ["Red Border On Enemy Units"] = "Borde rojo en unidades enemigas", ["Red Name Text On Infight Units"] = nil, ["Regional Settings"] = nil, @@ -782,6 +782,7 @@ pfUI_translation["esES"] = { ["Target Castbar"] = "Barra de lanzamiento del objetivo", ["Target Debuff Bar"] = "Barra de perjuicios del objetivo", ["Target Nameplate Zoom Factor"] = "Factor de zoom de la placa de nombre del objetivo", + ["Target Totem"] = nil, ["Target-Target"] = "Objetivo-Objetivo", ["Target-Target-Target"] = "Objetivo-Objetivo-Objetivo", ["Text"] = nil, diff --git a/env/translations_frFR.lua b/env/translations_frFR.lua index 97116a3e..5563b428 100644 --- a/env/translations_frFR.lua +++ b/env/translations_frFR.lua @@ -619,8 +619,8 @@ pfUI_translation["frFR"] = { ["Random Roll Announcement Rarity"] = "Rareté des annonces des jets de dés aléatoires", ["Random Rolling"] = "Lancer de dés aléatoires", ["Range Based Hunter Paging"] = "Pagination de distance basée sur le chasseur", - ["Range Check Interval"] = "Intervalle de vérification de la distance", ["Rank"] = nil, + ["Recast Totem"] = nil, ["Red Border On Enemy Units"] = "Bordure rouge sur les unités ennemies", ["Red Name Text On Infight Units"] = nil, ["Regional Settings"] = nil, @@ -782,6 +782,7 @@ pfUI_translation["frFR"] = { ["Target Castbar"] = "Barre d'incantation de la cible", ["Target Debuff Bar"] = "Barre des affaiblissements de la cible", ["Target Nameplate Zoom Factor"] = "Facteur de zoom du Nameplate de la cible", + ["Target Totem"] = nil, ["Target-Target"] = "Cible de la cible", ["Target-Target-Target"] = "Cible de la cible de la cible", ["Text"] = nil, diff --git a/env/translations_koKR.lua b/env/translations_koKR.lua index bd99c7f2..17d950f4 100644 --- a/env/translations_koKR.lua +++ b/env/translations_koKR.lua @@ -619,8 +619,8 @@ pfUI_translation["koKR"] = { ["Random Roll Announcement Rarity"] = nil, ["Random Rolling"] = nil, ["Range Based Hunter Paging"] = nil, - ["Range Check Interval"] = nil, ["Rank"] = nil, + ["Recast Totem"] = nil, ["Red Border On Enemy Units"] = nil, ["Red Name Text On Infight Units"] = nil, ["Regional Settings"] = nil, @@ -782,6 +782,7 @@ pfUI_translation["koKR"] = { ["Target Castbar"] = nil, ["Target Debuff Bar"] = nil, ["Target Nameplate Zoom Factor"] = nil, + ["Target Totem"] = nil, ["Target-Target"] = "대상-대상", ["Target-Target-Target"] = nil, ["Text"] = nil, diff --git a/env/translations_ruRU.lua b/env/translations_ruRU.lua index d7e8ce25..ca6c77f0 100644 --- a/env/translations_ruRU.lua +++ b/env/translations_ruRU.lua @@ -619,8 +619,8 @@ pfUI_translation["ruRU"] = { ["Random Roll Announcement Rarity"] = "Оповещение случайного броска для качества предмета", ["Random Rolling"] = "Случайный бросок костей для", ["Range Based Hunter Paging"] = "[|cffA9D271Охотник|r] Переключение страниц на основе диапазона", - ["Range Check Interval"] = "Интервал проверки диапазона", ["Rank"] = "Ранг", + ["Recast Totem"] = nil, ["Red Border On Enemy Units"] = "Красные границы вражеских юнитов", ["Red Name Text On Infight Units"] = nil, ["Regional Settings"] = "Региональные настройки", @@ -782,6 +782,7 @@ pfUI_translation["ruRU"] = { ["Target Castbar"] = "Панель применения цели", ["Target Debuff Bar"] = "Панель дебаффов цели", ["Target Nameplate Zoom Factor"] = "Коэффициент увеличения индикатора здоровья цели", + ["Target Totem"] = nil, ["Target-Target"] = "Цель цели", ["Target-Target-Target"] = "Цель цели цели", ["Text"] = nil, diff --git a/env/translations_zhCN.lua b/env/translations_zhCN.lua index 7a13a180..1578985a 100644 --- a/env/translations_zhCN.lua +++ b/env/translations_zhCN.lua @@ -619,8 +619,8 @@ pfUI_translation["zhCN"] = { ["Random Roll Announcement Rarity"] = "随机Roll点稀有度", ["Random Rolling"] = "随机Roll点 物品:", ["Range Based Hunter Paging"] = "启用基于范围的自动分页[|cff7fff7f猎人|r]", - ["Range Check Interval"] = "范围检查间隔", ["Rank"] = "军衔", + ["Recast Totem"] = nil, ["Red Border On Enemy Units"] = "显示敌方单位红色边框", ["Red Name Text On Infight Units"] = "进战斗的单位显示红色姓名", ["Regional Settings"] = "区域设置", @@ -783,6 +783,7 @@ pfUI_translation["zhCN"] = { ["Target Castbar"] = "目标施法条", ["Target Debuff Bar"] = "目标Debuffs条", ["Target Nameplate Zoom Factor"] = "目标姓名板缩放系数", + ["Target Totem"] = nil, ["Target-Target"] = "目标的目标", ["Target-Target-Target"] = "目标的目标的目标", ["Text"] = "文本", diff --git a/env/translations_zhTW.lua b/env/translations_zhTW.lua index 48a9919d..ddcdf251 100644 --- a/env/translations_zhTW.lua +++ b/env/translations_zhTW.lua @@ -619,8 +619,8 @@ pfUI_translation["zhTW"] = { ["Random Roll Announcement Rarity"] = "隨機Roll點公示稀有度", ["Random Rolling"] = "隨機Roll點 物品:", ["Range Based Hunter Paging"] = nil, - ["Range Check Interval"] = "範圍檢查間隔", ["Rank"] = nil, + ["Recast Totem"] = nil, ["Red Border On Enemy Units"] = nil, ["Red Name Text On Infight Units"] = nil, ["Regional Settings"] = nil, @@ -782,6 +782,7 @@ pfUI_translation["zhTW"] = { ["Target Castbar"] = nil, ["Target Debuff Bar"] = nil, ["Target Nameplate Zoom Factor"] = nil, + ["Target Totem"] = nil, ["Target-Target"] = "目標的目標", ["Target-Target-Target"] = nil, ["Text"] = nil, diff --git a/modules/totems.lua b/modules/totems.lua index 7825f711..2184ed83 100644 --- a/modules/totems.lua +++ b/modules/totems.lua @@ -14,34 +14,25 @@ pfUI:RegisterModule("totems", function () end) totems.OnEnter = function(self) - if not this.id then return end - -- native GetTotemInfo's 1st return is tool presence, not "summoned"; - -- a live totem shows a non-empty name / non-zero start. - local _, name = GetTotemInfo(this.id) - if not name or name == "" then return end - local color = slots[this.id] + local id = this:GetID() + local spellID = select(7, GetTotemInfo(id)) + if not spellID or spellID == 0 then return end GameTooltip:SetOwner(this, "ANCHOR_LEFT") - GameTooltip:SetText(name, color.r+.2, color.g+.2, color.b+.2) - local timeleft = GetTotemTimeLeft(this.id) - if timeleft and timeleft > 0 then - GameTooltip:AddLine(string.format("%d:%02d", floor(timeleft/60), floor(mod(timeleft, 60))), 1, 1, 1) - end + GameTooltip:SetSpell(FindSpellBookSlotByID(spellID)) + GameTooltip:AddDoubleLine(T["Left Click"], "|cffffffff" .. T["Recast Totem"]) + GameTooltip:AddDoubleLine(T["Right Click"], "|cffffffff" .. T["Target Totem"]) GameTooltip:Show() end - totems.OnLeave = function(self) - GameTooltip:Hide() - end + totems.OnLeave = GameTooltip_Hide totems.OnClick = function(self) - if not this.id then return end + local id = this:GetID() if arg1 == "LeftButton" then - -- recast the totem on left click - local _, name = GetTotemInfo(this.id) + local _, name = GetTotemInfo(id) if name and name ~= "" then CastSpellByName(name) end elseif arg1 == "RightButton" then - -- target the totem on right click - TargetTotem(this.id) + TargetTotem(id) end end @@ -57,7 +48,7 @@ pfUI:RegisterModule("totems", function () self.bar[count]:Show() self.bar[count]:SetBackdropBorderColor(color.r, color.g, color.b) self.bar[count].icon:SetTexture(icon) - self.bar[count].id = i + self.bar[count]:SetID(i) CooldownFrame_SetTimer(self.bar[count].cd, start, duration, 1) end @@ -76,7 +67,7 @@ pfUI:RegisterModule("totems", function () self:Show() end - local count = count and count > 0 and count or MAX_TOTEMS + count = count and count > 0 and count or MAX_TOTEMS if pfUI_config.totems.direction == "HORIZONTAL" then self:SetHeight(self.iconsize + self.spacing*2) @@ -113,8 +104,7 @@ pfUI:RegisterModule("totems", function () end end - self.bar[i]:SetHeight(self.iconsize) - self.bar[i]:SetWidth(self.iconsize) + self.bar[i]:SetSize(self.iconsize, self.iconsize) CreateBackdrop(self.bar[i], nil, true) self.bar[i].icon = self.bar[i].icon or self.bar[i]:CreateTexture(nil, "ARTWORK") @@ -122,8 +112,7 @@ pfUI:RegisterModule("totems", function () SetAllPointsOffset(self.bar[i].icon, self.bar[i], 2,-2) self.bar[i].cdbg = self.bar[i].cdbg or CreateFrame("Frame", nil, self.bar[i]) - self.bar[i].cdbg:SetHeight(self.iconsize - 3) - self.bar[i].cdbg:SetWidth(self.iconsize - 3) + self.bar[i].cdbg:SetSize(self.iconsize - 3, self.iconsize - 3) self.bar[i].cdbg:SetPoint("CENTER", self.bar[i], "CENTER", 0, 0) self.bar[i].cd = self.bar[i].cd or CreateFrame(COOLDOWN_FRAME_TYPE, "pfTotemsBar"..i.."Cooldown", self.bar[i].cdbg, "CooldownFrameTemplate") self.bar[i].cd.pfCooldownStyleAnimation = 1