Page MenuHomeWildfire Games

Tab more names when autocomplete in chat (Autocomplete Cycling)
Needs ReviewPublic

Authored by ffffffff on Aug 31 2017, 3:29 PM.

Details

Reviewers
elexis
vladislavbelov
Trac Tickets
#4971
Summary

When tabbed out names in chat its always taken first name approach from playerlist.

but when ther are actualy more playernames matching u cant tab them. So this patch make it possible to tab again and get next playername also matching
typed pattern, and when tabbed player names are all tabbed through begin again with first match.

Test Plan

test in chat tabbing around with playernames having same start pattern in playerlist like ffffffff, fpre starting f.

so tab though f x-times on playerlist in chat when fffffffff and fpre are online f.e.

or take any from playerlist having same pattern maybe taking two accounts having same pattern in begin in name.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

ffffffff created this revision.Aug 31 2017, 3:29 PM
ffffffff updated this revision to Diff 3419.Aug 31 2017, 3:37 PM

comment to explain

  • Remove the unrelated changes
  • let in local scope, var on global
  • each variable declaration on a separate line
  • tries is the number of tab keypresses and determines which match will be displayed?
  • I really thought we had this feature some day ago.
In D856#33522, @elexis wrote:
  • Remove the unrelated changes
  • let in local scope, var on global
  • each variable declaration on a separate line
  • tries is the number of tab keypresses and determines which match will be displayed?
  • I really thought we had this feature some day ago.

hey elexis,

y @tries.

ffffffff updated this revision to Diff 3432.Aug 31 2017, 5:55 PM

var each line

ffffffff edited the test plan for this revision. (Show Details)Aug 31 2017, 11:31 PM
ffffffff added a comment.EditedSep 11 2017, 2:29 PM
In D856#33522, @elexis wrote:
  • Remove the unrelated changes
  • let in local scope, var on global
  • each variable declaration on a separate line
  • tries is the number of tab keypresses and determines which match will be displayed?
  • I really thought we had this feature some day ago.

if u dont find look this

ffffffff updated this revision to Diff 4162.Nov 13 2017, 5:46 AM
ffffffff added a subscriber: bb.Nov 13 2017, 5:38 PM
ffffffff updated this revision to Diff 4265.Nov 18 2017, 8:29 PM

contextdiff

It seems it can be implemented shorter, i.e. we don't need new text, we only need a base text and a number of tries.

binaries/data/mods/public/gui/common/functions_utility.js
9

Ins't it better to combine all this variables in a one object? Like:

var g_LastAutocomplete = {
    "buffer_position": "",
    "text": "",
    "tries": 0,
    "new_text": ""
};
188

It could written like:

if (!firstFound)
ffffffff added inline comments.Nov 30 2017, 12:07 AM
binaries/data/mods/public/gui/common/functions_utility.js
9

n1.

188

y i think js interprets value 0 as not? then it wont be matched here correctly if word has value 0 and firstFound also, no?

ffffffff updated this revision to Diff 4538.Dec 4 2017, 6:56 PM

g_LastAutoComplete object update

ffffffff updated this revision to Diff 5135.Jan 6 2018, 7:46 PM

vladis update an a test playerlist later removed

ffffffff added inline comments.Jan 6 2018, 7:47 PM
binaries/data/mods/public/gui/common/functions_utility.js
188

Ok true works. Only strings parsed (playernames) though !firstFound works. tx!

i see here less improvements. why is it so uninterested in the code here.

ffffffff marked 5 inline comments as done.Jan 8 2018, 1:49 PM
elexis updated the Trac tickets for this revision.Jan 18 2018, 5:37 AM

Sorry @vladislavbelov forget my last comment :(.

You might got time to last review my updated code? really sorry :(

Imarok retitled this revision from Tab more names when autocomplete in chat to Tab more names when autocomplete in chat (Autocomplete Cycling).May 22 2018, 11:03 PM
Imarok added a subscriber: Imarok.May 22 2018, 11:19 PM

Just quickly scanned the diff and tried it out. Seems to be nice.
Shouldn't we also do cycling for the other autocomplete words?

binaries/data/mods/public/gui/common/functions_utility.js
8–13

Would be nice to add a more extensive comment, that explains all those variables.

In D856#61990, @Imarok wrote:

Just quickly scanned the diff and tried it out. Seems to be nice.
Shouldn't we also do cycling for the other autocomplete words?

don't we?

nani awarded a token.May 8 2019, 3:42 AM
nani added a subscriber: nani.
nani added inline comments.
binaries/data/mods/public/gui/lobby/lobby.js
600 ↗(On Diff #5135)

?