Rejiggling toolbar

This commit is contained in:
SilentSpike 2015-07-20 18:13:13 +01:00
parent 5af5284bee
commit 52244c1647
5 changed files with 28 additions and 28 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -59,8 +59,14 @@
<Key ID="STR_ACE_Spectator_HelpTitle">
<English>Spectator Controls</English>
</Key>
<Key ID="STR_ACE_Spectator_RandomUnit">
<English>Random Unit</English>
<Key ID="STR_ACE_Spectator_ViewFree">
<English>Free</English>
</Key>
<Key ID="STR_ACE_Spectator_ViewInternal">
<English>Internal</English>
</Key>
<Key ID="STR_ACE_Spectator_ViewExternal">
<English>External</English>
</Key>
<!-- Keybinds -->