From a7b5a6494d58ad99ade46548c5bb68a0443b85e1 Mon Sep 17 00:00:00 2001 From: Vollmer Date: Tue, 17 Dec 2024 19:32:30 +0100 Subject: [PATCH] locale and tooltips --- Locales/enUS.lua | 5 +++++ Menu/Builder.lua | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/Locales/enUS.lua b/Locales/enUS.lua index f7cc704..2d42544 100644 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -242,6 +242,11 @@ L.playerCastBar = "Player Cast Bar" L.HideAtMaxLevel = "Hide at Max Level" L.ShowTarget = "Show Target" L.Separator = "Separator" +L.TimeToHold = "Time to Hold" +L.TimeToHoldTooltip = "Time in seconds to hold the Cast Bar after the spell has failed or been interrupted" +L.Label = "Label" +L.InterruptedLabelTooltip = [[%s - Type (%s or %s) +%s - Spell Name]] -- Custom Formats L.ValidTags = "Valid Tags" diff --git a/Menu/Builder.lua b/Menu/Builder.lua index 52fae6c..393dd1c 100644 --- a/Menu/Builder.lua +++ b/Menu/Builder.lua @@ -64,6 +64,9 @@ Builder.MenuOptions = { Glow = 37 } +local FAILED = FAILED or "Failed" +local INTERRUPTED = INTERRUPTED or "Interrupted" + ------------------------------------------------- -- MARK: Build Menu ------------------------------------------------- @@ -1577,9 +1580,12 @@ function Builder:CreateCastBarGeneralOptions(parent, widgetName) f.timeToHoldSlider = self:CreateSlider(f, widgetName, L.TimeToHold, nil, 0, 10, const.OPTION_KIND.TIME_TO_HOLD) self:AnchorBelow(f.timeToHoldSlider, f.onlyShowInterruptableCB) + CUF:SetTooltips(f.timeToHoldSlider, "ANCHOR_TOPLEFT", 0, 3, L.TimeToHold, L.TimeToHoldTooltip) f.interruptedLabelEditBox = self:CreateEditBox(f, widgetName, L.Label, nil, const.OPTION_KIND.INTERRUPTED_LABEL) self:AnchorRight(f.interruptedLabelEditBox, f.timeToHoldSlider) + CUF:SetTooltips(f.interruptedLabelEditBox, "ANCHOR_TOPLEFT", 0, 3, L.Label, + string.format(L.InterruptedLabelTooltip, "%t", INTERRUPTED, FAILED, "%s")) local function LoadPageDB() f.onlyShowInterruptableCB:SetEnabled(CUF.vars.selectedUnit ~= const.UNIT.PLAYER)