Skip to content

Commit

Permalink
Merge pull request #10 from Cplhardcore/Medication_Rework
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
Cplhardcore authored Oct 12, 2024
2 parents c6ec349 + d16f109 commit 34bc05f
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 122 deletions.
2 changes: 0 additions & 2 deletions addons/gui/functions/fnc_onMenuOpen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ if (ACEGVAR(medical_gui,target) == ACE_player) then {
_ctrl ctrlSetText QACEPATHTOF(medical_gui,data\categories\toggle_to_self.paa);
_ctrl ctrlSetTooltip ACELLSTRING(medical_gui,ToggleToSelf);
};
[] call FUNC(updateMedications);
[] call FUNC(updateSyringes);
private _syringeMenuStatus = player getVariable ["SyringeMenu", false];
if (_syringeMenuStatus == true) then {
[] call FUNC(openSyringeMenu);
Expand Down
4 changes: 3 additions & 1 deletion addons/gui/functions/fnc_openSyringeMenu.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: Cplhardcore
* opens the syringe menu
* opens the syringe menu and populates it
*
* Arguments:
* none
Expand All @@ -14,6 +14,8 @@
*
* Public: No
*/
[] call FUNC(updateMedications);
[] call FUNC(updateSyringes);
[{player setVariable ["SyringeMenu", true];
ctrlShow [71300, true];
ctrlShow [71301, true];
Expand Down
31 changes: 15 additions & 16 deletions addons/gui/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ class ACE_Medical_Menu {
shadow = "true";
};
};
};
class SYRINGEBackground: IVFlowBackground {
idc = IDC_SYRINGE_BACKGROUND; // LOOK HERE
x = QUOTE(POS_X(39.6));
Expand All @@ -187,9 +186,9 @@ class ACE_Medical_Menu {
color = "#E5E5E5";
font = "RobotoCondensed";
shadow = "true";
};
};
};
};
class controls {
class IVbutton: RscButton {
idc = IDC_IV_FLOW_SHOWBUTTON; // LOOK HERE
Expand Down Expand Up @@ -665,9 +664,9 @@ class ACE_Medical_Menu {
class SyringeOpenButton: RscButton {
idc = IDC_SYRINGE_OPEN;
text = CSTRING(OpenSyringeMenu);
x = QUOTE(POS_X(39.6));
y = QUOTE(POS_Y(4.9));
w = QUOTE(POS_W(4));
x = QUOTE(POS_X(23.6));
y = QUOTE(POS_Y(0));
w = QUOTE(POS_W(4.4));
h = QUOTE(POS_H(1));
colorBackgroundDisabled[] = GUI_BCG_COLOR;
colorBackground[] = GUI_BCG_COLOR;
Expand All @@ -687,7 +686,7 @@ class ACE_Medical_Menu {
w = QUOTE(POS_W(9.2));
h = QUOTE(POS_H(16.5));
class controls {
class SyringeCloseButton: RscButton {
class SyringeCloseButton: RscButton {
idc = IDC_SYRINGE_CLOSE;
text = CSTRING(CloseMenu);
x = QUOTE(POS_X(10.3));
Expand All @@ -702,8 +701,7 @@ class ACE_Medical_Menu {
font = "RobotoCondensed";
shadow = "false";
};
};

};
class SyringeTypeTitle: RscStructuredText {
idc = IDC_SYRINGE_TYPE_TITLE; // LOOK HERE
text = CSTRING(SyringeTitleList);
Expand All @@ -720,15 +718,15 @@ class ACE_Medical_Menu {
font = "RobotoCondensed";
shadow = "false";
};
};
};
class SyringeList: RscListBox {
idc = IDC_SYRINGE_TYPE_LIST; // LOOK HERE
x = QUOTE(POS_X(3.8));
y = QUOTE(POS_Y(2.3));
w = QUOTE(POS_W(8));
h = QUOTE(POS_H(2));
show = 1;
};
};
class MedicationTypeTitle: RscStructuredText {
idc = IDC_MEDICATION_TYPE_TITLE; // LOOK HERE
text = CSTRING(MedicationTitleList);
Expand All @@ -744,16 +742,16 @@ class ACE_Medical_Menu {
color = "#E5E5E5";
font = "RobotoCondensed";
shadow = "false";
};
};
};
class MedicationList: RscListBox {
idc = IDC_MEDICATION_TYPE_LIST; // LOOK HERE
x = QUOTE(POS_X(3.8));
y = QUOTE(POS_Y(5.6));
w = QUOTE(POS_W(8));
h = QUOTE(POS_H(6));
show = 1;
};
};
class DoseTitle: RscStructuredText {
idc = IDC_MEDICATION_DOSE_TITLE; // LOOK HERE
text = CSTRING(DoseTitle);
Expand All @@ -769,8 +767,8 @@ class ACE_Medical_Menu {
color = "#E5E5E5";
font = "RobotoCondensed";
shadow = "false";
};
};
};
class DoseList: RscCombo {
idc = IDC_MEDICATION_DOSE_COMBO; // LOOK HERE
x = QUOTE(POS_X(3.8));
Expand All @@ -795,9 +793,9 @@ class ACE_Medical_Menu {
{
text = CSTRING(DoseHigh);
value = 3;
};
};
};
};
class PrepSyringe: RscButton {
idc = IDC_MEDICATION_PREP_SYRINGE; // LOOK HERE
text = CSTRING(PrepSyringe);
Expand All @@ -817,7 +815,8 @@ class ACE_Medical_Menu {
font = "RobotoCondensed";
shadow = "false";
};
};
};
};
};
};
};
};
14 changes: 13 additions & 1 deletion addons/pharma/ACE_Medical_Treatment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ class ACE_ADDON(Medical_Treatment) {
timeTillMaxEffect = 20;
viscosityChange = -10;
opioidRelief = 1.2;
opioidEffect = 0.17;
};
class syringe_fentanyl_5ml_3 {
painReduce = 1;
Expand Down Expand Up @@ -546,6 +547,8 @@ class ACE_ADDON(Medical_Treatment) {
timeInSystem = 900;
timeTillMaxEffect = 15;
viscosityChange = 10;
onOverDose = "";
opioidEffect = 0.11;
};
class syringe_nalbuphine_5ml_1 {
painReduce = 0.5;
Expand Down Expand Up @@ -719,7 +722,9 @@ class ACE_ADDON(Medical_Treatment) {
timeInSystem = 300;
timeTillMaxEffect = 60;
viscosityChange = -10;
opioidRelief = 1.1;
onOverDose = "";
opioidRelief = 1.5;
opioidEffect = 0.17;
};
class syringe_fentanyl_10ml_3 {
painReduce = 0.8;
Expand All @@ -730,6 +735,7 @@ class ACE_ADDON(Medical_Treatment) {
timeTillMaxEffect = 60;
viscosityChange = -10;
opioidRelief = 1.3;
opioidEffect = 0.17;
};
class syringe_ketamine_10ml_1 {
painReduce = 0.6;
Expand Down Expand Up @@ -826,12 +832,15 @@ class ACE_ADDON(Medical_Treatment) {
maxDoseDeviation = 3;
incompatibleMedication[] = {};
onOverDose = "";
opioidRelief = 1.3;
opioidEffect = 0.17;
};
class syringe_nitroglycerin {
maxDose = 9;
maxDoseDeviation = 3;
incompatibleMedication[] = {};
onOverDose = "";
opioidEffect = 0.17;
};
class syringe_atropineIV {
maxDose = 9;
Expand All @@ -850,12 +859,15 @@ class ACE_ADDON(Medical_Treatment) {
maxDoseDeviation = 3;
incompatibleMedication[] = {};
onOverDose = "";
opioidRelief = 1.5;
opioidEffect = 0.17;
};
class syringe_flumazenil {
maxDose = 6;
maxDoseDeviation = 3;
incompatibleMedication[] = {};
onOverDose = "";
opioidEffect = 0.17;
};
class syringe_lorazepam {
maxDose = 6;
Expand Down
18 changes: 9 additions & 9 deletions addons/pharma/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ACE_Medical_Treatment_Actions {
class BloodIV_500: BloodIV {
callbackSuccess = "[_medic, _patient, _bodyPart, _className, _itemUser, _usedItem] call ace_medical_treatment_fnc_ivBag; [_patient, -400, 8] call kat_pharma_fnc_fluid;";
};
class BloodIV_350: BloodIV {
class BloodIV_250: BloodIV {
callbackSuccess = "[_medic, _patient, _bodyPart, _className, _itemUser, _usedItem] call ace_medical_treatment_fnc_ivBag; [_patient, -200, 4] call kat_pharma_fnc_fluid;";
};
class SalineIV: BloodIV {
Expand All @@ -25,7 +25,7 @@ class ACE_Medical_Treatment_Actions {
class SalineIV_500: SalineIV {
callbackSuccess = "[_medic, _patient, _bodyPart, _className, _itemUser, _usedItem] call ace_medical_treatment_fnc_ivBag; [_patient, 350, 0] call kat_pharma_fnc_fluid;";
};
class SalineIV_350: SalineIV {
class SalineIV_250: SalineIV {
callbackSuccess = "[_medic, _patient, _bodyPart, _className, _itemUser, _usedItem] call ace_medical_treatment_fnc_ivBag; [_patient, 150, 0] call kat_pharma_fnc_fluid;";
};
class PlasmaIV: BloodIV {
Expand All @@ -34,7 +34,7 @@ class ACE_Medical_Treatment_Actions {
class PlasmaIV_500: PlasmaIV {
callbackSuccess = "[_medic, _patient, _bodyPart, _className, _itemUser, _usedItem] call ace_medical_treatment_fnc_ivBag; [_patient, -250, 10] call kat_pharma_fnc_fluid;";
};
class PlasmaIV_350: PlasmaIV {
class PlasmaIV_250: PlasmaIV {
callbackSuccess = "[_medic, _patient, _bodyPart, _className, _itemUser, _usedItem] call ace_medical_treatment_fnc_ivBag; [_patient, -100, 5] call kat_pharma_fnc_fluid;";
};
class Epinephrine: Morphine {
Expand Down Expand Up @@ -886,20 +886,20 @@ class ACE_Medical_Treatment_Actions {
sounds[] = {};
};
class syringe_morphineIV_10ml_1: syringe_TXA_10ml_1 {
displayName = CSTRING(inject_morphine_IM_1);
displayNameProgress = CSTRING(injecting_morphine_IM_1);
displayName = CSTRING(inject_morphineIV_IM_1);
displayNameProgress = CSTRING(injecting_morphineIV_IM_1);
allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"};
allowSelfTreatment = 1;
medicRequired = QGVAR(medLvl_morphineIM);
treatmentTime = QGVAR(treatmentTime_morphineIM);
items[] = {"kat_syringe_morphine_10ml_1"};
items[] = {"kat_syringe_morphineIV_10ml_1"};
callbackSuccess = QFUNC(medication);
sounds[] = {};
};
class syringe_morphineIV_10ml_3: syringe_morphineIV_10ml_1 {
displayName = CSTRING(inject_morphine_IM_3);
displayNameProgress = CSTRING(injecting_morphine_IM_3);
items[] = {"kat_syringe_morphine_10ml_3"};
displayName = CSTRING(inject_morphineIV_IM_3);
displayNameProgress = CSTRING(injecting_morphineIV_IM_3);
items[] = {"kat_syringe_morphineIV_10ml_3"};
callbackSuccess = QFUNC(medication);
sounds[] = {};
};
Expand Down
22 changes: 11 additions & 11 deletions addons/pharma/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class CfgWeapons {
descriptionShort = CSTRING(Lorazepam_DescShort);
ACE_isMedicalItem = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 0.2;
mass = 0.5;
};
};
class kat_flumazenil: ACE_ItemCore {
Expand All @@ -242,7 +242,7 @@ class CfgWeapons {
descriptionShort = CSTRING(Flumazenil_DescShort);
ACE_isMedicalItem = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 0.2;
mass = 0.5;
};
};
class kat_etomidate: ACE_ItemCore {
Expand All @@ -253,7 +253,7 @@ class CfgWeapons {
descriptionShort = CSTRING(Etomidate_DescShort);
ACE_isMedicalItem = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 0.2;
mass = 0.5;
};
};
class kat_epinephrineIV: ACE_ItemCore {
Expand All @@ -264,7 +264,7 @@ class CfgWeapons {
descriptionShort = CSTRING(EpinephrineIV_DescShort);
ACE_isMedicalItem = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 0.2;
mass = 0.5;
};
};
class kat_morphineIV: ACE_ItemCore {
Expand All @@ -275,7 +275,7 @@ class CfgWeapons {
descriptionShort = CSTRING(MorphineIV_DescShort);
ACE_isMedicalItem = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 0.2;
mass = 0.5;
};
};
class kat_adenosineIV: ACE_ItemCore {
Expand All @@ -286,7 +286,7 @@ class CfgWeapons {
descriptionShort = CSTRING(AdenosineIV_DescShort);
ACE_isMedicalItem = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 0.2;
mass = 0.5;
};
};
class kat_coag_sense: ACE_ItemCore {
Expand Down Expand Up @@ -324,7 +324,7 @@ class CfgWeapons {
};
class kat_syringe_morphineIV_10ml_1: ACE_ItemCore {
scope = 1;
displayName = CSTRING(Syringe_morphine_10_1_Display);
displayName = CSTRING(Syringe_morphineIV_10_1_Display);
picture = QPATHTOF(ui\syringe_item.paa);
model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d";
descriptionShort = CSTRING(Syringe_morphineIV_10_1_DescShort);
Expand Down Expand Up @@ -731,21 +731,21 @@ class CfgWeapons {
};
class kat_syringe_morphineIV_5ml_1: ACE_ItemCore {
scope = 1;
displayName = CSTRING(Syringe_morphine_5_1_Display);
displayName = CSTRING(Syringe_morphineIV_5_1_Display);
picture = QPATHTOF(ui\syringe_item.paa);
model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d";
descriptionShort = CSTRING(Syringe_morphine_5_1_DescShort);
descriptionShort = CSTRING(Syringe_morphineIV_5_1_DescShort);
ACE_isMedicalItem = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 1;
};
};
class kat_syringe_morphineIV_5ml_3: ACE_ItemCore {
scope = 1;
displayName = CSTRING(Syringe_morphine_5_3_Display);
displayName = CSTRING(Syringe_morphineIV_5_3_Display);
picture = QPATHTOF(ui\syringe_item.paa);
model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d";
descriptionShort = CSTRING(Syringe_morphine_5_3_DescShort);
descriptionShort = CSTRING(Syringe_morphineIV_5_3_DescShort);
ACE_isMedicalItem = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 1;
Expand Down
3 changes: 0 additions & 3 deletions addons/pharma/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
PREP(alphaAction);
PREP(applyIV);
PREP(checkIV);
PREP(clotWound);
Expand Down Expand Up @@ -49,7 +48,5 @@ PREP(treatmentAdvanced_TXALocal);
PREP(vehicleCheckDialysis);
PREP(prepareSyringe);
PREP(checkIVType);
PREP(treatmentAdvanced_KetamineSedationLocal);
PREP(ivCondition);
PREP(AMSCheck);
PREP(getAllMedicationsCount)
1 change: 0 additions & 1 deletion addons/pharma/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
[QGVAR(pervitinLocal), LINKFUNC(treatmentAdvanced_PervitinLocal)] call CBA_fnc_addEventHandler;
[QGVAR(pervitinPP), LINKFUNC(pervitinPP)] call CBA_fnc_addEventHandler;
[QGVAR(ketamineLocal), LINKFUNC(treatmentAdvanced_KetamineLocal)] call CBA_fnc_addEventHandler;
[QGVAR(ketamineLocal), LINKFUNC(treatmentAdvanced_KetamineSedationLocal)] call CBA_fnc_addEventHandler;
[QGVAR(fentanylLocal), LINKFUNC(treatmentAdvanced_FentanylLocal)] call CBA_fnc_addEventHandler;
[QGVAR(caffeineLocal), LINKFUNC(treatmentAdvanced_CaffeineLocal)] call CBA_fnc_addEventHandler;

Expand Down
Loading

0 comments on commit 34bc05f

Please sign in to comment.