mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Finalized ACE medical menu settings
This commit is contained in:
parent
4c7bcbb6fe
commit
696546de5c
@ -644,6 +644,9 @@
|
||||
<Portuguese>Não</Portuguese>
|
||||
<Italian>No</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_VehiclesOnly">
|
||||
<English>Vehicles only</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_DoNotForce">
|
||||
<English>Do Not Force</English>
|
||||
<Polish>Nie wymuszaj</Polish>
|
||||
|
@ -856,9 +856,9 @@ class ACE_Medical_Advanced {
|
||||
// specific details for the ACE_Morphine treatment action
|
||||
class Morphine {
|
||||
painReduce = 15;
|
||||
hrIncreaseLow[] = {-10, -30, 35};
|
||||
hrIncreaseNormal[] = {-10, -50, 40};
|
||||
hrIncreaseHigh[] = {-10, -40, 50};
|
||||
hrIncreaseLow[] = {-10, -20, 35};
|
||||
hrIncreaseNormal[] = {-10, -30, 35};
|
||||
hrIncreaseHigh[] = {-10, -35, 50};
|
||||
timeInSystem = 900;
|
||||
maxDose = 4;
|
||||
inCompatableMedication[] = {};
|
||||
|
@ -3,14 +3,16 @@ class ACE_Settings {
|
||||
class GVAR(allow) {
|
||||
displayName = CSTRING(allow);
|
||||
description = CSTRING(allow_Descr);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
typeName = "SCALAR";
|
||||
values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), ECSTRING(common,VehiclesOnly)};
|
||||
};
|
||||
class GVAR(useMenu) {
|
||||
displayName = CSTRING(useMenu);
|
||||
description = CSTRING(useMenu_Descr);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
value = 0;
|
||||
typeName = "SCALAR";
|
||||
values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), ECSTRING(common,VehiclesOnly)};
|
||||
isClientSettable = 1;
|
||||
};
|
||||
class GVAR(openAfterTreatment) {
|
||||
|
@ -1,8 +1,56 @@
|
||||
|
||||
class CfgVehicles {
|
||||
|
||||
class ACE_Module;
|
||||
class ACE_moduleMedicalSettings: ACE_Module {
|
||||
scope = 2;
|
||||
displayName = CSTRING(module_DisplayName);
|
||||
icon = QUOTE(PATHTOEF(medical,UI\Icon_Module_Medical_ca.paa));
|
||||
category = "ACE_medical";
|
||||
function = QUOTE(DFUNC(module));
|
||||
functionPriority = 1;
|
||||
isGlobal = 1;
|
||||
isTriggerActivated = 0;
|
||||
author = ECSTRING(common,ACETeam);
|
||||
class Arguments {
|
||||
class allow {
|
||||
displayName = CSTRING(allow);
|
||||
description = CSTRING(allow_Descr);
|
||||
typeName = "NUMBER";
|
||||
class values {
|
||||
class disable {
|
||||
name = ECSTRING(common,Disabled);
|
||||
value = 0;
|
||||
};
|
||||
class enable {
|
||||
name = ECSTRING(common,Enabled);
|
||||
value = 1;
|
||||
default = 1;
|
||||
};
|
||||
class VehiclesOnly {
|
||||
name = ECSTRING(common,VehiclesOnly);
|
||||
value = 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class ModuleDescription {
|
||||
description = CSTRING(module_Desc);
|
||||
sync[] = {};
|
||||
};
|
||||
};
|
||||
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
class ACE_SelfActions {
|
||||
class Medical_Menu {
|
||||
displayName = CSTRING(OpenMenu);
|
||||
runOnHover = 0;
|
||||
exceptions[] = {"isNotInside"};
|
||||
condition = QUOTE([ARR_2(ACE_player,_target)] call FUNC(canOpenMenu));
|
||||
statement = QUOTE([_target] call DFUNC(openMenu));
|
||||
icon = PATHTOEF(medical,UI\icons\medical_cross.paa);
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_Actions {
|
||||
@ -12,7 +60,7 @@ class CfgVehicles {
|
||||
displayName = CSTRING(OpenMenu);
|
||||
runOnHover = 0;
|
||||
exceptions[] = {"isNotInside"};
|
||||
condition = QUOTE(GVAR(allow) && GVAR(useMenu));
|
||||
condition = QUOTE([ARR_2(ACE_player,_target)] call FUNC(canOpenMenu));
|
||||
statement = QUOTE([_target] call DFUNC(openMenu));
|
||||
icon = PATHTOEF(medical,UI\icons\medical_cross.paa);
|
||||
};
|
||||
|
@ -19,6 +19,7 @@ if (!hasInterface) exitwith {};
|
||||
if (!(_target isKindOf "CAManBase") || ACE_player distance _target > 10) then {_target = ACE_player};
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if !([ACE_player, _target] call FUNC(canOpenMenu)) exitwith {false};
|
||||
|
||||
// Statement
|
||||
[_target] call FUNC(openMenu);
|
||||
@ -30,3 +31,4 @@ if (!hasInterface) exitwith {};
|
||||
};
|
||||
},
|
||||
[35, [false, false, false]], false, 0] call CBA_fnc_addKeybind;
|
||||
|
||||
|
@ -5,6 +5,7 @@ ADDON = false;
|
||||
PREP(onMenuOpen);
|
||||
PREP(openMenu);
|
||||
|
||||
PREP(canOpenMenu);
|
||||
PREP(updateIcons);
|
||||
PREP(updateUIInfo);
|
||||
PREP(handleUI_DisplayOptions);
|
||||
@ -16,6 +17,7 @@ PREP(updateBodyImage);
|
||||
PREP(updateInformationLists);
|
||||
PREP(setTriageStatus);
|
||||
PREP(collectActions);
|
||||
PREP(module);
|
||||
|
||||
GVAR(INTERACTION_TARGET) = objNull;
|
||||
GVAR(actionsOther) = [];
|
||||
|
24
addons/medical_menu/functions/fnc_canOpenMenu.sqf
Normal file
24
addons/medical_menu/functions/fnc_canOpenMenu.sqf
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Check if ACE_player can Open the medical menu
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Caller <OBJECT>
|
||||
* 1: Target <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Can open <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_medical_menu_canOpenMenu
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_caller", "_target"];
|
||||
|
||||
if !(GVAR(allow) == 1 || (GVAR(allow) == 2 && {vehicle _caller != _caller || vehicle _target != _target} && {alive ACE_player})) exitwith {false};
|
||||
if !(GVAR(useMenu) == 1 || (GVAR(useMenu) == 2 && {vehicle _caller != _caller || vehicle _target != _target} && {alive ACE_player})) exitwith {false};
|
||||
|
||||
true;
|
22
addons/medical_menu/functions/fnc_module.sqf
Normal file
22
addons/medical_menu/functions/fnc_module.sqf
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Module for adjusting the medical menu settings
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The module logic <LOGIC>
|
||||
* 1: units <ARRAY>
|
||||
* 2: activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_logic", "_units", "_activated"];
|
||||
|
||||
if !(_activated) exitWith {};
|
||||
|
||||
[_logic, QGVAR(allow), "allow"] call EFUNC(common,readSettingFromModule);
|
@ -26,7 +26,12 @@
|
||||
<Key ID="STR_ACE_Medical_Menu_DisplayMenuKey">
|
||||
<English>Open Medical Menu</English>
|
||||
</Key>
|
||||
|
||||
<Key ID="STR_ACE_Medical_Menu_module_DisplayName">
|
||||
<English>Medical Menu Settings</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_Menu_module_Desc">
|
||||
<English>Configure the usage of the Medical Menu</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_Menu_EXAMINE_TREATMENT">
|
||||
<Original>EXAMINE & TREATMENT</Original>
|
||||
<Russian>ОСМОТР И ЛЕЧЕНИЕ</Russian>
|
||||
|
Loading…
Reference in New Issue
Block a user