Skip to content

Commit

Permalink
Moved parameters into a single array so I stop breaking things when I…
Browse files Browse the repository at this point in the history
… add new options
  • Loading branch information
ConnorAU committed May 6, 2020
1 parent 4e2d3a1 commit f294a21
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 11 deletions.
6 changes: 5 additions & 1 deletion addon/systems/displayColorPicker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@
#define GRID_COLOR(x,i) linearConversion[0,VAL_CELL_COUNT,x,i,1,true]

params [
["_color",[],[[],""]],
["_parameters",[],[[]]],
["_title","",[""]],
["_code",{},[{}]],
["_button1","",[""]],
["_button2",0,[""]],
["_parentDisplay",displayNull,[displayNull]]
];
_parameters params [
["_color",[],[[],""]]
];

if (!isNull _parentDisplay) then {
_parentDisplay createDisplay QUOTE(DISPLAY_NAME);
} else {
Expand Down
5 changes: 4 additions & 1 deletion addon/systems/displayGuiMessage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
#include "_defines.inc"

params [
["_text","",[""]],
["_parameters",[],[[]]],
["_title","",[""]],
["_code",{},[{}]],
["_button1","",[""]],
["_button2",0,[""]],
["_parentDisplay",displayNull,[displayNull]]
];
_parameters params [
["_text","",[""]]
];

if (!isNull _parentDisplay) then {
_parentDisplay createDisplay QUOTE(DISPLAY_NAME);
Expand Down
13 changes: 9 additions & 4 deletions addon/systems/displayListbox.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@
#include "_defines.inc"

params [
["_items",[],[[]]],
["_startIndex",0,[0]],
["_multiSel",false,[true]],
["_parameters",[],[[]]],
["_title","",[""]],
["_code",{},[{}]],
["_button1","",[""]],
["_button2",0,[""]],
["_parentDisplay",displayNull,[displayNull]]
];
_parameters params [
["_items",[],[[]]],
["_startIndex",0,[0]],
["_multiSel",false,[true]]
];

if (!isNull _parentDisplay) then {
_parentDisplay createDisplay ([QUOTE(DISPLAY_NAME),QUOTE(JOIN(DISPLAY_NAME,Multi))] select _multiSel);
Expand Down Expand Up @@ -98,4 +101,6 @@ lbClear _ctrlInput;
_ctrlInput lbSetValue [_index,_value];
} forEach _items;

_ctrlInput lbSetCurSel (0 max _startIndex min (lbSize _ctrlInput - 1));
private _index = 0 max _startIndex min (lbSize _ctrlInput - 1);
_ctrlInput lbSetCurSel _index;
if _multiSel then {_ctrlInput lbSetSelected [_index,true]};
9 changes: 6 additions & 3 deletions addon/systems/displaySlider.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@
#include "_defines.inc"

params [
["_range",[0,0],[[]],2],
["_position",0,[0]],
["_speed",[1,1],[[]],2],
["_parameters",[],[[]]],
["_title","",[""]],
["_formatVal",{},[{}]],
["_code",{},[{}]],
["_button1","",[""]],
["_button2",0,[""]],
["_parentDisplay",displayNull,[displayNull]]
];
_parameters params [
["_range",[0,0],[[]],2],
["_position",0,[0]],
["_speed",[1,1],[[]],2]
];

if (!isNull _parentDisplay) then {
_parentDisplay createDisplay QUOTE(DISPLAY_NAME);
Expand Down
7 changes: 5 additions & 2 deletions addon/systems/displayText.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@
#include "_defines.inc"

params [
["_multiLine",false,[true]],
["_startText","",[""]],
["_parameters",[],[[]]],
["_title","",[""]],
["_code",{},[{}]],
["_button1","",[""]],
["_button2",0,[""]],
["_parentDisplay",displayNull,[displayNull]]
];
_parameters params [
["_multiLine",false,[true]],
["_startText","",[""]]
];

if (!isNull _parentDisplay) then {
_parentDisplay createDisplay ([QUOTE(DISPLAY_NAME),QUOTE(JOIN(DISPLAY_NAME,Multi))] select _multiLine);
Expand Down

0 comments on commit f294a21

Please sign in to comment.