Skip to content

Commit

Permalink
bunch more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
indig0fox committed Mar 28, 2022
1 parent 8a26ce2 commit 5606d06
Show file tree
Hide file tree
Showing 23 changed files with 649 additions and 433 deletions.
2 changes: 1 addition & 1 deletion x/ocap2/addons/main/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// During postInit, we'll remoteExec these settings onto clients so vars are synchronized and modifiable during a mission.
{
_x remoteExec ["CBA_fnc_addSetting", [0, -2] select isDedicated, true];
} forEach GVARMAIN(allSettings);
} forEach GVAR(allSettings);


ADDON = true;
197 changes: 5 additions & 192 deletions x/ocap2/addons/main/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,209 +4,22 @@

// This PreInit creates the settings on the server, only so that the global vars will be registered and synchronized with clients.

GVARMAIN(allSettings) = [
// AUTO START SETTINGS
[
QEGVAR(settings,autoStart),
"CHECKBOX", // setting type
[
"Auto Start Recording", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"Automatically start OCAP recordings at session start. Default: true"
],
[COMPONENT_NAME, "Auto-start Settings"], // Pretty name of the category where the setting can be found. Can be stringtable entry.
true, // default enabled
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{}, // function that will be executed once on mission start and every time the setting is changed.
true // requires restart to apply
],

[
QEGVAR(settings,minPlayerCount),
"SLIDER", // setting type
[
"Minimum Player Count", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"Auto-start will begin once this player count is reached. Default: 15"
],
[COMPONENT_NAME, "Auto-start Settings"], // Pretty name of the category where the setting can be found. Can be stringtable entry.
[
1, // min
150, // max
15, // default
0, // trailing decimals
false // percentage
], // data for this setting: [min, max, default, number of shown trailing decimals]
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{}, // function that will be executed once on mission start and every time the setting is changed.
true // requires restart to apply
],



// RECORDING SETTINGS
[
QEGVAR(settings,frameCaptureDelay),
"SLIDER", // setting type
[
"Frame Capture Delay", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"Positioning, medical status, and crew states of units and vehicles will be captured every X amount of seconds. Default: 1"
],
[COMPONENT_NAME, "Recording Settings"], // Pretty name of the category where the setting can be found. Can be stringtable entry.
[
0.25, // min
10, // max
1, // default
0, // trailing decimals
false // percentage
], // data for this setting: [min, max, default, number of shown trailing decimals]
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{}, // function that will be executed once on mission start and every time the setting is changed.
false // requires restart to apply
],

[
QEGVAR(settings,minMissionTime),
"SLIDER", // setting type
[
"Required Duration to Save", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"A recording must be at least this long (in minutes) to save. Default: 20"
],
[COMPONENT_NAME, "Recording Settings"], // Pretty name of the category where the setting can be found. Can be stringtable entry.
[
1, // min
120, // max
20, // default
0, // trailing decimals
false // percentage
], // data for this setting: [min, max, default, number of shown trailing decimals]
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{}, // function that will be executed once on mission start and every time the setting is changed.
false // requires restart to apply
],

[
QEGVAR(settings,preferACEUnconscious),
"CHECKBOX", // setting type
[
"Use ACE3 Medical", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"If true, will check ACE3 medical status on units. If false, or ACE3 isn't loaded, fall back to vanilla. Default: true"
],
[COMPONENT_NAME, "Recording Settings"], // Pretty name of the category where the setting can be found. Can be stringtable entry.
true, // default enabled
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{}, // function that will be executed once on mission start and every time the setting is changed.
false // requires restart to apply
],

[
QEGVAR(settings,excludeClassFromRecord),
"EDITBOX", // setting type
[
"Classnames to Exclude", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"Array of object classnames that should be excluded from recording. Use single quotes! Default: ['ACE_friesAnchorBar', 'GroundWeaponHolder', 'WeaponHolderSimulated']"
],
[COMPONENT_NAME, "Recording Settings"], // Pretty name of the category where the setting can be found. Can be stringtable entry.
"['ACE_friesAnchorBar', 'GroundWeaponHolder', 'WeaponHolderSimulated']", // default string value
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{}, // function that will be executed once on mission start and every time the setting is changed.
false // requires restart to apply
],

[
QEGVAR(settings,excludeKindFromRecord),
"EDITBOX", // setting type
[
"Object KindOfs to Exclude", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"Array of classnames which, along with all child classes, should be excluded from recording. Use single quotes! Default: []"
],
[COMPONENT_NAME, "Recording Settings"], // Pretty name of the category where the setting can be found. Can be stringtable entry.
"[]", // default string value
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{}, // function that will be executed once on mission start and every time the setting is changed.
false // requires restart to apply
],

[
QEGVAR(settings,excludeMarkerFromRecord),
"EDITBOX", // setting type
[
"Marker Prefixes to Exclude", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"Array of prefixes - any markers matching these prefixes will be excluded from recording. Use single quotes! Default: ['SystemMarker_']"
],
[COMPONENT_NAME, "Recording Settings"], // Pretty name of the category where the setting can be found. Can be stringtable entry.
"['SystemMarker_']", // default string value
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{}, // function that will be executed once on mission start and every time the setting is changed.
false // requires restart to apply
],

[
QEGVAR(settings,trackTimes),
"CHECKBOX", // setting type
[
"Enable Mission Time Tracking", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"Will continuously track in-game world time during a mission. Useful for accelerated/skipped time scenarios. Default: false"
],
[COMPONENT_NAME, "Recording Settings"], // Pretty name of the category where the setting can be found. Can be stringtable entry.
false, // default enabled
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{}, // function that will be executed once on mission start and every time the setting is changed.
false // requires restart to apply
],

[
QEGVAR(settings,trackTimeInterval),
"SLIDER", // setting type
[
"Mission Time Tracking Interval", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"If time tracking is enabled, it will be checked every X capture frames. Default: 10"
],
[COMPONENT_NAME, "Recording Settings"], // Pretty name of the category where the setting can be found. Can be stringtable entry.
[
5, // min
25, // max
10, // default
0, // trailing decimals
false // percentage
], // data for this setting: [min, max, default, number of shown trailing decimals]
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{}, // function that will be executed once on mission start and every time the setting is changed.
false // requires restart to apply
],



// SAVING SETTINGS
[
QEGVAR(settings,saveMissionEnded),
"CHECKBOX", // setting type
[
"Auto-save on MPEnded Event", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"If true, automatically save and export the mission when the MPEnded event fires. Default: true"
],
[COMPONENT_NAME, "Save/Export Settings"], // Pretty name of the category where the setting can be found. Can be stringtable entry.
true, // default enabled
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{}, // function that will be executed once on mission start and every time the setting is changed.
false // requires restart to apply
],



// DEBUG
GVAR(allSettings) = [
// Core
[
QGVARMAIN(enabled),
"CHECKBOX", // setting type
[
"Recording Enabled", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"Turns on or off all recording functionality. Will not reset anything from existing session, will just stop recording any new data. Default: true"
"Turns on or off most recording functionality. Will not reset anything from existing session, will just stop recording most new data. Note: For record/pause switching, use the CBA events! Default: true"
],
[COMPONENT_NAME, "Core"], // Pretty name of the category where the setting can be found. Can be stringtable entry.
true, // default enabled
true, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{
params ["_value"];
if (!isServer) exitWith {};
EFUNC(recorder,init);
if (_value) then {call EFUNC(recorder,init)};
}, // function that will be executed once on mission start and every time the setting is changed.
false // requires restart to apply
],
Expand All @@ -230,6 +43,6 @@ GVARMAIN(allSettings) = [

{
_x call CBA_fnc_addSetting;
} forEach GVARMAIN(allSettings);
} forEach GVAR(allSettings);

ADDON = true;
5 changes: 3 additions & 2 deletions x/ocap2/addons/main/script_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
#define ARR6(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6) [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6]




#include "\x\cba\addons\main\script_macros_common.hpp"
#include "\x\cba\addons\xeh\script_xeh.hpp"

#define SHOULDSAVEEVENTS ((missionNamespace getVariable [QGVAR(recording), false]) && missionNamespace getVariable [QGVAR(startTime), -1] > -1)

6 changes: 3 additions & 3 deletions x/ocap2/addons/mod.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name = "OCAP"; // Name of your mod
name = "OCAP2"; // Name of your mod
picture = "logo_ocap.paa"; // Picture displayed from the expansions menu. Optimal size is 2048x1024
//logoSmall = "\Samples_F\Data_01\Logos\logo_small.paa"; // Display next to the item added by the mod
//logo = "\Samples_F\Data_01\Logos\logo.paa"; // Logo displayed in the main menu
//logoOver = "\Samples_F\Data_01\Logos\logoOver.paa"; // When the mouse is over, in the main menu
actionName = "Github"; // Text displayed on the "website" button
action = "https://github.com/OCAPv2"; // Website URL, that can accessed from the expansions menu
tooltipOwned = "Operation Capture and Playback v2"; // Tool tip displayed when the mouse is left over, in the main menu
action = "https://github.com/OCAP2/OCAP"; // Website URL, that can accessed from the expansions menu
tooltipOwned = "Operation Capture and Playback 2"; // Tool tip displayed when the mouse is left over, in the main menu

// Color used for DLC stripes and backgrounds (RGBA)
dlcColor[] =
Expand Down
6 changes: 3 additions & 3 deletions x/ocap2/addons/recorder/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "script_component.hpp"
#include "XEH_prep.sqf"

if (!EGVAR(settings,autoStart)) then {
call FUNC(init);
};
{
_x remoteExec ["CBA_fnc_addSetting", [0, -2] select isDedicated, true];
} forEach GVAR(allSettings);

ADDON = true;
Loading

0 comments on commit 5606d06

Please sign in to comment.