Page MenuHomeWildfire Games

Scrollbug when player/gamelist receives update in lobby
ClosedPublic

Authored by ffffffff on Jan 18 2018, 5:25 PM.

Details

Reviewers
elexis
Trac Tickets
#4987
Summary

The code introduces selected_unscrolled attribute to CList.cpp. So we can keep selected player on updated playerlist selected, if position in list changed, but doesn't go for an update to auto scroll to it, so we can keep our scroll view consistent too.

Same for updated gamelist. Keep selected game consistent, if position changed, but dont loose scroll view.

Test Plan

select a player.

scroll player out of view in list. Make updateplayerlist call by type /away in chat.

select a game. scroll out of view. try to get updategamelist call.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

ffffffff created this revision.Jan 18 2018, 5:25 PM
ffffffff updated this revision to Diff 5367.Jan 18 2018, 5:27 PM

Better version with unscrolled code as normal behaviour should be autoscroll feature when selected setted. So make new attribute which sets selected item but dont update auto scroll.

ffffffff retitled this revision from Selection bug when playerlist update scollbug to Scrollbug when player/gamelist receives update in lobby.Jan 18 2018, 5:51 PM
ffffffff edited the summary of this revision. (Show Details)
ffffffff edited the test plan for this revision. (Show Details)
ffffffff updated the Trac tickets for this revision.

Not to be implemented like this. There may only be one property specifying the selection.
A better yet inacceptable implementation would be a boolean that determines if we want an autoscroller or not and change that from JS back and forth.
But I'd rather revert the original commit than doing that.
What we want is to be able to call custom functions on GUI objects.

jes true but as we are very lame slow maybe take this till full impli

I'm not sure why I'm posting these comments.

U figure ur own or shall i figure

as i guess also selected_unscrolled attribute is cheap

elexis requested changes to this revision.Jan 20 2018, 7:04 PM

as i guess also selected_unscrolled attribute is cheap

Im Sinne von günstig oder billig? :P

That property would have the disadvantage of two variables storing the same data (selected ID).
It violates the https://en.wikipedia.org/wiki/Single_source_of_truth pattern.

I would accept an autofocus JS-only boolean that is instantly set to false when receiving the changed message however. https://trac.wildfiregames.com/ticket/4987#comment:6

JS-only means the new property is not going to be added to gui.rng nor gui.rnc.

Also move the debug code out of the patch.

This revision now requires changes to proceed.Jan 20 2018, 7:04 PM
ffffffff updated this revision to Diff 5404.Jan 22 2018, 2:05 AM

auto_scroll attribute

ffffffff updated this revision to Diff 5408.Jan 22 2018, 2:37 AM

replay menu and auto scroll default false and always set before selected attribute

ffffffff updated this revision to Diff 5409.Jan 22 2018, 2:55 AM

gui.rnc and gui.rng file update

ffffffff updated this revision to Diff 5410.Jan 22 2018, 3:13 AM

set in xml auto_scroll

ffffffff updated this revision to Diff 5411.Jan 22 2018, 3:34 AM

loadgame modmod gui support

elexis accepted this revision.Jan 22 2018, 5:41 AM

Works. Really neat patch, seems even nicer than a C++ method after all.
Your lobby test data eased the testing process.

Thanks a lot for helping out on this one!

binaries/data/mods/public/gui/lobby/lobby.js
755

unneeded

1091

Much nicer to set it to false here, because the reader sees why it's set to false on first sight, right?

binaries/data/mods/public/gui/replaymenu/replay_menu.xml
60

Tested, works as expected, good job

This revision is now accepted and ready to land.Jan 22 2018, 5:41 AM

Committed in rP20958, @ffffffff can you close this?

ffffffff closed this revision.Jan 22 2018, 6:50 AM

tx

binaries/data/mods/public/gui/lobby/lobby.js
1091

y