Medical GUI - Add divider bars for triage and toggle category buttons (#9496)

* Add divider bars for triage and toggle category buttons

* Tweak vertical position of category icons

* Fix spacing
This commit is contained in:
amsteadrayle 2023-10-15 18:45:45 -04:00 committed by GitHub
parent 8104c8f465
commit 863d88ff41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 2 deletions

View File

@ -59,9 +59,25 @@ private _countEnabled = {
if (_category isEqualType "") then { _x set [1, (GVAR(actions) findIf {_category == _x select 1}) > -1]; }; if (_category isEqualType "") then { _x set [1, (GVAR(actions) findIf {_category == _x select 1}) > -1]; };
_x select 1 _x select 1
} count _list; } count _list;
private _offsetX = POS_X(1.75) + 0.5 * (POS_X(12) - POS_X(_countEnabled * 1.5)); private _offsetX = POS_X(1.5) + 0.5 * (POS_X(12.33) - POS_X(_countEnabled * 1.5) - POS_W(2 * 0.2));
// 0.2 - divider gap size
// Set divider position
private _ctrl = _display displayCtrl IDC_TRIAGE_DIVIDER;
_ctrl ctrlSetPositionX _offsetX + POS_W(1.5) + POS_W(0.085); // 0.085 = (0.2 - 0.03) / 2
_ctrl ctrlCommit 0;
_ctrl = _display displayCtrl IDC_TOGGLE_DIVIDER;
_ctrl ctrlSetPositionX _offsetX + POS_W(1.5*(_countEnabled - 1)) + POS_W(0.2) + POS_W(0.085);
_ctrl ctrlCommit 0;
{ {
_x params ["_idc", "_enabled"]; _x params ["_idc", "_enabled"];
if (_forEachIndex == 1 || {_forEachIndex == count _list - 1}) then {
_offsetX = _offsetX + POS_W(0.2);
};
private _ctrl = _display displayCtrl _idc; private _ctrl = _display displayCtrl _idc;
if (_enabled) then { if (_enabled) then {
_ctrl ctrlSetPositionX _offsetX; _ctrl ctrlSetPositionX _offsetX;

View File

@ -266,7 +266,7 @@ class ACE_Medical_Menu {
text = QPATHTOF(data\categories\triage_card.paa); text = QPATHTOF(data\categories\triage_card.paa);
tooltip = CSTRING(ViewTriageCard); tooltip = CSTRING(ViewTriageCard);
x = QUOTE(POS_X(1.75)); x = QUOTE(POS_X(1.75));
y = QUOTE(POS_Y(2.73)); y = QUOTE(POS_Y(2.75));
w = QUOTE(POS_W(1.5)); w = QUOTE(POS_W(1.5));
h = QUOTE(POS_H(1.5)); h = QUOTE(POS_H(1.5));
color[] = {1, 1, 1, 1}; color[] = {1, 1, 1, 1};
@ -324,6 +324,17 @@ class ACE_Medical_Menu {
text = QPATHTOF(data\categories\toggle_to_other.paa); text = QPATHTOF(data\categories\toggle_to_other.paa);
x = QUOTE(POS_X(12)); x = QUOTE(POS_X(12));
}; };
class TriageDivider: HeaderLine {
idc = IDC_TRIAGE_DIVIDER;
x = QUOTE(POS_X(3.265));
y = QUOTE(POS_Y(3.0));
w = QUOTE(POS_W(0.03));
h = QUOTE(POS_H(1.0));
};
class ToggleDivider: TriageDivider {
idc = IDC_TOGGLE_DIVIDER;
x = QUOTE(POS_X(3.265));
};
class TriageCard: RscListBox { class TriageCard: RscListBox {
idc = IDC_TRIAGE_CARD; idc = IDC_TRIAGE_CARD;
x = QUOTE(POS_X(1.5)); x = QUOTE(POS_X(1.5));

View File

@ -46,6 +46,8 @@
#define IDC_ADVANCED 1350 #define IDC_ADVANCED 1350
#define IDC_DRAG 1360 #define IDC_DRAG 1360
#define IDC_TOGGLE 1370 #define IDC_TOGGLE 1370
#define IDC_TRIAGE_DIVIDER 1380
#define IDC_TOGGLE_DIVIDER 1390
#define IDC_TRIAGE_CARD 1400 #define IDC_TRIAGE_CARD 1400
#define IDC_INJURIES 1410 #define IDC_INJURIES 1410