[Patch] quick goto (r14400)

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

sulai
Traffic Manager
Traffic Manager
Posts: 159
Joined: 24 Sep 2004 18:23

[Patch] quick goto (r14400)

Post by sulai »

Hey guys,

Creating orders for vehicles is much clicking. This patch makes things easier:
  • - goto button is already active, if you open an orders window with less than two "goto station" entries
    - the goto button stays active until you click it again or hit Esc
    - ctrl+click
    • - on a station makes a "full load any" entry
      - on a depot makes a "service" entry
      - on a waypoint makes a stop/nonstop entry (depending on the new_nonstop patch setting)
You will save many clicks. Example: you save 4 clicks creating these orders:

Code: Select all

1: Go to Station#1 (Full Load)
2: Go to Station#2
This saves 2 clicks:

Code: Select all

1: Go to Station#1
2: Go to Station#2
creating shared/copied orders saves 1 click.

There is a patch entry in the interface category.

This is the Flyspray Task.

(Old versions of) Quick Goto is available in
Roest's Patch Pack (including Windows Binaries)
Tib's Patch Pack (including Windows Binaries)
Attachments
quickgoto_r14400.diff
(8.73 KiB) Downloaded 199 times
Last edited by sulai on 26 Sep 2008 10:31, edited 18 times in total.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Patch: quick goto

Post by Yexo »

The ctrl+click giving full load is good. The goto button stays active needs a patch option, but the goto already active should only happen if the order list is empty.
Mchl
Director
Director
Posts: 611
Joined: 05 Jan 2007 15:50
Location: Poland
Contact:

Re: Patch: quick goto

Post by Mchl »

!!

Some nice ideas!
sulai
Traffic Manager
Traffic Manager
Posts: 159
Joined: 24 Sep 2004 18:23

Re: Patch: quick goto

Post by sulai »

Good points, Yexo! Thank you for feedback =)
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: Patch: quick goto

Post by Trond »

/me like! hi 5 (borat style)
..: 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
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Patch: quick goto

Post by FooBar »

I don't like it...pause not (also borat style)

Very Nice! (borat style too)

Seriously, I think this patch is a great adittion to the game. I agree with Yexo's comments. If you implement those, I'm pretty sure that your patch will be inculeded in trunk (at least, I hope so!).
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Patch: quick goto

Post by planetmaker »

Very nice idea!
sulai
Traffic Manager
Traffic Manager
Posts: 159
Joined: 24 Sep 2004 18:23

Re: Patch: quick creation of vehicle orders

Post by sulai »

Just a little update:

* goto is already active only if there are no (or just one) orders
* there is a patch option now, which doesn't affect savegame format or network synchronization.

See first post for the .diff file.
User avatar
vwspeedracer
Engineer
Engineer
Posts: 28
Joined: 31 Mar 2008 01:37
Location: Colchester, VT, USA
Contact:

Re: Patch: quick creation of vehicle orders

Post by vwspeedracer »

Couldn't you call the function that flags a train as having too few orders, and use that to determine whether or not the goto should start off active?
Fan of: Image
User avatar
Core Xii
Traffic Manager
Traffic Manager
Posts: 228
Joined: 08 Apr 2008 09:47
Location: Finland

Re: Patch: quick creation of vehicle orders

Post by Core Xii »

This is a very useful addition, I like it.
sulai
Traffic Manager
Traffic Manager
Posts: 159
Joined: 24 Sep 2004 18:23

Re: Patch: quick creation of vehicle orders

Post by sulai »

Thank you core! Good idea, vwspeedracer, I will check that!
zombie
Traffic Manager
Traffic Manager
Posts: 153
Joined: 19 May 2005 22:19
Location: Germany

Re: Patch: quick creation of vehicle orders (quick goto)

Post by zombie »

Hi.

The Ctrl-Click for the full load enty is a really great idea. I'd made this a patch of it's own. I think that's very likely to get into trunk if coded to the coding guide lines. Nice work, btw.

