Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch: scroll with arrow keys in server list #2194

Closed
DorpsGek opened this issue Aug 6, 2008 · 7 comments
Closed

Patch: scroll with arrow keys in server list #2194

DorpsGek opened this issue Aug 6, 2008 · 7 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Aug 6, 2008

Roujin opened the ticket and wrote:

This patch allows to scroll with the arrow keys in the network server list.
It also scrolls the list down/up to the selected server if it is outside the currently displayed range.

Please comment.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/2194
@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 6, 2008

Roujin wrote:

After glx's suggestion to save the currently selected server's position instead of searching through the list every time, here's a second version.

It also features scrolling to the selected server when clicking on the "last visited server" panel.

Please comment.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2194#comment4541

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 6, 2008

Roujin wrote:

Fixed two small style mistakes.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2194#comment4546

@DorpsGek
Copy link
Member Author

Roujin wrote:

Update to r14505, now also includes pageup, pagedown, home and end keys - they do what is obvious. Also fixed the issue that 0 is a valid position in the list, and switched to uint16, which the number of servers should never reach.

Please comment (pretty please?)...

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2194#comment4911

@DorpsGek
Copy link
Member Author

Rubidium wrote:

+typedef uint16 ServerListPosition;
+enum {SLP_INVALID = 0xFFFF};
You can better use static const ServerListPosition SLP_INVALID = 0xFFFF; here so you don't have to cast in "? : " statements with SLP_INVALID.

Furthermore this->list_position can be -1 or 0 in OnKeyPress which might cause segmentation faults. So I think you should ignore keypresses when there are no servers in the list.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2194#comment4920

@DorpsGek
Copy link
Member Author

Roujin wrote:

Thanks for your feedback! I will implement the two suggestions as soon as I can and reupload it here then.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2194#comment4925

@DorpsGek
Copy link
Member Author

Roujin wrote:

Here's the new version with the two changes.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2194#comment4927

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Implemented

In r14517.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2194

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant