Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NaturalDocs.Project/Project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

Title: OCAP2
Subtitle: Operations Capture and Playback
Style: OCAP2


# This is where you put general information about your project. None of these
Expand Down
3 changes: 3 additions & 0 deletions NaturalDocs.Project/Styles/OCAP2/Style.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Inherit: Default

Frame OnLoad: NDThemes.SetAvailableThemes([["Dark","Dark"],["Light","Light"],["Auto","Auto:Light/Dark"],["Black","Black"]])
17 changes: 1 addition & 16 deletions addons/recorder/fnc_addEventMission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,7 @@ if (isClass (configFile >> "CfgPatches" >> "ace_explosives")) then {
};


/*
CBA Event: OCAP_customEvent
Description:
Event listener for custom event text to be added to the timeline. Calls <OCAP_recorder_fnc_handleCustomEvent> when triggered.

Parameters:
0 - Event name [String]
1 - Event data [Array]
1.0 - Always "generalEvent" [String]
1.1 - Custom event text [String]

Example:
> ["OCAP_customEvent", ["generalEvent", "The warehouse has been secured!"]] call CBA_fnc_serverEvent;
> [QGVARMAIN(customEvent), ["generalEvent", "The warehouse has been secured!"]] call CBA_fnc_serverEvent;

*/
// See <OCAP_recorder_fnc_handleCustomEvent> for usage and examples
if (isNil QEGVAR(listener,customEvent)) then {
EGVAR(listener,customEvent) = [QGVARMAIN(customEvent), {
_this call FUNC(handleCustomEvent);
Expand Down
22 changes: 17 additions & 5 deletions addons/recorder/fnc_handleCustomEvent.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,27 @@
true

Examples:
These examples use the expanded event name "OCAP_customEvent" so they can be
called from user-defined mission scripts without requiring the CBA macros.

(start code)
// Sector captured with structured data (sent by fnc_trackSectors)
[QGVARMAIN(customEvent), ["captured", ["sector", "Sector Alpha", str west, getPosASL _sector]]] call CBA_fnc_localEvent;
// Sector captured with structured data
["OCAP_customEvent", ["captured", ["sector", "Sector Alpha", str west, getPosASL _sector]]] call CBA_fnc_localEvent;

// Sector contested (no owning side)
["OCAP_customEvent", ["contested", ["sector", "Sector Alpha", "", getPosASL _sector]]] call CBA_fnc_localEvent;

// End mission with side and message
[QGVARMAIN(customEvent), ["endMission", [str west, "BLUFOR controlled all sectors!"]]] call CBA_fnc_localEvent;
["OCAP_customEvent", ["endMission", [str west, "BLUFOR controlled all sectors!"]]] call CBA_fnc_localEvent;

// End mission with just a message (no side)
["OCAP_customEvent", ["endMission", "Mission complete!"]] call CBA_fnc_localEvent;

// Generic event — any unrecognized event name goes through the general handler
["OCAP_customEvent", ["generalEvent", "Some event text"]] call CBA_fnc_serverEvent;

// Generic event with optional extra data
[QGVARMAIN(customEvent), ["generalEvent", "Some event text"]] call CBA_fnc_serverEvent;
// Custom event name — works the same as generalEvent via the default handler
["OCAP_customEvent", ["myCustomEvent", "Player reached the extraction zone"]] call CBA_fnc_serverEvent;
(end code)

Public:
Expand Down