mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-10-05 14:00:00 +00:00
Animations: wire remaining effects + 2-column options panel
- Shared FX toolkit in fx-celebrate.lua: mth_shake tween type, MTH_FX_Flash glow helper, MTH_CelebrateRunaway red shaking banner, gold title reset. - pet.runaway, pet.happiness, pet.loyaltyup, pet.feed - combat.ammoswap, combat.rangedswap, combat.mmprocs - ui.zbar, ui.stable, ui.minimapping, ui.optionsclose - book.model, book.search - Options > Animations panel now uses a balanced two-column layout. - CHANGELOG Animations entry expanded (no version bump).
This commit is contained in:
@@ -120,25 +120,37 @@ function MTH_SetupAnimationsOptions()
|
||||
end)
|
||||
end
|
||||
|
||||
-- Per-animation checkboxes, grouped by section.
|
||||
local y = -104
|
||||
-- Per-animation checkboxes, grouped by section, laid out in two columns.
|
||||
-- Each whole section is placed into whichever column is currently shorter
|
||||
-- (largest remaining Y), so the two columns stay balanced as defs grow.
|
||||
local rowStep = 26
|
||||
local sectionGap = 12
|
||||
local columns = {
|
||||
{ headerX = 15, cbX = 28, y = -104 },
|
||||
{ headerX = 300, cbX = 313, y = -104 },
|
||||
}
|
||||
local s = 1
|
||||
while MTH_FX_ANIM_SECTIONS and s <= table.getn(MTH_FX_ANIM_SECTIONS) do
|
||||
local sec = MTH_FX_ANIM_SECTIONS[s]
|
||||
|
||||
-- Pick the shorter column (the one whose cursor is nearest the top).
|
||||
local col = columns[1]
|
||||
if columns[2].y > columns[1].y then
|
||||
col = columns[2]
|
||||
end
|
||||
|
||||
local header = container:CreateFontString(nil, "ARTWORK", "GameFontNormal")
|
||||
header:SetPoint("TOPLEFT", container, "TOPLEFT", 15, y)
|
||||
header:SetPoint("TOPLEFT", container, "TOPLEFT", col.headerX, col.y)
|
||||
header:SetText(MTH_ANIM_L(sec.titleKey, sec.title))
|
||||
header:SetTextColor(1.00, 0.82, 0.00)
|
||||
y = y - 22
|
||||
col.y = col.y - 22
|
||||
|
||||
local d = 1
|
||||
while MTH_FX_ANIM_DEFS and d <= table.getn(MTH_FX_ANIM_DEFS) do
|
||||
local def = MTH_FX_ANIM_DEFS[d]
|
||||
if def.section == sec.id then
|
||||
local cbName = "MetaHuntOptionsAnim_" .. string.gsub(def.key, "%.", "_")
|
||||
local cb = MTH_CreateCheckbox(container, cbName, MTH_ANIM_L(def.labelKey, def.label), y, 28)
|
||||
local cb = MTH_CreateCheckbox(container, cbName, MTH_ANIM_L(def.labelKey, def.label), col.y, col.cbX)
|
||||
if cb then
|
||||
cb.mthKey = def.key
|
||||
cb:SetChecked(MTH_FX_GetFlag(def.key))
|
||||
@@ -155,12 +167,12 @@ function MTH_SetupAnimationsOptions()
|
||||
cb:SetScript("OnLeave", function() GameTooltip:Hide() end)
|
||||
end
|
||||
table.insert(MTH_ANIM_CTRL, cb)
|
||||
y = y - rowStep
|
||||
col.y = col.y - rowStep
|
||||
end
|
||||
end
|
||||
d = d + 1
|
||||
end
|
||||
y = y - sectionGap
|
||||
col.y = col.y - sectionGap
|
||||
s = s + 1
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user