Skip to content

Request: Casting (Hurtful) status trigger #25

@Zwikkry

Description

@Zwikkry

Currently, when using the "Casting" status trigger, even mounting up toggles the alpha of the HUD. While some people might not mind this, I would love it if you could add a "Casting (Hurtful)" status trigger. I've already got this working locally by tweaking the Statuses/Casting.lua:OnEvent (line 8) with the following:

local function OnEvent(_, event)
    local isCasting = false
    local spell, _, _, _, _, _, _, _, spellID = UnitCastingInfo("player")
    local isHarmfulSpell = false

    if spell then
        isHarmfulSpell = C_Spell.IsSpellHarmful(spellID)
    end

    if event == "UNIT_SPELLCAST_START" then
        if isHarmfulSpell then
            isCasting = true
        end
    elseif event == "UNIT_SPELLCAST_STOP" then
        isCasting = false
    elseif event == "UNIT_SPELLCAST_CHANNEL_START" then
        if isHarmfulSpell then
            isCasting = true
        end
    elseif event == "UNIT_SPELLCAST_CHANNEL_STOP" then
        isCasting = false
    end

    CR:Fire("PLAYER_CASTING_UPDATE", isCasting, eventDelay)
    addonTable.events["PLAYER_CASTING_UPDATE"] = isCasting
end

This does the job, and it only shows up while casting damaging (hurtful) attacks. It's shoddy code, so you might want to look into doing it differently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions