diff --git a/addons/interaction/RscTitles.hpp b/addons/interaction/RscTitles.hpp index ec3882b2a1..ee4783da30 100644 --- a/addons/interaction/RscTitles.hpp +++ b/addons/interaction/RscTitles.hpp @@ -155,6 +155,9 @@ class RscInteractionText: RscText{ w = 24 * GUI_GRID_W; h = 1.5 * GUI_GRID_H; }; +class RscInteractionText_right: RscText{ + style = 1; // right aligned text +}; class RscTitles { class GVAR(InteractionHelper) { diff --git a/addons/interaction/functions/fnc_hideMouseHint.sqf b/addons/interaction/functions/fnc_hideMouseHint.sqf index 757fe952e5..bb9fc9440a 100644 --- a/addons/interaction/functions/fnc_hideMouseHint.sqf +++ b/addons/interaction/functions/fnc_hideMouseHint.sqf @@ -19,7 +19,7 @@ if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith { (QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; -// Disable action menu, showHud also disables all scripted UI (such as drawIcon3D) +// Re-enable action menu inGameUISetEventHandler ["PrevAction", "false"]; inGameUISetEventHandler ["NextAction", "false"]; inGameUISetEventHandler ["Action", "false"]; diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index 9ea1f26cba..c9fb628c15 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -6,6 +6,7 @@ * 0: Left Click Text * 1: Right Click Text * 2: Scroll Text (Optional) + * 2: Extra Icon/Text pairs * * Return Value: * None @@ -20,7 +21,7 @@ #define GUI_GRID_W (0.025) #define GUI_GRID_H (0.04) -params ["_leftClick", "_rightClick", ["_scroll", ""]]; +params ["_leftClick", "_rightClick", ["_scroll", ""], ["_extraIconSets", []]]; (QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutRsc [QGVAR(InteractionHelper), "PLAIN", 0.5, false]; @@ -28,7 +29,7 @@ disableSerialization; private _display = uiNamespace getVariable ["ACE_Helper_Display", objNull]; -if (isNull _display) exitWith {}; +if (isNull _display) exitWith {WARNING("Display was null");}; (_display displayCtrl 1000) ctrlSetText _leftClick; (_display displayCtrl 1001) ctrlSetText _rightClick; @@ -38,18 +39,42 @@ if (isNull _display) exitWith {}; (_display displayCtrl 1001) ctrlShow (_rightClick != ""); (_display displayCtrl 1201) ctrlShow (_rightClick != ""); -if (_scroll == "") exitWith { +private _offset = 19; + +if (_scroll == "") then { (_display displayCtrl 1002) ctrlShow false; (_display displayCtrl 1202) ctrlShow false; (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 24 * GUI_GRID_W, 1.5 * GUI_GRID_H]; (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1.5 * GUI_GRID_W, 1 * GUI_GRID_H]; (_display displayCtrl 1001) ctrlCommit 0; (_display displayCtrl 1201) ctrlCommit 0; +} else { + _offset = _offset + 1; + (_display displayCtrl 1002) ctrlSetText _scroll; + + // Disable action menu + inGameUISetEventHandler ["PrevAction", "true"]; + inGameUISetEventHandler ["NextAction", "true"]; + inGameUISetEventHandler ["Action", "true"]; }; -(_display displayCtrl 1002) ctrlSetText _scroll; +{ + _x params [["_xKeyName", "", [""]], ["_xText", "", [""]]]; + switch (toLower _xKeyName) do { + case ("alt"): {_xKeyName = format ["<%1>", toUpper localize "str_dik_alt"];}; + case ("control"); + case ("ctrl"): {_xKeyName = format ["<%1>", toUpper localize "str_dik_control"];}; + case ("shift"): {_xKeyName = format ["<%1>", toUpper localize "str_dik_shift"];}; + }; + + private _keyNameCtrl = _display ctrlCreate ["RscInteractionText_right", -1]; + private _textCtrl = _display ctrlCreate ["RscInteractionText", -1]; + _keyNameCtrl ctrlSetText _xKeyName; + _textCtrl ctrlSetText _xText; + _keyNameCtrl ctrlSetPosition [0 * GUI_GRID_W, _offset * GUI_GRID_H, 21.4 * GUI_GRID_W, 1.5 * GUI_GRID_H]; + _textCtrl ctrlSetPosition [21 * GUI_GRID_W, _offset * GUI_GRID_H, 24 * GUI_GRID_W, 1.5 * GUI_GRID_H]; + _keyNameCtrl ctrlCommit 0; + _textCtrl ctrlCommit 0; + _offset = _offset + 1; +} forEach _extraIconSets; -// Enable action menu -inGameUISetEventHandler ["PrevAction", "true"]; -inGameUISetEventHandler ["NextAction", "true"]; -inGameUISetEventHandler ["Action", "true"];