Add vision mode to toolbar

This commit is contained in:
SilentSpike 2015-07-21 17:10:04 +01:00
parent 1890bc1d59
commit b6ff45e8bd
4 changed files with 18 additions and 9 deletions

View File

@ -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;
};

View File

@ -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;

View File

@ -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

View File

@ -74,7 +74,7 @@
<English>Night vision</English>
</Key>
<Key ID="STR_ACE_Spectator_visions_ti">
<English>Thermal Imaging</English>
<English>Thermal imaging</English>
</Key>
<!-- Interface strings -->
@ -90,6 +90,15 @@
<Key ID="STR_ACE_Spectator_ViewExternal">
<English>External</English>
</Key>
<Key ID="STR_ACE_Spectator_VisionNormal">
<English>Normal</English>
</Key>
<Key ID="STR_ACE_Spectator_VisionNight">
<English>Night</English>
</Key>
<Key ID="STR_ACE_Spectator_VisionThermal">
<English>Thermal</English>
</Key>
<!-- Keybinds -->
<Key ID="STR_ACE_Spectator_keyCamMoveForward">