New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Show rail/road/tram NewGRF name in Land Area Information window #8794
base: master
Are you sure you want to change the base?
Conversation
Looks fine on the whole. Few warnings for you to take a look at - grffile is not null It also concerns me that you've apparently taken a photo of your screen ;) |
Took the photo because screenshots are not working in the most recent 1.11 beta ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I be mildly unreasonable and ask that the (initial) TrackDesc changes be in a separate commit? Then adding the GRF name is clean and easy to read & review
Not really what I meant. I'd rather an actual constructor: (and you can also have a "default" constructor that "zero-initialises" the members too) |
df7ae42
to
ec698c5
Compare
b2eccae
to
4142097
Compare
FYI this is ready for review at this point :) |
@@ -2808,8 +2808,7 @@ static bool ClickTile_Track(TileIndex tile) | |||
static void GetTileDesc_Track(TileIndex tile, TileDesc *td) | |||
{ | |||
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(tile)); | |||
td->rail_speed = rti->max_speed; | |||
td->railtype = rti->strings.name; | |||
td->rail_desc = TrackDesc(rti->strings.name, rti->max_speed, rti->grffile[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The console command dump_info railtypes
(that probably no one knows about) uses rti->grffile[RTSG_GROUND]
(i.e. index 2) for GRF info output.
(Also applies to all other instances where track GRF is queried).
@@ -2098,14 +2098,12 @@ static void GetTileDesc_Road(TileIndex tile, TileDesc *td) | |||
RoadType tram_rt = GetRoadTypeTram(tile); | |||
if (road_rt != INVALID_ROADTYPE) { | |||
const RoadTypeInfo *rti = GetRoadTypeInfo(road_rt); | |||
td->roadtype = rti->strings.name; | |||
td->road_speed = rti->max_speed / 2; | |||
td->road_desc = TrackDesc(rti->strings.name, rti->max_speed / 2, rti->grffile[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above for road, ROTSG_GROUND
(2).
(Also applies to all other instances where road/tram GRF is queried).
Friendly ping to see if you are still interested in what appears the last few comments to get this merged? Let us know! Tnx :) |
Motivation / Problem
Currently there is no way of retrieving NewGRF name for a rail, road or tram track.
Closes #8779
Description
This code change introduces extra fields in the Land Area Information window to display the NewGRF names for rail, road and tram tracks, as well as for stations. It works for railroad crossings and overlapping road and tram tracks.
Limitations
Not that I am aware of.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.