Page MenuHomeWildfire Games

Saving sort order in GUI list, on same column values compare also previous columns, default order per column
Needs ReviewPublic

Authored by ffffffff on Mar 11 2017, 4:20 PM.

Details

Reviewers
bb
Trac Tickets
#4979
Summary

Easylize code and make proper compare column function.

Test Plan

t

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

ffffffff created this revision.Mar 11 2017, 4:20 PM
ffffffff edited the summary of this revision. (Show Details)Mar 11 2017, 4:23 PM
scythetwirler added inline comments.Mar 16 2017, 12:13 AM
./gui/lobby/lobby.js
214 ↗(On Diff #765)

Might as well make sortBy case consistent with the default.cfg value?

elexis requested changes to this revision.Mar 16 2017, 12:52 AM

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.

This revision now requires changes to proceed.Mar 16 2017, 12:52 AM

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.

ffffffff updated this revision to Diff 3108.Aug 13 2017, 10:21 PM
ffffffff edited edge metadata.

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

ffffffff updated this revision to Diff 3109.Aug 13 2017, 10:22 PM
ffffffff updated this revision to Diff 3110.
ffffffff added inline comments.Aug 13 2017, 10:29 PM
binaries/data/mods/public/gui/lobby/lobby.js
648

this coming block is indent false will come correct in final diff if all finished

980

two lines or let sortA = "", sortB = "";

990

this coming block is indent false will come correct in final diff if all finished

1022

wrong indent

ffffffff updated this revision to Diff 3116.Aug 13 2017, 11:46 PM
ffffffff updated this revision to Diff 3117.Aug 14 2017, 12:07 AM
ffffffff edited the summary of this revision. (Show Details)
ffffffff edited the test plan for this revision. (Show Details)
ffffffff retitled this revision from Saving sort order made in lobby for playerlist and gamelist to Saving sort order made in lobby for playerlist and gamelist + Multi column sort.
ffffffff updated this revision to Diff 4159.Nov 12 2017, 10:31 PM
ffffffff updated this revision to Diff 4160.
ffffffff added a reviewer: bb.
ffffffff added inline comments.Nov 12 2017, 10:33 PM
binaries/data/mods/public/gui/lobby/lobby.js
672

testing

1002

testing

ffffffff updated this revision to Diff 4246.Nov 18 2017, 7:06 AM

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.

ffffffff marked 3 inline comments as done.Nov 18 2017, 7:07 AM
ffffffff added inline comments.
binaries/data/mods/public/gui/lobby/lobby.js
625

Maybe this function into somewhere common?

ffffffff updated this revision to Diff 4269.Nov 18 2017, 8:38 PM

contextdiff

ffffffff updated this revision to Diff 4274.Nov 19 2017, 8:15 AM

parseInt eliminated

ffffffff updated this revision to Diff 4290.Nov 21 2017, 9:25 AM
ffffffff updated this revision to Diff 4540.Dec 4 2017, 7:06 PM

setting default column order in playerlist to "buddy,status,name,rating"
and in games list to "buddy,name (incl. status)"

ffffffff updated this revision to Diff 4701.Dec 10 2017, 3:29 PM

fedUpWithZeros function out.
init config values function.
code shorten.

elexis resigned from this revision.Dec 12 2017, 8:37 PM
ffffffff updated this revision to Diff 4880.Dec 22 2017, 3:34 AM
ffffffff retitled this revision from Saving sort order made in lobby for playerlist and gamelist + Multi column sort to Saving sort order for playerlist and gamelist and allow mixed column sort.
ffffffff edited the summary of this revision. (Show Details)
ffffffff edited the test plan for this revision. (Show Details)
ffffffff removed a reviewer: elexis.
ffffffff added a subscriber: elexis.
ffffffff updated this revision to Diff 5263.EditedJan 13 2018, 1:21 AM

for the eye hopefuly helping review this patch

ffffffff updated this revision to Diff 5276.Jan 13 2018, 6:27 PM

Xml settings changed in js -> put into js.
Some more readable names and comments.

ffffffff updated this revision to Diff 5277.Jan 13 2018, 6:31 PM

i was wrong selectionChange event attribute can stay in xml. as it nothing todo with sorting.

ffffffff added inline comments.Jan 13 2018, 9:07 PM
binaries/data/config/default.cfg
402

maybe name playerlist

406

maybe name gamelist

ffffffff updated this revision to Diff 5279.Jan 14 2018, 3:12 AM
ffffffff updated this revision to Diff 5280.Jan 14 2018, 3:42 AM

Adding string comparison language support.

ffffffff updated the Trac tickets for this revision.Jan 18 2018, 7:13 AM
ffffffff updated this revision to Diff 5427.EditedJan 22 2018, 8:02 PM

g_LocaleCompare and unified translate phrase. (was wrong diff. correct diff was D928. revert to previous diff from history in next step.)

ffffffff updated this revision to Diff 5429.Jan 22 2018, 8:05 PM

Wrong diff updated before. Revert to previous diff. :(

ffffffff planned changes to this revision.Jan 30 2018, 4:29 AM

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

ffffffff updated this revision to Diff 5602.Jan 31 2018, 9:41 AM

update code

ffffffff updated this revision to Diff 5804.Feb 16 2018, 11:31 PM
ffffffff retitled this revision from Saving sort order for playerlist and gamelist and allow mixed column sort to Saving sort order in GUI list, on same column values compare also previous columns, default order per column.
ffffffff edited the summary of this revision. (Show Details)
ffffffff edited the test plan for this revision. (Show Details)
ffffffff added inline comments.Feb 17 2018, 10:39 AM
binaries/data/mods/public/gui/lobby/lobby.js
983

old remove line