Skip to content

Commit 6d78ee3

Browse files
ACE Compats - Context menu Action to Open Ace Medical Menu on Unit (#805)
* add context for ace medical menu * ace medical menu context menu action - priority: 51 * healUnits context menu action - priority: 52 * string pascalcase * _entity and lazyEval * _entity, rm line and ACEFUNC * fnl * Update fnc_canOpenMedicalMenu.sqf * Update CfgContext.hpp * Apply suggestions from code review --------- Co-authored-by: BrettMayson <brett@mayson.io>
1 parent 8e911df commit 6d78ee3

File tree

7 files changed

+60
-1
lines changed

7 files changed

+60
-1
lines changed

addons/compat_ace/CfgContext.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class EGVAR(context_menu,actions) {
2+
class AceMedicalMenu {
3+
displayName = CSTRING(OpenMedicalMenu);
4+
icon = QPATHTOEF(context_actions,ui\medical_cross_ca.paa);
5+
condition = QUOTE(_hoveredEntity call FUNC(canOpenMedicalMenu));
6+
statement = QUOTE(_hoveredEntity call FUNC(openMedicalMenu));
7+
priority = 51;
8+
};
9+
};

addons/compat_ace/XEH_PREP.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
PREP(canFastrope);
2+
PREP(canOpenMedicalMenu);
23
PREP(canRemoteControl);
4+
PREP(openMedicalMenu);
35
PREP(remoteControl);

addons/compat_ace/config.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ PRELOAD_ADDONS;
2626
#include "CfgVehicles.hpp"
2727
#include "CfgWaypointTypes.hpp"
2828
#include "ACE_ZeusActions.hpp"
29+
#include "CfgContext.hpp"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include "script_component.hpp"
2+
/*
3+
* Author: OverlordZorn
4+
* Checks if the ace medical menu can be opened for an unit.
5+
*
6+
* Arguments:
7+
* 0: Entity <ANY>
8+
*
9+
* Return Value:
10+
* Can Open ACE Medical Menu <BOOL>
11+
*
12+
* Example:
13+
* [_entity] call zen_compat_ace_fnc_canOpenMedicalMenu
14+
*
15+
* Public: No
16+
*/
17+
18+
params ["_entity"];
19+
20+
_entity isEqualType objNull
21+
&& {!isNull _entity}
22+
&& {_entity isKindOf "CAManBase"}
23+
&& {["ace_medical_gui"] call ACEFUNC(common,isModLoaded)}
24+
&& {[objNull, _entity] call ACEFUNC(medical_gui,canOpenMenu)}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include "script_component.hpp"
2+
/*
3+
* Author: OverlordZorn
4+
* Opens ace medical menu for an unit.
5+
*
6+
* Arguments:
7+
* 0: Entity <ANY>
8+
*
9+
* Return Value:
10+
* None
11+
*
12+
* Example:
13+
* [_entity] call zen_compat_ace_fnc_openMedicalMenu
14+
*
15+
* Public: No
16+
*/
17+
18+
params ["_entity"];
19+
20+
[_entity] call ACEFUNC(medical_gui,openMenu);

addons/compat_ace/stringtable.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
<French>Cacher les modules ACE</French>
1616
<Chinesesimp>隐藏ACE模块</Chinesesimp>
1717
</Key>
18+
<Key ID="STR_ZEN_Compat_ACE_OpenMedicalMenu">
19+
<English>Open Medical Menu</English>
20+
</Key>
1821
<Key ID="STR_ZEN_Compat_ACE_HideModules_Description">
1922
<English>Hides duplicate modules added by ACE Zeus. Requires display reload.</English>
2023
<Korean>ACE 제우스에 의해 추가된 모듈을 숨깁니다. 디스플레이 재시작이 필요합니다.</Korean>

addons/context_actions/CfgContext.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class EGVAR(context_menu,actions) {
187187
class HealUnits {
188188
displayName = "$STR_State_Heal";
189189
icon = QPATHTOF(ui\medical_cross_ca.paa);
190-
priority = 50;
190+
priority = 52;
191191
class All {
192192
displayName = ECSTRING(common,All);
193193
condition = QUOTE([ARR_2(_objects,_args)] call FUNC(canHealUnits));

0 commit comments

Comments
 (0)