Skip to content

Commit

Permalink
locale and tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
Krealle committed Dec 17, 2024
1 parent 4269a4d commit a7b5a64
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions Menu/Builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ Builder.MenuOptions = {
Glow = 37
}

local FAILED = FAILED or "Failed"
local INTERRUPTED = INTERRUPTED or "Interrupted"

-------------------------------------------------
-- MARK: Build Menu
-------------------------------------------------
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a7b5a64

Please sign in to comment.