move modifyAction func to menu component

This commit is contained in:
commy2 2016-10-07 01:58:40 +02:00
parent d4dd1626a5
commit b698a88dc1
5 changed files with 19 additions and 17 deletions

View File

@ -3,7 +3,7 @@ class ACE_Head {
icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); icon = QPATHTOEF(medical,UI\icons\medical_cross.paa);
exceptions[] = {"isNotInside", "isNotSitting"}; exceptions[] = {"isNotInside", "isNotSitting"};
statement = QUOTE([ARR_3(_target, true, 0)] call EFUNC(medical_treatment,displayPatientInformation)); statement = QUOTE([ARR_3(_target, true, 0)] call EFUNC(medical_treatment,displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,0,_this select 3)] call EFUNC(medical_treatment,modifyMedicalAction)); modifierFunction = QUOTE([ARR_4(_target,_player,0,_this select 3)] call FUNC(modifyAction));
condition = "true"; condition = "true";
runOnHover = 1; runOnHover = 1;
}; };
@ -14,7 +14,7 @@ class ACE_Torso {
runOnHover = 1; runOnHover = 1;
exceptions[] = {"isNotInside", "isNotSitting"}; exceptions[] = {"isNotInside", "isNotSitting"};
statement = QUOTE([ARR_3(_target, true, 1)] call EFUNC(medical_treatment,displayPatientInformation)); statement = QUOTE([ARR_3(_target, true, 1)] call EFUNC(medical_treatment,displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,1,_this select 3)] call EFUNC(medical_treatment,modifyMedicalAction)); modifierFunction = QUOTE([ARR_4(_target,_player,1,_this select 3)] call FUNC(modifyAction));
showDisabled = 1; showDisabled = 1;
priority = 2; priority = 2;
icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); icon = QPATHTOEF(medical,UI\icons\medical_cross.paa);
@ -24,7 +24,7 @@ class ACE_ArmLeft {
runOnHover = 1; runOnHover = 1;
exceptions[] = {"isNotInside", "isNotSitting"}; exceptions[] = {"isNotInside", "isNotSitting"};
statement = QUOTE([ARR_3(_target, true, 2)] call EFUNC(medical_treatment,displayPatientInformation)); statement = QUOTE([ARR_3(_target, true, 2)] call EFUNC(medical_treatment,displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,2,_this select 3)] call EFUNC(medical_treatment,modifyMedicalAction)); modifierFunction = QUOTE([ARR_4(_target,_player,2,_this select 3)] call FUNC(modifyAction));
condition = "true"; condition = "true";
icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); icon = QPATHTOEF(medical,UI\icons\medical_cross.paa);
}; };
@ -33,7 +33,7 @@ class ACE_ArmRight {
runOnHover = 1; runOnHover = 1;
exceptions[] = {"isNotInside", "isNotSitting"}; exceptions[] = {"isNotInside", "isNotSitting"};
statement = QUOTE([ARR_3(_target, true, 3)] call EFUNC(medical_treatment,displayPatientInformation)); statement = QUOTE([ARR_3(_target, true, 3)] call EFUNC(medical_treatment,displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,3,_this select 3)] call EFUNC(medical_treatment,modifyMedicalAction)); modifierFunction = QUOTE([ARR_4(_target,_player,3,_this select 3)] call FUNC(modifyAction));
condition = "true"; condition = "true";
icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); icon = QPATHTOEF(medical,UI\icons\medical_cross.paa);
}; };
@ -42,7 +42,7 @@ class ACE_LegLeft {
runOnHover = 1; runOnHover = 1;
exceptions[] = {"isNotInside", "isNotSitting"}; exceptions[] = {"isNotInside", "isNotSitting"};
statement = QUOTE([ARR_3(_target, true, 4)] call EFUNC(medical_treatment,displayPatientInformation)); statement = QUOTE([ARR_3(_target, true, 4)] call EFUNC(medical_treatment,displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,4,_this select 3)] call EFUNC(medical_treatment,modifyMedicalAction)); modifierFunction = QUOTE([ARR_4(_target,_player,4,_this select 3)] call FUNC(modifyAction));
condition = "true"; condition = "true";
icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); icon = QPATHTOEF(medical,UI\icons\medical_cross.paa);
}; };
@ -51,7 +51,7 @@ class ACE_LegRight {
runOnHover = 1; runOnHover = 1;
exceptions[] = {"isNotInside", "isNotSitting"}; exceptions[] = {"isNotInside", "isNotSitting"};
statement = QUOTE([ARR_3(_target, true, 5)] call EFUNC(medical_treatment,displayPatientInformation)); statement = QUOTE([ARR_3(_target, true, 5)] call EFUNC(medical_treatment,displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,5,_this select 3)] call EFUNC(medical_treatment,modifyMedicalAction)); modifierFunction = QUOTE([ARR_4(_target,_player,5,_this select 3)] call FUNC(modifyAction));
condition = "true"; condition = "true";
icon = QPATHTOEF(medical,UI\icons\medical_cross.paa); icon = QPATHTOEF(medical,UI\icons\medical_cross.paa);
}; };

