Skip to content

Commit

Permalink
Circulation/GUI - Add ABG Setting (#647)
Browse files Browse the repository at this point in the history
**When merged this pull request will:**
- Adds a setting to enable whether or not the option for the ABG menu is
visible
- Disables blood sample draws if ABG menu is disabled

### IMPORTANT

- [Development Guidelines](https://ace3.acemod.org/wiki/development/)
are read, understood and applied.
- Title of this PR uses our standard template `Component -
Add|Fix|Improve|Change|Make|Remove {changes}`.

---------

Co-authored-by: MiszczuZPolski <[email protected]>
  • Loading branch information
mazinskihenry and MiszczuZPolski authored Dec 2, 2024
1 parent bbbfde3 commit b06f15a
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion addons/circulation/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class ACE_Medical_Treatment_Actions {
displayName = CSTRING(DrawArterial_Action_Use);
displayNameProgress = CSTRING(DrawBlood_Action_Progress);
treatmentTime = 10;
condition = QUOTE(GVAR(abgEnable));
callbackSuccess = QFUNC(drawArterial);
condition = "true";
items[] = {"kat_IV_16"};
};

Expand Down
10 changes: 10 additions & 0 deletions addons/circulation/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ if (isServer) then {
true
] call CBA_Settings_fnc_init;

// Enables ABG Menu and Testing
[
QGVAR(abgEnable),
"CHECKBOX",
[LLSTRING(SETTING_abg_enable), LLSTRING(SETTING_abg_enable_DESC)],
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)],
[false],
true
] call CBA_Settings_fnc_init;

//location for AED - Defi:
[
QGVAR(useLocation_AED),
Expand Down
6 changes: 6 additions & 0 deletions addons/circulation/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1990,6 +1990,12 @@
<Russian>Устанавливает группы крови, которые будут присвоены игрокам на основе их Steam ID \nГруппы крови разделены запятой (","), список должен содержать в общей сложности 10 групп крови</Russian>
<Dutch>Bepaald de bloedgroepen die aan spelers worden gegeven op basis van hun SteamID. \nBloedgroepen zijn gescheiden met een comma(","). De lijst moet 10 verschillende bloedgroepen bevatten</Dutch>
</Key>
<Key ID="STR_KAT_Circulation_SETTING_abg_enable">
<English>Enable ABG Testing</English>
</Key>
<Key ID="STR_KAT_Circulation_SETTING_abg_enable_DESC">
<English>Enables ABG Testing and ACE Menu Visibility</English>
</Key>
<Key ID="STR_KAT_Circulation_bloodtype_log">
<English>%1 checked dogtags blood group: %2</English>
<German>%1 hat die Blutgruppe der Erkennungsmarke überprüft: %2</German>
Expand Down
4 changes: 4 additions & 0 deletions addons/gui/functions/fnc_onMenuOpen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ if (EGVAR(pharma,RequireInsIV) && EGVAR(pharma,IVflowControl)) then {
(_display displayCtrl IDC_IV_FLOW_SHOWBUTTON) ctrlShow true;
};

if (EGVAR(circulation,abgEnable)) then {
(_display displayCtrl IDC_TEST_SHOWBUTTON) ctrlShow true;
};

// Set toggle button icon and tooltip
private _ctrl = _display displayCtrl IDC_TOGGLE;
if (ACEGVAR(medical_gui,target) == ACE_player) then {
Expand Down
2 changes: 1 addition & 1 deletion addons/gui/functions/fnc_updateABGStatus.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ if (_ABGmenuShow) then {
};
};

} forEach [IDC_TEST_PACO2, IDC_TEST_PAO2, IDC_TEST_SPO2, IDC_TEST_HCO3, IDC_TEST_PH];
} forEach [IDC_TEST_PACO2, IDC_TEST_PAO2, IDC_TEST_SPO2, IDC_TEST_HCO3, IDC_TEST_PH];
5 changes: 3 additions & 2 deletions addons/gui/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class ACE_Medical_Menu {
y = QUOTE(POS_Y(1.1));
w = QUOTE(POS_W(9));
h = QUOTE(POS_H(3.3));
show = 0;
};
class ABGTitle: IVFlowTitle {
idc = IDC_ABG_TITLE; // LOOK HERE
Expand All @@ -144,7 +145,7 @@ class ACE_Medical_Menu {
y = QUOTE(POS_Y(0));
w = QUOTE(POS_W(9));
h = QUOTE(POS_H(1));
show = 1;
show = 0;
class Attributes {
color = "#E5E5E5";
font = "RobotoCondensed";
Expand Down Expand Up @@ -535,7 +536,7 @@ class ACE_Medical_Menu {
y = QUOTE(POS_Y(0));
w = QUOTE(POS_W(4.2));
h = QUOTE(POS_H(1));
show = 1;
show = 0;
colorBackground[] = {0, 0, 0, 0};
colorBackgroundActive[] = {1, 1, 1, 0.4};
colorBackgroundDisabled[] = {0, 0, 0, 0};
Expand Down
2 changes: 1 addition & 1 deletion addons/gui/gui_defines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@

#define IDC_TEST_SHOWBUTTON 71208

#define IDC_ABG_BACKGROUND 71299
#define IDC_ABG_BACKGROUND 71299

0 comments on commit b06f15a

Please sign in to comment.