mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Interface toggles
This commit is contained in:
parent
c6e71fbc36
commit
5d279e11ec
@ -79,10 +79,17 @@ class GVAR(interface) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
class nameTool: RscText {
|
class toolbar: RscControlsGroupNoScrollbars {
|
||||||
idc = IDC_TOOL_NAME;
|
idc = IDC_TOOL;
|
||||||
x = safeZoneX;
|
x = safeZoneX;
|
||||||
y = safeZoneY;
|
y = safeZoneY;
|
||||||
|
w = safeZoneW;
|
||||||
|
h = TOOL_H;
|
||||||
|
class controls {
|
||||||
|
class nameTool: RscText {
|
||||||
|
idc = IDC_TOOL_NAME;
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
w = TOOL_W * 2;
|
w = TOOL_W * 2;
|
||||||
h = TOOL_H;
|
h = TOOL_H;
|
||||||
shadow = 2;
|
shadow = 2;
|
||||||
@ -96,7 +103,7 @@ class GVAR(interface) {
|
|||||||
};
|
};
|
||||||
class viewTool: nameTool {
|
class viewTool: nameTool {
|
||||||
idc = IDC_TOOL_VIEW;
|
idc = IDC_TOOL_VIEW;
|
||||||
x = safeZoneX + TOOL_W * 2 + MARGIN;
|
x = TOOL_W * 2 + MARGIN;
|
||||||
w = TOOL_W;
|
w = TOOL_W;
|
||||||
};
|
};
|
||||||
class viewFrame: viewTool {
|
class viewFrame: viewTool {
|
||||||
@ -105,7 +112,7 @@ class GVAR(interface) {
|
|||||||
};
|
};
|
||||||
class clockTool: viewTool {
|
class clockTool: viewTool {
|
||||||
idc = IDC_TOOL_CLOCK;
|
idc = IDC_TOOL_CLOCK;
|
||||||
x = safeZoneX + TOOL_W * 3 + MARGIN * 2;
|
x = TOOL_W * 3 + MARGIN * 2;
|
||||||
};
|
};
|
||||||
class clockFrame: clockTool {
|
class clockFrame: clockTool {
|
||||||
idc = -1;
|
idc = -1;
|
||||||
@ -113,7 +120,7 @@ class GVAR(interface) {
|
|||||||
};
|
};
|
||||||
class focusTool: viewTool {
|
class focusTool: viewTool {
|
||||||
idc = IDC_TOOL_FOCUS;
|
idc = IDC_TOOL_FOCUS;
|
||||||
x = safeZoneX + safeZoneW - TOOL_W * 3 - MARGIN * 2;
|
x = safeZoneW - TOOL_W * 3 - MARGIN * 2;
|
||||||
};
|
};
|
||||||
class focusFrame: focusTool {
|
class focusFrame: focusTool {
|
||||||
idc = -1;
|
idc = -1;
|
||||||
@ -121,7 +128,7 @@ class GVAR(interface) {
|
|||||||
};
|
};
|
||||||
class fovTool: viewTool {
|
class fovTool: viewTool {
|
||||||
idc = IDC_TOOL_FOV;
|
idc = IDC_TOOL_FOV;
|
||||||
x = safeZoneX + safeZoneW - TOOL_W * 2 - MARGIN;
|
x = safeZoneW - TOOL_W * 2 - MARGIN;
|
||||||
};
|
};
|
||||||
class fovFrame: fovTool {
|
class fovFrame: fovTool {
|
||||||
idc = -1;
|
idc = -1;
|
||||||
@ -129,12 +136,14 @@ class GVAR(interface) {
|
|||||||
};
|
};
|
||||||
class speedTool: viewTool {
|
class speedTool: viewTool {
|
||||||
idc = IDC_TOOL_SPEED;
|
idc = IDC_TOOL_SPEED;
|
||||||
x = safeZoneX + safeZoneW - TOOL_W;
|
x = safeZoneW - TOOL_W;
|
||||||
};
|
};
|
||||||
class speedFrame: speedTool {
|
class speedFrame: speedTool {
|
||||||
idc = -1;
|
idc = -1;
|
||||||
style = 64;
|
style = 64;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
class unitTools: RscControlsGroupNoScrollbars {
|
class unitTools: RscControlsGroupNoScrollbars {
|
||||||
idc = IDC_UNIT;
|
idc = IDC_UNIT;
|
||||||
x = safeZoneX;
|
x = safeZoneX;
|
||||||
@ -153,9 +162,9 @@ class GVAR(interface) {
|
|||||||
colorBorder[] = {COL_FORE};
|
colorBorder[] = {COL_FORE};
|
||||||
colorBackground[] = {COL_BACK};
|
colorBackground[] = {COL_BACK};
|
||||||
colorSelect[] = {
|
colorSelect[] = {
|
||||||
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])",
|
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])",
|
||||||
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])",
|
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])",
|
||||||
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])",
|
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])",
|
||||||
1
|
1
|
||||||
};
|
};
|
||||||
multiselectEnabled = 0;
|
multiselectEnabled = 0;
|
||||||
@ -167,19 +176,20 @@ class GVAR(interface) {
|
|||||||
w = TOOL_W * 2;
|
w = TOOL_W * 2;
|
||||||
h = TOOL_H;
|
h = TOOL_H;
|
||||||
sizeEx = TOOL_H;
|
sizeEx = TOOL_H;
|
||||||
|
colorBackground[] = {COL_FORE_D};
|
||||||
text = CSTRING(RefreshList);
|
text = CSTRING(RefreshList);
|
||||||
action = QUOTE([] call FUNC(updateUnits));
|
action = QUOTE([] call FUNC(updateUnits));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
class spectatorMap: RscMapControl {
|
class mapOverlay: RscMapControl {
|
||||||
idc = IDC_MAP;
|
idc = IDC_MAP;
|
||||||
x = safeZoneX;
|
x = safeZoneX;
|
||||||
y = safeZoneY + TOOL_H;
|
y = safeZoneY;
|
||||||
w = safeZoneW;
|
w = safeZoneW;
|
||||||
h = safeZoneH;
|
h = safeZoneH;
|
||||||
};
|
};
|
||||||
class helpBox: RscControlsGroupNoScrollbars {
|
class helpSplash: RscControlsGroupNoScrollbars {
|
||||||
idc = IDC_HELP;
|
idc = IDC_HELP;
|
||||||
x = 0.5 - W_PART(12);
|
x = 0.5 - W_PART(12);
|
||||||
y = 0.5 - H_PART(12);
|
y = 0.5 - H_PART(12);
|
||||||
@ -196,12 +206,7 @@ class GVAR(interface) {
|
|||||||
class helpTitle: helpBack {
|
class helpTitle: helpBack {
|
||||||
h = H_PART(1);
|
h = H_PART(1);
|
||||||
colorText[]={COL_FORE};
|
colorText[]={COL_FORE};
|
||||||
colorBackground[] = {
|
colorBackground[] = {COL_FORE_D};
|
||||||
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])",
|
|
||||||
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])",
|
|
||||||
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])",
|
|
||||||
1
|
|
||||||
};
|
|
||||||
sizeEx = H_PART(1);
|
sizeEx = H_PART(1);
|
||||||
text = CSTRING(HelpTitle);
|
text = CSTRING(HelpTitle);
|
||||||
};
|
};
|
||||||
|
@ -10,11 +10,20 @@ PREP(handleRespawn);
|
|||||||
PREP(handleTree);
|
PREP(handleTree);
|
||||||
PREP(moduleSpectatorSettings);
|
PREP(moduleSpectatorSettings);
|
||||||
PREP(setSpectator);
|
PREP(setSpectator);
|
||||||
|
PREP(updateInterface);
|
||||||
PREP(updateUnits);
|
PREP(updateUnits);
|
||||||
PREP(updateView);
|
PREP(updateView);
|
||||||
|
|
||||||
|
GVAR(showComp) = true;
|
||||||
|
GVAR(showHelp) = true;
|
||||||
|
GVAR(showInterface) = true;
|
||||||
|
GVAR(showMap) = false;
|
||||||
|
GVAR(showTool) = true;
|
||||||
|
GVAR(showUnit) = true;
|
||||||
|
|
||||||
GVAR(unitList) = [];
|
GVAR(unitList) = [];
|
||||||
GVAR(unitBlacklist) = [];
|
GVAR(unitBlacklist) = [];
|
||||||
GVAR(unitWhitelist) = [];
|
GVAR(unitWhitelist) = [];
|
||||||
|
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -124,9 +124,10 @@ switch (toLower _mode) do {
|
|||||||
// Initalize the display
|
// Initalize the display
|
||||||
_display = _args select 0;
|
_display = _args select 0;
|
||||||
|
|
||||||
// Hide the map
|
// Always show interface and hide map upon opening
|
||||||
(_display displayCtrl IDC_MAP) ctrlShow false;
|
GVAR(showInterface) = true;
|
||||||
(_display displayCtrl IDC_MAP) mapCenterOnCamera false;
|
GVAR(showMap) = false;
|
||||||
|
[] call FUNC(updateInterface);
|
||||||
|
|
||||||
// Set text values
|
// Set text values
|
||||||
(_display displayCtrl IDC_TOOL_FOCUS) ctrlSetText str(GVAR(camFocus));
|
(_display displayCtrl IDC_TOOL_FOCUS) ctrlSetText str(GVAR(camFocus));
|
||||||
@ -195,14 +196,11 @@ switch (toLower _mode) do {
|
|||||||
|
|
||||||
switch (_dik) do {
|
switch (_dik) do {
|
||||||
case 1: { // Esc
|
case 1: { // Esc
|
||||||
["close"] call FUNC(handleInterface); // Handle esc menu goes here, currently closes for purposes of testing
|
[player,false] call FUNC(setSpectator); // Handle esc menu goes here, currently closes for purposes of testing
|
||||||
};
|
};
|
||||||
case 14: { // Backspace
|
case 14: { // Backspace
|
||||||
private ["_tree","_show"];
|
GVAR(showInterface) = !GVAR(showInterface);
|
||||||
_tree = _display displayCtrl IDC_UNIT;
|
[] call FUNC(updateInterface);
|
||||||
_show = !ctrlShown _tree;
|
|
||||||
|
|
||||||
_tree ctrlShow _show;
|
|
||||||
};
|
};
|
||||||
case 16: { // Q
|
case 16: { // Q
|
||||||
GVAR(camBoom) set [0,true];
|
GVAR(camBoom) set [0,true];
|
||||||
@ -210,6 +208,14 @@ switch (toLower _mode) do {
|
|||||||
case 17: { // W
|
case 17: { // W
|
||||||
GVAR(camDolly) set [0,true];
|
GVAR(camDolly) set [0,true];
|
||||||
};
|
};
|
||||||
|
case 20: { // T
|
||||||
|
GVAR(showTool) = !GVAR(showTool);
|
||||||
|
[] call FUNC(updateInterface);
|
||||||
|
};
|
||||||
|
case 22: { // U
|
||||||
|
GVAR(showUnit) = !GVAR(showUnit);
|
||||||
|
[] call FUNC(updateInterface);
|
||||||
|
};
|
||||||
case 29: { // Ctrl
|
case 29: { // Ctrl
|
||||||
GVAR(ctrlKey) = true;
|
GVAR(ctrlKey) = true;
|
||||||
};
|
};
|
||||||
@ -223,21 +229,19 @@ switch (toLower _mode) do {
|
|||||||
GVAR(camDolly) set [3,true];
|
GVAR(camDolly) set [3,true];
|
||||||
};
|
};
|
||||||
case 35: { // H
|
case 35: { // H
|
||||||
private ["_help","_show"];
|
GVAR(showHelp) = !GVAR(showHelp);
|
||||||
_help = _display displayCtrl IDC_HELP;
|
[] call FUNC(updateInterface);
|
||||||
_show = !ctrlShown _help;
|
};
|
||||||
|
case 37: { // K
|
||||||
_help ctrlShow _show;
|
GVAR(showComp) = !GVAR(showComp);
|
||||||
|
[] call FUNC(updateInterface);
|
||||||
};
|
};
|
||||||
case 44: { // Z
|
case 44: { // Z
|
||||||
GVAR(camBoom) set [1,true];
|
GVAR(camBoom) set [1,true];
|
||||||
};
|
};
|
||||||
case 50: { // M
|
case 50: { // M
|
||||||
private ["_map","_show"];
|
GVAR(showMap) = !GVAR(showMap);
|
||||||
_map = _display displayCtrl IDC_MAP;
|
[] call FUNC(updateInterface);
|
||||||
_show = !ctrlShown _map;
|
|
||||||
|
|
||||||
_map ctrlShow _show;
|
|
||||||
//[_show] call FUNC(handleMap);
|
//[_show] call FUNC(handleMap);
|
||||||
};
|
};
|
||||||
case 57: { // Spacebar
|
case 57: { // Spacebar
|
||||||
|
19
addons/spectator/functions/fnc_updateInterface.sqf
Normal file
19
addons/spectator/functions/fnc_updateInterface.sqf
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
private ["_display","_elements","_show"];
|
||||||
|
disableSerialization;
|
||||||
|
|
||||||
|
_display = GETUVAR(GVAR(display),displayNull);
|
||||||
|
_elements = [IDC_COMP,IDC_HELP,IDC_MAP,IDC_TOOL,IDC_UNIT];
|
||||||
|
_show = [GVAR(showComp),GVAR(showHelp),GVAR(showMap),GVAR(showTool),GVAR(showUnit)];
|
||||||
|
|
||||||
|
// Hide/show interface elements in accordance with good UX design
|
||||||
|
if (GVAR(showInterface)) then {
|
||||||
|
{
|
||||||
|
(_display displayCtrl _x) ctrlShow (_show select _forEachIndex);
|
||||||
|
} forEach _elements;
|
||||||
|
} else {
|
||||||
|
{
|
||||||
|
(_display displayCtrl _x) ctrlShow GVAR(showInterface);
|
||||||
|
} forEach _elements;
|
||||||
|
};
|
@ -52,3 +52,4 @@
|
|||||||
// UI colours
|
// UI colours
|
||||||
#define COL_BACK 0.1,0.1,0.1,0.8
|
#define COL_BACK 0.1,0.1,0.1,0.8
|
||||||
#define COL_FORE 1,1,1,1
|
#define COL_FORE 1,1,1,1
|
||||||
|
#define COL_FORE_D 0.1,0.1,0.1,1
|
||||||
|
Loading…
Reference in New Issue
Block a user