Skip to content

Commit

Permalink
convert position strings to grid macros
Browse files Browse the repository at this point in the history
  • Loading branch information
commy2 committed Jun 18, 2016
1 parent f4b8561 commit 5b018d7
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 138 deletions.
160 changes: 80 additions & 80 deletions addons/settings/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class GVAR(OptionsGroup): RscControlsGroup {
class HScrollbar: HScrollbar {
height = 0;
};
x = "0.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "3.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "35 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "13.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
lineHeight = "1 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_W(0.5);
y = POS_H(3.5);
w = POS_W(35);
h = POS_H(13.8);
lineHeight = POS_H(1);

class controls {}; // auto generated
};
Expand All @@ -51,46 +51,46 @@ class GVAR(OptionsGroup): RscControlsGroup {
class GVAR(AddonsList): RscCombo {
linespacing = 1;
text = "";
wholeHeight = "12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "21 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
wholeHeight = POS_H(12);
x = POS_W(4.5);
y = POS_H(1);
w = POS_W(21);
h = POS_H(1);
};

class RscDisplayGameOptions {
class controls {
class CBA_ButtonConfigureAddons: RscButtonMenu {
idc = IDC_BTN_CONFIGURE_ADDONS;
text = CSTRING(configureAddons);
x = "20.15 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
y = "23 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))";
w = "12.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_X(20.15);
y = POS_Y(23);
w = POS_W(12.5);
h = POS_H(1);
};

class CBA_ButtonClient: RscButtonMenu {
idc = IDC_BTN_CLIENT;
text = CSTRING(ButtonClient);
tooltip = CSTRING(ButtonClient_tooltip);
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))";
w = "8 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_X(1);
y = POS_Y(2.1);
w = POS_W(8);
h = POS_H(1);
};

class CBA_ButtonServer: CBA_ButtonClient {
idc = IDC_BTN_SERVER;
text = CSTRING(ButtonServer);
tooltip = CSTRING(ButtonServer_tooltip);
x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
x = POS_X(9);
};

class CBA_ButtonMission: CBA_ButtonClient {
idc = IDC_BTN_MISSION;
text = CSTRING(ButtonMission);
tooltip = CSTRING(ButtonMission_tooltip);
x = "17 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
x = POS_X(17);
};

class CBA_AddonsGroup: RscControlsGroup {
Expand All @@ -102,41 +102,41 @@ class RscDisplayGameOptions {
};
idc = IDC_ADDONS_GROUP;
enableDisplay = 0;
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
y = "3.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))";
w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "17.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_X(1);
y = POS_Y(3.1);
w = POS_W(38);
h = POS_H(17.3);

class controls {
class CBA_AddonsEmptyBackground: RscText {
idc = -1;
type = 0x00;
text = "";
colorBackground[] = {0,0,0,0.4};
x = "0.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "3.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "35 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "13.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_W(0.5);
y = POS_H(3.5);
w = POS_W(35);
h = POS_H(13.8);
};
class CBA_AddonsCA_ControlsPageText: RscText {
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
style = 0x01;
idc = 2002;
text = "Addon:";
x = "0.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "4 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_W(0.5);
y = POS_H(1);
w = POS_W(4);
h = POS_H(1);
sizeEx = POS_H(1);
};
class CBA_ForceSettingText: RscText {
style = 0x01;
idc = IDC_TXT_FORCE;
text = "";
tooltip = CSTRING(force_tooltip);
x = "25 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_W(25);
y = POS_H(2.5);
w = POS_W(10);
h = POS_H(1);
};
};
};
Expand All @@ -147,10 +147,10 @@ class CBA_ButtonConfigureSettings_base: RscButtonMenu {
onButtonClick = QUOTE(ctrlParent (_this select 0) call COMPILE_FILE(openSettingsMenu));
idc = IDC_BTN_SETTINGS;
text = CSTRING(configureAddons);
x = "safezoneX + (11.1 * (((safezoneW / safezoneH) min 1.2) / 40))";
y = "23 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))";
w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_X(11.1);
y = POS_Y(23);
w = POS_W(10);
h = POS_H(1);
};

class RscDisplayMainMap;
Expand Down Expand Up @@ -180,80 +180,80 @@ class GVAR(presets) {
class controls {
class CBA_Presets: RscControlsGroup {
idc = IDC_PRESETS_GROUP;
x = "10 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2)) / 2)";
y = "0.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2)) / 2)";
w = "20 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "22.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_X_CENTERED(10);
y = POS_Y_CENTERED(0.9);
w = POS_W(20);
h = POS_H(22.2);

class controls {
class CBA_Title: RscTitle {
style = 0;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])","(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"};
idc = IDC_PRESETS_TITLE;
text = "";
x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "20 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_W(0);
y = POS_H(0);
w = POS_W(20);
h = POS_H(1);
};
class CBA_Background: RscText {
idc = -1;
colorBackground[] = {0,0,0,0.8};
x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "20 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "20 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_W(0);
y = POS_H(1.1);
w = POS_W(20);
h = POS_H(20);
};
class CBA_TextName: RscText {
style = 1;
idc = IDC_PRESETS_NAME;
text = "$STR_DISP_INTEL_NAME";
x = "0.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "19.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "5.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_W(0.5);
y = POS_H(19.6);
w = POS_W(5.5);
h = POS_H(1);
sizeEx = POS_H(0.8);
};
class CBA_EditName: RscEdit {
idc = IDC_PRESETS_EDIT;
x = "6 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "19.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "13.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_W(6);
y = POS_H(19.6);
w = POS_W(13.5);
h = POS_H(1);
sizeEx = POS_H(0.8);
};
class CBA_ValueName: RscListBox {
idc = IDC_PRESETS_VALUE;
colorBackground[] = {1,1,1,0.2};
x = "0.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "1.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "19 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "17.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_W(0.5);
y = POS_H(1.6);
w = POS_W(19);
h = POS_H(17.5);
sizeEx = POS_H(0.8);
};
class CBA_ButtonOK: RscButtonMenu {
idc = IDC_PRESETS_OK;
text = "$STR_DISP_OK";
x = "15 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "21.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_W(15);
y = POS_H(21.2);
w = POS_W(5);
h = POS_H(1);
};
class CBA_ButtonCancel: RscButtonMenu {
idc = IDC_PRESETS_CANCEL;
text = "$STR_DISP_CANCEL";
x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "21.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_W(0);
y = POS_H(21.2);
w = POS_W(5);
h = POS_H(1);
};
class CBA_ButtonDelete: RscButtonMenu {
idc = IDC_PRESETS_DELETE;
text = "$STR_DISP_DELETE";
x = "9.9 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "21.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = POS_W(9.9);
y = POS_H(21.2);
w = POS_W(5);
h = POS_H(1);
};
};
};
Expand Down
8 changes: 4 additions & 4 deletions addons/settings/gui_createMenu.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ _display setVariable [QGVAR(controls), []];
_ctrlSettingName ctrlSetText format ["%1:", _displayName];
_ctrlSettingName ctrlSetTooltip _tooltip;
_ctrlSettingName ctrlSetPosition [
POS_X(1),
POS_Y(_offsetY),
POS_X(15),
POS_Y(1)
POS_W(1),
POS_H(_offsetY),
POS_W(15),
POS_H(1)
];
_ctrlSettingName ctrlCommit 0;

Expand Down
8 changes: 4 additions & 4 deletions addons/settings/gui_createMenu_checkbox.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ private _ctrlSetting = _display ctrlCreate ["RscCheckBox", count _contols + IDC_
_contols pushBack _ctrlSetting;

_ctrlSetting ctrlSetPosition [
POS_X(16),
POS_Y(_offsetY),
POS_X(1),
POS_Y(1)
POS_W(16),
POS_H(_offsetY),
POS_W(1),
POS_H(1)
];
_ctrlSetting ctrlCommit 0;
_ctrlSetting cbSetChecked _currentValue;
Expand Down
24 changes: 12 additions & 12 deletions addons/settings/gui_createMenu_color.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ private _ctrlSettingPreview = _display ctrlCreate ["RscText", count _contols + I
_contols pushBack _ctrlSettingPreview;

_ctrlSettingPreview ctrlSetPosition [
POS_X(9.5),
POS_Y(_offsetY + MENU_OFFSET_COLOR),
POS_X(6),
POS_Y(1)
POS_W(9.5),
POS_H(_offsetY + MENU_OFFSET_COLOR),
POS_W(6),
POS_H(1)
];
_ctrlSettingPreview ctrlCommit 0;

Expand All @@ -32,10 +32,10 @@ for "_index" from 0 to (((count _defaultValue max 3) min 4) - 1) do {
_contols pushBack _ctrlSetting;

_ctrlSetting ctrlSetPosition [
POS_X(16),
POS_Y(_offsetY),
POS_X(8),
POS_Y(1)
POS_W(16),
POS_H(_offsetY),
POS_W(8),
POS_H(1)
];
_ctrlSetting ctrlCommit 0;

Expand Down Expand Up @@ -66,10 +66,10 @@ for "_index" from 0 to (((count _defaultValue max 3) min 4) - 1) do {
_contols pushBack _ctrlSettingEdit;

_ctrlSettingEdit ctrlSetPosition [
POS_X(24),
POS_Y(_offsetY),
POS_X(2),
POS_Y(1)
POS_W(24),
POS_H(_offsetY),
POS_W(2),
POS_H(1)
];
_ctrlSettingEdit ctrlCommit 0;

Expand Down
8 changes: 4 additions & 4 deletions addons/settings/gui_createMenu_default.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ private _ctrlSettingDefault = _display ctrlCreate ["RscButtonMenu", count _conto
_contols pushBack _ctrlSettingDefault;

_ctrlSettingDefault ctrlSetPosition [
POS_X(27),
POS_Y(_ctrlOptionsGroup getVariable QGVAR(offsetY)),
POS_X(5),
POS_Y(1)
POS_W(27),
POS_H(_ctrlOptionsGroup getVariable QGVAR(offsetY)),
POS_W(5),
POS_H(1)
];
_ctrlSettingDefault ctrlCommit 0;
_ctrlSettingDefault ctrlSetText localize LSTRING(Default);
Expand Down
8 changes: 4 additions & 4 deletions addons/settings/gui_createMenu_force.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ private _ctrlSettingForce = _display ctrlCreate ["RscCheckBox", count _contols +
_contols pushBack _ctrlSettingForce;

_ctrlSettingForce ctrlSetPosition [
POS_X(33),
POS_Y(_ctrlOptionsGroup getVariable QGVAR(offsetY)),
POS_X(1),
POS_Y(1)
POS_W(33),
POS_H(_ctrlOptionsGroup getVariable QGVAR(offsetY)),
POS_W(1),
POS_H(1)
];
_ctrlSettingForce ctrlCommit 0;
_ctrlSettingForce cbSetChecked ([_setting, _source] call FUNC(isForced));
Expand Down
8 changes: 4 additions & 4 deletions addons/settings/gui_createMenu_list.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ private _ctrlSetting = _display ctrlCreate ["RscCombo", count _contols + IDC_OFF
_contols pushBack _ctrlSetting;

_ctrlSetting ctrlSetPosition [
POS_X(16),
POS_Y(_offsetY),
POS_X(10),
POS_Y(1)
POS_W(16),
POS_H(_offsetY),
POS_W(10),
POS_H(1)
];
_ctrlSetting ctrlCommit 0;

Expand Down
Loading

0 comments on commit 5b018d7

Please sign in to comment.