Minor UX tweaks

This commit is contained in:
SilentSpike 2015-07-19 22:30:44 +01:00
parent e95186f550
commit cc9283ed96
2 changed files with 11 additions and 6 deletions

View File

@ -140,11 +140,11 @@ switch (toLower _mode) do {
case "onmousezchanged": { case "onmousezchanged": {
_args params ["_ctrl","_zChange"]; _args params ["_ctrl","_zChange"];
// Scroll to change zoom, modifier for focus // Scroll to change speed, modifier for zoom
if (GVAR(ctrlKey)) then { if (GVAR(ctrlKey)) then {
GVAR(camFocus) = (GVAR(camFocus) + _zChange) max 0; GVAR(camZoom) = ((GVAR(camZoom) + _zChange * 0.1) max 0.01) min 2;
} else { } else {
GVAR(camZoom) = ((GVAR(camZoom) + (_zChange * 0.1)) max 0.01) min 2; GVAR(camSpeed) = (GVAR(camSpeed) + _zChange * 0.2) max 0.05;
}; };
}; };
case "onmousemoving": { case "onmousemoving": {

View File

@ -20,16 +20,21 @@ private ["_display","_elements","_show"];
disableSerialization; disableSerialization;
_display = GETUVAR(GVAR(display),displayNull); _display = GETUVAR(GVAR(display),displayNull);
_elements = [IDC_COMP,IDC_HELP,IDC_MAP,IDC_TOOL,IDC_UNIT]; _elements = [IDC_COMP,IDC_TOOL,IDC_UNIT];
_show = [GVAR(showComp),GVAR(showHelp),GVAR(showMap),GVAR(showTool),GVAR(showUnit)]; _show = [GVAR(showComp),GVAR(showTool),GVAR(showUnit)];
// Hide/show interface elements as appropriate // Hide/show interface elements as appropriate
if (GVAR(showInterface)) then { if (GVAR(showInterface)) then {
// Hide while map is open to prevent active element weirdness
{ {
(_display displayCtrl _x) ctrlShow (_show select _forEachIndex); (_display displayCtrl _x) ctrlShow ([(_show select _forEachIndex),false] select GVAR(showMap));
} forEach _elements; } forEach _elements;
} else { } else {
{ {
(_display displayCtrl _x) ctrlShow GVAR(showInterface); (_display displayCtrl _x) ctrlShow GVAR(showInterface);
} forEach _elements; } forEach _elements;
}; };
// Map and help operate seperate from interface
(_display displayCtrl IDC_HELP) ctrlShow GVAR(showHelp);
(_display displayCtrl IDC_MAP) ctrlShow GVAR(showMap);