Improve spectator help window layout

Having the help window in the centre of the screen blocked too much of the users view and also clashed with the MPTable element (the table that appears on death, aka "respawnDialog"). It was moved to the right of the screen and now mirrors the unit list. To save screen space, the action keys are given as tooltips for the listbox entries so users must mouse over for more info.
This commit is contained in:
SilentSpike 2015-08-07 01:44:32 +01:00
parent f59536b5a3
commit 043c5c47c5
2 changed files with 50 additions and 42 deletions

View File

@ -10,7 +10,7 @@ class RscFrame {
class RscButtonMenu;
class RscControlsGroupNoScrollbars;
//class RscFrame;
class RscListNBox;
class RscListBox;
class RscMapControl;
class RscPicture;
class RscText;
@ -163,12 +163,13 @@ class GVAR(interface) {
h = safeZoneH - TOOL_H * 13;
sizeEx = H_PART(0.8);
borderSize = 1;
colorText[] = {COL_FORE};
colorBorder[] = {COL_FORE};
colorBackground[] = {COL_BACK};
colorSelect[] = {
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])",
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])",
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])",
QUOTE(GETPRVAR(GUI_BCG_RGB_R,0.77)),
QUOTE(GETPRVAR(GUI_BCG_RGB_G,0.51)),
QUOTE(GETPRVAR(GUI_BCG_RGB_B,0.08)),
1
};
multiselectEnabled = 0;
@ -184,35 +185,43 @@ class GVAR(interface) {
onMouseButtonDown = QUOTE([ARR_2('onMapClick',_this)] call FUNC(handleInterface));
onDraw = QUOTE(_this call FUNC(handleMap));
};
class helpSplash: RscControlsGroupNoScrollbars {
class helpWindow: RscControlsGroupNoScrollbars {
idc = IDC_HELP;
x = 0.5 - W_PART(12);
y = 0.5 - H_PART(12);
w = W_PART(24);
h = H_PART(24);
x = safeZoneX + safeZoneW - TOOL_W * 2;
y = safeZoneY + TOOL_H * 6;
w = TOOL_W * 2;
h = safeZoneH - TOOL_H * 13;
colorText[] = {COL_FORE};
colorSelectBackground[] = {COL_FORE_D};
colorSelectBackground2[] = {COL_BACK};
colorBackground[] = {0,0,0,0};
class controls {
class helpBack: RscText {
class helpTitle: RscText {
x = 0;
y = 0;
w = W_PART(24);
h = H_PART(24);
colorBackground[] = {COL_BACK};
};
class helpTitle: helpBack {
w = TOOL_W * 2;
h = H_PART(1);
colorText[]={COL_FORE};
colorText[] = {COL_FORE};
colorBackground[] = {COL_FORE_D};
sizeEx = H_PART(1);
text = CSTRING(HelpTitle);
};
class helpContent: RscListNBox {
class helpContent: RscListBox {
idc = IDC_HELP_LIST;
x = W_PART(1);
y = H_PART(2);
W = W_PART(22);
H = H_PART(21);
x = 0;
y = H_PART(1);
w = TOOL_W * 2;
h = safeZoneH - TOOL_H * 14;
colorBackground[] = {COL_BACK};
default = 1;
columns[] = {0.01,0.5};
};
class helpFrame: RscText {
x = 0;
y = 0;
w = TOOL_W * 2;
h = safeZoneH - TOOL_H * 13;
colorText[] = {COL_FORE};
style = 64;
};
};
};

View File

@ -117,27 +117,27 @@ switch (toLower _mode) do {
// Handle unit icons on map and 3D
GVAR(iconHandler) = addMissionEventHandler ["Draw3D",FUNC(handleIcons)];
// Populate the help splash
// Populate the help window
private "_help";
_help = (_display displayCtrl IDC_HELP) controlsGroupCtrl IDC_HELP_LIST;
{
// Add space before category titles
if (count _x == 1) then {
_help lnbAddRow [""];
_i = _help lbAdd (_x select 0);
if ((_x select 1) == "") then {
_help lbSetPicture [_i,"\A3\ui_f\data\map\markers\military\dot_CA.paa"];
_help lbSetPictureColor [_i,[COL_FORE]];
} else {
_help lbSetTooltip [_i,_x select 1];
};
_help lnbAddRow _x;
} forEach [
[localize LSTRING(uiControls),""],
[localize LSTRING(uiToggleHelp),"H"],
[localize LSTRING(uiToggleMap),"M"],
[localize LSTRING(uiToggleUnits),"1"],
[localize LSTRING(uiToggleTools),"2"],
[localize LSTRING(uiToggleCompass),"3"],
[localize LSTRING(uiToggleIcons),"4"],
[localize LSTRING(uiToggleHelp),"2"],
[localize LSTRING(uiToggleTools),"3"],
[localize LSTRING(uiToggleCompass),"4"],
[localize LSTRING(uiToggleIcons),"5"],
[localize LSTRING(uiToggleMap),"M"],
[localize LSTRING(uiToggleInterface),"Backspace"],
[localize LSTRING(freeCamControls)],
[localize LSTRING(freeCamControls),""],
[localize LSTRING(freeCamForward),"W"],
[localize LSTRING(freeCamBackward),"S"],
[localize LSTRING(freeCamLeft),"A"],
@ -150,8 +150,7 @@ switch (toLower _mode) do {
[localize LSTRING(freeCamZoom),"Ctrl + Scrollwheel"],
[localize LSTRING(freeCamNextVis),"N"],
[localize LSTRING(freeCamPrevVis),"Ctrl + N"],
[localize LSTRING(otherControls)],
[localize LSTRING(otherControls),""],
[localize LSTRING(nextCam),"Up Arrow"],
[localize LSTRING(prevCam),"Down Arrow"],
[localize LSTRING(nextUnit),"Right Arrow"],
@ -250,12 +249,15 @@ switch (toLower _mode) do {
[_display,nil,nil,nil,nil,nil,true] call FUNC(toggleInterface);
};
case 3: { // 2
[_display,nil,nil,nil,nil,true] call FUNC(toggleInterface);
[_display,nil,true] call FUNC(toggleInterface);
};
case 4: { // 3
[_display,true] call FUNC(toggleInterface);
[_display,nil,nil,nil,nil,true] call FUNC(toggleInterface);
};
case 5: { // 4
[_display,true] call FUNC(toggleInterface);
};
case 6: { // 5
GVAR(showIcons) = !GVAR(showIcons);
};
case 14: { // Backspace
@ -279,9 +281,6 @@ switch (toLower _mode) do {
case 32: { // D
GVAR(camDolly) set [0, GVAR(camSpeed)];
};
case 35: { // H
[_display,nil,true] call FUNC(toggleInterface);
};
case 44: { // Z
GVAR(camBoom) = -0.5 * GVAR(camSpeed);
};