Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General - Remove Overwrites #488

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion addons/airway/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
PREP(checkAirway);
PREP(checkRecovery);
PREP(fullHealLocal);
PREP(gui_updateBodyImage);
PREP(gui_updateInjuryListGeneral);
PREP(gui_updateInjuryListPart);
PREP(handleAirway);
PREP(handlePuking);
PREP(handleRecoveryPosition);
PREP(handleRespawn);
PREP(init);
PREP(startHeadTurning);
PREP(treatmentAdvanced_Accuvac);
Expand All @@ -16,4 +21,4 @@ PREP(treatmentAdvanced_hyperextendHead);
PREP(treatmentAdvanced_RecoveryPosition);
PREP(treatmentAdvanced_RecoveryPositionLocal);
PREP(treatmentAdvanced_RemoveAirwayItem);
PREP(treatmentAdvanced_RemoveAirwayItemLocal);
PREP(treatmentAdvanced_RemoveAirwayItemLocal);
10 changes: 8 additions & 2 deletions addons/airway/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ if !(GVAR(enable)) exitWith {};
[_output, 2, _medic] call ACEFUNC(common,displayTextStructured);
}] call CBA_fnc_addEventHandler;

[QEGVAR(misc,handleRespawn), LINKFUNC(handleRespawn)] call CBA_fnc_addEventHandler;

