Search in Sign List

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Search in Sign List

Post by Zuu »

Hi,

In cooperative multiplayer it often involves that one has to find a sign in the sign list.

What I would like to do is to type the keyword I got via chat and the sign list will either just highlight the first match or better filter the view so only signs that contain the text I've typed.


This could also be applyed to town and station list which also tend to become long and tedious to scroll through. Through on sign-list one also have to check zero, one, two and possible even more spaces in the begining of the word.
Last edited by Zuu on 29 Jul 2008 11:35, edited 1 time in total.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Search in Sign List - and probably other lists too

Post by Zuu »

So I checked out the source and had a look on the source. Note that currently the filtering is kind of hacky. A proper way would be to make a second list of signs with only the one that matches and then use it for output/input. What I've done is to in the print sign loop only draw signs that matches. Hacky - I know. And I'll attempt to make it better later when I have more time.
Sign window has just been opened. Looks as usual, except for the text box at the bottom.
Sign window has just been opened. Looks as usual, except for the text box at the bottom.
Signs Inc, 3rd May 1950.png (57.37 KiB) Viewed 1042 times
I've typed a search word in the text box.
I've typed a search word in the text box.
Signs Inc, 11th May 1950.png (56.63 KiB) Viewed 1042 times
Also I have to address some usability issues. Such as when typing should be activated and not.

Solution:
1. Always allow typing when the window is open. Update sign list as you type and go to the first visible sign when user press Enter. Close window on escape.

2.
  • Hide the edit box widget and have a button there.
  • When the button is pressed (or via hotkey) the edit box appears.
  • When the edit box is visible:
    • Update the sign list as you type.
    • Goto first shown sign on enter key
    • Hide the edit box on escape and again show the button.
  • When the edit box is invisible:
    • User can close window with delete key as usual
A cancel/clear button could be added next to the edit box for users who don't know of or want to use the escape key.


Your opinions on the two solutions or if you have a third option are welcome. Also if you have any other opinions on the search/filter function they are welcome.



--------

EDIT 2008-08-01: This thread have been continued in the development forum:
http://www.tt-forums.net/viewtopic.php?f=33&t=38715
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 12 guests