OverrideAbilityIconColorImproved
Tracking Issue: #749
Tags: compatibility, events
The OverrideAbilityIconColorImproved
event allows mods to override background and foreground
colors of ability icons.
The "background" color is the color of the icon itself, and normally varies depending on
the AbilitySourceName
property of the X2AbilityTemplate
.
The "foreground" color is normally always black.
Default colors used by the game can be found in the UIUtilities_Colors
class.
Performance note: this event gets triggered a lot, so try to avoid complex computations in listeners to reduce the performance hit.
OverrideAbilityIconColorImproved event
Param | Value |
---|---|
EventID | OverrideAbilityIconColorImproved |
EventData | XComLWTuple |
EventSource | XComGameState_Ability |
NewGameState | none |
Tuple contents
Index | Name | Type | Direction |
---|---|---|---|
0 | IsObjective | bool | in |
1 | BackgroundColor | string | inout |
2 | ForegroundColor | string | inout |
Listener template
static function EventListenerReturn OnOverrideAbilityIconColorImproved(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
local XComGameState_Ability AbilityState;
local XComLWTuple Tuple;
local bool IsObjective;
local string BackgroundColor;
local string ForegroundColor;
AbilityState = XComGameState_Ability(EventSource);
Tuple = XComLWTuple(EventData);
IsObjective = Tuple.Data[0].b;
BackgroundColor = Tuple.Data[1].s;
ForegroundColor = Tuple.Data[2].s;
// Your code here
Tuple.Data[1].s = BackgroundColor;
Tuple.Data[2].s = ForegroundColor;
return ELR_NoInterrupt;
}
Compatibility
This event takes precedence over the deprecated event OverrideAbilityIconColor, so any listener that changes ability icon colors will always overwrite any changes made by listeners of the deprecated event.