OverrideCovertActionRewardString

Tracking Issue: #1379

Tags: ui, events

Fires an event that allows mods to override the reward string shown on an individual Covert Action staff slot, covering both the preview shown while the action can still be staffed and the string shown once the action has completed.

bPreview is true for the preview string (GetRewardPreviewString) and false for the completion string (GetRewardString). Setting RewardString to the empty string suppresses the slot's reward line entirely, including the m_strSoldierReward label and its coloring.

StaffSlotState is the slot the reward belongs to

OverrideCovertActionRewardString event

Param Value
EventID OverrideCovertActionRewardString
EventData XComLWTuple
EventSource UICovertActionStaffSlot
NewGameState none

Tuple contents

Index Name Type Direction
0 RewardState XComGameState_Reward in
1 StaffSlotState XComGameState_StaffSlot in
2 bPreview bool in
3 RewardString string inout

Listener template

static function EventListenerReturn OnOverrideCovertActionRewardString(Object EventData, Object EventSource, XComGameState GameState, Name EventID, Object CallbackObject)
{
    local UICovertActionStaffSlot SlotUI;
    local XComLWTuple Tuple;
    local XComGameState_Reward RewardState;
    local XComGameState_StaffSlot StaffSlotState;
    local bool bPreview;
    local string RewardString;

    SlotUI = UICovertActionStaffSlot(EventSource);
    Tuple = XComLWTuple(EventData);

    RewardState = XComGameState_Reward(Tuple.Data[0].o);
    StaffSlotState = XComGameState_StaffSlot(Tuple.Data[1].o);
    bPreview = Tuple.Data[2].b;
    RewardString = Tuple.Data[3].s;

    // Your code here

    Tuple.Data[3].s = RewardString;

    return ELR_NoInterrupt;
}

Source code references