mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-10-09 10:00:01 +00:00
MM widget: show SKIP on the action cell when the active ammo school is immune
This commit is contained in:
@@ -412,6 +412,13 @@ local ICON_STEADY = "Interface\\Icons\\Ability_Hunter_SteadyShot"
|
||||
local ICON_MULTI = "Interface\\Icons\\Ability_UpgradeMoonGlaive"
|
||||
local ICON_SERPENT = "Interface\\Icons\\Ability_Hunter_QuickShot"
|
||||
local ICON_ARCANE = "Interface\\Icons\\Ability_ImpalingBolt"
|
||||
|
||||
-- Consume-spell icon per state (shown on the action cell).
|
||||
local CONSUME_ICON = {
|
||||
[EXPLOSIVE] = ICON_MULTI,
|
||||
[POISONOUS] = ICON_SERPENT,
|
||||
[ENCHANTED] = ICON_ARCANE,
|
||||
}
|
||||
-- Aura/effect textures (aura-dump debug capture)
|
||||
local ICON_EXP = "Interface\\Icons\\Ability_SearingArrow" -- Explosive Ammunition debuff
|
||||
local ICON_POI = "Interface\\Icons\\Ability_PoisonArrow" -- Poisonous Ammunition debuff
|
||||
@@ -516,13 +523,15 @@ local function MTH_EA_GetSpellCD(spellName)
|
||||
end
|
||||
|
||||
-- Action button: what spell to show and what spell to cast right now.
|
||||
-- Returns displaySpell, icon, r, g, b, cooldownRemaining, castSpell
|
||||
-- Returns displaySpell, icon, r, g, b, cooldownRemaining, castSpell, blocked
|
||||
local function MTH_EA_GetActionSpell()
|
||||
-- If current ammo state is blocked (creature immune or rotation toggle),
|
||||
-- skip the consume-spell and fall through to Aimed/Steady instead.
|
||||
-- skip the consume-spell and fall through to Aimed/Steady instead. The cell
|
||||
-- shows the skipped consume-spell icon in red with a SKIP hint.
|
||||
if rt.state ~= IDLE and MTH_EA_IsStateBlocked(rt.state) then
|
||||
local cd = MTH_EA_GetSpellCD(SPELL_AIMED)
|
||||
return SPELL_AIMED, ICON_AIMED, 1.00, 0.85, 0.00, cd, (cd > 0 and SPELL_STEADY or SPELL_AIMED)
|
||||
local skipIcon = CONSUME_ICON[rt.state] or ICON_AIMED
|
||||
return SPELL_AIMED, skipIcon, 1.00, 0.25, 0.25, cd, (cd > 0 and SPELL_STEADY or SPELL_AIMED), true
|
||||
end
|
||||
|
||||
if rt.state == EXPLOSIVE then
|
||||
@@ -718,9 +727,16 @@ MTH_EA_UpdateUI = function()
|
||||
|
||||
-- ── BOTTOM cell: action button ────────────────────────────
|
||||
if cellBot then
|
||||
local displaySpell, icon, r, g, b, cdRemain = MTH_EA_GetActionSpell()
|
||||
local displaySpell, icon, r, g, b, cdRemain, _castSpell, blocked = MTH_EA_GetActionSpell()
|
||||
|
||||
if rt.state == IDLE then
|
||||
if blocked then
|
||||
-- Current ammo school is immune: skip the consume-spell.
|
||||
cellBotBlink = 0
|
||||
cellBotIcon:SetTexture(icon)
|
||||
cellBotIcon:SetVertexColor(r, g, b, 1)
|
||||
cellBot:SetBackdropBorderColor(1, 0, 0, 1)
|
||||
cellBotCD:SetText("|cffff3030SKIP|r")
|
||||
elseif rt.state == IDLE then
|
||||
-- Always display Aimed Shot icon + its CD.
|
||||
-- The action (keybind/click) casts Steady Shot while Aimed is on CD.
|
||||
cellBotIcon:SetTexture(ICON_AIMED)
|
||||
|
||||
Reference in New Issue
Block a user