Continue laying the base for the SQF of the loadouts display

This commit is contained in:
Josuan Albin
2017-10-23 18:32:59 +02:00
parent a19774ce34
commit dab034a833
10 changed files with 57 additions and 14 deletions

View File

@ -11,6 +11,7 @@ PREP(buttonLoadoutsSaveAs);
PREP(buttonLoadoutsShare);
PREP(clearSearchbar);
PREP(fillLeftPanel);
PREP(fillLoadoutsList);
PREP(fillRightPanel);
PREP(handleMouse);
PREP(handleScrollWheel);
@ -28,6 +29,7 @@ PREP(onLoadoutsOpen);
PREP(onMouseButtonDown);
PREP(onMouseButtonUp);
PREP(onSelChangedLeft);
PREP(onSelChangedLoadouts);
PREP(onSelChangedRight);
PREP(onSelChangedRightListnBox);
PREP(openBox);

View File

@ -98,7 +98,10 @@
#define IDC_centerBox 3
#define IDC_centerTitle 301
#define IDC_contentPanel 302
#define IDC_centerBoxButtonLoad 303
#define IDC_buttonSave 303
#define IDC_buttonSaveAs 304
#define IDC_buttonLoad 305
#define IDC_buttonShare 306
#define IDC_buttonMyLoadouts 401
#define IDC_buttonDefaultLoadouts 402
#define IDC_buttonSharedLoadouts 403

View File

@ -1,4 +1,8 @@
#include "script_component.hpp"
#include "..\defines.hpp"
params ["_display"];
params ["_display", "_control"];
systemChat str [_display, _control];
if !(ctrlEnabled _control) exitWith {};

View File

@ -1,4 +1,8 @@
#include "script_component.hpp"
#include "..\defines.hpp"
params ["_display"];
params ["_display", "_control"];
systemChat str [_display, _control];
if !(ctrlEnabled _control) exitWith {};

View File

@ -1,4 +1,8 @@
#include "script_component.hpp"
#include "..\defines.hpp"
params ["_display"];
params ["_display", "_control"];
systemChat str [_display, _control];
if !(ctrlEnabled _control) exitWith {};

View File

@ -1,4 +1,8 @@
#include "script_component.hpp"
#include "..\defines.hpp"
params ["_display"];
params ["_display", "_control"];
systemChat str [_display, _control];
if !(ctrlEnabled _control) exitWith {};

View File

@ -0,0 +1,2 @@
#include "script_component.hpp"
#include "..\defines.hpp"

View File

@ -5,4 +5,21 @@ params ["_display", "_control"];
systemChat str [_display, _control];
if !(ctrlEnabled _control) exitWith {};
if !(ctrlEnabled _control) exitWith {};
private _centerBoxTitleCtrl = _display displayCtrl IDC_centerTitle;
switch (ctrlIDC _control) do {
case IDC_buttonMyLoadouts: {
_centerBoxTitleCtrl ctrlSetText "My loadouts"; // TBL
// Call filling func
};
case IDC_buttonDefaultLoadouts: {
_centerBoxTitleCtrl ctrlSetText "Default loadouts"; // TBL
// Call filling func
};
case IDC_buttonSharedLoadouts: {
_centerBoxTitleCtrl ctrlSetText "Shared loadouts"; // TBL
// Call filling func
};
};

View File

@ -0,0 +1,2 @@
#include "script_component.hpp"
#include "..\defines.hpp"

View File

@ -758,6 +758,7 @@ class GVAR(loadoutsDisplay) {
columns[]={0.10, 0.20, 0.75};
drawSideArrows=0;
disableOverflow=1;
onLBSelChanged = QUOTE(_this call FUNC(onSelChangedLoadouts));
x = QUOTE(0);
y = QUOTE(5 * GRID_H);
w = QUOTE(160 * GRID_W);
@ -765,36 +766,36 @@ class GVAR(loadoutsDisplay) {
sizeEx = QUOTE(7 * GRID_H);
};
class buttonSave: ctrlButton {
idc = -1;
idc = IDC_buttonSave;
x = QUOTE(5 * GRID_W);
y = QUOTE(safezoneH - (55 * GRID_H));
w = QUOTE(30 * GRID_W);
h = QUOTE(10 * GRID_H);
text="Save"; // TBL
tooltip="Save selected loadout"; // TBL
onButtonClick = "";
onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(buttonLoadoutsSave));
colorBackground[] = {0,0,0,0.8};
};
class buttonSaveAs: buttonSave {
idc = -1;
idc = IDC_buttonSaveAs;
x = QUOTE(45 * GRID_W);
text="Save as"; // TBL
tooltip="Save loadout as"; // TBL
onButtonClick = "";
onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(buttonLoadoutsSaveAs));
};
class buttonLoad: buttonSave {
idc = IDC_centerBoxButtonLoad;
idc = IDC_buttonLoad;
x = QUOTE(85 * GRID_W);
text="Load"; // TBL
tooltip="Load selected loadout"; // TBL
onButtonClick = "";
onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(buttonLoadoutsLoad));
};
class buttonShare: buttonSave {
idc = IDC_centerBoxButtonShare;
idc = IDC_buttonShare;
x = QUOTE(125 * GRID_W);
text="Share"; // TBL
tooltip="Share selected loadout"; // TBL
onButtonClick = "";
onButtonClick = QUOTE([ARR_2(ctrlparent (_this select 0), _this select 0)] call FUNC(buttonLoadoutsShare));
};
};
};