The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Dwachs on February 09, 2012, 02:19:49 PM

Title: [patch] add goto-button to chat messages
Post by: Dwachs on February 09, 2012, 02:19:49 PM
This patch adds the following: whenever a chat message contains a map coordinate in the form @(234,23) then a goto button is shown in front of the message (like for the automatic generated messages, where the button brings you to the crowded station etc).
Title: Re: [patch] add goto-button to chat messages
Post by: Milko on February 09, 2012, 02:22:25 PM
Hello

   Very useful!

Thanks

Giuseppe

Title: Re: [patch] add goto-button to chat messages
Post by: Fabio on February 09, 2012, 02:32:26 PM
Great idea, but isn't synthax @(x,y) non-intuitive for new players?
How to explain them?

Here's an idea: clicking inspection tool on a tile saves coordinates. A special button in chat window could paste the last coordinates saved in the appropriate format.
Title: Re: [patch] add goto-button to chat messages
Post by: VS on February 09, 2012, 03:21:32 PM
That could be another stage...
Title: Re: [patch] add goto-button to chat messages
Post by: prissi on February 09, 2012, 04:16:42 PM
Why the @(x,y)? Simply (x,y) would work also well, as one would rarely type this without coordinates in mind.
Title: Re: [patch] add goto-button to chat messages
Post by: jamespetts on February 09, 2012, 11:29:51 PM
How about middle clicking on a co-ordinate while in the chat window will paste the co-ordinates in the correct format into the chat text box?
Title: Re: [patch] add goto-button to chat messages
Post by: Fabio on February 09, 2012, 11:48:33 PM
Middle clicking-- not somethings my hands want to do, nor an easy guess for new players... But the idea is good.
Maybe with chat window open and text input box selected the cursor could turn into a marker (like with schedule dialog) and a normal left click on a tile would add the formatted coordinates... 
Title: Re: [patch] add goto-button to chat messages
Post by: jamespetts on February 10, 2012, 12:04:47 AM
I thought middle clicking because it is the default paste button for Linux.
Title: Re: [patch] add goto-button to chat messages
Post by: Fabio on February 10, 2012, 12:40:15 AM
Sorry, I didn't know that. The only use I have for middle click is closing tabs in the browser...
It might be an option, although it needs to be more like copy than paste... :-[
Title: Re: [patch] add goto-button to chat messages
Post by: sdog on February 10, 2012, 05:57:45 AM
gnome & chrome: i middle click to open windows with the copied string as search term. (i don't know how windows users survive without that)

what james suggests is exactly the opposite of the behaviour in many linux window managers, middle click pastes, while normal click selects. in line with this a middle click on the chat window would enter the map coordinate of the last clicked field. (which i would not be too happy about, as i want my middle clicks to copy&paste text strings, eg when renaming lines)
Title: Re: [patch] add goto-button to chat messages
Post by: ӔO on February 10, 2012, 06:11:21 AM
I would suggest something simple to use, like last clicked coordinates that always results in a go to arrow.
This way there is no need to worry about using special commands in the message or special key strokes or mouse clicks to get it to work.
Title: Re: [patch] add goto-button to chat messages
Post by: Ters on February 10, 2012, 05:20:21 PM
How many mouse buttons do Macs have nowadays? Didn't they use to have just one? And what about touch devices, though their lack of a keyboard may be more problematic.
Title: Re: [patch] add goto-button to chat messages
Post by: Ashley on February 10, 2012, 07:46:56 PM
Please avoid middle-click, it's not good for the Mac platform in general.

I agree that simply parsing any string of the form (x,y) should be sufficient, then put some text into the chat window to indicate that you can do this.
Title: Re: [patch] add goto-button to chat messages
Post by: jamespetts on February 10, 2012, 08:56:28 PM
How about without the brackets? Or perhaps double-click, if middle is difficult for some platforms?
Title: Re: [patch] add goto-button to chat messages
Post by: sdog on February 10, 2012, 09:03:13 PM
without brackets it would confuse real values with a ',' as decimal separator (which is international standard, '.' is an american convention)

@10,6 with the @ but without the bracket could be alternatively used to the bracketed version. (on many keyboard layouts @ is easier to write than brackets)
Title: Re: [patch] add goto-button to chat messages
Post by: ӔO on February 10, 2012, 10:25:24 PM
from a player standpoint, the less we have to learn or read, the happier we are.
macros, functions to copy/paste, they are not needed if any message typed simply gives the coordinates of the last clicked location.
Title: Re: [patch] add goto-button to chat messages
Post by: sdog on February 10, 2012, 10:29:55 PM
how about a syntax completion approach, writing @ and pressing tab would fill in the coordinate of the last pressed coordinate. tab completion is a gui concept anyone using a computer is likely accustomed to.
Title: Re: [patch] add goto-button to chat messages
Post by: Fabio on February 10, 2012, 11:18:31 PM
A mix of sdog's,  AEO's and original proposals:
Every message gives the coordinates of last clicked tile, unless you type explicitly @x,y or (x,y) -- both being accepted. Maybe default coordinates go in default colour, whereas explicit coordinates go in red (if a player enters them manually he must have a very strong reason to do so).
A @ with no coordinates (but no tab needed) would mark in red the default coordinates without typing them.
Title: Re: [patch] add goto-button to chat messages
Post by: Dwachs on February 16, 2012, 10:52:50 AM
Incorporated in r5339.

I implemented both suggestions to type coordinates: @x,y  and (x,y) - the closing bracket can even be omitted.

Still searching a smart hint text to be shown in the message window.
Something like "Hint: typing @x,y will add a goto-button to your message"

Suggestions?
Title: Re: [patch] add goto-button to chat messages
Post by: Fabio on February 16, 2012, 11:54:56 AM
What about the idea of simple "@" (i.e. x,y omitted) being additionally  interpreted as @x_last_clicked,y_last_clicked?