mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Formating
This commit is contained in:
parent
a595b48d32
commit
fe4a0b9be8
@ -1,7 +1,7 @@
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
|
@ -1,23 +1,23 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"Combat Space Enhancement"};
|
||||
authorUrl = "http://csemod.com";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"Combat Space Enhancement"};
|
||||
authorUrl = "http://csemod.com";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
class CfgAddons {
|
||||
class PreloadAddons {
|
||||
class ADDON {
|
||||
list[] = {QUOTE(ADDON)};
|
||||
};
|
||||
};
|
||||
class PreloadAddons {
|
||||
class ADDON {
|
||||
list[] = {QUOTE(ADDON)};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
|
@ -9,6 +9,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_currentValue"];
|
||||
PARAMS_4(_name,_localizedName,_localizedDescription,_defaultValue);
|
||||
|
||||
GVAR(clientSideColors) pushBack [_name, _localizedName, _localizedDescription, [], _defaultValue];
|
||||
|
@ -9,6 +9,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_currentValue"];
|
||||
PARAMS_5(_name,_localizedName,_localizedDescription,_possibleValues,_defaultValue);
|
||||
|
||||
GVAR(clientSideOptions) pushBack [_name, _localizedName, _localizedDescription, _possibleValues, -1, _defaultValue];
|
||||
|
@ -1,15 +1,15 @@
|
||||
/**
|
||||
* fnc_loadFromProfile.sqf
|
||||
* @Descr: N/A
|
||||
* @Author: Glowbal
|
||||
*
|
||||
* @Arguments: []
|
||||
* @Return:
|
||||
* @PublicAPI: false
|
||||
*/
|
||||
* fnc_loadFromProfile.sqf
|
||||
* @Descr: N/A
|
||||
* @Author: Glowbal
|
||||
*
|
||||
* @Arguments: []
|
||||
* @Return:
|
||||
* @PublicAPI: false
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_settingValue"];
|
||||
private ["_typeString", "_settingValue", "_badData"];
|
||||
PARAMS_3(_type,_name,_default);
|
||||
|
||||
_typeString = "";
|
||||
@ -22,10 +22,10 @@ _settingValue = profileNamespace getvariable [(format ["ace_%1_%2", _typeString,
|
||||
|
||||
_badData = isNil "_settingValue";
|
||||
if (!_badData) then {
|
||||
switch (_type) do {
|
||||
case (MENU_TAB_OPTIONS): {_badData = ((typeName _settingValue) != (typeName 0));};
|
||||
case (MENU_TAB_COLORS): {_badData = (((typeName _settingValue) != (typeName [])) || {(count _settingValue) != 4});};
|
||||
};
|
||||
switch (_type) do {
|
||||
case (MENU_TAB_OPTIONS): {_badData = ((typeName _settingValue) != (typeName 0));};
|
||||
case (MENU_TAB_COLORS): {_badData = (((typeName _settingValue) != (typeName [])) || {(count _settingValue) != 4});};
|
||||
};
|
||||
};
|
||||
if (_badData) then {
|
||||
_settingValue = _default;
|
||||
|
@ -9,10 +9,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_settingsMenu", "_rightDropDownIndex", "_onChangeCode", "_settingIndex", "_settingIndex"];
|
||||
disableSerialization;
|
||||
_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu';
|
||||
|
||||
private ["_settingIndex", "_rightDropDownIndex"];
|
||||
|
||||
_settingIndex = lbCurSel 200; //Index of left list
|
||||
_rightDropDownIndex = lbCurSel 400; //Index of right drop down
|
||||
@ -21,10 +18,10 @@ if (_rightDropDownIndex < 0) then {_rightDropDownIndex = 0;};
|
||||
|
||||
switch (GVAR(optionMenu_openTab)) do {
|
||||
case (MENU_TAB_OPTIONS): {
|
||||
if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideOptions)))) then {
|
||||
_settingIndex = (GVAR(clientSideOptions) select _settingIndex) select 0;
|
||||
[MENU_TAB_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting);
|
||||
};
|
||||
[false] call FUNC(settingsMenuUpdateList);
|
||||
};
|
||||
if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideOptions)))) then {
|
||||
_settingIndex = (GVAR(clientSideOptions) select _settingIndex) select 0;
|
||||
[MENU_TAB_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting);
|
||||
};
|
||||
[false] call FUNC(settingsMenuUpdateList);
|
||||
};
|
||||
};
|
||||
|
@ -10,19 +10,20 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_newColor", "_settingIndex"];
|
||||
|
||||
_newColor = [];
|
||||
{
|
||||
_newColor pushBack ((sliderPosition _x) / 255);
|
||||
_newColor pushBack ((sliderPosition _x) / 255);
|
||||
} forEach [410, 411, 412, 413];
|
||||
|
||||
_settingIndex = lbCurSel 200;
|
||||
|
||||
switch (GVAR(optionMenu_openTab)) do {
|
||||
case (MENU_TAB_COLORS): {
|
||||
if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then {
|
||||
_settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0;
|
||||
[MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting);
|
||||
};
|
||||
[false] call FUNC(settingsMenuUpdateList);
|
||||
};
|
||||
if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then {
|
||||
_settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0;
|
||||
[MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting);
|
||||
};
|
||||
[false] call FUNC(settingsMenuUpdateList);
|
||||
};
|
||||
};
|
||||
|
@ -9,23 +9,22 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_type", "_collection", "_default", "_lastSelected"];
|
||||
|
||||
private ["_name", "_default", "_lastSelected"];
|
||||
|
||||
{
|
||||
_name = _x select 0;
|
||||
_default = _x select 5;
|
||||
[MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting);
|
||||
} forEach GVAR(clientSideOptions);
|
||||
_name = _x select 0;
|
||||
_default = _x select 5;
|
||||
[MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting);
|
||||
} forEach GVAR(clientSideOptions);
|
||||
|
||||
{
|
||||
_name = _x select 0;
|
||||
_default = _x select 4;
|
||||
[MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting);
|
||||
_name = _x select 0;
|
||||
_default = _x select 4;
|
||||
[MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting);
|
||||
} forEach GVAR(clientSideColors);
|
||||
|
||||
_lastSelected = lbCurSel 200;
|
||||
[GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged);
|
||||
if (_lastSelected != -1) then {
|
||||
lbSetCurSel [200, _lastSelected];
|
||||
lbSetCurSel [200, _lastSelected];
|
||||
};
|
||||
|
@ -12,25 +12,26 @@
|
||||
private ["_nameSelected", "_saved"];
|
||||
PARAMS_2(_type,_name);
|
||||
|
||||
_saved = false;
|
||||
switch (_type) do {
|
||||
case (MENU_TAB_OPTIONS): {
|
||||
{
|
||||
_nameSelected = _x select 0;
|
||||
if (_nameSelected == _name) exitwith {
|
||||
profileNamespace setvariable [(format ["ace_option_%1", _name]), (_x select 4)];
|
||||
_saved = true;
|
||||
};
|
||||
}foreach GVAR(clientSideOptions);
|
||||
};
|
||||
{
|
||||
_nameSelected = _x select 0;
|
||||
if (_nameSelected == _name) exitwith {
|
||||
profileNamespace setvariable [(format ["ace_option_%1", _name]), (_x select 4)];
|
||||
_saved = true;
|
||||
};
|
||||
}foreach GVAR(clientSideOptions);
|
||||
};
|
||||
case (MENU_TAB_COLORS): {
|
||||
{
|
||||
_nameSelected = _x select 0;
|
||||
if (_nameSelected == _name) exitwith {
|
||||
profileNamespace setvariable [(format ["ace_color_%1", _name]), (_x select 3)];
|
||||
_saved = true;
|
||||
};
|
||||
}foreach GVAR(clientSideColors);
|
||||
};
|
||||
{
|
||||
_nameSelected = _x select 0;
|
||||
if (_nameSelected == _name) exitwith {
|
||||
profileNamespace setvariable [(format ["ace_color_%1", _name]), (_x select 3)];
|
||||
_saved = true;
|
||||
};
|
||||
}foreach GVAR(clientSideColors);
|
||||
};
|
||||
};
|
||||
|
||||
_saved
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_setting","_ctrlList","_collection","_settingsMenu", "_keybinding","_keyCode","_shiftPressed","_altPressed","_ctrlPressed"];
|
||||
private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor"];
|
||||
disableSerialization;
|
||||
|
||||
_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu';
|
||||
@ -18,50 +18,48 @@ _ctrlList = _settingsMenu displayCtrl 200;
|
||||
_collection = switch (GVAR(optionMenu_openTab)) do {
|
||||
case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)};
|
||||
case MENU_TAB_COLORS: {GVAR(clientSideColors)};
|
||||
default {[]};
|
||||
default {[]};
|
||||
};
|
||||
|
||||
if (count _collection > 0) then {
|
||||
_settingIndex = (lbCurSel _ctrlList);
|
||||
if (_settingIndex > (count _collection)) then {
|
||||
_settingIndex = count _collection - 1;
|
||||
};
|
||||
_settingIndex = (lbCurSel _ctrlList);
|
||||
if (_settingIndex > (count _collection)) then {
|
||||
_settingIndex = count _collection - 1;
|
||||
};
|
||||
|
||||
if (_settingIndex < 0) exitwith {
|
||||
_settingIndex = 0;
|
||||
};
|
||||
_setting = _collection select _settingIndex;
|
||||
if (_settingIndex < 0) exitwith {
|
||||
_settingIndex = 0;
|
||||
};
|
||||
_setting = _collection select _settingIndex;
|
||||
|
||||
_entryName = _setting select 0;
|
||||
_localizedName = _setting select 1;
|
||||
_localizedDescription = _setting select 2;
|
||||
|
||||
if (_localizedName == "") then {_localizedName = _entryName;};
|
||||
(_settingsMenu displayCtrl 250) ctrlSetText _localizedName;
|
||||
(_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription;
|
||||
(_settingsMenu displayCtrl 300) ctrlSetText _entryName;
|
||||
_entryName = _setting select 0;
|
||||
_localizedName = _setting select 1;
|
||||
_localizedDescription = _setting select 2;
|
||||
|
||||
|
||||
|
||||
switch (GVAR(optionMenu_openTab)) do {
|
||||
case (MENU_TAB_OPTIONS): {
|
||||
_possibleValues = _setting select 3;
|
||||
_settingsValue = _setting select 4;
|
||||
lbClear 400;
|
||||
{ lbAdd [400, _x]; } foreach _possibleValues;
|
||||
if (_localizedName == "") then {_localizedName = _entryName;};
|
||||
(_settingsMenu displayCtrl 250) ctrlSetText _localizedName;
|
||||
(_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription;
|
||||
(_settingsMenu displayCtrl 300) ctrlSetText _entryName;
|
||||
|
||||
(_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue;
|
||||
};
|
||||
case (MENU_TAB_COLORS): {
|
||||
_currentColor = _setting select 3;
|
||||
{
|
||||
sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))];
|
||||
} forEach [410, 411, 412, 413];
|
||||
};
|
||||
};
|
||||
switch (GVAR(optionMenu_openTab)) do {
|
||||
case (MENU_TAB_OPTIONS): {
|
||||
_possibleValues = _setting select 3;
|
||||
_settingsValue = _setting select 4;
|
||||
lbClear 400;
|
||||
{ lbAdd [400, _x]; } foreach _possibleValues;
|
||||
|
||||
(_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue;
|
||||
};
|
||||
case (MENU_TAB_COLORS): {
|
||||
_currentColor = _setting select 3;
|
||||
{
|
||||
sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))];
|
||||
} forEach [410, 411, 412, 413];
|
||||
};
|
||||
};
|
||||
} else { //no settings in list:
|
||||
lbClear 400;
|
||||
(_settingsMenu displayCtrl 250) ctrlSetText _localizedName;
|
||||
(_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription;
|
||||
(_settingsMenu displayCtrl 300) ctrlSetText _entryName;
|
||||
lbClear 400;
|
||||
(_settingsMenu displayCtrl 250) ctrlSetText _localizedName;
|
||||
(_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription;
|
||||
(_settingsMenu displayCtrl 300) ctrlSetText _entryName;
|
||||
};
|
||||
|
@ -9,37 +9,35 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_settingsMenu","_ctrlList","_collection","_keyBindingText","_keybinding", "_updateKeyView"];
|
||||
disableSerialization;
|
||||
private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView"];
|
||||
DEFAULT_PARAM(0,_updateKeyView,true);
|
||||
|
||||
_updateKeyView = [_this, 0, true, [true]] call BIS_fnc_Param;
|
||||
|
||||
_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu';
|
||||
disableSerialization
|
||||
_ctrlList = _settingsMenu displayCtrl 200;
|
||||
|
||||
lbclear _ctrlList;
|
||||
|
||||
switch (GVAR(optionMenu_openTab)) do {
|
||||
case (MENU_TAB_OPTIONS): {
|
||||
{
|
||||
_settingsText = ((_x select 3) select (_x select 4));
|
||||
_ctrlList lbadd (_x select 1);
|
||||
_ctrlList lbadd (_settingsText);
|
||||
}foreach GVAR(clientSideOptions);
|
||||
};
|
||||
{
|
||||
_settingsText = ((_x select 3) select (_x select 4));
|
||||
_ctrlList lbadd (_x select 1);
|
||||
_ctrlList lbadd (_settingsText);
|
||||
}foreach GVAR(clientSideOptions);
|
||||
};
|
||||
case (MENU_TAB_COLORS): {
|
||||
{
|
||||
_color = +(_x select 3);
|
||||
{
|
||||
_color set [_forEachIndex, ((round (_x * 100))/100)];
|
||||
} forEach _color;
|
||||
|
||||
_settingsColor = str _color;
|
||||
_ctrlList lbadd (_x select 1);
|
||||
_ctrlList lbadd (_settingsColor);
|
||||
_ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 3)];
|
||||
}foreach GVAR(clientSideColors);
|
||||
};
|
||||
{
|
||||
_color = +(_x select 3);
|
||||
{
|
||||
_color set [_forEachIndex, ((round (_x * 100))/100)];
|
||||
} forEach _color;
|
||||
_settingsColor = str _color;
|
||||
_ctrlList lbadd (_x select 1);
|
||||
_ctrlList lbadd (_settingsColor);
|
||||
_ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 3)];
|
||||
}foreach GVAR(clientSideColors);
|
||||
};
|
||||
};
|
||||
if (_updateKeyView) then {
|
||||
[] call FUNC(settingsMenuUpdateKeyView);
|
||||
};
|
||||
[] call FUNC(settingsMenuUpdateKeyView);
|
||||
};
|
||||
|
@ -9,36 +9,35 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_type,_name,_newValue);
|
||||
|
||||
private ["_changed"];
|
||||
PARAMS_3(_type,_name,_newValue);
|
||||
|
||||
_changed = false;
|
||||
|
||||
switch (_type) do {
|
||||
case (MENU_TAB_OPTIONS): {
|
||||
{
|
||||
if ((_x select 0) == _name) then {
|
||||
if (!((_x select 4) isEqualTo _newValue)) then {
|
||||
_changed = true;
|
||||
_x set [4, _newValue];
|
||||
};
|
||||
};
|
||||
} foreach GVAR(clientSideOptions);
|
||||
};
|
||||
{
|
||||
if ((_x select 0) == _name) then {
|
||||
if (!((_x select 4) isEqualTo _newValue)) then {
|
||||
_changed = true;
|
||||
_x set [4, _newValue];
|
||||
};
|
||||
};
|
||||
} foreach GVAR(clientSideOptions);
|
||||
};
|
||||
case (MENU_TAB_COLORS): {
|
||||
{
|
||||
if (((_x select 0) == _name) && {!((_x select 3) isEqualTo _newValue)}) then {
|
||||
_changed = true;
|
||||
_x set [3, _newValue];
|
||||
};
|
||||
} foreach GVAR(clientSideColors);
|
||||
};
|
||||
{
|
||||
if (((_x select 0) == _name) && {!((_x select 3) isEqualTo _newValue)}) then {
|
||||
_changed = true;
|
||||
_x set [3, _newValue];
|
||||
};
|
||||
} foreach GVAR(clientSideColors);
|
||||
};
|
||||
};
|
||||
|
||||
if (_changed) then {
|
||||
missionNameSpace setVariable [_name, _newValue];
|
||||
[_type, _name] call FUNC(saveToProfile);
|
||||
["SettingChanged", [_name, _newValue]] call EFUNC(common,localEvent);
|
||||
TRACE_2("Variable Updated",_name,_newValue);
|
||||
missionNameSpace setVariable [_name, _newValue];
|
||||
[_type, _name] call FUNC(saveToProfile);
|
||||
["SettingChanged", [_name, _newValue]] call EFUNC(common,localEvent);
|
||||
TRACE_2("Variable Updated",_name,_newValue);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user