Zeus - Move to native CBA Settings (#8381)

* Zeus - Move to CBA settings

* Zeus - Update BI module functions to 2.04 versions
This commit is contained in:
Kyle Mckay 2021-08-16 12:01:50 +01:00 committed by GitHub
parent 981ef7e31e
commit 62679832df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 90 additions and 44 deletions

View File

@ -1,45 +1,20 @@
class ACE_Settings { class ACE_Settings {
class GVAR(zeusAscension) { class GVAR(zeusAscension) {
category = CSTRING(DisplayName); movedToSQF = 1;
displayName = CSTRING(ascension_DisplayName);
description = CSTRING(ascension_Description);
typeName = "BOOL";
value = 0;
}; };
class GVAR(zeusBird) { class GVAR(zeusBird) {
category = CSTRING(DisplayName); movedToSQF = 1;
displayName = CSTRING(bird_DisplayName);
description = CSTRING(bird_Description);
typeName = "BOOL";
value = 0;
}; };
class GVAR(remoteWind) { class GVAR(remoteWind) {
category = CSTRING(DisplayName); movedToSQF = 1;
displayName = CSTRING(remoteWind_DisplayName);
description = CSTRING(remoteWind_Description);
typeName = "BOOL";
value = 0;
}; };
class GVAR(radioOrdnance) { class GVAR(radioOrdnance) {
category = CSTRING(DisplayName); movedToSQF = 1;
displayName = CSTRING(radioOrdnance_DisplayName);
description = CSTRING(radioOrdnance_Description);
typeName = "BOOL";
value = 0;
}; };
class GVAR(revealMines) { class GVAR(revealMines) {
category = CSTRING(DisplayName); movedToSQF = 1;
displayName = CSTRING(revealMines_DisplayName);
description = CSTRING(revealMines_Description);
typeName = "SCALAR";
value = 0;
values[] = {"$STR_A3_OPTIONS_DISABLED", CSTRING(revealMines_partial), CSTRING(revealMines_full)};
}; };
class GVAR(autoAddObjects) { class GVAR(autoAddObjects) {
category = CSTRING(DisplayName); movedToSQF = 1;
typeName = "BOOL";
value = 0;
displayName = CSTRING(AddObjectsToCurator);
description = CSTRING(AddObjectsToCurator_desc);
}; };
}; };

View File

@ -2,13 +2,6 @@
#define IDD_DISPLAY3DEN 313 #define IDD_DISPLAY3DEN 313
["ace_settingsInitialized",{
// Only add an InitPost EH if setting is enabled (and apply retroactively)
if (isServer && {GVAR(autoAddObjects)}) then {
["AllVehicles", "InitPost", FUNC(addObjectToCurator), true, [], true] call CBA_fnc_addClassEventHandler;
};
}] call CBA_fnc_addEventHandler;
// Global skill module PVs values for persistence, just listen for the PV // Global skill module PVs values for persistence, just listen for the PV
QGVAR(GlobalSkillAI) addPublicVariableEventHandler FUNC(moduleGlobalSetSkill); QGVAR(GlobalSkillAI) addPublicVariableEventHandler FUNC(moduleGlobalSetSkill);

View File

@ -8,6 +8,13 @@ PREP_RECOMPILE_END;
if (isServer) then { if (isServer) then {
[QGVAR(zeusUnitAssigned), FUNC(handleZeusUnitAssigned)] call CBA_fnc_addEventHandler; [QGVAR(zeusUnitAssigned), FUNC(handleZeusUnitAssigned)] call CBA_fnc_addEventHandler;
// Only add an InitPost EH if setting is enabled (and apply retroactively)
["CBA_settingsInitialized", {
if (GVAR(autoAddObjects)) then {
["AllVehicles", "InitPost", FUNC(addObjectToCurator), true, [], true] call CBA_fnc_addClassEventHandler;
};
}] call CBA_fnc_addEventHandler;
}; };
GVAR(GlobalSkillAI) = [0.5,0.5,0.5,0.5,true,true]; GVAR(GlobalSkillAI) = [0.5,0.5,0.5,0.5,true,true];

View File

@ -27,14 +27,14 @@ if (_activated) then {
_explosive attachto [_logic]; _explosive attachto [_logic];
// Added by ace_zeus to control if mines are revealed // Added by ace_zeus to control if mines are revealed
if (GVAR(revealMines) > 0) then { if (GVAR(revealMines) > MINE_REVEAL_NONE) then {
//--- Reveal the mine to curator's side //--- Reveal the mine to curator's side
{ {
_side = (getassignedcuratorunit _x) call bis_fnc_objectSide; _side = (getassignedcuratorunit _x) call bis_fnc_objectSide;
_side revealmine _explosive; _side revealmine _explosive;
} forEach (objectcurators _logic); } forEach (objectcurators _logic);
if (GVAR(revealMines) > 1) then { if (GVAR(revealMines) == MINE_REVEAL_FULL) then {
//--- Mark minefields in the map //--- Mark minefields in the map
[] spawn bis_fnc_drawMinefields; [] spawn bis_fnc_drawMinefields;
}; };

View File

@ -90,10 +90,9 @@ if (_activated) then {
}; };
_fnc_playRadio = { _fnc_playRadio = {
if (_radio != "") then { if (_radio != "") then {
_entities = (getposatl _logic) nearentities ["All",100];
_sides = []; _sides = [];
{ {
if (isplayer _x) then { if (_x distance2D _logic < 100) then {
_side = side group _x; _side = side group _x;
if (_side in [east,west,resistance,civilian]) then { if (_side in [east,west,resistance,civilian]) then {
//--- Play radio (only if it wasn't played recently) //--- Play radio (only if it wasn't played recently)
@ -103,14 +102,14 @@ if (_activated) then {
}; };
}; };
}; };
} foreach _entities; } foreach allPlayers;
}; };
}; };
if (count _hint > 0 && {count objectcurators _logic > 0}) then { if (count _hint > 0 && {count objectcurators _logic > 0}) then {
[[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectcurators _logic] call bis_fnc_mp; [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectcurators _logic] call bis_fnc_mp;
}; };
if (count _velocity == 3) then { if (count _velocity == 3) then {
_altitude = (_logic getvariable ["altitude",_altitude]) call bis_fnc_parsenumber; _altitude = (_logic getvariable ["altitude",_altitude]) call BIS_fnc_parseNumberSafe;
_radio = _logic getvariable ["radio",_radio]; _radio = _logic getvariable ["radio",_radio];
//--- Create projectile //--- Create projectile

View File

@ -1,3 +1,71 @@
[
QGVAR(zeusAscension),
"CHECKBOX",
[LLSTRING(ascension_DisplayName), LLSTRING(ascension_Description)],
format ["ACE %1", LLSTRING(DisplayName)],
false,
true
] call CBA_fnc_addSetting;
[
QGVAR(zeusBird),
"CHECKBOX",
[LLSTRING(bird_DisplayName), LLSTRING(bird_Description)],
format ["ACE %1", LLSTRING(DisplayName)],
false,
true
] call CBA_fnc_addSetting;
[
QGVAR(remoteWind),
"CHECKBOX",
[LLSTRING(remoteWind_DisplayName), LLSTRING(remoteWind_Description)],
format ["ACE %1", LLSTRING(DisplayName)],
false,
true
] call CBA_fnc_addSetting;
[
QGVAR(radioOrdnance),
"CHECKBOX",
[LLSTRING(radioOrdnance_DisplayName), LLSTRING(radioOrdnance_Description)],
format ["ACE %1", LLSTRING(DisplayName)],
false,
true
] call CBA_fnc_addSetting;
[
QGVAR(revealMines),
"LIST",
[LLSTRING(revealMines_DisplayName), LLSTRING(revealMines_Description)],
format ["ACE %1", LLSTRING(DisplayName)],
[
[
MINE_REVEAL_NONE,
MINE_REVEAL_TO_SIDE,
MINE_REVEAL_FULL
],
[
localize "STR_A3_OPTIONS_DISABLED",
LLSTRING(revealMines_partial),
LLSTRING(revealMines_full)
],
0
],
true
] call CBA_fnc_addSetting;
[
QGVAR(autoAddObjects),
"CHECKBOX",
[LLSTRING(AddObjectsToCurator), LLSTRING(AddObjectsToCurator_desc)],
format ["ACE %1", LLSTRING(DisplayName)],
false,
true,
{},
true // XEH class EH cannot be removed, requires mission restart
] call CBA_fnc_addSetting;
[ [
QGVAR(canCreateZeus), QGVAR(canCreateZeus),
"LIST", "LIST",

View File

@ -28,3 +28,7 @@
#define CAN_CREATE_ADMIN 0 #define CAN_CREATE_ADMIN 0
#define CAN_CREATE_CONSOLE 1 #define CAN_CREATE_CONSOLE 1
#define CAN_CREATE_ALL 2 #define CAN_CREATE_ALL 2
#define MINE_REVEAL_NONE 0
#define MINE_REVEAL_TO_SIDE 1
#define MINE_REVEAL_FULL 2