Formating

This commit is contained in:
PabstMirror 2015-01-21 16:27:53 -06:00
parent a595b48d32
commit fe4a0b9be8
12 changed files with 154 additions and 159 deletions

View File

@ -1,7 +1,7 @@
class Extended_PreInit_EventHandlers { class Extended_PreInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit)); init = QUOTE(call COMPILE_FILE(XEH_preInit));
}; };
}; };
class Extended_PostInit_EventHandlers { class Extended_PostInit_EventHandlers {

View File

@ -1,23 +1,23 @@
#include "script_component.hpp" #include "script_component.hpp"
class CfgPatches { class CfgPatches {
class ADDON { class ADDON {
units[] = {}; units[] = {};
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"}; requiredAddons[] = {"ace_common"};
author[] = {"Combat Space Enhancement"}; author[] = {"Combat Space Enhancement"};
authorUrl = "http://csemod.com"; authorUrl = "http://csemod.com";
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
class CfgAddons { class CfgAddons {
class PreloadAddons { class PreloadAddons {
class ADDON { class ADDON {
list[] = {QUOTE(ADDON)}; list[] = {QUOTE(ADDON)};
}; };
}; };
}; };
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"

View File

@ -9,6 +9,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_currentValue"];
PARAMS_4(_name,_localizedName,_localizedDescription,_defaultValue); PARAMS_4(_name,_localizedName,_localizedDescription,_defaultValue);
GVAR(clientSideColors) pushBack [_name, _localizedName, _localizedDescription, [], _defaultValue]; GVAR(clientSideColors) pushBack [_name, _localizedName, _localizedDescription, [], _defaultValue];

View File

@ -9,6 +9,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_currentValue"];
PARAMS_5(_name,_localizedName,_localizedDescription,_possibleValues,_defaultValue); PARAMS_5(_name,_localizedName,_localizedDescription,_possibleValues,_defaultValue);
GVAR(clientSideOptions) pushBack [_name, _localizedName, _localizedDescription, _possibleValues, -1, _defaultValue]; GVAR(clientSideOptions) pushBack [_name, _localizedName, _localizedDescription, _possibleValues, -1, _defaultValue];

View File

@ -1,15 +1,15 @@
/** /**
* fnc_loadFromProfile.sqf * fnc_loadFromProfile.sqf
* @Descr: N/A * @Descr: N/A
* @Author: Glowbal * @Author: Glowbal
* *
* @Arguments: [] * @Arguments: []
* @Return: * @Return:
* @PublicAPI: false * @PublicAPI: false
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_settingValue"]; private ["_typeString", "_settingValue", "_badData"];
PARAMS_3(_type,_name,_default); PARAMS_3(_type,_name,_default);
_typeString = ""; _typeString = "";
@ -22,10 +22,10 @@ _settingValue = profileNamespace getvariable [(format ["ace_%1_%2", _typeString,
_badData = isNil "_settingValue"; _badData = isNil "_settingValue";
if (!_badData) then { if (!_badData) then {
switch (_type) do { switch (_type) do {
case (MENU_TAB_OPTIONS): {_badData = ((typeName _settingValue) != (typeName 0));}; case (MENU_TAB_OPTIONS): {_badData = ((typeName _settingValue) != (typeName 0));};
case (MENU_TAB_COLORS): {_badData = (((typeName _settingValue) != (typeName [])) || {(count _settingValue) != 4});}; case (MENU_TAB_COLORS): {_badData = (((typeName _settingValue) != (typeName [])) || {(count _settingValue) != 4});};
}; };
}; };
if (_badData) then { if (_badData) then {
_settingValue = _default; _settingValue = _default;

View File

@ -9,10 +9,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_settingsMenu", "_rightDropDownIndex", "_onChangeCode", "_settingIndex", "_settingIndex"]; private ["_settingIndex", "_rightDropDownIndex"];
disableSerialization;
_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu';
_settingIndex = lbCurSel 200; //Index of left list _settingIndex = lbCurSel 200; //Index of left list
_rightDropDownIndex = lbCurSel 400; //Index of right drop down _rightDropDownIndex = lbCurSel 400; //Index of right drop down
@ -21,10 +18,10 @@ if (_rightDropDownIndex < 0) then {_rightDropDownIndex = 0;};
switch (GVAR(optionMenu_openTab)) do { switch (GVAR(optionMenu_openTab)) do {
case (MENU_TAB_OPTIONS): { case (MENU_TAB_OPTIONS): {
if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideOptions)))) then { if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideOptions)))) then {
_settingIndex = (GVAR(clientSideOptions) select _settingIndex) select 0; _settingIndex = (GVAR(clientSideOptions) select _settingIndex) select 0;
[MENU_TAB_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); [MENU_TAB_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting);
}; };
[false] call FUNC(settingsMenuUpdateList); [false] call FUNC(settingsMenuUpdateList);
}; };
}; };

View File

@ -10,19 +10,20 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_newColor", "_settingIndex"]; private ["_newColor", "_settingIndex"];
_newColor = []; _newColor = [];
{ {
_newColor pushBack ((sliderPosition _x) / 255); _newColor pushBack ((sliderPosition _x) / 255);
} forEach [410, 411, 412, 413]; } forEach [410, 411, 412, 413];
_settingIndex = lbCurSel 200; _settingIndex = lbCurSel 200;
switch (GVAR(optionMenu_openTab)) do { switch (GVAR(optionMenu_openTab)) do {
case (MENU_TAB_COLORS): { case (MENU_TAB_COLORS): {
if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then {
_settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0;
[MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); [MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting);
}; };
[false] call FUNC(settingsMenuUpdateList); [false] call FUNC(settingsMenuUpdateList);
}; };
}; };

View File

@ -9,23 +9,22 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_type", "_collection", "_default", "_lastSelected"]; private ["_name", "_default", "_lastSelected"];
{ {
_name = _x select 0; _name = _x select 0;
_default = _x select 5; _default = _x select 5;
[MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting);
} forEach GVAR(clientSideOptions); } forEach GVAR(clientSideOptions);
{ {
_name = _x select 0; _name = _x select 0;
_default = _x select 4; _default = _x select 4;
[MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting);
} forEach GVAR(clientSideColors); } forEach GVAR(clientSideColors);
_lastSelected = lbCurSel 200; _lastSelected = lbCurSel 200;
[GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged); [GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged);
if (_lastSelected != -1) then { if (_lastSelected != -1) then {
lbSetCurSel [200, _lastSelected]; lbSetCurSel [200, _lastSelected];
}; };

View File

@ -12,25 +12,26 @@
private ["_nameSelected", "_saved"]; private ["_nameSelected", "_saved"];
PARAMS_2(_type,_name); PARAMS_2(_type,_name);
_saved = false;
switch (_type) do { switch (_type) do {
case (MENU_TAB_OPTIONS): { case (MENU_TAB_OPTIONS): {
{ {
_nameSelected = _x select 0; _nameSelected = _x select 0;
if (_nameSelected == _name) exitwith { if (_nameSelected == _name) exitwith {
profileNamespace setvariable [(format ["ace_option_%1", _name]), (_x select 4)]; profileNamespace setvariable [(format ["ace_option_%1", _name]), (_x select 4)];
_saved = true; _saved = true;
}; };
}foreach GVAR(clientSideOptions); }foreach GVAR(clientSideOptions);
}; };
case (MENU_TAB_COLORS): { case (MENU_TAB_COLORS): {
{ {
_nameSelected = _x select 0; _nameSelected = _x select 0;
if (_nameSelected == _name) exitwith { if (_nameSelected == _name) exitwith {
profileNamespace setvariable [(format ["ace_color_%1", _name]), (_x select 3)]; profileNamespace setvariable [(format ["ace_color_%1", _name]), (_x select 3)];
_saved = true; _saved = true;
}; };
}foreach GVAR(clientSideColors); }foreach GVAR(clientSideColors);
}; };
}; };
_saved _saved

View File

@ -9,7 +9,7 @@
*/ */
#include "script_component.hpp" #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; disableSerialization;
_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu';
@ -18,50 +18,48 @@ _ctrlList = _settingsMenu displayCtrl 200;
_collection = switch (GVAR(optionMenu_openTab)) do { _collection = switch (GVAR(optionMenu_openTab)) do {
case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)}; case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)};
case MENU_TAB_COLORS: {GVAR(clientSideColors)}; case MENU_TAB_COLORS: {GVAR(clientSideColors)};
default {[]}; default {[]};
}; };
if (count _collection > 0) then { if (count _collection > 0) then {
_settingIndex = (lbCurSel _ctrlList); _settingIndex = (lbCurSel _ctrlList);
if (_settingIndex > (count _collection)) then { if (_settingIndex > (count _collection)) then {
_settingIndex = count _collection - 1; _settingIndex = count _collection - 1;
}; };
if (_settingIndex < 0) exitwith { if (_settingIndex < 0) exitwith {
_settingIndex = 0; _settingIndex = 0;
}; };
_setting = _collection select _settingIndex; _setting = _collection select _settingIndex;
_entryName = _setting select 0; _entryName = _setting select 0;
_localizedName = _setting select 1; _localizedName = _setting select 1;
_localizedDescription = _setting select 2; _localizedDescription = _setting select 2;
if (_localizedName == "") then {_localizedName = _entryName;};
(_settingsMenu displayCtrl 250) ctrlSetText _localizedName;
(_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription;
(_settingsMenu displayCtrl 300) ctrlSetText _entryName;
if (_localizedName == "") then {_localizedName = _entryName;};
(_settingsMenu displayCtrl 250) ctrlSetText _localizedName;
switch (GVAR(optionMenu_openTab)) do { (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription;
case (MENU_TAB_OPTIONS): { (_settingsMenu displayCtrl 300) ctrlSetText _entryName;
_possibleValues = _setting select 3;
_settingsValue = _setting select 4;
lbClear 400;
{ lbAdd [400, _x]; } foreach _possibleValues;
(_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; switch (GVAR(optionMenu_openTab)) do {
}; case (MENU_TAB_OPTIONS): {
case (MENU_TAB_COLORS): { _possibleValues = _setting select 3;
_currentColor = _setting select 3; _settingsValue = _setting select 4;
{ lbClear 400;
sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; { lbAdd [400, _x]; } foreach _possibleValues;
} forEach [410, 411, 412, 413];
}; (_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: } else { //no settings in list:
lbClear 400; lbClear 400;
(_settingsMenu displayCtrl 250) ctrlSetText _localizedName; (_settingsMenu displayCtrl 250) ctrlSetText _localizedName;
(_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription;
(_settingsMenu displayCtrl 300) ctrlSetText _entryName; (_settingsMenu displayCtrl 300) ctrlSetText _entryName;
}; };

View File

@ -9,37 +9,35 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_settingsMenu","_ctrlList","_collection","_keyBindingText","_keybinding", "_updateKeyView"]; private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView"];
disableSerialization; DEFAULT_PARAM(0,_updateKeyView,true);
_updateKeyView = [_this, 0, true, [true]] call BIS_fnc_Param; disableSerialization
_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu';
_ctrlList = _settingsMenu displayCtrl 200; _ctrlList = _settingsMenu displayCtrl 200;
lbclear _ctrlList; lbclear _ctrlList;
switch (GVAR(optionMenu_openTab)) do { switch (GVAR(optionMenu_openTab)) do {
case (MENU_TAB_OPTIONS): { case (MENU_TAB_OPTIONS): {
{ {
_settingsText = ((_x select 3) select (_x select 4)); _settingsText = ((_x select 3) select (_x select 4));
_ctrlList lbadd (_x select 1); _ctrlList lbadd (_x select 1);
_ctrlList lbadd (_settingsText); _ctrlList lbadd (_settingsText);
}foreach GVAR(clientSideOptions); }foreach GVAR(clientSideOptions);
}; };
case (MENU_TAB_COLORS): { case (MENU_TAB_COLORS): {
{ {
_color = +(_x select 3); _color = +(_x select 3);
{ {
_color set [_forEachIndex, ((round (_x * 100))/100)]; _color set [_forEachIndex, ((round (_x * 100))/100)];
} forEach _color; } forEach _color;
_settingsColor = str _color;
_settingsColor = str _color; _ctrlList lbadd (_x select 1);
_ctrlList lbadd (_x select 1); _ctrlList lbadd (_settingsColor);
_ctrlList lbadd (_settingsColor); _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 3)];
_ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 3)]; }foreach GVAR(clientSideColors);
}foreach GVAR(clientSideColors); };
};
}; };
if (_updateKeyView) then { if (_updateKeyView) then {
[] call FUNC(settingsMenuUpdateKeyView); [] call FUNC(settingsMenuUpdateKeyView);
}; };

View File

@ -9,36 +9,35 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_3(_type,_name,_newValue);
private ["_changed"]; private ["_changed"];
PARAMS_3(_type,_name,_newValue);
_changed = false; _changed = false;
switch (_type) do { switch (_type) do {
case (MENU_TAB_OPTIONS): { case (MENU_TAB_OPTIONS): {
{ {
if ((_x select 0) == _name) then { if ((_x select 0) == _name) then {
if (!((_x select 4) isEqualTo _newValue)) then { if (!((_x select 4) isEqualTo _newValue)) then {
_changed = true; _changed = true;
_x set [4, _newValue]; _x set [4, _newValue];
}; };
}; };
} foreach GVAR(clientSideOptions); } foreach GVAR(clientSideOptions);
}; };
case (MENU_TAB_COLORS): { case (MENU_TAB_COLORS): {
{ {
if (((_x select 0) == _name) && {!((_x select 3) isEqualTo _newValue)}) then { if (((_x select 0) == _name) && {!((_x select 3) isEqualTo _newValue)}) then {
_changed = true; _changed = true;
_x set [3, _newValue]; _x set [3, _newValue];
}; };
} foreach GVAR(clientSideColors); } foreach GVAR(clientSideColors);
}; };
}; };
if (_changed) then { if (_changed) then {
missionNameSpace setVariable [_name, _newValue]; missionNameSpace setVariable [_name, _newValue];
[_type, _name] call FUNC(saveToProfile); [_type, _name] call FUNC(saveToProfile);
["SettingChanged", [_name, _newValue]] call EFUNC(common,localEvent); ["SettingChanged", [_name, _newValue]] call EFUNC(common,localEvent);
TRACE_2("Variable Updated",_name,_newValue); TRACE_2("Variable Updated",_name,_newValue);
}; };