Added dynamic actions to unload patients (unconscious) from vehicles

This commit is contained in:
Nicolás Badano 2015-03-21 15:32:32 -03:00
parent 274dae9a02
commit f8ea603977
6 changed files with 147 additions and 3 deletions

View File

@ -1,7 +1,6 @@
/*
* Author: CAA-Picard
* Mount unit actions inside passenger submenu
* Note: This function is NOT global.
*
* Argument:
* 0: Vehicle <OBJECT>

View File

@ -1,7 +1,6 @@
/*
* Author: CAA-Picard
* Create one action per passenger
* Note: This function is NOT global.
*
* Argument:
* 0: Vehicle <OBJECT>
@ -29,7 +28,7 @@ _actions = [];
str(_unit),
[_unit, true] call EFUNC(common,getName),
"",
{systemChat "selected passenger"},
{},
{true},
{_this call FUNC(addPassengerActions);},
[_unit]

View File

@ -1430,4 +1430,98 @@ class CfgVehicles {
};
};
};
// Patient unload from vehicle actions
class LandVehicle;
class Car: LandVehicle {
class ACE_Actions {
class ACE_MainActions {
class ACE_UnloadPatients {
displayName = "$STR_ACE_Medical_UnloadPatient";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
};
};
};
};
class Tank: LandVehicle {
class ACE_Actions {
class ACE_MainActions {
class ACE_UnloadPatients {
displayName = "$STR_ACE_Medical_UnloadPatient";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
};
};
};
};
class Air;
class Helicopter: Air {
class ACE_Actions {
class ACE_MainActions {
class ACE_UnloadPatients {
displayName = "$STR_ACE_Medical_UnloadPatient";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
};
};
};
};
class Plane: Air {
class ACE_Actions {
class ACE_MainActions {
class ACE_UnloadPatients {
displayName = "$STR_ACE_Medical_UnloadPatient";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
};
};
};
};
class Ship;
class Ship_F: Ship {
class ACE_Actions {
class ACE_MainActions {
class ACE_UnloadPatients {
displayName = "$STR_ACE_Medical_UnloadPatient";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
};
};
};
};
class StaticWeapon: LandVehicle {
class ACE_Actions {
class ACE_MainActions {
class ACE_UnloadPatients {
displayName = "$STR_ACE_Medical_UnloadPatient";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
};
};
};
};
class StaticMortar;
class Mortar_01_base_F: StaticMortar {
class ACE_Actions {
class ACE_MainActions {
class ACE_UnloadPatients {
displayName = "$STR_ACE_Medical_UnloadPatient";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions));
};
};
};
};
};

View File

@ -16,6 +16,7 @@ PREP(addToInjuredCollection);
PREP(addToLog);
PREP(addToTriageCard);
PREP(addUnconsciousCondition);
PREP(addUnloadPatientActions);
PREP(canAccessMedicalEquipment);
PREP(canTreat);
PREP(determineIfFatal);

View File

@ -0,0 +1,48 @@
/*
* Author: CAA-Picard
* Create one unload action per unconscious passenger
*
* Argument:
* 0: Vehicle <OBJECT>
* 1: Player <OBJECT>
* 3: Parameters <ARRAY>
*
* Return value:
* Children actions <ARRAY>
*
* Public: No
*/
#include "script_component.hpp"
EXPLODE_3_PVT(_this,_vehicle,_player,_parameters);
systemChat format ["Generating for %1 %2", _vehicle, _player];
private ["_actions"];
_actions = [];
{
_unit = _x;
systemChat str(_unit);
if (_unit != _player && {(alive _unit) && {_unit getVariable ["ACE_isUnconscious", false]}}) then {
systemChat "Entered";
_actions pushBack
[
[
str(_unit),
[_unit, true] call EFUNC(common,getName),
"",
{[_player, (_this select 2) select 0] call FUNC(actionUnloadUnit);},
{true},
{},
[_unit]
] call EFUNC(interact_menu,createAction),
[],
_unit
];
};
} forEach crew _vehicle;
systemChat str(count _actions);
_actions

View File

@ -725,6 +725,9 @@
<Russian>%1 проводит вам интубацию</Russian>
<Spanish>%1 te está intubando</Spanish>
</Key>
<Key ID="STR_ACE_Medical_UnloadPatient">
<English>Unload patient &gt;&gt;</English>
</Key>
</Container>
</Package>