big refactor, WIP!
This commit is contained in:
@@ -1,26 +1,28 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
// ACE SELF-INTERACTIONS FOR FILING AND RESCINDING REINSERT REQUESTS NEAR BASE - ALL PLAYERS
|
||||
localNamespace setVariable ["milsim_reinsert_fileForReinsertClassesAdded", []];
|
||||
localNamespace setVariable [QGVAR(fileForReinsertClassesAdded), []];
|
||||
// add actions to current class
|
||||
[typeOf player] call milsim_reinsert_fnc_addAceSelfActions;
|
||||
[typeOf player] call FUNC(addAceSelfActions);
|
||||
// add actions to future classes
|
||||
["ace_interact_menu_newControllableObject", {
|
||||
_this call milsim_reinsert_fnc_addAceSelfActions;
|
||||
_this call FUNC(addAceSelfActions);
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
// PILOTS ONLY
|
||||
// ACE SELF-INTERACTIONS FOR CHECKING REINSERT QUEUE - ONLY FOR PILOTS
|
||||
if ((typeOf player) in ["B_Helipilot_F", "B_helicrew_F"]) then {
|
||||
localNamespace setVariable ["milsim_reinsert_checkReinsertQueueClassesAdded", []];
|
||||
localNamespace setVariable ["milsim_reinsert_lastReinsertQueueCheck", diag_tickTime];
|
||||
localNamespace setVariable [QGVAR(checkReinsertQueueClassesAdded), []];
|
||||
localNamespace setVariable [QGVAR(lastReinsertQueueCheck), diag_tickTime];
|
||||
|
||||
// add actions to current class
|
||||
[typeOf player] call milsim_reinsert_fnc_addCheckQueueSelfAction;
|
||||
[typeOf player] call FUNC(addCheckQueueSelfAction);
|
||||
// add actions to future classes
|
||||
["ace_interact_menu_newControllableObject", {
|
||||
_this call milsim_reinsert_fnc_addCheckQueueSelfAction;
|
||||
_this call FUNC(addCheckQueueSelfAction);
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
};
|
||||
/////////////////////////////////////////////////////
|
||||
@@ -31,13 +33,13 @@ if ((typeOf player) in ["B_Helipilot_F", "B_helicrew_F"]) then {
|
||||
[{
|
||||
// if module not enabled and pilot forced check not enabled, exit
|
||||
if (not (
|
||||
missionNamespace getVariable ["milsim_reinsert_setting_reinsertion_enabled", true] &&
|
||||
missionNamespace getVariable ["milsim_reinsert_setting_reinsertion_pilotForcedCheckEnabled", true]
|
||||
missionNamespace getVariable [QGVAR(setting_enabled), true] &&
|
||||
missionNamespace getVariable [QGVAR(setting_pilotForcedCheckEnabled), true]
|
||||
)) exitWith {};
|
||||
|
||||
// if last check was less than X minutes ago, skip
|
||||
private _lastCheck = localNamespace getVariable ["milsim_reinsert_lastReinsertQueueCheck", diag_tickTime];
|
||||
private _requiredCheckInterval = missionNamespace getVariable ["milsim_reinsert_setting_reinsertion_pilotForcedCheckInterval", 60*20];
|
||||
private _lastCheck = localNamespace getVariable [QGVAR(lastReinsertQueueCheck), diag_tickTime];
|
||||
private _requiredCheckInterval = missionNamespace getVariable [QGVAR(setting_pilotForcedCheckInterval), 60*20];
|
||||
if (
|
||||
diag_tickTime - _lastCheck <
|
||||
_requiredCheckInterval
|
||||
@@ -45,9 +47,16 @@ if ((typeOf player) in ["B_Helipilot_F", "B_helicrew_F"]) then {
|
||||
|
||||
// last check was greater than X minutes ago
|
||||
// reset last check time
|
||||
localNamespace setVariable ["milsim_reinsert_lastReinsertQueueCheck", diag_tickTime];
|
||||
localNamespace setVariable [QGVAR(lastReinsertQueueCheck), diag_tickTime];
|
||||
// request notification from the server
|
||||
call milsim_reinsert_fnc_requestShowQueue;
|
||||
call FUNC(requestShowQueue);
|
||||
}, 30] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
[
|
||||
LEVEL_DEBUG,
|
||||
QUOTE(COMPONENT),
|
||||
"postInit complete",
|
||||
[]
|
||||
] call EFUNC(common,log);
|
||||
Reference in New Issue
Block a user