Commit Graph

9 Commits

Author SHA1 Message Date
Cathy J. Fitzpatrick
fa05e003b9 Add shift+tab function for navigation
After the introduction of the tab complete feature, the tab
key can no longer be used to navigate away from the chatbox.
This commit adds a shift+tab function to navigate away from
the chatbox, rather than tab completing a name.
2013-01-27 23:03:55 -07:00
Cathy J. Fitzpatrick
7510edbe12 Implement tab completion of user names
This commit implements a feature commonly found in IRC clients
and often referred to as "tab complete". This allows a user to
type part of a user's name in the chat box and then press tab, which
causes the program to complete the user's name in the chat box. The
user can then press tab additional times in order to cycle through
the list of possible matches.

Tab complete has been implemented for the main chat, for battles,
and for private messages.

The algorithm implemented is that when you press tab, the program
looks backward to the last space (or start of the line) and
considers the substring between the last space and the position of
the cursor to be the prefix of a name. It then builds a list of
all names that it could be, which is then sorted. The sort is
done first based on activity (i.e. users who have spoken more
recently are sorted higher), and if users are tied as to activity,
then by alphabetical order.

After a name has been tab-completed, you can then press tab
subsequent times in order to cycle through the remainder of the list.

The idea behind this algorithm is that a user will usually want
to refer to somebody who has spoken recently in the chat. This
is especially helpful for Pokemon Showdown because with 1500+
users, it would be difficult to complete the correct name if it
were based purely on alphabetical order.

Matching of names is based on userids, which are strictly
alphanumeric. Therefore, when intending to use tab complete,
a user should type only the letters and numbers from a user's
name, not any spaces or symbols. After pressing tab, the spaces
and symbols will appear in the chatbox, however.
2013-01-27 03:45:47 -07:00
Guangcong Luo
32c4cec99d Prevent lobbychat scrollback from hitting RAM limits 2013-01-26 09:20:37 -08:00
yenatch
d6ad3f0031 add a button to stop the battle timer 2013-01-25 19:49:26 -05:00
Cathy J. Fitzpatrick
3b82cf5cec Refactor acknowledging requests from server
See the corresponding server commit for details.
2013-01-25 12:20:46 -07:00
Cathy J. Fitzpatrick
ccf0a97733 Acknowledge receiving requests from the server
There will be a more detailed explanation of this in the
corresponding server commit.
2013-01-25 01:05:59 -07:00
Guangcong Luo
1ba0c95ad0 Fix crash for non-main servers 2013-01-23 18:18:42 -08:00
Guangcong Luo
e4bde150e0 Add support for a test client 2013-01-23 17:45:03 -08:00
Guangcong Luo
b16c1527da Populate with current state of client 2013-01-23 16:39:14 -08:00