mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Use proper lnbXXX commands
This commit is contained in:
parent
bdca10eac4
commit
a908863317
@ -16,14 +16,14 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_settingsMenu", "_settingIndex", "_rightDropDownIndex"];
|
private ["_settingIndex", "_rightDropDownIndex"];
|
||||||
|
|
||||||
_rightDropDownIndex = lbCurSel 400; //Index of right drop down
|
_rightDropDownIndex = lbCurSel 400; //Index of right drop down
|
||||||
if (_rightDropDownIndex < 0) then {_rightDropDownIndex = 0;};
|
if (_rightDropDownIndex < 0) then {_rightDropDownIndex = 0;};
|
||||||
|
|
||||||
_settingIndex = -1;
|
_settingIndex = -1;
|
||||||
if (((lbCurSel 200) >= 0) && {(lbCurSel 200) < ((lbSize 200)/2)}) then {
|
if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then {
|
||||||
_settingIndex = lbValue [200, (lbCurSel 200)];
|
_settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]];
|
||||||
};
|
};
|
||||||
if (_settingIndex == -1) exitWith {};
|
if (_settingIndex == -1) exitWith {};
|
||||||
|
|
||||||
|
@ -23,4 +23,4 @@ _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu';
|
|||||||
_ctrlComboBox = (_settingsMenu displayCtrl 14);
|
_ctrlComboBox = (_settingsMenu displayCtrl 14);
|
||||||
GVAR(currentCategorySelection) = lbCurSel _ctrlComboBox;
|
GVAR(currentCategorySelection) = lbCurSel _ctrlComboBox;
|
||||||
|
|
||||||
[false] call FUNC(serverSettingsMenuUpdateList);
|
[true] call FUNC(serverSettingsMenuUpdateList);
|
||||||
|
@ -21,8 +21,8 @@ private ["_settingIndex", "_inputText", "_setting", "_settingName", "_convertedV
|
|||||||
_inputText = ctrlText 414; //Index of right drop down
|
_inputText = ctrlText 414; //Index of right drop down
|
||||||
|
|
||||||
_settingIndex = -1;
|
_settingIndex = -1;
|
||||||
if (((lbCurSel 200) >= 0) && {(lbCurSel 200) < ((lbSize 200)/2)}) then {
|
if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then {
|
||||||
_settingIndex = lbValue [200, (lbCurSel 200)];
|
_settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]];
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (GVAR(optionMenu_openTab)) do {
|
switch (GVAR(optionMenu_openTab)) do {
|
||||||
|
@ -16,11 +16,11 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_newColor", "_settingIndex", "_settingsMenu"];
|
private ["_newColor", "_settingIndex"];
|
||||||
|
|
||||||
_settingIndex = -1;
|
_settingIndex = -1;
|
||||||
if (((lbCurSel 200) >= 0) && {(lbCurSel 200) < ((lbSize 200)/2)}) then {
|
if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then {
|
||||||
_settingIndex = lbValue [200, (lbCurSel 200)];
|
_settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]];
|
||||||
};
|
};
|
||||||
if (_settingIndex == -1) exitWith {};
|
if (_settingIndex == -1) exitWith {};
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ private ["_name", "_default", "_lastSelected"];
|
|||||||
[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 = lnbCurSelRow 200;
|
||||||
[GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged);
|
[GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged);
|
||||||
if (_lastSelected != -1) then {
|
if (_lastSelected != -1) then {
|
||||||
lbSetCurSel [200, _lastSelected];
|
lnbSetCurSelRow [200, _lastSelected];
|
||||||
};
|
};
|
||||||
|
@ -36,7 +36,7 @@ private ["_name", "_default", "_lastSelected"];
|
|||||||
[MENU_TAB_SERVER_VALUES, _name, _default] call FUNC(updateSetting);
|
[MENU_TAB_SERVER_VALUES, _name, _default] call FUNC(updateSetting);
|
||||||
} forEach GVAR(serverSideVakyes);
|
} forEach GVAR(serverSideVakyes);
|
||||||
|
|
||||||
_lastSelected = lbCurSel 200;
|
_lastSelected = lnbCurSelRow 200;
|
||||||
[GVAR(optionMenu_openTab)] call FUNC(onserverListBoxShowSelectionChanged);
|
[GVAR(optionMenu_openTab)] call FUNC(onserverListBoxShowSelectionChanged);
|
||||||
if (_lastSelected != -1) then {
|
if (_lastSelected != -1) then {
|
||||||
lbSetCurSel [200, _lastSelected];
|
lbSetCurSel [200, _lastSelected];
|
||||||
|
@ -16,11 +16,10 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor", "_expectedType", "_filteredCollection", "_selectedCategory"];
|
private ["_settingsMenu", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor", "_expectedType"];
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
|
|
||||||
_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu';
|
_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu';
|
||||||
_ctrlList = _settingsMenu displayCtrl 200;
|
|
||||||
|
|
||||||
_collection = switch (GVAR(optionMenu_openTab)) do {
|
_collection = switch (GVAR(optionMenu_openTab)) do {
|
||||||
case MENU_TAB_SERVER_OPTIONS: {GVAR(serverSideOptions)};
|
case MENU_TAB_SERVER_OPTIONS: {GVAR(serverSideOptions)};
|
||||||
@ -30,8 +29,8 @@ _collection = switch (GVAR(optionMenu_openTab)) do {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_settingIndex = -1;
|
_settingIndex = -1;
|
||||||
if (((lbCurSel _ctrlList) >= 0) && {(lbCurSel _ctrlList) < ((lbSize _ctrlList)/2)}) then {
|
if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then {
|
||||||
_settingIndex = _ctrlList lbValue (lbCurSel _ctrlList);
|
_settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]];
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then {
|
if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then {
|
||||||
|
@ -16,14 +16,14 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"];
|
private ["_settingName", "_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"];
|
||||||
DEFAULT_PARAM(0,_updateKeyView,true);
|
DEFAULT_PARAM(0,_updateKeyView,true);
|
||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu';
|
_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu';
|
||||||
_ctrlList = _settingsMenu displayCtrl 200;
|
_ctrlList = _settingsMenu displayCtrl 200;
|
||||||
|
|
||||||
lbclear _ctrlList;
|
lnbClear _ctrlList;
|
||||||
|
|
||||||
_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection);
|
_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection);
|
||||||
|
|
||||||
@ -32,10 +32,10 @@ switch (GVAR(optionMenu_openTab)) do {
|
|||||||
case (MENU_TAB_SERVER_OPTIONS): {
|
case (MENU_TAB_SERVER_OPTIONS): {
|
||||||
{
|
{
|
||||||
if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then {
|
if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then {
|
||||||
if ((_x select 3) != "") then {
|
_settingName = if ((_x select 3) != "") then {
|
||||||
_ctrlList lbadd (_x select 3);
|
(_x select 3);
|
||||||
} else {
|
} else {
|
||||||
_ctrlList lbadd (_x select 0);
|
(_x select 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
_settingsValue = _x select 9;
|
_settingsValue = _x select 9;
|
||||||
@ -47,10 +47,8 @@ switch (GVAR(optionMenu_openTab)) do {
|
|||||||
(_x select 5) select _settingsValue;
|
(_x select 5) select _settingsValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
_ctrlList lbadd (_settingsText);
|
_added = _ctrlList lnbAddRow [_settingName, _settingsText];
|
||||||
|
_ctrlList lnbSetValue [[_added, 0], _forEachIndex];
|
||||||
_ctrlList lbSetValue [_added, _forEachIndex];
|
|
||||||
_added = _added + 1;
|
|
||||||
};
|
};
|
||||||
}foreach GVAR(serverSideOptions);
|
}foreach GVAR(serverSideOptions);
|
||||||
};
|
};
|
||||||
@ -62,35 +60,32 @@ switch (GVAR(optionMenu_openTab)) do {
|
|||||||
_color set [_forEachIndex, ((round (_x * 100))/100)];
|
_color set [_forEachIndex, ((round (_x * 100))/100)];
|
||||||
} forEach _color;
|
} forEach _color;
|
||||||
_settingsColor = str _color;
|
_settingsColor = str _color;
|
||||||
if ((_x select 3) != "") then {
|
_settingName = if ((_x select 3) != "") then {
|
||||||
_ctrlList lbadd (_x select 3);
|
(_x select 3);
|
||||||
} else {
|
} else {
|
||||||
_ctrlList lbadd (_x select 0);
|
(_x select 0);
|
||||||
};
|
};
|
||||||
_ctrlList lbadd (_settingsColor);
|
|
||||||
|
_added = _ctrlList lnbAddRow [_settingName, _settingsColor];
|
||||||
_ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 9)];
|
_ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 9)];
|
||||||
|
_ctrlList lnbSetValue [[_added, 0], _forEachIndex];
|
||||||
_ctrlList lbSetValue [_added, _forEachIndex];
|
|
||||||
_added = _added + 1;
|
|
||||||
};
|
};
|
||||||
}foreach GVAR(serverSideColors);
|
}foreach GVAR(serverSideColors);
|
||||||
};
|
};
|
||||||
case (MENU_TAB_SERVER_VALUES): {
|
case (MENU_TAB_SERVER_VALUES): {
|
||||||
{
|
{
|
||||||
if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then {
|
if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then {
|
||||||
if ((_x select 3) != "") then {
|
_settingName = if ((_x select 3) != "") then {
|
||||||
_ctrlList lbadd (_x select 3);
|
(_x select 3);
|
||||||
} else {
|
} else {
|
||||||
_ctrlList lbadd (_x select 0);
|
(_x select 0);
|
||||||
};
|
};
|
||||||
_settingsValue = _x select 9;
|
_settingsValue = _x select 9;
|
||||||
if (typeName _settingsValue != "STRING") then {
|
if (typeName _settingsValue != "STRING") then {
|
||||||
_settingsValue = format["%1", _settingsValue];
|
_settingsValue = format["%1", _settingsValue];
|
||||||
};
|
};
|
||||||
_ctrlList lbadd (_settingsValue);
|
_added = _ctrlList lnbAddRow [_settingName, _settingsValue];
|
||||||
|
_ctrlList lnbSetValue [[_added, 0], _forEachIndex];
|
||||||
_ctrlList lbSetValue [_added, _forEachIndex];
|
|
||||||
_added = _added + 1;
|
|
||||||
};
|
};
|
||||||
}foreach GVAR(serverSideValues);
|
}foreach GVAR(serverSideValues);
|
||||||
};
|
};
|
||||||
|
@ -29,12 +29,10 @@ _collection = switch (GVAR(optionMenu_openTab)) do {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_settingIndex = -1;
|
_settingIndex = -1;
|
||||||
if (((lbCurSel _ctrlList) >= 0) && {(lbCurSel _ctrlList) < ((lbSize _ctrlList)/2)}) then {
|
if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then {
|
||||||
_settingIndex = _ctrlList lbValue (lbCurSel _ctrlList);
|
_settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]];
|
||||||
};
|
};
|
||||||
|
|
||||||
TRACE_3("Selected",_settingIndex,(lbCurSel _ctrlList),((lbSize _ctrlList)/2));
|
|
||||||
|
|
||||||
if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then {
|
if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then {
|
||||||
_setting = _collection select _settingIndex;
|
_setting = _collection select _settingIndex;
|
||||||
|
|
||||||
|
@ -16,23 +16,22 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"];
|
private ["_settingName", "_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"];
|
||||||
DEFAULT_PARAM(0,_updateKeyView,true);
|
DEFAULT_PARAM(0,_updateKeyView,true);
|
||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu';
|
_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu';
|
||||||
_ctrlList = _settingsMenu displayCtrl 200;
|
_ctrlList = _settingsMenu displayCtrl 200;
|
||||||
|
|
||||||
lbclear _ctrlList;
|
lnbClear _ctrlList;
|
||||||
|
|
||||||
_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection);
|
_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection);
|
||||||
|
|
||||||
_added = 0;
|
|
||||||
switch (GVAR(optionMenu_openTab)) do {
|
switch (GVAR(optionMenu_openTab)) do {
|
||||||
case (MENU_TAB_OPTIONS): {
|
case (MENU_TAB_OPTIONS): {
|
||||||
{
|
{
|
||||||
if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then {
|
if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then {
|
||||||
_ctrlList lbadd (_x select 3);
|
_settingName = (_x select 3);
|
||||||
_settingsValue = _x select 9;
|
_settingsValue = _x select 9;
|
||||||
|
|
||||||
// Created disable/enable options for bools
|
// Created disable/enable options for bools
|
||||||
@ -41,10 +40,8 @@ switch (GVAR(optionMenu_openTab)) do {
|
|||||||
} else {
|
} else {
|
||||||
(_x select 5) select _settingsValue;
|
(_x select 5) select _settingsValue;
|
||||||
};
|
};
|
||||||
_ctrlList lbadd (_settingsText);
|
_added = _ctrlList lnbAddRow [_settingName, _settingsText];
|
||||||
|
_ctrlList lnbSetValue [[_added, 0], _forEachIndex];
|
||||||
_ctrlList lbSetValue [_added, _forEachIndex];
|
|
||||||
_added = _added + 1;
|
|
||||||
};
|
};
|
||||||
} foreach GVAR(clientSideOptions);
|
} foreach GVAR(clientSideOptions);
|
||||||
};
|
};
|
||||||
@ -56,12 +53,11 @@ switch (GVAR(optionMenu_openTab)) do {
|
|||||||
_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 3);
|
_settingName = (_x select 3);
|
||||||
_ctrlList lbadd (_settingsColor);
|
|
||||||
|
_added = _ctrlList lnbAddRow [_settingName, _settingsColor];
|
||||||
_ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 9)];
|
_ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 9)];
|
||||||
|
_ctrlList lnbSetValue [[_added, 0], _forEachIndex];
|
||||||
_ctrlList lbSetValue [_added, _forEachIndex];
|
|
||||||
_added = _added + 1;
|
|
||||||
};
|
};
|
||||||
}foreach GVAR(clientSideColors);
|
}foreach GVAR(clientSideColors);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user