Skip to content

Commit 0819605

Browse files
committed
Added loading of CBA config
1 parent 9b88cd3 commit 0819605

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

arma3/@task_force_radio/addons/task_force_radio/CfgFunctions.h

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class CfgFunctions
66
{
77
file="task_force_radio\functions";
88
class TaskForceArrowheadRadioInit{postInit = 1;};
9+
class PreInit{preInit = 1;};
910
class ServerInit;
1011
class ClientInit;
1112
// A
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
Name: TFAR_fnc_PreInit
3+
4+
Author(s):
5+
Dedmen
6+
7+
Description:
8+
Initialises CBA_Settings component
9+
10+
Parameters:
11+
Nothing
12+
13+
Returns:
14+
Nothing
15+
16+
Example:
17+
Called by ArmA via functions library.
18+
*/
19+
20+
21+
// frame after preInit, but before postInit (from https://github.com/CBATeam/CBA_A3/blob/master/template/static_settings_addon/XEH_preInit.sqf)
22+
0 spawn {
23+
{
24+
// do nothing if CBA auto_load_settings_file is enabled
25+
if (isClass (configFile >> "CfgPatches" >> "cba_auto_load_settings_file")) exitWith {};
26+
27+
private _info = loadFile "userconfig\cba\settings.sqf";
28+
29+
_info = _info call CBA_settings_fnc_parse;
30+
31+
{
32+
_x params ["_setting", "_value", "_force"];
33+
[_setting, _value, _force, "server"] call CBA_settings_fnc_set;
34+
} forEach _info;
35+
} call CBA_fnc_directCall;
36+
};

0 commit comments

Comments
 (0)