Skip to content

Commit 5f5efdc

Browse files
authored
Merge pull request #1779 from CBATeam/fixUnicodeSort
Settings - Fix setting showing up in unicode subcategories
2 parents bdabdb4 + 112dc0d commit 5f5efdc

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

addons/settings/XEH_preInit.sqf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ if (isNil QFUNC(init)) then {
3535
["Test_6", "EDITBOX", "setting 6", ["Test Category", "Evens"], "null", 2, {systemChat str [6, _this]}] call CBA_fnc_addSetting;
3636
["Test_7", "EDITBOX", "setting 7", ["Test Category", "Seven"], "null", 2, {systemChat str [7, _this]}] call CBA_fnc_addSetting;
3737

38+
["Test_b1", "CHECKBOX", "setting b1", ["Test йййй"], false, 2, {systemChat str ["b1", _this]}] call CBA_fnc_addSetting;
39+
["Test_b2", "CHECKBOX", "setting b2л", ["Test йййй", "ллл"], false, 2, {systemChat str ["b2", _this]}] call CBA_fnc_addSetting;
40+
["Test_b3", "CHECKBOX", "setting b3ф", ["Test йййй", "ффф"], true, 2, {systemChat str ["b3", _this]}] call CBA_fnc_addSetting;
41+
42+
["Test_c1", "CHECKBOX", "setting c1", ["Test nnnn"], false, 2, {systemChat str ["c1", _this]}] call CBA_fnc_addSetting;
43+
["Test_c2", "CHECKBOX", "setting c2r", ["Test nnnn", "rrr"], false, 2, {systemChat str ["c2", _this]}] call CBA_fnc_addSetting;
44+
["Test_c3", "CHECKBOX", "setting c3o", ["Test nnnn", "ooo"], true, 2, {systemChat str ["c3", _this]}] call CBA_fnc_addSetting;
45+
3846
["Test_A", "EDITBOX", "setting 1", "Test Category 1", "a", nil, {systemChat str [1, _this]}] call CBA_fnc_addSetting;
3947
["Test_B", "EDITBOX", "setting 2", "Test Category 1", "b", nil, {systemChat str [2, _this]}] call CBA_fnc_addSetting;
4048
["Test_C", "EDITBOX", "setting 3", "Test Category 3", "c", nil, {systemChat str [3, _this]}] call CBA_fnc_addSetting;

addons/settings/gui_createCategory.inc.sqf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ private _categorySettings = [];
2929
if (isLocalized _subCategory) then {
3030
_subCategory = localize _subCategory;
3131
};
32-
_categorySettings pushBack [_subCategory, _forEachIndex, _setting];
32+
// Make sure empty-subcategory is always sorted first (fixing unicode)
33+
_categorySettings pushBack [parseNumber (_subCategory != ""), _subCategory, _forEachIndex, _setting];
3334
};
3435
} forEach GVAR(allSettings);
3536

3637
_categorySettings sort true;
3738
private _lastSubCategory = "$START";
3839

3940
{
40-
_x params ["_subCategory", "", "_setting"];
41+
_x params ["", "_subCategory", "", "_setting"];
4142
private _createHeader = false;
4243
if (_subCategory != _lastSubCategory) then {
4344
_lastSubCategory = _subCategory;

0 commit comments

Comments
 (0)