mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
0ae940fdfb
Gut keybind stuff, redo data arrays, reset button, progress on color changer.
94 lines
2.7 KiB
Plaintext
94 lines
2.7 KiB
Plaintext
/**
|
|
* fnc_settingsMenuUpdateKeyView.sqf
|
|
* @Descr: N/A
|
|
* @Author: Glowbal
|
|
*
|
|
* @Arguments: []
|
|
* @Return:
|
|
* @PublicAPI: false
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
private ["_setting","_ctrlList","_collection","_settingsMenu", "_keybinding","_keyCode","_shiftPressed","_altPressed","_ctrlPressed"];
|
|
disableSerialization;
|
|
|
|
_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu';
|
|
_ctrlList = _settingsMenu displayCtrl 200;
|
|
|
|
_collection = switch (GVAR(optionMenu_openTab)) do {
|
|
case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)};
|
|
default {[]};
|
|
};
|
|
|
|
if (count _collection > 0) then {
|
|
_selectedSetting = (lbCurSel _ctrlList);
|
|
if (_selectedSetting > (count _collection)) then {
|
|
_selectedSetting = count _collection - 1;
|
|
};
|
|
|
|
if (_selectedSetting < 0) exitwith {
|
|
_selectedSetting = 0;
|
|
};
|
|
_setting = _collection select _selectedSetting;
|
|
|
|
_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;
|
|
|
|
switch (GVAR(optionMenu_openTab)) do {
|
|
case (MENU_TAB_OPTIONS): {
|
|
_possibleValues = _setting select 3;
|
|
_settingsValue = _setting select 4;
|
|
lbClear 400;
|
|
_settingsText = (_possibleValues select _settingsValue); // expecting: value [[any, TEXT (DESCRIPTION)]]
|
|
(_settingsMenu displayCtrl 300) ctrlSetText _entryName;
|
|
{
|
|
lbAdd [400, _x];
|
|
} foreach _possibleValues;
|
|
|
|
(_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
// if (GVAR(optionMenu_openTab) != MENU_TAB_OPTIONS) then {
|
|
// _keybinding = _setting select 1;
|
|
|
|
// _keyCode = _keybinding select 0;
|
|
// _shiftPressed = _keybinding select 1;
|
|
// _ctrlPressed = _keybinding select 2;
|
|
// _altPressed = _keybinding select 3;
|
|
|
|
// _keyBindingText = keyName _keyCode;
|
|
// if (_keyBindingText == '""') then {
|
|
// _keyBindingText = "No key assigned";
|
|
// };
|
|
// (_settingsMenu displayCtrl 300) ctrlSetText ("Key: " + _keyBindingText);
|
|
|
|
// lbClear 400;
|
|
// lbadd [400, "No"];
|
|
// lbadd [400, "Yes"];
|
|
// lbadd [400, "Ignore"];
|
|
// (_settingsMenu displayCtrl 400) lbSetCurSel _shiftPressed;
|
|
// (_settingsMenu displayCtrl 401) lbSetCurSel _ctrlPressed;
|
|
// (_settingsMenu displayCtrl 402) lbSetCurSel _altPressed;
|
|
// } else {
|
|
// _possibleValues = _setting select 1;
|
|
// _settingsValue = _setting select 2;
|
|
|
|
// lbClear 400;
|
|
|
|
// _settingsText = (_possibleValues select _settingsValue); // expecting: value [[any, TEXT (DESCRIPTION)]]
|
|
// (_settingsMenu displayCtrl 300) ctrlSetText ("Setting: " + _settingsText);
|
|
// {
|
|
// lbAdd [400, _x];
|
|
// } foreach _possibleValues;
|
|
|
|
// (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue;
|
|
// };
|
|
}; |