diff --git a/NaturalDocs.Project/Project.txt b/NaturalDocs.Project/Project.txt index c16f500..2a48acb 100644 --- a/NaturalDocs.Project/Project.txt +++ b/NaturalDocs.Project/Project.txt @@ -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 diff --git a/NaturalDocs.Project/Styles/OCAP2/Style.txt b/NaturalDocs.Project/Styles/OCAP2/Style.txt new file mode 100644 index 0000000..240aeba --- /dev/null +++ b/NaturalDocs.Project/Styles/OCAP2/Style.txt @@ -0,0 +1,3 @@ +Inherit: Default + +Frame OnLoad: NDThemes.SetAvailableThemes([["Dark","Dark"],["Light","Light"],["Auto","Auto:Light/Dark"],["Black","Black"]]) diff --git a/addons/recorder/fnc_addEventMission.sqf b/addons/recorder/fnc_addEventMission.sqf index cbad80f..ee649eb 100644 --- a/addons/recorder/fnc_addEventMission.sqf +++ b/addons/recorder/fnc_addEventMission.sqf @@ -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 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 for usage and examples if (isNil QEGVAR(listener,customEvent)) then { EGVAR(listener,customEvent) = [QGVARMAIN(customEvent), { _this call FUNC(handleCustomEvent); diff --git a/addons/recorder/fnc_handleCustomEvent.sqf b/addons/recorder/fnc_handleCustomEvent.sqf index b772d3f..4e6245b 100644 --- a/addons/recorder/fnc_handleCustomEvent.sqf +++ b/addons/recorder/fnc_handleCustomEvent.sqf @@ -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: