mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Rejiggling toolbar
This commit is contained in:
parent
5af5284bee
commit
52244c1647
@ -111,27 +111,27 @@ class GVAR(interface) {
|
|||||||
idc = -1;
|
idc = -1;
|
||||||
style = 64;
|
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 {
|
class clockTool: viewTool {
|
||||||
idc = IDC_TOOL_CLOCK;
|
idc = IDC_TOOL_CLOCK;
|
||||||
x = TOOL_W * 3 + MARGIN * 2;
|
x = safeZoneW - TOOL_W * 3 - MARGIN * 2;
|
||||||
};
|
};
|
||||||
class clockFrame: clockTool {
|
class clockFrame: clockTool {
|
||||||
idc = -1;
|
idc = -1;
|
||||||
style = 64;
|
style = 64;
|
||||||
};
|
};
|
||||||
class focusTool: viewTool {
|
class depthTool: viewTool {
|
||||||
idc = IDC_TOOL_FOCUS;
|
idc = IDC_TOOL_DEPTH;
|
||||||
x = safeZoneW - TOOL_W * 3 - MARGIN * 2;
|
|
||||||
};
|
|
||||||
class focusFrame: focusTool {
|
|
||||||
idc = -1;
|
|
||||||
style = 64;
|
|
||||||
};
|
|
||||||
class fovTool: viewTool {
|
|
||||||
idc = IDC_TOOL_FOV;
|
|
||||||
x = safeZoneW - TOOL_W * 2 - MARGIN;
|
x = safeZoneW - TOOL_W * 2 - MARGIN;
|
||||||
};
|
};
|
||||||
class fovFrame: fovTool {
|
class depthFrame: depthTool {
|
||||||
idc = -1;
|
idc = -1;
|
||||||
style = 64;
|
style = 64;
|
||||||
};
|
};
|
||||||
|
@ -17,7 +17,6 @@ PREP(updateInterface);
|
|||||||
PREP(updateUnits);
|
PREP(updateUnits);
|
||||||
|
|
||||||
// Permanent variables
|
// Permanent variables
|
||||||
GVAR(camFocus) = 0;
|
|
||||||
GVAR(camMode) = 0;
|
GVAR(camMode) = 0;
|
||||||
GVAR(camPan) = 0;
|
GVAR(camPan) = 0;
|
||||||
GVAR(camPos) = [worldSize * 0.5,worldSize * 0.5,0];
|
GVAR(camPos) = [worldSize * 0.5,worldSize * 0.5,0];
|
||||||
|
@ -22,39 +22,34 @@ params ["_display"];
|
|||||||
// Kill PFH when display is closed
|
// Kill PFH when display is closed
|
||||||
if (isNull _display) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; };
|
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) camSetFov -(linearConversion [0.1,2,GVAR(camZoom),-2,-0.1,true]);
|
||||||
GVAR(camera) camCommit 0;
|
GVAR(camera) camCommit 0;
|
||||||
|
|
||||||
// Reduce overhead when toolbar is hidden
|
// Reduce overhead when toolbar is hidden
|
||||||
if !(ctrlShown (_display displayCtrl IDC_TOOL)) exitWith {};
|
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;
|
_toolbar = _display displayCtrl IDC_TOOL;
|
||||||
|
|
||||||
// Find all tool values
|
// Find all tool values
|
||||||
if (GVAR(camMode) == 0) then {
|
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];
|
_fov = format ["%1x", floor(GVAR(camZoom) * 100) * 0.01];
|
||||||
_name = "None";
|
_name = localize "STR_VOICE_MASK_NONE";
|
||||||
_speed = format ["%1 m/s", GVAR(camSpeed)];
|
_speed = format ["%1 m/s", GVAR(camSpeed)];
|
||||||
} else {
|
} else {
|
||||||
_focus = rank GVAR(camUnit);
|
_depth = format ["%1 m", floor(getPosASL GVAR(camUnit) select 2)];
|
||||||
_fov = WFSideText (group GVAR(camUnit));
|
_fov = WFSideText (group GVAR(camUnit));
|
||||||
_name = name 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;
|
_time = [daytime,"HH:MM"] call BIS_fnc_timeToString;
|
||||||
|
|
||||||
// Update the UI tools
|
// Update the UI tools
|
||||||
(_toolbar controlsGroupCtrl IDC_TOOL_CLOCK) ctrlSetText _time;
|
(_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_FOV) ctrlSetText _fov;
|
||||||
(_toolbar controlsGroupCtrl IDC_TOOL_NAME) ctrlSetText _name;
|
(_toolbar controlsGroupCtrl IDC_TOOL_NAME) ctrlSetText _name;
|
||||||
(_toolbar controlsGroupCtrl IDC_TOOL_SPEED) ctrlSetText _speed;
|
(_toolbar controlsGroupCtrl IDC_TOOL_SPEED) ctrlSetText _speed;
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
#define IDC_TOOL 3000
|
#define IDC_TOOL 3000
|
||||||
#define IDC_TOOL_CLOCK 3003
|
#define IDC_TOOL_CLOCK 3003
|
||||||
#define IDC_TOOL_FOCUS 3004
|
#define IDC_TOOL_DEPTH 3004
|
||||||
#define IDC_TOOL_FOV 3005
|
#define IDC_TOOL_FOV 3005
|
||||||
#define IDC_TOOL_NAME 3001
|
#define IDC_TOOL_NAME 3001
|
||||||
#define IDC_TOOL_SPEED 3006
|
#define IDC_TOOL_SPEED 3006
|
||||||
|
@ -59,8 +59,14 @@
|
|||||||
<Key ID="STR_ACE_Spectator_HelpTitle">
|
<Key ID="STR_ACE_Spectator_HelpTitle">
|
||||||
<English>Spectator Controls</English>
|
<English>Spectator Controls</English>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Spectator_RandomUnit">
|
<Key ID="STR_ACE_Spectator_ViewFree">
|
||||||
<English>Random Unit</English>
|
<English>Free</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Spectator_ViewInternal">
|
||||||
|
<English>Internal</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Spectator_ViewExternal">
|
||||||
|
<English>External</English>
|
||||||
</Key>
|
</Key>
|
||||||
|
|
||||||
<!-- Keybinds -->
|
<!-- Keybinds -->
|
||||||
|
Loading…
Reference in New Issue
Block a user