-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #450 from CBATeam/optional-file-to-load-userconfig…
…-settings add optional pbo to load settings from userconfig file
- Loading branch information
Showing
7 changed files
with
69 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
x\cba\addons\auto_load_settings_file |
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,6 @@ | ||
|
||
class Extended_PreInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preInit)); | ||
}; | ||
}; |
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,12 @@ | ||
#include "script_component.hpp" | ||
|
||
ADDON = false; | ||
|
||
// frame after preInit, but before postInit | ||
0 spawn { | ||
{ | ||
#include "loadSettingsFile.sqf" | ||
} call CBA_fnc_directCall; | ||
}; | ||
|
||
ADDON = true; |
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,17 @@ | ||
#include "script_component.hpp" | ||
|
||
class CfgPatches { | ||
class ADDON { | ||
author = "$STR_CBA_Author"; | ||
name = ECSTRING(settings,component); | ||
url = "$STR_CBA_URL"; | ||
units[] = {}; | ||
weapons[] = {}; | ||
requiredVersion = REQUIRED_VERSION; | ||
requiredAddons[] = {"cba_settings"}; | ||
version = VERSION; | ||
authors[] = {"commy2"}; | ||
}; | ||
}; | ||
|
||
#include "CfgEventHandlers.hpp" |
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,14 @@ | ||
|
||
if (isFilePatchingEnabled) then { | ||
private _source = ["client", "server"] select (isMultiplayer && isServer); | ||
private _file = loadFile PATH_SETTINGS_FILE; | ||
|
||
if (_file != "") then { | ||
[_file, _source] call EFUNC(settings,import); | ||
diag_log text "[CBA] (settings): Settings file loaded."; | ||
} else { | ||
diag_log text "[CBA] (settings): Settings file not loaded. File empty or does not exist."; | ||
}; | ||
} else { | ||
diag_log text "[CBA] (settings): Cannot load settings file. File patching disabled. Use -filePatching flag."; | ||
}; |
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,16 @@ | ||
#define COMPONENT auto_load_settings_file | ||
#include "\x\cba\addons\main\script_mod.hpp" | ||
|
||
//#define DEBUG_ENABLED_AUTO_LOAD_SETTINGS_FILE | ||
|
||
#ifdef DEBUG_ENABLED_AUTO_LOAD_SETTINGS_FILE | ||
#define DEBUG_MODE_FULL | ||
#endif | ||
|
||
#ifdef DEBUG_SETTINGS_AUTO_LOAD_SETTINGS_FILE | ||
#define DEBUG_SETTINGS DEBUG_SETTINGS_AUTO_LOAD_SETTINGS_FILE | ||
#endif | ||
|
||
#include "\x\cba\addons\main\script_macros.hpp" | ||
|
||
#define PATH_SETTINGS_FILE "userconfig\cba\settings.sqf" |