Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cplhardcore committed Oct 27, 2024
1 parent b1aa8af commit 6411ce3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
3 changes: 3 additions & 0 deletions addons/gui/functions/fnc_onMenuOpen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ if (EGVAR(pharma,RequireInsIV) && EGVAR(pharma,IVflowControl)) then {
(_display displayCtrl IDC_IV_FLOW_SHOWBUTTON) ctrlShow true;
};

if (EGVAR(pharma,AMS_Enabled)) then {
(_display displayCtrl IDC_SYRINGE_OPEN) ctrlShow true;
};
// Set toggle button icon and tooltip
private _ctrl = _display displayCtrl IDC_TOGGLE;
if (ACEGVAR(medical_gui,target) == ACE_player) then {
Expand Down
16 changes: 9 additions & 7 deletions addons/gui/functions/fnc_prepSyringe.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,25 @@
*
* Public: No
*/
if !(EGVAR(pharma,AMS_Enabled)) exitWith {};
private _playerMedicalLevel = [_player] call ace_medical_fnc_getMedicLevel;
private _requiredMedicalLevel = GVAR(medLvl_PrepSyringe);
if (_playerMedicalLevel < _requiredMedicalLevel) exitWith {};

[EGVAR(pharma,prepTime_PrepSyringe), [], {
private _syringeBox = findDisplay 38580 displayCtrl 71303;
private _medicationBox = findDisplay 38580 displayCtrl 71305;
private _doseCombo = findDisplay 38580 displayCtrl 71307;

private _syringeSelected = lbCurSel _syringeBox;
private _medicationSelected = lbCurSel _medicationBox;
private _doseSelected = lbCurSel _doseCombo;

private _syringeType = _syringeBox lbData _syringeSelected;
private _medicationType = _medicationBox lbData _medicationSelected;
private _doseType = _doseCombo lbValue _doseSelected;
private _syringeClassName = format ["kat_syringe_%1_%2_%3", _medicationType, _syringeType, _doseType];
private _hasSyringe = isClass (configFile >> "CfgWeapons" >> _syringeClassName);
if (!_hasSyringe) exitWith {
hint format ["This syringe combination does not exist. kat_syringe %1 %2 %3", _medicationType, _syringeType, _doseType];
[{hint ""}, [], 5] call CBA_fnc_waitAndExecute;
};
[EGVAR(pharma,prepTime_PrepSyringe), [], {
[player, _medicationType, _syringeType, _doseType] call kat_pharma_fnc_prepareSyringe;
}, {}, "Preparing Syringe..."] call ace_common_fnc_progressBar;


[player, _medicationType, _syringeType, _doseType] call kat_pharma_fnc_prepareSyringe;}, {}, "Preparing Syringe..."] call ace_common_fnc_progressBar;
7 changes: 5 additions & 2 deletions addons/gui/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,11 @@ class ACE_Medical_Menu {
y = QUOTE(POS_Y(0));
w = QUOTE(POS_W(4.4));
h = QUOTE(POS_H(1));
colorBackgroundDisabled[] = GUI_BCG_COLOR;
colorBackground[] = GUI_BCG_COLOR;
show = 0;
colorBackground[] = {0, 0, 0, 0};
colorBackgroundActive[] = {1, 1, 1, 0.4};
colorBackgroundDisabled[] = {0, 0, 0, 0};
colorBorder[] = {0,0,0,0};
onButtonClick = QUOTE([] call FUNC(openSyringeMenu));
class Attributes {
align = "Right";
Expand Down
8 changes: 4 additions & 4 deletions addons/pharma/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4151,16 +4151,16 @@
<English>5ml Syringe loaded with 0.2mg of Flumazenil</English>
</Key>
<Key ID="STR_KAT_Pharma_Syringe_etomidate_5_1_Display">
<English>5ml Syringe/0.2mg Etomidate</English>
<English>5ml Syringe/20mg Etomidate</English>
</Key>
<Key ID="STR_KAT_Pharma_Syringe_etomidate_5_1_DescShort">
<English>5ml Syringe loaded with 0.2mg of Etomidate</English>
<English>5ml Syringe loaded with 20mg of Etomidate</English>
</Key>
<Key ID="STR_KAT_Pharma_Syringe_etomidate_5_3_Display">
<English>5ml Syringe/0.3mg Etomidate</English>
<English>5ml Syringe/30mg Etomidate</English>
</Key>
<Key ID="STR_KAT_Pharma_Syringe_etomidate_5_3_DescShort">
<English>5ml Syringe loaded with 0.3mg of Etomidate</English>
<English>5ml Syringe loaded with 30mg of Etomidate</English>
</Key>
<Key ID="STR_KAT_Pharma_Syringe_epinephrineIV_5_1_Display">
<English>5ml Syringe/10mcg Epinephrine</English>
Expand Down

0 comments on commit 6411ce3

Please sign in to comment.