Easylize code and make proper compare column function.
Diff Detail
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
./gui/lobby/lobby.js | ||
---|---|---|
214 ↗ | (On Diff #765) | Might as well make sortBy case consistent with the default.cfg value? |
scythetwirler and me agreed that we don't see much need for this, but adding it doesn't hurt.
Considering that we are going to add more useful columns in D125 and D209, the feature will become useful then.
So agreeing to have it.
"sortOrder = "1"" in the default.cfg is unreadable, but don't see the point in adding code to translate it to "ascending" and "descending" back and forth.
Don't save the settings on updateGameList() and updatePlayerList(), but only when the user actually changed the sorting order.
Also don't write the file twice when changing two entries.
You can move the saving to new functions, change all 4 values in one go with CreateValue and then do a (single) WriteFile.
Also that what scythetwirler remarked.
./gui/lobby/lobby.js | ||
---|---|---|
328 ↗ | (On Diff #765) | You should upload patches with 9999 lines of context, so that we can see to which function you added changes. |
Would be great to have this in alpha 22 since we have now 2 more columns which are likely candidates for being sorted by often.
elexis i stated that arrows sorting shown are wrong direction cause in name f.e. a is lowest char z highest and arrow peak shows up when thers lowest char on first. so i changed in code.
i made multi column ordering. in case double values like buddied or online status. so u order like status then name.
its saved like buddies delimited with ","
sort column and order in user config
ther some indent error on 'case rating': if (i !=0)...
i'll fix if code final
Last changes applied.
One seperate function for sortOrder and sortBy save to config file and update game/player list.
Consisty of sortOrder and sortBy in default.cfg applied.
binaries/data/mods/public/gui/lobby/lobby.js | ||
---|---|---|
625 | Maybe this function into somewhere common? |
setting default column order in playerlist to "buddy,status,name,rating"
and in games list to "buddy,name (incl. status)"
i was wrong selectionChange event attribute can stay in xml. as it nothing todo with sorting.
g_LocaleCompare and unified translate phrase. (was wrong diff. correct diff was D928. revert to previous diff from history in next step.)
changes from comments -> rid off
binaries/data/mods/public/gui/lobby/lobby.js | ||
---|---|---|
656 | rid off not needed inline | |
1065 | after all changes maybe inline function | |
1068 | kill if unneed just unshift | |
1070 | Move sort by column to front | |
1071 | kill while one splice enough unshift(splice(obj,1) || obj); | |
1079 | sync to current base maybe kill some vars | |
1083 | two lines sync no vars |
binaries/data/mods/public/gui/lobby/lobby.js | ||
---|---|---|
983 | old remove line |