Some fixes

This commit is contained in:
PabstMirror 2015-08-07 15:08:52 -05:00
parent d125b9ad9c
commit a3a481f96d
5 changed files with 24 additions and 22 deletions

View File

@ -2,6 +2,7 @@
#include "script_component.hpp"
["SettingsInitialized", {
GVAR(categories) pushback ""; //Ensure All Catagories is at top
{
if !(_x select 8 in GVAR(categories)) then {
GVAR(categories) pushback (_x select 8);

View File

@ -59,3 +59,7 @@ if (GVAR(serverConfigGeneration) == 0) then {
};
(_menu displayCtrl 14) lbAdd _x;
} forEach GVAR(categories);
(_menu displayCtrl 14) lbSetCurSel 0; //All Catagoies

View File

@ -28,27 +28,24 @@ _collection = switch (GVAR(optionMenu_openTab)) do {
default {[]};
};
if (count _collection > 0) then {
_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection);
_filteredCollection = [];
{
if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then {
_filteredCollection pushBack _x;
};
} forEach _collection;
if (count _filteredCollection > 0) then {
_settingIndex = (lbCurSel _ctrlList);
if (_settingIndex > (count _collection)) then {
_settingIndex = count _collection - 1;
if (_settingIndex > (count _filteredCollection)) then {
_settingIndex = count _filteredCollection - 1;
};
if (_settingIndex < 0) then {
_settingIndex = 0;
};
diag_log format["_collection: %1", _collection];
_setting = _collection select _settingIndex;
_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection);
if !(_selectedCategory == "All Categories" || _selectedCategory == (_setting select 8)) exitwith {
systemChat format["INCORRECT CATEGORY: %1 != %2", _selectedCategory, _setting];
diag_log format["INCORRECT CATEGORY: %1 != %2", _selectedCategory, _setting];
lbClear 400;
(_settingsMenu displayCtrl 250) ctrlSetText "No settings available";
(_settingsMenu displayCtrl 251) ctrlSetText "No settings available";
(_settingsMenu displayCtrl 300) ctrlSetText "No settings available";
};
_setting = _filteredCollection select _settingIndex;
_entryName = _setting select 0;
_localizedName = _setting select 3;

View File

@ -30,7 +30,7 @@ _selectedCategory = GVAR(categories) select GVAR(currentCategorySelection);
switch (GVAR(optionMenu_openTab)) do {
case (MENU_TAB_OPTIONS): {
{
if (_selectedCategory == "All Categories" || _selectedCategory == (_X select 8)) then {
if (_selectedCategory == "" || _selectedCategory == (_X select 8)) then {
_ctrlList lbadd (_x select 3);
_settingsValue = _x select 9;
@ -46,7 +46,7 @@ switch (GVAR(optionMenu_openTab)) do {
};
case (MENU_TAB_COLORS): {
{
if (_selectedCategory == "All Categories" || _selectedCategory == (_X select 8)) then {
if (_selectedCategory == "" || _selectedCategory == (_X select 8)) then {
_color = +(_x select 9);
{
_color set [_forEachIndex, ((round (_x * 100))/100)];

View File

@ -34,7 +34,7 @@ switch (_type) do {
if !((_x select 9) isEqualTo _newValue) then {
_changed = true;
_x set [8, _newValue];
_x set [9, _newValue];
} ;
};
@ -44,7 +44,7 @@ switch (_type) do {
{
if (((_x select 0) == _name) && {!((_x select 9) isEqualTo _newValue)}) then {
_changed = true;
_x set [8, _newValue];
_x set [9, _newValue];
};
} foreach GVAR(clientSideColors);
};
@ -58,7 +58,7 @@ switch (_type) do {
if !((_x select 9) isEqualTo _newValue) then {
_changed = true;
_x set [8, _newValue];
_x set [9, _newValue];
} ;
};
@ -68,7 +68,7 @@ switch (_type) do {
{
if (((_x select 0) == _name) && {!((_x select 9) isEqualTo _newValue)}) then {
_changed = true;
_x set [8, _newValue];
_x set [9, _newValue];
};
} foreach GVAR(serverSideColors);
};
@ -76,7 +76,7 @@ switch (_type) do {
{
if (((_x select 0) == _name) && {!((_x select 9) isEqualTo _newValue)}) then {
_changed = true;
_x set [8, _newValue];
_x set [9, _newValue];
};
} foreach GVAR(serverSideValues);
};