2015-03-06 17:15:32 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
2015-03-14 18:10:25 +00:00
|
|
|
* Updates the right half of the option menu for the currently selected option.
|
2015-03-06 17:15:32 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2015-03-14 18:10:25 +00:00
|
|
|
* None
|
2015-03-06 17:15:32 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-03-14 18:10:25 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [] call ACE_optionsmenu_fnc_settingsMenuUpdateKeyView
|
2015-03-06 17:15:32 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-01-21 11:43:58 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-01-21 22:27:53 +00:00
|
|
|
private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor"];
|
2015-01-21 11:43:58 +00:00
|
|
|
disableSerialization;
|
|
|
|
|
|
|
|
_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu';
|
|
|
|
_ctrlList = _settingsMenu displayCtrl 200;
|
|
|
|
|
|
|
|
_collection = switch (GVAR(optionMenu_openTab)) do {
|
2015-03-06 17:15:32 +00:00
|
|
|
case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)};
|
|
|
|
case MENU_TAB_COLORS: {GVAR(clientSideColors)};
|
|
|
|
default {[]};
|
2015-01-21 11:43:58 +00:00
|
|
|
};
|
|
|
|
|
2015-08-07 20:08:52 +00:00
|
|
|
_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection);
|
|
|
|
_filteredCollection = [];
|
|
|
|
{
|
|
|
|
if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then {
|
|
|
|
_filteredCollection pushBack _x;
|
|
|
|
};
|
|
|
|
} forEach _collection;
|
|
|
|
|
|
|
|
if (count _filteredCollection > 0) then {
|
2015-03-06 17:15:32 +00:00
|
|
|
_settingIndex = (lbCurSel _ctrlList);
|
2015-08-07 20:08:52 +00:00
|
|
|
if (_settingIndex > (count _filteredCollection)) then {
|
|
|
|
_settingIndex = count _filteredCollection - 1;
|
2015-03-06 17:15:32 +00:00
|
|
|
};
|
2015-01-21 11:43:58 +00:00
|
|
|
|
2015-03-06 17:15:32 +00:00
|
|
|
if (_settingIndex < 0) then {
|
|
|
|
_settingIndex = 0;
|
|
|
|
};
|
2015-08-07 20:08:52 +00:00
|
|
|
_setting = _filteredCollection select _settingIndex;
|
2015-08-07 19:14:45 +00:00
|
|
|
|
2015-03-06 17:15:32 +00:00
|
|
|
_entryName = _setting select 0;
|
|
|
|
_localizedName = _setting select 3;
|
|
|
|
_localizedDescription = _setting select 4;
|
2015-01-21 11:43:58 +00:00
|
|
|
|
2015-03-06 17:15:32 +00:00
|
|
|
if (_localizedName == "") then {_localizedName = _entryName;};
|
|
|
|
(_settingsMenu displayCtrl 250) ctrlSetText _localizedName;
|
|
|
|
(_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription;
|
|
|
|
(_settingsMenu displayCtrl 300) ctrlSetText _entryName;
|
2015-01-21 11:43:58 +00:00
|
|
|
|
2015-03-06 17:15:32 +00:00
|
|
|
switch (GVAR(optionMenu_openTab)) do {
|
|
|
|
case (MENU_TAB_OPTIONS): {
|
|
|
|
_possibleValues = _setting select 5;
|
2015-08-07 19:14:45 +00:00
|
|
|
_settingsValue = _setting select 9;
|
2015-01-21 22:27:53 +00:00
|
|
|
|
2015-03-06 17:15:32 +00:00
|
|
|
// Created disable/enable options for bools
|
|
|
|
if ((_setting select 1) == "BOOL") then {
|
|
|
|
lbClear 400;
|
2015-08-08 16:02:20 +00:00
|
|
|
lbAdd [400, (localize ELSTRING(common,No))];
|
|
|
|
lbAdd [400, (localize ELSTRING(common,Yes))];
|
2015-03-06 17:15:32 +00:00
|
|
|
_settingsValue = [0, 1] select _settingsValue;
|
|
|
|
} else {
|
|
|
|
lbClear 400;
|
|
|
|
{ lbAdd [400, _x]; } foreach _possibleValues;
|
|
|
|
};
|
|
|
|
(_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue;
|
|
|
|
};
|
|
|
|
case (MENU_TAB_COLORS): {
|
2015-08-07 19:14:45 +00:00
|
|
|
_currentColor = _setting select 9;
|
2015-03-06 17:15:32 +00:00
|
|
|
{
|
|
|
|
sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))];
|
|
|
|
} forEach [410, 411, 412, 413];
|
|
|
|
};
|
2015-01-21 22:27:53 +00:00
|
|
|
};
|
2015-01-21 22:00:54 +00:00
|
|
|
} else { //no settings in list:
|
2015-03-06 17:15:32 +00:00
|
|
|
lbClear 400;
|
|
|
|
(_settingsMenu displayCtrl 250) ctrlSetText "No settings available";
|
|
|
|
(_settingsMenu displayCtrl 251) ctrlSetText "No settings available";
|
|
|
|
(_settingsMenu displayCtrl 300) ctrlSetText "No settings available";
|
2015-01-21 22:00:54 +00:00
|
|
|
};
|