-
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.
- Loading branch information
Showing
54 changed files
with
2,176 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
class Extended_PreInit_EventHandlers | ||
{ | ||
class ADDON | ||
{ | ||
clientInit = QUOTE(call COMPILE_FILE(XEH_preClientInit)); | ||
|
||
class Extended_PreInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preInit)); | ||
}; | ||
}; | ||
|
||
class Extended_DisplayLoad_EventHandlers { | ||
class RscDisplayConfigure { | ||
ADDON = QUOTE(_this call COMPILE_FILE(XEH_configureDisplayLoad)); | ||
}; | ||
}; |
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
addons/keybinding/XEH_preClientInit.sqf → addons/keybinding/XEH_preInit.sqf
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
Empty 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
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\settings |
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,54 @@ | ||
|
||
class CBA_Setting_Boolean_base { | ||
type = "BOOLEAN"; | ||
displayName = ""; | ||
tooltip = ""; | ||
defaultValue = 0; | ||
}; | ||
|
||
class CBA_Setting_List_base { | ||
type = "LIST"; | ||
displayName = ""; | ||
tooltip = ""; | ||
values[] = {0,1}; | ||
//valueNames[] = {"disabled","enabled"}; | ||
defaultIndex = 0; | ||
}; | ||
|
||
class CBA_Setting_Slider_base { | ||
type = "SLIDER"; | ||
displayName = ""; | ||
tooltip = ""; | ||
min = 0; | ||
max = 100; | ||
defaultValue = 50; | ||
}; | ||
|
||
class CBA_Setting_Slider_2_base: CBA_Setting_Slider_base { | ||
min = 0; | ||
max = 1; | ||
defaultValue = 0.5; | ||
trailingDecimals = 2; | ||
}; | ||
|
||
class CBA_Setting_Color_base { | ||
type = "COLOR"; | ||
displayName = ""; | ||
tooltip = ""; | ||
defaultValue[] = {1,1,1}; | ||
}; | ||
|
||
class CBA_Setting_Color_Alpha_base: CBA_Setting_Color_base { | ||
defaultValue[] = {1,1,1,1}; | ||
}; | ||
|
||
class CBA_Settings { | ||
class CBA { | ||
displayName = "CBA"; | ||
class CBA_TEST1: CBA_Setting_List_base {}; | ||
class CBA_TEST2: CBA_Setting_Boolean_base {}; | ||
class CBA_TEST3: CBA_Setting_Slider_base {}; | ||
class CBA_TEST_C: CBA_Setting_Color_base { displayName = "Test Setting Color"; }; | ||
class CBA_TEST_A: CBA_Setting_Color_Alpha_base { displayName = "Test Setting Color Alpha"; }; | ||
}; | ||
}; |
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,25 @@ | ||
|
||
class Cfg3DEN { | ||
class Mission { | ||
class Scenario { | ||
class AttributeCategories { | ||
class Presentation { // any existing | ||
class Attributes { | ||
class BriefingName; | ||
class Author; // needed, to put blank space at the end. for looks | ||
class GVAR(missionSettings) { | ||
property = QGVAR(missionSettings); | ||
value = 0; | ||
control = "Default"; // blank space. not editable by hand | ||
displayName = ""; | ||
tooltip = ""; | ||
defaultValue = "[]"; | ||
expression = QUOTE(missionNamespace setVariable [ARR_3(QUOTE(QGVAR(3denSettings)),_value,true)]); | ||
wikiType = "[[Array]]"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; |
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,27 @@ | ||
|
||
class Extended_PreStart_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preStart)); | ||
}; | ||
}; | ||
|
||
class Extended_PreInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preInit)); | ||
}; | ||
}; | ||
|
||
class Extended_PostInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_postInit)); | ||
}; | ||
}; | ||
|
||
class Extended_DisplayLoad_EventHandlers { | ||
class RscDisplayGameOptions { | ||
ADDON = QUOTE(_this call COMPILE_FILE(gui\gui_initDisplay)); | ||
}; | ||
class Display3DEN { | ||
ADDON = QUOTE(_this call COMPILE_FILE(init_3den)); | ||
}; | ||
}; |
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,10 @@ | ||
|
||
#define F_FILEPATH(func) class func {\ | ||
file = QUOTE(PATHTOF(DOUBLES(fnc,func).sqf));\ | ||
} | ||
|
||
class CfgFunctions { | ||
class CBA { | ||
class Settings {}; | ||
}; | ||
}; |
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,18 @@ | ||
|
||
PREP(init); | ||
PREP(set); | ||
PREP(get); | ||
PREP(check); | ||
PREP(parse); | ||
PREP(import); | ||
PREP(export); | ||
PREP(clear); | ||
PREP(saveTempData); | ||
PREP(isForced); | ||
PREP(isOverwritten); | ||
PREP(create); | ||
|
||
PREP(gui_addonChanged); | ||
PREP(gui_sourceChanged); | ||
PREP(gui_configure); | ||
PREP(gui_closeMenu); |
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 @@ | ||
#include "script_component.hpp" | ||
SCRIPT(XEH_postInit); | ||
|
||
// refresh all settings after postInit to guarantee that events are added | ||
{ | ||
{ | ||
[QGVAR(refreshSetting), _x] call CBA_fnc_localEvent; | ||
} forEach GVAR(allSettings); | ||
} call CBA_fnc_execNextFrame; |
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,52 @@ | ||
#include "script_component.hpp" | ||
SCRIPT(XEH_preInit); | ||
|
||
ADDON = false; | ||
|
||
#include "XEH_PREP.sqf" | ||
|
||
call FUNC(init); | ||
|
||
// event to refresh missionNamespace value if setting has changed and call public event | ||
[QGVAR(refreshSetting), { | ||
params ["_setting"]; | ||
private _value = _setting call FUNC(get); | ||
|
||
missionNamespace setVariable [_setting, _value]; | ||
["CBA_SettingChanged", [_setting, _value]] call CBA_fnc_localEvent; | ||
}] call CBA_fnc_addEventHandler; | ||
|
||
// event to refresh all settings at once - saves bandwith | ||
[QGVAR(refreshAllSettings), { | ||
{ | ||
[QGVAR(refreshSetting), _x] call CBA_fnc_globalEvent; | ||
} forEach GVAR(allSettings); | ||
}] call CBA_fnc_addEventHandler; | ||
|
||
#ifdef DEBUG_MODE_FULL | ||
["CBA_SettingChanged", { | ||
params ["_setting", "_value"]; | ||
|
||
private _message = format ["[CBA] (settings): %1 = %2", _setting, _value]; | ||
systemChat _message; | ||
diag_log text _message; | ||
}] call CBA_fnc_addEventHandler; | ||
#endif | ||
|
||
// event to modify settings on a dedicated server as admin | ||
if (isServer) then { | ||
[QGVAR(setSettingServer), { | ||
params ["_setting", "_value", "_forced"]; | ||
[_setting, _value, _forced, "server"] call FUNC(set); | ||
}] call CBA_fnc_addEventHandler; | ||
}; | ||
|
||
// import settings from file if filepatching is enabled | ||
if (isFilePatchingEnabled) then { | ||
[loadFile PATH_SETTINGS_FILE, "client"] call FUNC(import); | ||
diag_log text "[CBA] (settings): Settings file loaded."; | ||
} else { | ||
diag_log text "[CBA] (settings): Cannot load settings file. File patching disabled. Use -filePatching flag."; | ||
}; | ||
|
||
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,4 @@ | ||
#include "script_component.hpp" | ||
SCRIPT(XEH_preStart); | ||
|
||
#include "XEH_PREP.sqf" |
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,21 @@ | ||
#include "script_component.hpp" | ||
|
||
class CfgPatches { | ||
class ADDON { | ||
units[] = {}; | ||
weapons[] = {}; | ||
requiredVersion = REQUIRED_VERSION; | ||
requiredAddons[] = {"CBA_common", "A3_UI_F"}; | ||
version = VERSION; | ||
author[] = {"commy2"}; | ||
authorUrl = "https://github.com/CBATeam/CBA_A3"; | ||
}; | ||
}; | ||
|
||
#include "CfgEventHandlers.hpp" | ||
#include "CfgFunctions.hpp" | ||
|
||
#include "CBA_Settings.hpp" | ||
#include "Cfg3DEN.hpp" | ||
|
||
#include "gui\gui.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,40 @@ | ||
/* ---------------------------------------------------------------------------- | ||
Internal Function: CBA_settings_fnc_check | ||
Description: | ||
Check if provided value is valid. | ||
Parameters: | ||
_setting - Name of the setting <STRING> | ||
_value - Value of to test <ANY> | ||
Returns: | ||
All setting info. Additionally to being put into clipboard <BOOLEAN> | ||
Author: | ||
commy2 | ||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
|
||
params [["_setting", "", [""]], "_value"]; | ||
|
||
if (isNil "_value") exitWith {false}; | ||
|
||
(GVAR(defaultSettings) getVariable _setting) params ["_defaultValue", "", "_settingType", "_values"]; | ||
|
||
switch (toUpper _settingType) do { | ||
case ("BOOLEAN"): { | ||
_value isEqualType false | ||
}; | ||
case ("LIST"): { | ||
_value in _values | ||
}; | ||
case ("SLIDER"): { | ||
_values params ["_min", "_max"]; | ||
_value isEqualType 0 && {_value >= _min} && {_value <= _max} | ||
}; | ||
case ("COLOR"): { | ||
_value isEqualType [] && {count _value == count _defaultValue} && {{_x < 0 || _x > 1} count _value == 0} | ||
}; | ||
default {false}; | ||
}; |
Oops, something went wrong.