[QACEGVAR(medical_gui,updateInjuryListGeneral), LINKFUNC(gui_updateInjuryListGeneral)] call CBA_fnc_addEventHandler;
[QACEGVAR(medical_gui,updateInjuryListPart), LINKFUNC(gui_updateInjuryListPart)] call CBA_fnc_addEventHandler;
[QACEGVAR(medical_gui,updateBodyImage), LINKFUNC(gui_updateBodyImage)] call CBA_fnc_addEventHandler;
[QACEGVAR(medical_treatment,fullHealLocalMod), LINKFUNC(fullHealLocal)] call CBA_fnc_addEventHandler;
["ace_unconscious", {
params ["_unit", "_state"];
if !(_state) exitWith {
_unit call FUNC(init);
[_unit] call FUNC(init);
};

private _alive = alive _unit;
Expand All @@ -28,4 +34,4 @@ if !(GVAR(enable)) exitWith {};
};
[_unit] call FUNC(handleAirway);
[_unit] call FUNC(handlePuking);
}] call CBA_fnc_addEventHandler;
}] call CBA_fnc_addEventHandler;
4 changes: 2 additions & 2 deletions addons/airway/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class CfgPatches {
};
magazines[] = {};
requiredAddons[] = {
"kat_main",
"ace_medical",
"ace_medical_ai",
"ace_medical_blood",
Expand All @@ -31,8 +32,7 @@ class CfgPatches {
"ace_medical_treatment",
"ace_medical_vitals",
"ace_dogtags",
"cba_settings",
"kat_main"
"cba_settings"
};
author = "Katalam";
authors[] = {"Katalam"};
Expand Down
28 changes: 28 additions & 0 deletions addons/airway/functions/fnc_fullHealLocal.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include "..\script_component.hpp"
/*
* Author: MiszczuZPolski
* Local callback for fully healing a patient.
*
* Arguments:
* 0: Patient <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call kat_airway_fnc_fullHealLocal
*
* Public: No
*/

params ["_patient"];
TRACE_1("fullHealLocal",_patient);

_patient setVariable [QGVAR(airway_item), "", true];
_patient setVariable [QGVAR(airway), false, true];
_patient setVariable [QGVAR(clearedTime), 0, true];
_patient setVariable [QGVAR(obstruction), false, true];
_patient setVariable [QGVAR(occluded), false, true];
_patient setVariable [QGVAR(overstretch), false, true];
_patient setVariable [QGVAR(recovery), false, true];
_patient setVariable [QGVAR(wasOccluded), false];
38 changes: 38 additions & 0 deletions addons/airway/functions/fnc_gui_updateBodyImage.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include "..\script_component.hpp"
/*
* Author: Blue
* Updates the body image for given target.
*
* Arguments:
* 0: Body image controls group <CONTROL>
* 1: Target <OBJECT>
* 2: Body part <NUMBER>
*
* Return Value:
* None
*
* Example:
* [CONTROL, _target, 0] call kat_airway_fnc_gui_updateBodyImage
*
* Public: No
*/

params ["_ctrlGroup", "_target", "_selectionN"];

private _ctrlGuedelTube = _ctrlGroup controlsGroupCtrl IDC_BODY_HEAD_GUEDELTUBE;
private _ctrlKingLT = _ctrlGroup controlsGroupCtrl IDC_BODY_HEAD_KINGLT;

private _airwayItem = _target getVariable [QGVAR(airway_item), ""];

if !(_airwayItem isEqualTo "") then {
if (_airwayItem isEqualTo "Larynxtubus") then {
_ctrlGuedelTube ctrlShow false;
_ctrlKingLT ctrlShow true;
} else {
_ctrlGuedelTube ctrlShow true;
_ctrlKingLT ctrlShow false;
};
} else {
_ctrlGuedelTube ctrlShow false;
_ctrlKingLT ctrlShow false;
};
25 changes: 25 additions & 0 deletions addons/airway/functions/fnc_gui_updateInjuryListGeneral.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "..\script_component.hpp"
/*
* Author: AtrixZockt
* Updates injury list for given body part for the target.
*
* Arguments:
* 0: Injury list <CONTROL>
* 1: Target <OBJECT>
* 2: Body part, -1 to only show overall health info <NUMBER>
* 3: Entries <ARRAY>
*
* Return Value:
* None
*
* Example:
* [_ctrlInjuries, _target, 0] call kat_airway_fnc_gui_updateInjuryListGeneral
*
* Public: No
*/

params ["_ctrl", "_target", "_selectionN", "_entries"];

if (_target getVariable [QGVAR(recovery), false]) then {
_entries pushback [LLSTRING(RecoveryPosition), [0.1, 1, 1, 1]];
};
33 changes: 33 additions & 0 deletions addons/airway/functions/fnc_gui_updateInjuryListPart.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "..\script_component.hpp"
/*
* Author: AtrixZockt
* Updates injury list for given body part for the target.
*
* Arguments:
* 0: Injury list <CONTROL>
* 1: Target <OBJECT>
* 2: Body part, -1 to only show overall health info <NUMBER>
* 3: Entries <ARRAY>
*
* Return Value:
* None
*
* Example:
* [_ctrlInjuries, _target, 0] call kat_airway_fnc_gui_updateInjuryListPart
*
* Public: No
*/

params ["_ctrl", "_target", "_selectionN", "_entries"];

if (_target getVariable [QGVAR(overstretch), false] && _selectionN isEqualTo 0) then {
_entries pushBack [LLSTRING(Hyperextended), [0.1, 1, 1, 1]];
};

if (_target getVariable [QGVAR(airway), false] && _selectionN isEqualTo 0) then {
private _a = _target getVariable [QGVAR(airway_item), ""];
if !(_a isEqualTo "") then {
private _text = format [LSTRING(%1_Display), _a];
_entries pushback [localize _text, [0.1, 1, 1, 1]];
};
};
26 changes: 26 additions & 0 deletions addons/airway/functions/fnc_handleRespawn.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include "..\script_component.hpp"
/*
* Author: YetheSamartaka
* Ensures proper initial values reset on respawn
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Corpse <OBJECT>
*
* Return Value:
* None
*
* Example:
* [alive, body] call kat_misc_fnc_handleRespawn;
*
* Public: No
*/

params ["_unit","_dead"];
TRACE_2("handleRespawn",_unit,_dead);

[_unit] call FUNC(fullHealLocal);
// Can these go in fullHealLocal?
_unit setVariable [QEGVAR(airway,airway), false, true];
_unit setVariable [QEGVAR(airway,airway_item), "", true];
KAT_forceWakeup = false;
10 changes: 3 additions & 7 deletions addons/airway/functions/fnc_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ params ["_unit", ["_isRespawn", true]];
if (!local _unit) exitWith {};
if !(GVAR(enable)) exitWith {};

_unit setVariable [QGVAR(obstruction), false, true];
_unit setVariable [QGVAR(occluded), false, true];
_unit setVariable [QGVAR(airway), false, true];
_unit setVariable [QGVAR(overstretch), false, true];
_unit setVariable [QGVAR(recovery), false, true];
_unit setVariable [QGVAR(airway_item), "", true];
_unit setVariable [QGVAR(clearedTime), 0, true];
// init variables
[_unit] call FUNC(fullHealLocal);

KAT_forceWakeup = false;
1 change: 1 addition & 0 deletions addons/airway/script_component.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#define COMPONENT airway
#define COMPONENT_BEAUTIFIED KAT - Airway
#include "\x\kat\addons\main\script_mod.hpp"
#include "\x\kat\addons\gui\gui_defines.hpp"

// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
Expand Down
7 changes: 6 additions & 1 deletion addons/breathing/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
PREP(canUseBVM);
PREP(checkBreathing);
PREP(checkPulseOximeter);
PREP(fullHealLocal);
PREP(gui_updateBodyImage);
PREP(gui_updateInjuryListPart);
PREP(gui_updateInjuryListWounds);
PREP(handleBreathing);
PREP(handlePneumothoraxDeterioration);
PREP(handlePulmoHit);
PREP(handleRespawn);
PREP(hasBVM);
PREP(hasOxygenTank);
PREP(inflictAdvancedPneumothorax);
Expand All @@ -21,4 +26,4 @@ PREP(treatmentAdvanced_pulseoximeterLocal);
PREP(treatmentAdvanced_removePulseoximeter);
PREP(treatmentAdvanced_tensionpneumothorax);
PREP(treatmentAdvanced_tensionpneumothoraxLocal);
PREP(useBVM);
PREP(useBVM);
8 changes: 7 additions & 1 deletion addons/breathing/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
_unit say3D [QGVAR(pneumothoraxcough), 15];
}] call CBA_fnc_addEventHandler;

