Page 1 of 2
Patch: Track and road types on main toolbar [r14089]
Posted: 17 Aug 2008 12:57
by CommanderZ
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.
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 17 Aug 2008 17:34
by MJS
Pity about the bugs, but the idea is very good!
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 17 Aug 2008 18:13
by Roujin
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.
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 17 Aug 2008 19:05
by CommanderZ
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..
This is not hard, it should be easy to do. I'm much more afraid of the possibility to turn it off or on.
Keep in mind that availablility of rail(/road) types comes with availability of rail/road vehicles
Thanks, I would maybe forget this (I thought the tracks are enabled by year).
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 17 Aug 2008 19:06
by FooBar
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!
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 17 Aug 2008 19:18
by CommanderZ
It seems like another bug I missed, thanks.
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 17 Aug 2008 19:43
by Mchl
That's really nice idea! Me like!
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 17 Aug 2008 22:22
by mkxx
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.
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 18 Aug 2008 06:31
by peter1138
Now make it work with variable rail and road types.
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 18 Aug 2008 07:16
by CommanderZ
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]
Posted: 18 Aug 2008 09:21
by Zephyris
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]
Posted: 18 Aug 2008 09:27
by peter1138
The existing drop down list is easily extendable for adding more rail and road types. The toolbar buttons are not.
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 18 Aug 2008 09:58
by Mchl
Are we expecting new rail/road types anytime soon?
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 18 Aug 2008 13:28
by belugas
Should we add "features" that would block us from doing that, eventually?
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 18 Aug 2008 13:40
by Gremnon
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.
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 18 Aug 2008 15:30
by Agent_N
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.
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 18 Aug 2008 15:34
by DJ Nekkid
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 ...
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 18 Aug 2008 16:37
by CommanderZ
Welcome to TT-forums, nice first post.
Agent_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.
Thanks, I will have look at it
This also seem to be the bug which crashes while trying to take a screenshot.
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).
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).
This is task for another patch (of probably another author)
Should we add "features" that would block us from doing that, eventually?
I hope the code can be improved to be able to reflect this

Re: Patch: Track and road types on main toolbar [r14089]
Posted: 21 Aug 2008 02:43
by DaleStan
Gremnon wrote:It can be extended. It would just need an additional button, that's all.
As easily as you could (ie without drawing a new sprite) with the dropdown?
Also, "Without breaking the display on devices that are limited to 640x480?"
Re: Patch: Track and road types on main toolbar [r14089]
Posted: 21 Aug 2008 07:06
by CommanderZ
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.