Implement button logic for loadouts display

This commit is contained in:
Josuan Albin
2017-10-23 18:56:01 +02:00
parent e283fc89eb
commit e8feca9876
2 changed files with 42 additions and 1 deletions

View File

@ -8,18 +8,45 @@ systemChat str [_display, _control];
if !(ctrlEnabled _control) exitWith {};
private _centerBoxTitleCtrl = _display displayCtrl IDC_centerTitle;
private _shareButtonCtrl = _display displayCtrl IDC_buttonShare;
private _saveButtonCtrl = _display displayCtrl IDC_buttonSave;
private _saveAsButtonCtrl = _display displayCtrl IDC_buttonSaveAs;
switch (ctrlIDC _control) do {
case IDC_buttonMyLoadouts: {
_centerBoxTitleCtrl ctrlSetText "My loadouts"; // TBL
_shareButtonCtrl ctrlEnable ([false, true] select (GVAR(allowSharedLoadouts)));
_saveButtonCtrl ctrlEnable true;
_shareButtonCtrl ctrlCommit 0;
_saveButtonCtrl ctrlCommit 0;
// Call filling func
};
case IDC_buttonDefaultLoadouts: {
_centerBoxTitleCtrl ctrlSetText "Default loadouts"; // TBL
{
_x ctrlEnable false;
_x ctrlCommit 0;
} foreach [_shareButtonCtrl, _saveButtonCtrl];
// Call filling func
};
case IDC_buttonSharedLoadouts: {
_centerBoxTitleCtrl ctrlSetText "Shared loadouts"; // TBL
{
_x ctrlEnable false;
_x ctrlCommit 0;
} foreach [_shareButtonCtrl, _saveButtonCtrl];
// Call filling func
};
};

View File

@ -4,4 +4,18 @@
params ["", "_args"];
_args params ["_display"];
systemChat str _display;
systemChat str _display;
if !(GVAR(allowDefaultLoadouts)) then {
private _buttonDefaultLoadoutsCtrl = _display displayCtrl IDC_buttonDefaultLoadouts;
_buttonDefaultLoadoutsCtrl ctrlEnable false;
_buttonDefaultLoadoutsCtrl ctrlCommit 0;
};
if !(GVAR(allowSharedLoadouts)) then {
private _buttonShareLoadoutsCtrl = _display displayCtrl IDC_buttonSharedLoadouts;
_buttonShareLoadoutsCtrl ctrlEnable false;
_buttonShareLoadoutsCtrl ctrlCommit 0;
};
[_display, _display displayCtrl IDC_buttonMyLoadouts] call FUNC(loadoutsChangeTab);