Skip to content

Commit e4683e0

Browse files
authored
docs: dark theme by default and fix custom event examples (#108)
- Add custom NaturalDocs style that defaults to Dark theme (with Light/Auto/Black still available via the theme switcher) - Replace CBA macros with expanded "OCAP_customEvent" string in examples so they are usable from external mission scripts - Add missing event examples: contested, endMission string variant, and custom event names via the default handler - Remove duplicate OCAP_customEvent doc block from fnc_addEventMission
1 parent f8ada99 commit e4683e0

4 files changed

Lines changed: 22 additions & 21 deletions

File tree

NaturalDocs.Project/Project.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
Title: OCAP2
1010
Subtitle: Operations Capture and Playback
11+
Style: OCAP2
1112

1213

1314
# This is where you put general information about your project. None of these
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Inherit: Default
2+
3+
Frame OnLoad: NDThemes.SetAvailableThemes([["Dark","Dark"],["Light","Light"],["Auto","Auto:Light/Dark"],["Black","Black"]])

addons/recorder/fnc_addEventMission.sqf

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -185,22 +185,7 @@ if (isClass (configFile >> "CfgPatches" >> "ace_explosives")) then {
185185
};
186186

187187

188-
/*
189-
CBA Event: OCAP_customEvent
190-
Description:
191-
Event listener for custom event text to be added to the timeline. Calls <OCAP_recorder_fnc_handleCustomEvent> when triggered.
192-
193-
Parameters:
194-
0 - Event name [String]
195-
1 - Event data [Array]
196-
1.0 - Always "generalEvent" [String]
197-
1.1 - Custom event text [String]
198-
199-
Example:
200-
> ["OCAP_customEvent", ["generalEvent", "The warehouse has been secured!"]] call CBA_fnc_serverEvent;
201-
> [QGVARMAIN(customEvent), ["generalEvent", "The warehouse has been secured!"]] call CBA_fnc_serverEvent;
202-
203-
*/
188+
// See <OCAP_recorder_fnc_handleCustomEvent> for usage and examples
204189
if (isNil QEGVAR(listener,customEvent)) then {
205190
EGVAR(listener,customEvent) = [QGVARMAIN(customEvent), {
206191
_this call FUNC(handleCustomEvent);

addons/recorder/fnc_handleCustomEvent.sqf

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,27 @@
2121
true
2222
2323
Examples:
24+
These examples use the expanded event name "OCAP_customEvent" so they can be
25+
called from user-defined mission scripts without requiring the CBA macros.
26+
2427
(start code)
25-
// Sector captured with structured data (sent by fnc_trackSectors)
26-
[QGVARMAIN(customEvent), ["captured", ["sector", "Sector Alpha", str west, getPosASL _sector]]] call CBA_fnc_localEvent;
28+
// Sector captured with structured data
29+
["OCAP_customEvent", ["captured", ["sector", "Sector Alpha", str west, getPosASL _sector]]] call CBA_fnc_localEvent;
30+
31+
// Sector contested (no owning side)
32+
["OCAP_customEvent", ["contested", ["sector", "Sector Alpha", "", getPosASL _sector]]] call CBA_fnc_localEvent;
2733
2834
// End mission with side and message
29-
[QGVARMAIN(customEvent), ["endMission", [str west, "BLUFOR controlled all sectors!"]]] call CBA_fnc_localEvent;
35+
["OCAP_customEvent", ["endMission", [str west, "BLUFOR controlled all sectors!"]]] call CBA_fnc_localEvent;
36+
37+
// End mission with just a message (no side)
38+
["OCAP_customEvent", ["endMission", "Mission complete!"]] call CBA_fnc_localEvent;
39+
40+
// Generic event — any unrecognized event name goes through the general handler
41+
["OCAP_customEvent", ["generalEvent", "Some event text"]] call CBA_fnc_serverEvent;
3042
31-
// Generic event with optional extra data
32-
[QGVARMAIN(customEvent), ["generalEvent", "Some event text"]] call CBA_fnc_serverEvent;
43+
// Custom event name — works the same as generalEvent via the default handler
44+
["OCAP_customEvent", ["myCustomEvent", "Player reached the extraction zone"]] call CBA_fnc_serverEvent;
3345
(end code)
3446
3547
Public:

0 commit comments

Comments
 (0)