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

Settings - Automatically localize sub-category #1003

Merged
merged 1 commit into from
Oct 10, 2018
Merged
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
12 changes: 8 additions & 4 deletions addons/settings/gui_createCategory.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ private _categorySettings = [];
{
(GVAR(default) getVariable _x) params ["", "_setting", "", "", "_category", "", "", "", "", "_subCategory"];
if (_category == _selectedAddon) then {
if (isLocalized _subCategory) then {
_subCategory = localize _subCategory;
};
_categorySettings pushBack [_subCategory, _forEachIndex, _setting];
};
} forEach GVAR(allSettings);
Expand Down Expand Up @@ -96,13 +99,14 @@ private _lastSubCategory = "$START";
_ctrlOptionsGroup = _display getVariable _list;
};

// Add sub-category header:
// Add sub-category header
if (_createHeader) then {
private _header = _display ctrlCreate [QGVAR(subCat), -1, _ctrlOptionsGroup];
(_header controlsGroupCtrl IDC_SETTING_NAME) ctrlSetText format ["%1:", _subCategory];
private _ctrlHeaderGroup = _display ctrlCreate [QGVAR(subCat), -1, _ctrlOptionsGroup];
private _ctrlHeaderName = _ctrlHeaderGroup controlsGroupCtrl IDC_SETTING_NAME;
_ctrlHeaderName ctrlSetText format ["%1:", _subCategory];

private _tablePosY = (_ctrlOptionsGroup getVariable [QGVAR(tablePosY), TABLE_LINE_SPACING/2]);
_tablePosY = [_header, _tablePosY] call _fnc_controlSetTablePosY;
_tablePosY = [_ctrlHeaderGroup, _tablePosY] call _fnc_controlSetTablePosY;
_ctrlOptionsGroup setVariable [QGVAR(tablePosY), _tablePosY];
};

Expand Down