Kind regards

Zombie
sulai
Traffic Manager
Traffic Manager
Posts: 159
Joined: 24 Sep 2004 18:23

Re: Patch: quick goto

Post by sulai »

Patch updated to latest revision. See first post.
vwspeedracer wrote:Couldn't you call the function that flags a train as having too few orders, and use that to determine whether or not the goto should start off active?
I checked for that. The function that is responsible (order_cmd.cpp : CheckOrders()) depends on the "order_review_system" patch. Because of that you can't use that function for the check.

Anyway CheckOrders() inspired me to check only for "OT_GOTO_STATION" entries. If you have less than 2, the GoTo button will show up active if the orders window is opened.
FOR_VEHICLE_ORDERS(v, order) {
  • if (order->IsType(OT_GOTO_STATION)) {
    • n_st++;
    }
}
if (n_st < 2) {
  • // button active...
}


I also checked for the coding guide lines. Everything seems fine!
Gollum
Engineer
Engineer
Posts: 16
Joined: 24 Apr 2008 13:26

Re: Patch: quick goto

Post by Gollum »

is there any way to add a shortcut to create "Load any cargo" orders?
sulai
Traffic Manager
Traffic Manager
Posts: 159
Joined: 24 Sep 2004 18:23

Re: Patch: quick goto

Post by sulai »

May this could be done using a patch settings entry. You could select which type of order is created by "ctrl+click on station".

Another possibility: "ctrl + 2 clicks on station" cycles through full load, load any, ...
Tiberius
Engineer
Engineer
Posts: 86
Joined: 17 Sep 2004 03:15

Re: Patch: quick goto

Post by Tiberius »

anyway ... small bump to r13377 ... one step closer to new patchset! :D
Attachments
quick-goto_r13377.patch
(6.58 KiB) Downloaded 233 times
I may implement/fix/tweak/eat/ditch it soon (or in distant future, if at all, so don't hold your breath).
If anyone want to be the one please implement it for us all 8)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Patch: quick goto

Post by planetmaker »

Tiberius wrote:anyway ... small bump to r13377 ... one step closer to new patchset! :D
He, you made my work for the next edition of wwottdgd quite a bit easier, I guess. Thx mate.
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: Patch: quick goto

Post by Wolf01 »

This patch is a great idea
I didn't tried this patch, if you have more than 1 order is this behavior activated? What about CTRL+Click on the GoTo button to make it "sticky"?
I hope is possible to extend it for building too, I wanted to do the same thing to build road stops because you can build only one of them per time
I already started to work on drag&drop lay out road stations, all in the same direction and possibly overwriting existent ones, like happen now with rail stations, this mainly because when you want to extend a road station adjacent to 2 rail stations you can't because you can't drag the road station as you can do with the rail one and happens that: 1) you can't build an adjacent station 2) you build a different adjacent station
ok I know I write like a sheep, when I'll be back at home I'll post some pictures as support :P

EDIT: Here is it
Attachments
adjacent_roadstops.PNG
adjacent_roadstops.PNG (22.41 KiB) Viewed 9869 times
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Patch: quick goto

Post by planetmaker »

Tiberius wrote:anyway ... small bump to r13377 ... one step closer to new patchset! :D
hm... this patch doesn't apply the usual way with -p0 but with -p1 when in the trunk dir :S
Attachments
quickgoto_r13378.diff
usual svn diff applicable with -p0
(6.72 KiB) Downloaded 220 times
Tiberius
Engineer
Engineer
Posts: 86
Joined: 17 Sep 2004 03:15

Re: Patch: quick goto

Post by Tiberius »

sorry, I generated them with hg :(
will take care of this when releasing further patches ...
I may implement/fix/tweak/eat/ditch it soon (or in distant future, if at all, so don't hold your breath).
If anyone want to be the one please implement it for us all 8)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 18 guests