From 52244c164735cb754afddecb726562b6a718c354 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 20 Jul 2015 18:13:13 +0100 Subject: [PATCH] Rejiggling toolbar --- addons/spectator/UI/interface.hpp | 24 +++++++++---------- addons/spectator/XEH_preInit.sqf | 1 - .../spectator/functions/fnc_handleToolbar.sqf | 19 ++++++--------- addons/spectator/script_component.hpp | 2 +- addons/spectator/stringtable.xml | 10 ++++++-- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/addons/spectator/UI/interface.hpp b/addons/spectator/UI/interface.hpp index 7a73454af2..029bef45d0 100644 --- a/addons/spectator/UI/interface.hpp +++ b/addons/spectator/UI/interface.hpp @@ -111,27 +111,27 @@ class GVAR(interface) { idc = -1; style = 64; }; + class fovTool: viewTool { + idc = IDC_TOOL_FOV; + x = TOOL_W * 3 + MARGIN * 2; + }; + class fovFrame: fovTool { + idc = -1; + style = 64; + }; class clockTool: viewTool { idc = IDC_TOOL_CLOCK; - x = TOOL_W * 3 + MARGIN * 2; + x = safeZoneW - TOOL_W * 3 - MARGIN * 2; }; class clockFrame: clockTool { idc = -1; style = 64; }; - class focusTool: viewTool { - idc = IDC_TOOL_FOCUS; - x = safeZoneW - TOOL_W * 3 - MARGIN * 2; - }; - class focusFrame: focusTool { - idc = -1; - style = 64; - }; - class fovTool: viewTool { - idc = IDC_TOOL_FOV; + class depthTool: viewTool { + idc = IDC_TOOL_DEPTH; x = safeZoneW - TOOL_W * 2 - MARGIN; }; - class fovFrame: fovTool { + class depthFrame: depthTool { idc = -1; style = 64; }; diff --git a/addons/spectator/XEH_preInit.sqf b/addons/spectator/XEH_preInit.sqf index 1ed8c46ad5..8c38e6786c 100644 --- a/addons/spectator/XEH_preInit.sqf +++ b/addons/spectator/XEH_preInit.sqf @@ -17,7 +17,6 @@ PREP(updateInterface); PREP(updateUnits); // Permanent variables -GVAR(camFocus) = 0; GVAR(camMode) = 0; GVAR(camPan) = 0; GVAR(camPos) = [worldSize * 0.5,worldSize * 0.5,0]; diff --git a/addons/spectator/functions/fnc_handleToolbar.sqf b/addons/spectator/functions/fnc_handleToolbar.sqf index ece6cb6464..a65f4df088 100644 --- a/addons/spectator/functions/fnc_handleToolbar.sqf +++ b/addons/spectator/functions/fnc_handleToolbar.sqf @@ -22,39 +22,34 @@ params ["_display"]; // Kill PFH when display is closed if (isNull _display) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -if (GVAR(camFocus) == 0) then { - GVAR(camera) camSetFocus [-1,-1]; -} else { - GVAR(camera) camSetFocus [GVAR(camFocus),1]; -}; GVAR(camera) camSetFov -(linearConversion [0.1,2,GVAR(camZoom),-2,-0.1,true]); GVAR(camera) camCommit 0; // Reduce overhead when toolbar is hidden if !(ctrlShown (_display displayCtrl IDC_TOOL)) exitWith {}; -private ["_name","_focus","_fov","_speed","_mode","_time","_toolbar"]; +private ["_name","_depth","_fov","_speed","_mode","_time","_toolbar"]; _toolbar = _display displayCtrl IDC_TOOL; // Find all tool values if (GVAR(camMode) == 0) then { - _focus = ["AUTO FOCUS", format ["%1 m", round GVAR(camFocus)]] select (GVAR(camFocus) > 0); + _depth = format ["%1 m", floor(getPosASL GVAR(camera) select 2)]; _fov = format ["%1x", floor(GVAR(camZoom) * 100) * 0.01]; - _name = "None"; + _name = localize "STR_VOICE_MASK_NONE"; _speed = format ["%1 m/s", GVAR(camSpeed)]; } else { - _focus = rank GVAR(camUnit); + _depth = format ["%1 m", floor(getPosASL GVAR(camUnit) select 2)]; _fov = WFSideText (group GVAR(camUnit)); _name = name GVAR(camUnit); - _speed = format ["%1 km/h", floor(speed GVAR(camUnit))]; + _speed = format ["%1 km/h", floor(speed GVAR(camUnit)) max 0]; }; -_mode = ["FREE","FIRST","THIRD"] select GVAR(camMode); +_mode = [localize LSTRING(ViewFree),localize LSTRING(ViewInternal),localize LSTRING(ViewExternal)] select GVAR(camMode); _time = [daytime,"HH:MM"] call BIS_fnc_timeToString; // Update the UI tools (_toolbar controlsGroupCtrl IDC_TOOL_CLOCK) ctrlSetText _time; -(_toolbar controlsGroupCtrl IDC_TOOL_FOCUS) ctrlSetText _focus; +(_toolbar controlsGroupCtrl IDC_TOOL_DEPTH) ctrlSetText _depth; (_toolbar controlsGroupCtrl IDC_TOOL_FOV) ctrlSetText _fov; (_toolbar controlsGroupCtrl IDC_TOOL_NAME) ctrlSetText _name; (_toolbar controlsGroupCtrl IDC_TOOL_SPEED) ctrlSetText _speed; diff --git a/addons/spectator/script_component.hpp b/addons/spectator/script_component.hpp index 7578f47c6c..f0eab25ec8 100644 --- a/addons/spectator/script_component.hpp +++ b/addons/spectator/script_component.hpp @@ -40,7 +40,7 @@ #define IDC_TOOL 3000 #define IDC_TOOL_CLOCK 3003 -#define IDC_TOOL_FOCUS 3004 +#define IDC_TOOL_DEPTH 3004 #define IDC_TOOL_FOV 3005 #define IDC_TOOL_NAME 3001 #define IDC_TOOL_SPEED 3006 diff --git a/addons/spectator/stringtable.xml b/addons/spectator/stringtable.xml index 67d5980f4d..f6840ae8df 100644 --- a/addons/spectator/stringtable.xml +++ b/addons/spectator/stringtable.xml @@ -59,8 +59,14 @@ Spectator Controls - - Random Unit + + Free + + + Internal + + + External