Skip to content

Commit

Permalink
More GUI stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueTheKing committed Oct 17, 2023
1 parent 381abf8 commit 97ab5a5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
22 changes: 19 additions & 3 deletions addons/gui/functions/fnc_onMenuOpen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ if (ACEGVAR(interact_menu,menuBackground) == 2) then {0 cutRsc [QACEGVAR(interac
[{setMousePosition _this}, _this] call CBA_fnc_execNextFrame;
}, getMousePosition] call CBA_fnc_execNextFrame;

// Set target name as title
private _ctrlTitle = _display displayCtrl IDC_TITLE;
// Set middle header as target name
private _ctrlTitle = _display displayCtrl IDC_NAME;
_ctrlTitle ctrlSetText ([ACEGVAR(medical_gui,target)] call ACEFUNC(common,getName));

// Initially hide the triage select buttons
Expand Down Expand Up @@ -60,9 +60,25 @@ private _countEnabled = {
if (_category isEqualType "") then { _x set [1, (ACEGVAR(medical_gui,actions) findIf {_category == _x select 1}) > -1]; };
_x select 1
} 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"];

if (_forEachIndex == 1 || {_forEachIndex == count _list - 1}) then {
_offsetX = _offsetX + POS_W(0.2);
};

private _ctrl = _display displayCtrl _idc;
if (_enabled) then {
_ctrl ctrlSetPositionX _offsetX;
Expand Down
5 changes: 4 additions & 1 deletion addons/gui/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#define IDD_MEDICAL_MENU 38580

#define IDC_TITLE 1200
#define IDC_NAME 1210
#define IDC_TRIAGE 1300
#define IDC_EXAMINE 1310
#define IDC_BANDAGE 1320
Expand All @@ -47,7 +48,9 @@
#define IDC_ADVANCED 1350
#define IDC_DRAG 1360
#define IDC_TOGGLE 1370
#define IDC_SURGERY 1380
#define IDC_SURGERY 1385
#define IDC_TRIAGE_DIVIDER 1380
#define IDC_TOGGLE_DIVIDER 1390

#define IDC_TRIAGE_CARD 1400
#define IDC_INJURIES 1410
Expand Down

0 comments on commit 97ab5a5

Please sign in to comment.