View File

@ -1,13 +1,15 @@
PREP(canOpenMenu); PREP(canOpenMenu);
PREP(openMenu);
PREP(onMenuOpen);
PREP(onMenuClose);
PREP(collectActions); PREP(collectActions);
PREP(collectActions3D); PREP(collectActions3D);
PREP(modifyAction);
PREP(getTreatmentOptions); PREP(getTreatmentOptions);
PREP(handleUI_DisplayOptions); PREP(handleUI_DisplayOptions);
PREP(handleUI_dropDownTriageCard); PREP(handleUI_dropDownTriageCard);
PREP(module); PREP(module);
PREP(onMenuClose);
PREP(onMenuOpen);
PREP(openMenu);
PREP(setTriageStatus); PREP(setTriageStatus);
PREP(updateActivityLog); PREP(updateActivityLog);
PREP(updateBodyImage); PREP(updateBodyImage);

View File

@ -15,7 +15,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private _actionsConfig = [nil, configFile >> QEGVAR(medical_treatment,actions) >> "Basic", configFile >> QEGVAR(medical_treatment,actions) >> "Advanced"] select EGVAR(medical,level); private _actionsConfig = configFile >> QEGVAR(medical_treatment,actions) >> CUR_LEVEL;
private _actionPaths = ["ACE_Head", "ACE_Torso", "ACE_ArmLeft", "ACE_ArmRight", "ACE_LegLeft", "ACE_LegRight"]; private _actionPaths = ["ACE_Head", "ACE_Torso", "ACE_ArmLeft", "ACE_ArmRight", "ACE_LegLeft", "ACE_LegRight"];
private _actionPathTexts = [ private _actionPathTexts = [
localize ELSTRING(interaction,Head), localize ELSTRING(interaction,Torso), localize ELSTRING(interaction,Head), localize ELSTRING(interaction,Torso),

View File

@ -6,7 +6,7 @@
* Arguments: * Arguments:
* 0: The Patient Unit <OBJECT> * 0: The Patient Unit <OBJECT>
* 1: The Diagnosing Unit <OBJECT> * 1: The Diagnosing Unit <OBJECT>
* 2: Selection Number <NUMBER> * 2: Body part index <NUMBER>
* 3: The action to modify <OBJECT> * 3: The action to modify <OBJECT>
* *
* ReturnValue: * ReturnValue:
@ -14,16 +14,17 @@
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_target", "_player", "_partNumber", "_actionData"]; params ["_target", "_player", "_partIndex", "_actionData"];
private _bloodLossOnSelection = 0; private _bloodLossOnSelection = 0;
// Add all bleeding from wounds on selection // Add all bleeding from wounds on selection
{ {
_x params ["", "", "_selectionX", "_amountOf", "_percentageOpen"]; _x params ["", "", "_bodyPartN", "_amountOf", "_percentageOpen"];
if (_selectionX == _partNumber) then {
if (_bodyPartN == _partIndex) then {
_bloodLossOnSelection = _bloodLossOnSelection + (_amountOf * _percentageOpen); _bloodLossOnSelection = _bloodLossOnSelection + (_amountOf * _percentageOpen);
}; };
} forEach (_target getvariable [QEGVAR(medical,openWounds), []]); } forEach (_target getvariable [QEGVAR(medical,openWounds), []]);
@ -31,7 +32,7 @@ private _bloodLossOnSelection = 0;
if (_bloodLossOnSelection >= 0.15) then { if (_bloodLossOnSelection >= 0.15) then {
_actionData set [2, QPATHTOEF(medical,UI\icons\medical_crossRed.paa)]; _actionData set [2, QPATHTOEF(medical,UI\icons\medical_crossRed.paa)];
} else { } else {
if (_bloodLossOnSelection > 0 ) then { if (_bloodLossOnSelection > 0) then {
_actionData set [2, QPATHTOEF(medical,UI\icons\medical_crossYellow.paa)]; _actionData set [2, QPATHTOEF(medical,UI\icons\medical_crossYellow.paa)];
}; };
}; };

View File

@ -21,7 +21,6 @@ PREP(handleBandageOpening);
PREP(isBeingCarried); PREP(isBeingCarried);
PREP(isBeingDragged); PREP(isBeingDragged);
PREP(medicationEffectLoop); PREP(medicationEffectLoop);
PREP(modifyMedicalAction);
PREP(onMedicationUsage); PREP(onMedicationUsage);
// treaments // treaments