OverrideEffectIconColor

Tracking Issue: #1509

Tags: events

The OverrideEffectIconColor event allows mods to override the background and foreground colors of icons from X2Effect_Persistent set as ePerkBuff_Passive. The "background" color is the color of the icon itself, and normally varies depending on the AbilitySourceName property set on the X2Effect_Persistent The "foreground" color is normally always black. Default colors used by the game can be found in the UIUtilities_Colors class.

Listeners should use the Effect's AbilitySourceName provided in the EventData as a filter to ensure maximum compatibility.

Performance note: this event gets triggered a lot, so try to avoid complex computations in listeners to reduce the performance hit.

OverrideEffectIconColor event

Param Value
EventID OverrideEffectIconColor
EventData XComLWTuple
EventSource none
NewGameState none

Tuple contents

Index Name Type Direction
0 AbilitySourceName name in
1 BackgroundColor string out
2 ForegroundColor string out

Listener template

static function EventListenerReturn OnOverrideEffectIconColor(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComLWTuple Tuple;
    local name AbilitySourceName;
    local string BackgroundColor;
    local string ForegroundColor;

    Tuple = XComLWTuple(EventData);

    AbilitySourceName = Tuple.Data[0].n;

    // Your code here

    Tuple.Data[1].s = BackgroundColor;
    Tuple.Data[2].s = ForegroundColor;

    return ELR_NoInterrupt;
}

Source code references