From b6ff45e8bdd735445ae4f00744fa451cde83330b Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Tue, 21 Jul 2015 17:10:04 +0100 Subject: [PATCH] Add vision mode to toolbar --- addons/spectator/UI/interface.hpp | 6 +++--- addons/spectator/functions/fnc_handleToolbar.sqf | 8 ++++---- addons/spectator/script_component.hpp | 2 +- addons/spectator/stringtable.xml | 11 ++++++++++- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/addons/spectator/UI/interface.hpp b/addons/spectator/UI/interface.hpp index fa5df2ec03..39d1351bd5 100644 --- a/addons/spectator/UI/interface.hpp +++ b/addons/spectator/UI/interface.hpp @@ -127,11 +127,11 @@ class GVAR(interface) { idc = -1; style = 64; }; - class depthTool: viewTool { - idc = IDC_TOOL_DEPTH; + class visionTool: viewTool { + idc = IDC_TOOL_VISION; x = safeZoneW - TOOL_W * 2 - MARGIN; }; - class depthFrame: depthTool { + class visionFrame: visionTool { idc = -1; style = 64; }; diff --git a/addons/spectator/functions/fnc_handleToolbar.sqf b/addons/spectator/functions/fnc_handleToolbar.sqf index cab499a100..aed3941f5c 100644 --- a/addons/spectator/functions/fnc_handleToolbar.sqf +++ b/addons/spectator/functions/fnc_handleToolbar.sqf @@ -28,17 +28,17 @@ GVAR(camera) camCommit 0; // Reduce overhead when toolbar is hidden if !(ctrlShown (_display displayCtrl IDC_TOOL)) exitWith {}; -private ["_name","_depth","_fov","_speed","_mode","_time","_toolbar"]; +private ["_name","_vision","_fov","_speed","_mode","_time","_toolbar"]; _toolbar = _display displayCtrl IDC_TOOL; // Find all tool values if (GVAR(camMode) == 0) then { - _depth = format ["%1 m", floor(getPosASL GVAR(camera) select 2)]; + _vision = if (GVAR(camVision) >= 0) then {localize LSTRING(VisionThermal)} else { [localize LSTRING(VisionNight), localize LSTRING(VisionNormal)] select (GVAR(camVision) < -1) }; _fov = format ["%1x", floor(GVAR(camZoom) * 100) * 0.01]; _name = localize "STR_VOICE_MASK_NONE"; _speed = format ["%1 m/s", floor(GVAR(camSpeed) * 100) * 0.01]; } else { - _depth = format ["%1 m", floor(getPosASL GVAR(camUnit) select 2)]; + _vision = 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)) max 0]; @@ -49,7 +49,7 @@ _time = [daytime,"HH:MM"] call BIS_fnc_timeToString; // Update the UI tools (_toolbar controlsGroupCtrl IDC_TOOL_CLOCK) ctrlSetText _time; -(_toolbar controlsGroupCtrl IDC_TOOL_DEPTH) ctrlSetText _depth; +(_toolbar controlsGroupCtrl IDC_TOOL_VISION) ctrlSetText _vision; (_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 f0eab25ec8..27c7bda7c7 100644 --- a/addons/spectator/script_component.hpp +++ b/addons/spectator/script_component.hpp @@ -40,11 +40,11 @@ #define IDC_TOOL 3000 #define IDC_TOOL_CLOCK 3003 -#define IDC_TOOL_DEPTH 3004 #define IDC_TOOL_FOV 3005 #define IDC_TOOL_NAME 3001 #define IDC_TOOL_SPEED 3006 #define IDC_TOOL_VIEW 3002 +#define IDC_TOOL_VISION 3004 #define IDC_UNIT 6002 diff --git a/addons/spectator/stringtable.xml b/addons/spectator/stringtable.xml index b3df0501fe..9970f2f2e2 100644 --- a/addons/spectator/stringtable.xml +++ b/addons/spectator/stringtable.xml @@ -74,7 +74,7 @@ Night vision - Thermal Imaging + Thermal imaging @@ -90,6 +90,15 @@ External + + Normal + + + Night + + + Thermal +