Patch: Track and road types on main toolbar [r14089]
Moderator: OpenTTD Developers
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Patch: Track and road types on main toolbar [r14089]
This little patch puts icons of individual track and road types on main toolbar - significantly speeding up tasks like switching from tram to road etc.
Bugs:
- taking screenshot crashes the game (omg, why?)
- sometimes it takes a while until the toolbar repaints. Clicking on something on the toolbar can bypass it. I will have toplace repaint requests on several places in the code (year change, cheat year change, maybe also patch settings).
If I see interest in this, I will try to rewrite it somehow, so it is patch configurable (it is hardcoded right now).
Patch and Win32 package attached.
Bugs:
- taking screenshot crashes the game (omg, why?)
- sometimes it takes a while until the toolbar repaints. Clicking on something on the toolbar can bypass it. I will have toplace repaint requests on several places in the code (year change, cheat year change, maybe also patch settings).
If I see interest in this, I will try to rewrite it somehow, so it is patch configurable (it is hardcoded right now).
Patch and Win32 package attached.
- Attachments
-
- Year 2001 - all track types but maglev are enabled
- toolbar.jpg (18.93 KiB) Viewed 8035 times
-
- track types on toolbar r14089.patch
- Patch against r14089
- (6.9 KiB) Downloaded 218 times
-
- track types on toolbar r14089.zip
- Ready to use Win32 package with the patch applied
- (2.9 MiB) Downloaded 265 times
Re: Patch: Track and road types on main toolbar [r14089]
Pity about the bugs, but the idea is very good!
Re: Patch: Track and road types on main toolbar [r14089]
I like it too 
About the not-redrawing: that happens in trunk too iirc, it's just not as easily noticed as with your patch.
So you needn't change redrawing, but insert redrawing in some places.
Keep in mind that availablility of rail(/road) types comes with availability of rail/road vehicles, so whenever a player gets access to a new vehicle (also e.g. by changing newGrfs during the game), it should invoke a redraw of the toolbar.

About the not-redrawing: that happens in trunk too iirc, it's just not as easily noticed as with your patch.
So you needn't change redrawing, but insert redrawing in some places.
Keep in mind that availablility of rail(/road) types comes with availability of rail/road vehicles, so whenever a player gets access to a new vehicle (also e.g. by changing newGrfs during the game), it should invoke a redraw of the toolbar.
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Patch: Track and road types on main toolbar [r14089]
This is not hard, it should be easy to do. I'm much more afraid of the possibility to turn it off or on.About the not-redrawing: that happens in trunk too iirc, it's just not as easily noticed as with your patch.
So you needn't change redrawing, but insert redrawing in some places..
Thanks, I would maybe forget this (I thought the tracks are enabled by year).Keep in mind that availablility of rail(/road) types comes with availability of rail/road vehicles
Re: Patch: Track and road types on main toolbar [r14089]
I like the idea of having quick access, but I'm missing the spacers in your screenshot. It currently is a big mess of buttons pasted together. The toolbar already resizes on resolutions w<640px, so I don't really see why you left those out. Otherwise, very nice!
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Patch: Track and road types on main toolbar [r14089]
It seems like another bug I missed, thanks.
Re: Patch: Track and road types on main toolbar [r14089]
That's really nice idea! Me like!
Re: Patch: Track and road types on main toolbar [r14089]
I really like this idea - would like to see it in trunk as an option.
If you add the spacers between buttons and between RAIL / ROAD / other_transport sections, I'll be happy.

If you add the spacers between buttons and between RAIL / ROAD / other_transport sections, I'll be happy.
Re: Patch: Track and road types on main toolbar [r14089]
Now make it work with variable rail and road types.
He's like, some kind of OpenTTD developer.
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Patch: Track and road types on main toolbar [r14089]
There is something like that in the game? If you mean the GRF track type mods like purno's metro or the suspended tram, then yes, it should work (in theory, I will have to try it).
Re: Patch: Track and road types on main toolbar [r14089]
I think he means making it cope with some kind of newgrf rail/road types...
Re: Patch: Track and road types on main toolbar [r14089]
The existing drop down list is easily extendable for adding more rail and road types. The toolbar buttons are not.
He's like, some kind of OpenTTD developer.
Re: Patch: Track and road types on main toolbar [r14089]
Are we expecting new rail/road types anytime soon?
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Re: Patch: Track and road types on main toolbar [r14089]
Should we add "features" that would block us from doing that, eventually?
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Re: Patch: Track and road types on main toolbar [r14089]
It can be extended. It would just need an additional button, that's all.
Besides, to my knowledge all additional road/rail types overide an existing one presently, so as to be patch compatible.
Besides, to my knowledge all additional road/rail types overide an existing one presently, so as to be patch compatible.
Re: Patch: Track and road types on main toolbar [r14089]
I've just tested this patch and recognized that the airport build tool is not working. After looking at it I've seen that the menu handler array _menu_clicked_procs was not changed. I've updated the handler array and attached a new patch with it. This also seem to be the bug which crashes while trying to take a screenshot.
- Attachments
-
- track types on toolbar r14097.patch
- (7.23 KiB) Downloaded 100 times
Re: Patch: Track and road types on main toolbar [r14089]
as the idea is good, i think i'd rather would like to see a keyboard shortcut where i change to the "next type" of rail/road, and even change from rail to road to air to ship to rail to road to air to ship ........
This because the A-key open the autorail-tool, and it would be nice to have a shortcut that can change in "local" type (i.e. from rail - elrail etc) or change the "global" type (from rail to road etc).
Sorry if this already exist, but i've never found it ...

Sorry if this already exist, but i've never found it ...
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Patch: Track and road types on main toolbar [r14089]
Welcome to TT-forums, nice first post.

Thanks, I will have look at itAgent_N wrote:I've just tested this patch and recognized that the airport build tool is not working. After looking at it I've seen that the menu handler array _menu_clicked_procs was not changed. I've updated the handler array and attached a new patch with it.
I think you are wrong. The bug was imo present in trunk too and was fixed in r14094 (so you removed it by updating the patch).This also seem to be the bug which crashes while trying to take a screenshot.
This is task for another patch (of probably another author)as the idea is good, i think i'd rather would like to see a keyboard shortcut where i change to the "next type" of rail/road, and even change from rail to road to air to ship to rail to road to air to ship ........ This because the A-key open the autorail-tool, and it would be nice to have a shortcut that can change in "local" type (i.e. from rail - elrail etc) or change the "global" type (from rail to road etc).

I hope the code can be improved to be able to reflect thisShould we add "features" that would block us from doing that, eventually?

Re: Patch: Track and road types on main toolbar [r14089]
As easily as you could (ie without drawing a new sprite) with the dropdown?Gremnon wrote:It can be extended. It would just need an additional button, that's all.
Also, "Without breaking the display on devices that are limited to 640x480?"
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Patch: Track and road types on main toolbar [r14089]
That's why I want it to be optional.
Btw, as you can see, I'm using construction sprites, which have to be made anyways.
Btw, as you can see, I'm using construction sprites, which have to be made anyways.
Who is online
Users browsing this forum: Bing [Bot] and 11 guests