-
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 #451 from CBATeam/optional-file-for-repository-set…
…tings add template for a settings file inside a pbo
- Loading branch information
Showing
7 changed files
with
61 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
x\cba\addons\static_settings_addon |
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,9 @@ | ||
|
||
// do nothing if auto loaded settings file is present | ||
if (isClass (configFile >> "CfgPatches" >> "cba_auto_load_settings_file")) exitWith {}; | ||
|
||
private _source = ["client", "server"] select (isMultiplayer && isServer); | ||
private _file = loadFile PATH_SETTINGS_FILE_PBO; | ||
|
||
[_file, _source] call EFUNC(settings,import); | ||
diag_log text "[CBA] (settings): Settings file loaded from PBO."; |
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 static_settings_addon | ||
#include "\x\cba\addons\main\script_mod.hpp" | ||
|
||
//#define DEBUG_ENABLED_STATIC_SETTINGS_ADDON | ||
|
||
#ifdef DEBUG_ENABLED_STATIC_SETTINGS_ADDON | ||
#define DEBUG_MODE_FULL | ||
#endif | ||
|
||
#ifdef DEBUG_SETTINGS_STATIC_SETTINGS_ADDON | ||
#define DEBUG_SETTINGS DEBUG_SETTINGS_STATIC_SETTINGS_ADDON | ||
#endif | ||
|
||
#include "\x\cba\addons\main\script_macros.hpp" | ||
|
||
#define PATH_SETTINGS_FILE_PBO QPATHTOF(userconfig\cba\settings.sqf) |
Empty file.