Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add space after list settings #835

Merged
merged 1 commit into from
Dec 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions addons/settings/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ class GVAR(CheckboxSound): RscCheckBox {
soundEscape[] = {"\a3\ui_f\data\Sound\RscButtonMenu\soundEscape",0.090000004,1};
};

class GVAR(Row_Empty): RscText {
GVAR(script) = "";
x = POS_W(1);
y = POS_H(0);
w = POS_W(37);
h = POS_H(0);
};

class GVAR(Row_Base): RscControlsGroupNoScrollbars {
GVAR(script) = "";
x = POS_W(1);
Expand Down
19 changes: 15 additions & 4 deletions addons/settings/gui_createCategory.sqf
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
// inline function, don't include script_component.hpp

private _fnc_controlSetTablePosY = {
params ["_control", "_tablePosY"];
params ["_control", "_tablePosY", "_height"];

private _config = configFile >> ctrlClassName _control;

private _posX = getNumber (_config >> "x");
private _posY = getNumber (_config >> "y") + _tablePosY;
private _posH = getNumber (_config >> "h");
private _width = getNumber (_config >> "w");

_control ctrlSetPosition [_posX, _posY];
if (isNil "_height") then {
_height = getNumber (_config >> "h");
};

_control ctrlSetPosition [_posX, _posY, _width, _height];
_control ctrlCommit 0;

_posY + _posH
_posY + _height
};

private _lists = _display getVariable QGVAR(lists);
Expand Down Expand Up @@ -90,6 +94,13 @@ private _lists = _display getVariable QGVAR(lists);
_tablePosY = [_ctrlSettingGroup, _tablePosY] call _fnc_controlSetTablePosY;
_ctrlOptionsGroup setVariable [QGVAR(tablePosY), _tablePosY];

// ----- padding to make listboxes work
if (_settingType == "LIST") then {
private _ctrlEmpty = _display ctrlCreate [QGVAR(Row_Empty), IDC_SETTING_CONTROLS_GROUP, _ctrlOptionsGroup];
private _height = POS_H(count (_settingData select 0)) + TABLE_LINE_SPACING;
[_ctrlEmpty, _tablePosY, _height] call _fnc_controlSetTablePosY;
};

// ----- set setting name
private _ctrlSettingName = _ctrlSettingGroup controlsGroupCtrl IDC_SETTING_NAME;
_ctrlSettingName ctrlSetText format ["%1:", _displayName];
Expand Down
1 change: 1 addition & 0 deletions addons/settings/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "\a3\ui_f\hpp\defineCommonGrids.inc"
#include "\a3\ui_f\hpp\defineResincl.inc"

//#define DEBUG_MODE_FULL
//#define DISABLE_COMPILE_CACHE
//#define DEBUG_ENABLED_SETTINGS

Expand Down