mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Make "InitSettingsFromModules" pfeh run on dedicated
This commit is contained in:
parent
1804c6ceab
commit
177f590dda
@ -101,6 +101,43 @@ if(!isServer) then {
|
||||
|
||||
call FUNC(checkFiles);
|
||||
|
||||
|
||||
// Create a pfh to wait until all postinits are ready and settings are initialized
|
||||
[{
|
||||
PARAMS_1(_args);
|
||||
EXPLODE_1_PVT(_args,_waitingMsgSent);
|
||||
// If post inits are not ready then wait
|
||||
if !(SLX_XEH_MACHINE select 8) exitWith {};
|
||||
|
||||
// If settings are not initialized then wait
|
||||
if (isNil QGVAR(settings) || {(!isServer) && (isNil QEGVAR(modules,serverModulesRead))}) exitWith {
|
||||
if (!_waitingMsgSent) then {
|
||||
_args set [0, true];
|
||||
diag_log text format["[ACE] Waiting on settings from server"];
|
||||
};
|
||||
};
|
||||
|
||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
diag_log text format["[ACE] Settings received from server"];
|
||||
|
||||
// Event so that ACE_Modules have their settings loaded:
|
||||
["InitSettingsFromModules", []] call FUNC(localEvent);
|
||||
|
||||
// Load user settings from profile
|
||||
if (hasInterface) then {
|
||||
call FUNC(loadSettingsFromProfile);
|
||||
call FUNC(loadSettingsLocalizedText);
|
||||
};
|
||||
|
||||
diag_log text format["[ACE] Settings initialized"];
|
||||
|
||||
//Event that settings are safe to use:
|
||||
["SettingsInitialized", []] call FUNC(localEvent);
|
||||
|
||||
}, 0, [false]] call cba_fnc_addPerFrameHandler;
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/***************************************************************/
|
||||
/***************************************************************/
|
||||
@ -278,38 +315,3 @@ if(isMultiplayer && { ACE_time > 0 || isNull player } ) then {
|
||||
}] call FUNC(addEventHandler);
|
||||
|
||||
GVAR(commonPostInited) = true;
|
||||
|
||||
// Create a pfh to wait until all postinits are ready and settings are initialized
|
||||
[{
|
||||
PARAMS_1(_args);
|
||||
EXPLODE_1_PVT(_args,_waitingMsgSent);
|
||||
// If post inits are not ready then wait
|
||||
if !(SLX_XEH_MACHINE select 8) exitWith {};
|
||||
|
||||
// If settings are not initialized then wait
|
||||
if (isNil QGVAR(settings) || {(!isServer) && (isNil QEGVAR(modules,serverModulesRead))}) exitWith {
|
||||
if (!_waitingMsgSent) then {
|
||||
_args set [0, true];
|
||||
diag_log text format["[ACE] Waiting on settings from server"];
|
||||
};
|
||||
};
|
||||
|
||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
diag_log text format["[ACE] Settings received from server"];
|
||||
|
||||
// Event so that ACE_Modules have their settings loaded:
|
||||
["InitSettingsFromModules", []] call FUNC(localEvent);
|
||||
|
||||
// Load user settings from profile
|
||||
if (hasInterface) then {
|
||||
call FUNC(loadSettingsFromProfile);
|
||||
call FUNC(loadSettingsLocalizedText);
|
||||
};
|
||||
|
||||
diag_log text format["[ACE] Settings initialized"];
|
||||
|
||||
//Event that settings are safe to use:
|
||||
["SettingsInitialized", []] call FUNC(localEvent);
|
||||
|
||||
}, 0, [false]] call cba_fnc_addPerFrameHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user