Medical GUI - Add keybind to show player's patient information display (#9464)

* Add keybind to show patient information display

* Return false

* Add fadeout delay and associated setting

* Switch to CBA setting rounding

* Change setting type to time

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Fix incorrect behavior on repeated key presses

* Tweak setting name and description

* Tweak to prevent overlapping WUAE

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
This commit is contained in:
amsteadrayle 2023-10-08 17:34:51 -04:00 committed by GitHub
parent 78bb0514d1
commit 0e2c7167a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 0 deletions

View File

@ -12,6 +12,8 @@ GVAR(pendingReopen) = false;
GVAR(menuPFH) = -1;
GVAR(peekLastOpenedOn) = -1;
GVAR(selfInteractionActions) = [];
[] call FUNC(addTreatmentActions);
[] call FUNC(collectActions);
@ -71,6 +73,24 @@ GVAR(selfInteractionActions) = [];
false
}, [DIK_H, [false, false, false]], false, 0] call CBA_fnc_addKeybind;
["ACE3 Common", QGVAR(peekMedicalInfoKey), localize LSTRING(PeekMedicalInfo),
{
// Conditions: canInteract
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
// Statement
[ACE_player, 0] call FUNC(displayPatientInformation);
false
}, {
if (CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay)) then {
[{
CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay)
}, {QGVAR(RscPatientInfo) cutFadeOut 0.3}] call CBA_fnc_waitUntilAndExecute;
};
GVAR(peekLastOpenedOn) = CBA_missionTime;
false
}, [DIK_H, [false, true, false]], false, 0] call CBA_fnc_addKeybind;
// Close patient information display when interaction menu is closed
["ace_interactMenuClosed", {

View File

@ -126,3 +126,12 @@ private _categoryColors = [ELSTRING(medical,Category), format ["| %1 |", LELSTRI
true,
true // isGlobal
] call CBA_fnc_addSetting;
[
QGVAR(peekMedicalInfoReleaseDelay),
"TIME",
[LSTRING(PeekMedicalInfoReleaseDelay_DisplayName), LSTRING(PeekMedicalInfoReleaseDelay_Description)],
[ELSTRING(medical,Category), LSTRING(SubCategory)],
[0, 5, 1],
false
] call CBA_fnc_addSetting;

View File

@ -282,6 +282,15 @@
<Chinese>開起醫療選單</Chinese>
<Turkish>Medikal Menüyü Aç</Turkish>
</Key>
<Key ID="STR_ACE_Medical_GUI_PeekMedicalInfo">
<English>Peek Medical Info</English>
</Key>
<Key ID="STR_ACE_Medical_GUI_PeekMedicalInfoReleaseDelay_DisplayName">
<English>Medical Peek Duration</English>
</Key>
<Key ID="STR_ACE_Medical_GUI_PeekMedicalInfoReleaseDelay_Description">
<English>How long the medical info peek remains open after releasing the key.</English>
</Key>
<Key ID="STR_ACE_Medical_GUI_LoadPatient">
<English>Load Patient</English>
<Spanish>Cargar al paciente en</Spanish>