[QEGVAR(misc,handleRespawn), LINKFUNC(handleRespawn)] call CBA_fnc_addEventHandler;

[QACEGVAR(medical_gui,updateInjuryListPart), LINKFUNC(gui_updateInjuryListPart)] call CBA_fnc_addEventHandler;
[QACEGVAR(medical_gui,updateInjuryListWounds), LINKFUNC(gui_updateInjuryListWounds)] call CBA_fnc_addEventHandler;
[QACEGVAR(medical_gui,updateBodyImage), LINKFUNC(gui_updateBodyImage)] call CBA_fnc_addEventHandler;
[QACEGVAR(medical_treatment,fullHealLocalMod), LINKFUNC(fullHealLocal)] call CBA_fnc_addEventHandler;
[QACEGVAR(medical,woundReceived),LINKFUNC(handlePulmoHit)] call CBA_fnc_addEventHandler;

["kat_oxygenTank_300_Item", "kat_oxygenTank_300"] call ACEFUNC(common,registerItemReplacement);
["kat_oxygenTank_150_Item", "kat_oxygenTank_150"] call ACEFUNC(common,registerItemReplacement);
["kat_oxygenTank_150_Item", "kat_oxygenTank_150"] call ACEFUNC(common,registerItemReplacement);
6 changes: 3 additions & 3 deletions addons/breathing/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class CfgPatches {
};
magazines[] = {};
requiredAddons[] = {
"kat_main",
"kat_airway",
"kat_circulation",
"ace_medical",
"ace_medical_ai",
"ace_medical_blood",
Expand All @@ -27,9 +30,6 @@ class CfgPatches {
"ace_medical_treatment",
"ace_medical_vitals",
"ace_dogtags",
"kat_main",
"kat_airway",
"kat_circulation",
"cba_settings"
};
author = "Katalam";
Expand Down
30 changes: 30 additions & 0 deletions addons/breathing/functions/fnc_fullHealLocal.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include "..\script_component.hpp"
/*
* Author: MiszczuZPolski
* Local callback for fully healing a patient.
*
* Arguments:
* 0: Patient <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call kat_breathing_fnc_fullHealLocal
*
* Public: No
*/

params ["_patient"];
TRACE_1("fullHealLocal",_patient);

_patient setVariable [QGVAR(airwayStatus), 100, true];
_patient setVariable [QGVAR(pneumothorax), 0, true];
_patient setVariable [QGVAR(hemopneumothorax), false, true];
_patient setVariable [QGVAR(tensionpneumothorax), false, true];
_patient setVariable [QGVAR(activeChestSeal), false, true];
_patient setVariable [QGVAR(deepPenetratingInjury), false, true];

if (ACEGVAR(advanced_fatigue,enabled)) then {
["kat_LSDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor);
};
61 changes: 61 additions & 0 deletions addons/breathing/functions/fnc_gui_updateBodyImage.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#include "..\script_component.hpp"
/*
* Author: Blue
* Updates the body image for given target.
*
* Arguments:
* 0: Body image controls group <CONTROL>
* 1: Target <OBJECT>
* 2: Body part <NUMBER>
*
* Return Value:
* None
*
* Example:
* [CONTROL, _target, 0] call kat_breathing_fnc_gui_updateBodyImage
*
* Public: No
*/

params ["_ctrlGroup", "_target", "_selectionN"];

private _ctrlPulseOximeterRight = _ctrlGroup controlsGroupCtrl IDC_BODY_RIGHTARM_PULSEOX;
private _ctrlPulseOximeterLeft = _ctrlGroup controlsGroupCtrl IDC_BODY_LEFTARM_PULSEOX;
private _ctrlChestSeal = _ctrlGroup controlsGroupCtrl IDC_BODY_TORSO_CHESTSEAL;
private _ctrlChestInjury = _ctrlGroup controlsGroupCtrl IDC_BODY_TORSO_PNEUMOTHORAX;

if (_target getVariable [QGVAR(activeChestSeal), false]) then {
_ctrlChestSeal ctrlShow true;
} else {
_ctrlChestSeal ctrlShow false;
};

if (GVAR(PneumothoraxAlwaysVisible)) then {
if(_target getVariable [QGVAR(pneumothorax), 0] > 0) then {
_ctrlChestInjury ctrlShow true;
} else {
_ctrlChestInjury ctrlShow false;
};
} else {
if (_target getVariable [QGVAR(deepPenetratingInjury), false] || (_target getVariable [QGVAR(pneumothorax), 0] > 0)) then {
_ctrlChestInjury ctrlShow true;
} else {
_ctrlChestInjury ctrlShow false;
};
};

if (_target getVariable [QGVAR(pulseoximeter), false]) then {
if ((_target getVariable [QGVAR(PulseOximeter_Attached), [0,0]] select 0) > 0) then {
_ctrlPulseOximeterLeft ctrlShow true;
} else {
_ctrlPulseOximeterLeft ctrlShow false;
};
if ((_target getVariable [QGVAR(PulseOximeter_Attached), [0,0]] select 1) > 0) then {
_ctrlPulseOximeterRight ctrlShow true;
} else {
_ctrlPulseOximeterRight ctrlShow false;
};
} else {
_ctrlPulseOximeterLeft ctrlShow false;
_ctrlPulseOximeterRight ctrlShow false;
};
Loading
Loading