-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing includes, Set version in files, Update HEMTT config
- Loading branch information
Showing
11 changed files
with
228 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
/* | ||
Author: | ||
Karel Moricky, improved by Killzone_Kid | ||
Description: | ||
Initialize displays during preStart or init GUI display and run its script | ||
The config class of the display is available in "BIS_fnc_initDisplay_configClass" stored on display | ||
Example: _display getVariable "BIS_fnc_initDisplay_configClass"; | ||
Display is also stored in uiNamespace variable with config class name | ||
Example: uiNamespace getVariable "RscAvCamera"; | ||
Parameter(s): | ||
ARRAY - [] init displays during preStart | ||
or | ||
0: STRING - mode, can be "onLoad" or "onUnload" | ||
1: ARRAY - params passed from "onLoad" or "onUnload" event handler, contains only DISPLAY | ||
2: STRING - display class | ||
3: STRING - script path from CfgScriptPaths | ||
Returns: | ||
NOTHING | ||
*/ | ||
|
||
#define CONFIG_CLASS_VAR "BIS_fnc_initDisplay_configClass" | ||
#define INIT_GAME_VAR "BIS_initGame" | ||
|
||
// init displays during preStart (moved from BIS_fnc_initDisplays) | ||
if (_this isEqualTo []) exitWith | ||
{ | ||
{ | ||
{ | ||
if (getNumber (_x >> "scriptIsInternal") isEqualTo 0) then //--- Ignore internal scripts, they're recompiled first time they're opened | ||
{ | ||
_scriptName = getText (_x >> "scriptName"); | ||
_scriptPath = getText (_x >> "scriptPath"); | ||
|
||
if (_scriptName isEqualTo "" || _scriptPath isEqualTo "") exitWith | ||
{ | ||
[ | ||
'Undefined param(s) [scriptPath: "%2", scriptName: "%3"] while trying to init display "%1"', | ||
configName _x, | ||
_scriptPath, | ||
_scriptName | ||
] | ||
call BIS_fnc_logFormat; | ||
}; | ||
|
||
_script = _scriptName + "_script"; | ||
|
||
if (uiNamespace getVariable [_script, 0] isEqualType {}) exitWith {}; //--- already compiled | ||
|
||
uiNamespace setVariable | ||
[ | ||
_script, | ||
compileScript [ | ||
format ["%1%2.sqf", getText (configFile >> "CfgScriptPaths" >> _scriptPath), _scriptName], | ||
true, // final | ||
format ["scriptName '%1'; _fnc_scriptName = '%1'; ", _scriptName] // prefix | ||
] | ||
]; | ||
}; | ||
} | ||
forEach ("isText (_x >> 'scriptPath')" configClasses _x); | ||
} | ||
forEach | ||
[ | ||
configFile, | ||
configFile >> "RscTitles", | ||
configFile >> "RscInGameUI", | ||
configFile >> "Cfg3DEN" >> "Attributes" | ||
]; | ||
|
||
nil | ||
}; | ||
|
||
//--- Register/unregister display | ||
with uiNamespace do | ||
{ | ||
params | ||
[ | ||
["_mode", "", [""]], | ||
["_params", []], | ||
["_class", "", [""]], | ||
["_path", "default", [""]], | ||
["_register", true, [true, 0]] | ||
]; | ||
|
||
_display = _params param [0, displayNull]; | ||
if (isNull _display) exitWith {nil}; | ||
|
||
if (_register isEqualType true) then {_register = parseNumber _register}; | ||
if (_register > 0) then | ||
{ | ||
_varDisplays = _path + "_displays"; | ||
_displays = (uiNamespace getVariable [_varDisplays, []]) - [displayNull]; | ||
|
||
if (_mode == "onLoad") exitWith | ||
{ | ||
//--- Register current display | ||
_display setVariable [CONFIG_CLASS_VAR, _class]; | ||
uiNamespace setVariable [_class, _display]; | ||
|
||
_displays pushBackUnique _display; | ||
uiNamespace setVariable [_varDisplays, _displays]; | ||
|
||
if !(uiNamespace getVariable [INIT_GAME_VAR, false]) then | ||
{ | ||
//--- tell loading screen it can stop using ARMA 3 logo which is shown only before main menu | ||
//--- and start using the classic terrain picture | ||
uiNamespace setVariable [INIT_GAME_VAR, _path == "GUI" && {ctrlIdd _x >= 0} count _displays > 1]; | ||
}; | ||
|
||
[missionNamespace, "OnDisplayRegistered", [_display, _class]] call BIS_fnc_callScriptedEventHandler; | ||
}; | ||
|
||
if (_mode == "onUnload") exitWith | ||
{ | ||
//--- Unregister current display | ||
_displays = _displays - [_display]; | ||
uiNamespace setVariable [_varDisplays, _displays]; | ||
|
||
[missionNamespace, "OnDisplayUnregistered", [_display, _class]] call BIS_fnc_callScriptedEventHandler; | ||
}; | ||
|
||
}; | ||
|
||
//--- Call script in public version | ||
if (!cheatsEnabled) exitWith | ||
{ | ||
[_mode, _params, _class] call (uiNamespace getVariable (_class + "_script")); | ||
nil | ||
}; | ||
|
||
//--- Recompile in the internal version | ||
uinamespace setvariable | ||
[ | ||
_class + "_script", | ||
compileScript [ | ||
format ["%1%2.sqf", getText (configFile >> "CfgScriptPaths" >> _path), _class], | ||
true, // final | ||
format ["scriptName '%1'; _fnc_scriptName = '%1'; ", _class] // prefix | ||
] | ||
]; | ||
|
||
//--- Call script in internal version | ||
if !(uiNamespace getVariable ["BIS_disableUIscripts", false]) then | ||
{ | ||
[_mode, _params, _class] call (uiNamespace getVariable (_class + "_script")); | ||
nil | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
Author: Karel Moricky | ||
Description: | ||
Unregister a loading screen. When none other remains, end the loading. | ||
Parameter(s): | ||
0: STRING - screen ID, used in BIS_fnc_endLoadingScreen | ||
Returns: | ||
BOOL - true when unregistered | ||
*/ | ||
|
||
with uinamespace do { | ||
private ["_id","_ids"]; | ||
|
||
_id = _this param [0,"",[""]]; | ||
_ids = missionnamespace getvariable ["BIS_fnc_startLoadingScreen_ids",[]]; | ||
|
||
if (_id in _ids) then { | ||
_ids = _ids - [_id]; | ||
missionnamespace setvariable ["BIS_fnc_startLoadingScreen_ids",_ids]; | ||
if (count _ids == 0) then { | ||
endloadingscreen; | ||
-1 call bis_fnc_progressloadingscreen; | ||
}; | ||
//["End '%1' loading screen for %2",_id,profilename] call bis_fnc_logFormat; | ||
true | ||
} else { | ||
["Loading screen '%1' did not start yet.",_id] call bis_fnc_error; | ||
false | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
Author: Karel Moricky | ||
Description: | ||
Register a loading screen. Start the loading when it's the first one registered. | ||
Parameter(s): | ||
0: STRING - screen ID, will be used in BIS_fnc_endLoadingScreen | ||
1 (Optional): STRING - loading screen layout | ||
Returns: | ||
BOOL - true when registered | ||
*/ | ||
disableserialization; | ||
with uinamespace do { | ||
private ["_id","_rsc","_ids"]; | ||
_id = _this param [0,"",[""]]; | ||
_text = _this param [1,"",[""]]; | ||
_rsc = _this param [2,"",[""]]; | ||
_ids = missionnamespace getvariable ["BIS_fnc_startLoadingScreen_ids",[]]; | ||
|
||
if !(_id in _ids) then { | ||
//--- Array has to be adjusted before loading screen starts, otherwise the rest of the script can be delayed | ||
_ids set [count _ids,_id]; | ||
missionnamespace setvariable ["BIS_fnc_startLoadingScreen_ids",_ids]; | ||
startloadingscreen [_text,_rsc]; | ||
progressloadingscreen (uinamespace getvariable ["BIS_fnc_progressloadingscreen_progress",0]); | ||
//["Start '%1' loading screen for %2",_id,profilename] call bis_fnc_logFormat; | ||
true | ||
} else { | ||
//["Loading screen '%1' already started.",_id] call bis_fnc_error; | ||
false | ||
}; | ||
}; |