Page 1 of 2

Patches: Close tool with middle click / persistent clone

Posted: 23 Aug 2009 03:51
by Terkhen
This one is the penultimate of my patching spree. Don't worry about my sanity; it is very small and simple, but pretty handful. This feature allows to close any tool currently in use pressing the middle mouse button. This is specially useful with persistent tools and / or quick goto turned on. I know that you can already do the same with the ESC key, but it is so far from the rest of frequently used keys that I lose too much time using it. Try it once and you will never go back, I know I won't :D

The middle mouse button code (the complicated part) was created by erikjanp for the shade windows patch, which means that almost every line of this code was made by him.

Right now the behaviour is to close tools if there's a tool active, which lefts open the possibility of allowing it to do other things under different conditions. Do you think this behaviour for the middle button is consistent enough?. Is there any problem with using the middle button (besides that this feature can't be used in platforms without this button)?.

Patch: Persistent clone

Posted: 23 Aug 2009 04:58
by Terkhen
And the last one: persistent clone. While you are cloning, the clone tool stays active until you click on its button again or press ESC. To turn on / off this behaviour, it uses the same setting than the persistent building tool.

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

Posted: 23 Aug 2009 18:23
by petert
I find close tools with middle mouse button very useful. I usually have to use del key, therefore my finger is on the del key almost all the time that I am building. The tool that is sort-of pesky is the Land Area Information, since that doesn't go away when you press del. I don't know what people will do without a middle mouse button though. :roll:

:arrow: As for the persistant clone tool, as of now, that one didn't work for me. I tried making an aircraft, then clicked on clone and when I cloned it, I had to re-click clone vehicle again. I've a feeling I'm using this one wrong. :?:

If you need me to post screenshots, video, I can do that.

Keep up the good work Terkhan and erikjanp :!:

Me gusta como trabajas.

Peter

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

Posted: 23 Aug 2009 20:32
by Terkhen
petert wrote::arrow: As for the persistant clone tool, as of now, that one didn't work for me. I tried making an aircraft, then clicked on clone and when I cloned it, I had to re-click clone vehicle again. I've a feeling I'm using this one wrong. :?:
You probably have the setting for quick goto off; As stated, right now they are using the same setting. Turn it on and you will be able to enjoy persistent cloning.

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

Posted: 23 Aug 2009 20:58
by petert
Like I said:
petert wrote:I've a feeling I'm using this one wrong.
Thanks for the help.

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

Posted: 24 Aug 2009 12:26
by Terkhen
I just tested that these patches can apply to the 0.7 branch without rejects.

Edit: Persistent clone updated. I just made it use the existing "persistent building tools" settings: it is more correct in this way.

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

Posted: 24 Aug 2009 21:25
by petert
Can you update the first post with the compiled binary of v2 of persistant clone?

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

Posted: 24 Aug 2009 21:43
by Terkhen
The persistent clone binary and diff are at the second post. Why should I move the files?

ptmPP has a Google Code page!

Posted: 25 Aug 2009 02:02
by petert
Edit: Removed ptMPP from here, check out

ptMPP's Google Code Page

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

Posted: 25 Aug 2009 07:38
by Terkhen
If you are going to create a patch pack, you should start a new thread for it.

Edit: The download link is not correct: after clicking on the url I had to remove "Connection: close" from the end of the url to download it. Also, the zip file still has the .svn folders. If you export the files with svn after compiling and before packing (or delete the .svn folders manually) the zip file will be lighter.

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

Posted: 25 Aug 2009 15:43
by petert
The url doesn't contain "Connection: Close" at the end. I don't know what caused that.

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

Posted: 25 Aug 2009 15:46
by Scautura
MediaFire doesn't allow you to link directly to the file, you need to link here: http://www.mediafire.com/?o2dv1d5xey3

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

Posted: 25 Aug 2009 16:15
by petert
Ok, I updated the link. Thank you Scatura.

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

Posted: 26 Aug 2009 14:52
by Ammler
Terkhen wrote:If you export the files with svn after compiling and before packing (or delete the .svn folders manually) the zip file will be lighter.
or just use "make bundle_*" ;-)

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

Posted: 26 Aug 2009 15:20
by Terkhen
Ammler wrote:or just use "make bundle_*" ;-)
Sadly that's not possible for me since I use Visual Studio (or at least I wasn't able to find documentation about it).

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

Posted: 26 Aug 2009 15:33
by Yexo
Terkhen wrote:
Ammler wrote:or just use "make bundle_*" ;-)
Sadly that's not possible for me since I use Visual Studio (or at least I wasn't able to find documentation about it).
I use Visual Studio too, but for making a bundle I use cygwin or msys.

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

Posted: 26 Aug 2009 15:44
by Terkhen
I use gnuwin32 tools myself: I had to uninstall msys because it conflicted with devkitpro. Now that I finished my project involving devkitpro, I can give msys another chance when I finish my exams.

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

Posted: 26 Aug 2009 16:52
by DaleStan
Terkhen wrote:Right now the behaviour is to close tools if there's a tool active, which lefts open the possibility of allowing it to do other things under different conditions. Do you think this behaviour for the middle button is consistent enough?. Is there any problem with using the middle button (besides that this feature can't be used in platforms without this button)?.
If there's a tool active and you middle-click on the title-bar of a window, what happens? Does the window (un)shade, or does the tool get closed? (Or -- horror of horrors -- both?)

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

Posted: 27 Aug 2009 06:49
by Terkhen
The planned behaviour is to close the the tool first, and another click would shade the window. When the shade windows patch gets updated to trunk, I will do a version of close tool with middle click compatible with it. Right now, if you just tried to solve the rejects between the two patches manually shading window with middle click could either not work at all or land in the horror of horrors, depending on how it was solved. These are the correct changes, if anyone wants to try it before shade windows is updated.

Without erikjamp's code for middle click, my patch is this single line (placed in the part of the code that handles middle clicking):

Code: Select all

if (_cursor.sprite != SPR_CURSOR_MOUSE) ResetObjectToPlace();
To have compatibility with shade windows, it needs to be like this:

Code: Select all

if (_cursor.sprite != SPR_CURSOR_MOUSE) {
	ResetObjectToPlace();
} else {
	click = MC_MIDDLE; //Constant that I currently don't use, as the middle click don't needs to be checked in the GUI in my patch.
}

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

Posted: 27 Aug 2009 19:59
by audigex
How about clicking the middle mouse button again re-instates the previous tool?