Ctrl-Drag Bridge: instantly build fastest available

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

Post Reply
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Ctrl-Drag Bridge: instantly build fastest available

Post by Frostregen »

Some useful spinoff from copy&paste:

This patch allows to hold Ctrl while dragging a bridge,
which instantly builds the fastest available bridge,
without showing the bridge selection window.

I thought this may be useful because most players build the fastest available bridge anyway.

Please comment, or include ;)

Greetings,
Frostregen
Attachments
fastest_bridge_v1.diff
patch for SVN r12558
(2.1 KiB) Downloaded 211 times
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by Trond »

Sweet! Hope this goes into trunk!
..: Trond :.. because you deserve it! Image

The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell

MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
User avatar
Indiana
Engineer
Engineer
Posts: 36
Joined: 07 Feb 2008 09:15

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by Indiana »

Very good idea!
I hate to scroll down the bridge menu to find the fastest.
Have a N.I.C.E. day!
Indiana
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by Ammler »

Nice idea.

Also possible to make something like "use the last used" bridge?

Greets
Ammler
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by planetmaker »

Ammler wrote: Also possible to make something like "use the last used" bridge?
Yeah, very nice idea and even better, if Ammler's suggestion could be implemented as well (maybe with Alt or something).
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by Zuu »

planetmaker wrote:
Ammler wrote: Also possible to make something like "use the last used" bridge?
Yeah, very nice idea and even better, if Ammler's suggestion could be implemented as well (maybe with Alt or something).
Alt+(left)Drag is commonly used by window-managers to move windows. (and right-drag to resize them)

But we could have either Alt or Super (windows key). Will not suit all either since Super is possible used by some windows-alike WMs such as gnome/kde. Maybe someone have a better idea?
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
T-Unit
Transport Coordinator
Transport Coordinator
Posts: 368
Joined: 03 Feb 2007 18:53
Location: Leeds, England

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by T-Unit »

Is there a programmable difference between right and left ctrl?
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by Zuu »

Yes, but OTTD generalize the modifiers as just one 'key' of each type. At least if you look at the mod-bits. I don't remember if the CTRL-key exist also as a usual keycode where there could exist two keycodes one for left and one for right. But the OTTD standard way to read if a modifier is pressed is to look at the mod-bits.

(at least 1/2 a year ago, when I last worked on configurable hotkeys)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by SirkoZ »

Thanks!

This indeed is a really useful feature. I usually build the fastest bridge, only perhaps sometimes I prefer the "golden" tubular over the "silver" one... :-)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by planetmaker »

updated to trunk (r13058)
Attachments
fastest_bridge_v1_r13058.diff
fastest bridge via Ctrl-Drag, updated to r13058
(2.09 KiB) Downloaded 142 times
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by planetmaker »

any chance for an updated? I currently fail to updated it properly :S
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by Alberth »

yes

(edited: replaced attached patch file with new one with code/style changes as requested by Frostregen below)
Attachments
fastest_bridge_v1_r13418.patch
fastest bridge patch, with code changes as requested
(2.13 KiB) Downloaded 151 times
Last edited by Alberth on 08 Jun 2008 16:35, edited 2 times in total.
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by Frostregen »

If someone updates it again, consider using this version
http://bugs.openttd.org/?getfile=2853
as a base.
There were some coding/style changes, which should not be lost.

Thx,
Frostregen
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by Alberth »

done (by manually patching the patch-file). Compiles and runs against current trunk (13418)

For new version see my previous post (removed previous version of the attachement as it is not useful any more anyway).

Albert
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by Roujin »

Well, you are now able to sort bridges by speed in trunk. So I think this patch is not needed so urgently anymore...
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Ctrl-Drag Bridge: instantly build fastest available

Post by planetmaker »

Roujin wrote:Well, you are now able to sort bridges by speed in trunk. So I think this patch is not needed so urgently anymore...
True. But you still save one mouse click. Speed rulez :)

Frostregen & Albert: Thanks for the update.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 14 guests