[Patch] Order-based full-load any/all cargo selection

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
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

[Patch] Order-based full-load any/all cargo selection

Post by PhilSophus »

In this topic it was suggested to make it possible to select the full-load behavior per order instead of a global patch setting.

So here is the patch to implement that:
  1. Select an order.
  2. Enable full-load by pushing the full-load button. Whether this initially is full-load any or full-load all cargo depends on the global patch setting (the GUI shows you which).
  3. CTRL-click on the full-load button to toggle between full-load any and full-load all.
As this modification was even demanded by a todo tag in trunk, I guess this is a candidate for inclusion. Before I post this on flyspray, I would be grateful for any comments on coding style (I tried to obey it), on implementation and if it's working for you without bugs.

In the thread mentioned above it was discussed, whether it should be possible to select which cargo should be filled. I did not implement this for several reasons:
  1. I wanted to take a step-by-step approach and I think this would be an advanced step
  2. I was quite sure how to do this first step, but would have to think a bit about the selection by cargo
  3. I am not so sure anymore that such a feature would really be such a good thing as orders may be shared among vehicles with different cargos.
Update: Feature now in trunk (although not from this patch).
Last edited by PhilSophus on 12 Apr 2008 00:09, edited 5 times in total.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Re: [Patch] Order-based full-load any/all cargo selection

Post by richk67 »

Coding style looks OK to me. Watch the alignment in the final column of the SDT_BOOL( line in settings.cpp. If it works as advertised, (Ive not compiled to check), then post to FS. Should be dead cert for inclusion in my view.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Order-based full-load any/all cargo selection

Post by PhilSophus »

richk67 wrote:Watch the alignment in the final column of the SDT_BOOL( line in settings.cpp.
Yes, you're right. I removed this setting and added it again, as using it as a default value seemed to be a good idea. Must have happened then.
richk67 wrote: If it works as advertised, (Ive not compiled to check), then post to FS. Should be dead cert for inclusion in my view.
Well, it compiles under Linux and I tested loading old games with both settings and changing in-game very shortly. So let's wait for some reports from other platforms.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
User avatar
Indiana
Engineer
Engineer
Posts: 36
Joined: 07 Feb 2008 09:15

Re: [Patch] Order-based full-load any/all cargo selection

Post by Indiana »

Nice work.
I use it with the GonozalIN und windows XP and it works great.
Have a N.I.C.E. day!
Indiana
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 3 guests