AllowOnCovertActionCompleteAnalytics

Tracking Issue: #752

Tags: events

Allows mods to prevent CA completion from counting towards campaign stats.

This event is triggered from AnalyticsManager::OnCoverActionComplete and passes all original listener arguments in the tuple.

AllowOnCovertActionCompleteAnalytics event

Param Value
EventID AllowOnCovertActionCompleteAnalytics
EventData XComLWTuple
EventSource none
NewGameState none

Tuple contents

Index Name Type Direction
0 bAllow bool inout
1 OriginalEventData Object in
2 OriginalEventSource Object in
3 OriginalGameState XComGameState in
4 OriginalEvent name in
5 OriginalCallbackData Object in

Listener template

static function EventListenerReturn OnAllowOnCovertActionCompleteAnalytics(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local XComLWTuple Tuple;
    local bool bAllow;
    local Object OriginalEventData;
    local Object OriginalEventSource;
    local XComGameState OriginalGameState;
    local name OriginalEvent;
    local Object OriginalCallbackData;

    Tuple = XComLWTuple(EventData);

    bAllow = Tuple.Data[0].b;
    OriginalEventData = Tuple.Data[1].o;
    OriginalEventSource = Tuple.Data[2].o;
    OriginalGameState = XComGameState(Tuple.Data[3].o);
    OriginalEvent = Tuple.Data[4].n;
    OriginalCallbackData = Tuple.Data[5].o;

    // Your code here

    Tuple.Data[0].b = bAllow;

    return ELR_NoInterrupt;
}

Note 1: The OriginalEventSource should be the XComGameState_CovertAction that was just completed, although the AnalyticsManager code does not validate that.

Note 2: you must subscribe with ELD_Immediate deferral to modify bAllow

Source code references