Skip to content

Commit

Permalink
Localize sub-category (#1003)
Browse files Browse the repository at this point in the history
  • Loading branch information
mharis001 authored and commy2 committed Oct 10, 2018
1 parent ace6f2a commit d163d7f
Showing 1 changed file with 8 additions and 4 deletions.
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

0 comments on commit d163d7f

Please sign in to comment.