Patches: Close tool with middle click / persistent clone

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Patches: Close tool with middle click / persistent clone

Post by Terkhen »

audigex: But that would mean devoting the middle button only to reopening and closing tools... In which situations would reopening last tool be useful?
audigex
Tycoon
Tycoon
Posts: 2056
Joined: 09 Dec 2007 21:28
Contact:

Re: Patches: Close tool with middle click / persistent clone

Post by audigex »

I had a situation in mind, but I can't for the life of me remember now :s it was something to do with wanting to quickly select a station or train before continuing building.

I find that I occasionally want to click menu items (eg increase loan amount, starting trains moving) from already open windows. It would just be an ergonomic improvement to me (less movement) to wheel-click, click the button and wheel click again, rather than moving up to the toolbar, click, to the button, click, back to the toolbar, click and back to where I was building.

Alternatively, how about wheel-clicking cycles through a few handy tools?

Eg if I click the mouse wheel on no tool, for the first x (3?) seconds it cycles through the autorail, signal, station and depot tools. As soon as I place one or more rail/signal etc or 3 seconds pass, it reverts to cancelling the current tool.

It could even bring up tools based to the last used tool, eg if I just closed a rail tool, it cycles through rail tools - same for landscaping, ships, RVs and aeroplanes. If dont properly it could improve the whole ergonomic situation massively - an area where TTD (as with most games of the era, and most strategy/simulation games) have in common - by reducing the amount of movement while saving time.
Jon
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Patches: Close tool with middle click / persistent clone

Post by DaleStan »

Terkhen wrote:The planned behaviour is to close the the tool first, and another click would shade the window.
Interesting. I thought the other order would be a better choice.

My reasoning is that a middle click on a title bar with an active tool means one of two things:
  1. You want to shade a window. Likely, a window that is obstructing your use of the active tool, and possibly even the window that opened the tool. (e.g. the build-station or build-industry windows)
  2. You want to close the active tool, and happen to be pointing at a title bar.
I figure that the first is more likely than the second.
Terkhen wrote:audigex: But that would mean devoting the middle button only to reopening and closing tools... In which situations would reopening last tool be useful?
When you accidentally middle-clicked before you were ready to? :p
audigex wrote:I find that I occasionally want to click menu items (eg increase loan amount, starting trains moving) from already open windows. It would just be an ergonomic improvement to me (less movement) to wheel-click, click the button and wheel click again, rather than moving up to the toolbar, click, to the button, click, back to the toolbar, click and back to where I was building.
Or you could just click the button while the tool is active.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Patches: Close tool with middle click / persistent clone

Post by Terkhen »

audigex wrote:I find that I occasionally want to click menu items (eg increase loan amount, starting trains moving) from already open windows. It would just be an ergonomic improvement to me (less movement) to wheel-click, click the button and wheel click again, rather than moving up to the toolbar, click, to the button, click, back to the toolbar, click and back to where I was building.
I keep the tool open in these cases, as DaleStan said.
audigex wrote:Alternatively, how about wheel-clicking cycles through a few handy tools?
There are two problems with that. The most important is that scrolling is already being used for zooming / scrolling the map. The second is... which ones are handy tools exactly?. I doubt that there's a selection that makes everybody happy. It would need some way of personalization, using a key configuration feature that does not exist in trunk (the configurable hotkeys patch is developing it).
DaleStan wrote:My reasoning is that a middle click on a title bar with an active tool means one of two things:
  1. You want to shade a window. Likely, a window that is obstructing your use of the active tool, and possibly even the window that opened the tool. (e.g. the build-station or build-industry windows)
  2. You want to close the active tool, and happen to be pointing at a title bar.
I figure that the first is more likely than the second.
Your reasoning is right: I would probably end up closing the tool while trying to shade the window too. When I get to it, I'll give closing the active tool a lower priority than shading windows.
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Patches: Close tool with middle click / persistent clone

Post by Terkhen »

As promised, I have attached in the first post a version of the close tool with middle click patch that is compatible with the shade windows patch. If you middle click anywhere in the main window (that means not in the toolbar or in any other window), the current tool will be closed. I thought it would be more complicated to implement the behaviour that DaleStan suggested, but it was easy thanks to erikjamp's great design for the middle mouse button code. You can use this version of the patch only after applying the three parts of the Shade windows patch.
erikjanp
Engineer
Engineer
Posts: 16
Joined: 29 Aug 2008 22:30

Re: Patches: Close tool with middle click / persistent clone

Post by erikjanp »

thanks to erikjamp's great design for the middle mouse button code
Heh, I didn't really design it, I didn't do much more than copy the right mouse button code and then s/right/middle/. :roll:
So thanks to the original author of the code, for making it easy extendible.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 15 guests