The International Simutrans Forum

 

Author Topic: [Bug] bridge/tunnel/way info window chaos  (Read 556 times)

0 Members and 1 Guest are viewing this topic.

Offline Freahk

  • Devotee
  • *
  • Posts: 1419
  • Languages: DE, EN
[Bug] bridge/tunnel/way info window chaos
« on: January 08, 2020, 02:09:32 PM »
Hey there,
While I was comparing way costs of iron girder elevated road, which is quite inexpensive in maintainance, especially when equipped with trolleybus wires, compared to any flat road, the difference in cost is quite small.
Construction of girder elevated is even less expensive than TarMc roads, I asume this really needs some raised costs.

However, that's not the point here. While exploring this, I noticed that the bridge/tunnel info window does not show the cost of the bridge/tunnel at all.
As you can see in the image, "maintainance" is the maintainance of just and only the way on that bridge/tunnel, while "maintainance including assets" includes the catenary/trolleybus wire but not the bridge maintainance.
I assume it should list cost for the bridge, way and assets at that way and "maintainance including assets" should sum up all of these.
Not quite sure if bridges/tunnels also need renewal, but currently only the way is listed there.

Additionally, the second section in the window seems to be excessive. Is there any reason for this?

Further, for rails it seems there are always two different info windows:
The first click will open a window that will always be titled as the rail type,
the second click will open a window with further information, including the whole first window. That one will be titled as "Bridge" in case it is a bridge, otherwise it will be titled as the track type.
« Last Edit: January 20, 2020, 09:51:19 PM by Freahk »

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20685
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug] bridge/tunnel/way info window chaos
« Reply #1 on: January 08, 2020, 02:20:49 PM »
Thank you for the report. I will have to look into this in more detail after I get home.

I should note that tunnels and bridges were separated from the ways in 2014. The underlying tunnels and bridges need maintenance, but do not need renewal. There have been some further changes to the way information dialogue since this time, but I am not sure whether those are related to this issue.

I agree that this does need some improvement. I wonder whether any of the people who have done a lot of work recently on the GUI might be able to help, as my queue of tasks (including a long list of signalling bugs, which are always hard to fix) is very long?

Offline Freahk

  • Devotee
  • *
  • Posts: 1419
  • Languages: DE, EN
Re: [Bug] bridge/tunnel/way info window chaos
« Reply #2 on: January 08, 2020, 02:56:22 PM »
Quote
including a long list of signalling bugs
Sorry :D

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20685
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug] bridge/tunnel/way info window chaos
« Reply #3 on: January 08, 2020, 02:58:20 PM »
Sorry :D

One thing that might assist in organising my work once I get back home is some indication of the relative importance of the various bugs, perhaps in your bug and small coding project list thread?

Offline Freahk

  • Devotee
  • *
  • Posts: 1419
  • Languages: DE, EN
Re: [Bug] bridge/tunnel/way info window chaos
« Reply #4 on: January 08, 2020, 03:28:19 PM »
It is pretty hard to judge importance of bugs as that "relative importance" is pretty vague defined but I'll give it a try.

Offline Ranran

  • Devotee
  • *
  • Posts: 1432
  • Languages: ja
Re: [Bug] bridge/tunnel/way info window chaos
« Reply #5 on: January 08, 2020, 03:42:42 PM »
Further, for rails it seems there are always two different info windows:
Code: [Select]
if(!is_water()) {
if(flags&has_way1) {
buf.append(translator::translate(get_weg_nr(0)->get_name()));
buf.append("\n");
obj_bei(0)->info(buf, ist_bruecke());
has_way = true;
if(flags&has_way2) {
buf.append(translator::translate(get_weg_nr(1)->get_name()));
buf.append("\n");
obj_bei(1)->info(buf, ist_bruecke());
In a rough check, I think there is an error in this logic. (grund.cc grund_t::info)


Additionally, the second section in the window seems to be excessive. Is there any reason for this?
Probably, the window with the small amount of information displayed first is an unnecessary window. (Assuming that window will be deleted in the future) In that case, delete line 495 of weg.cc. In addition, you need to remove a line breaks.

Offline Ranran

  • Devotee
  • *
  • Posts: 1432
  • Languages: ja
Re: [Bug] bridge/tunnel/way info window chaos
« Reply #6 on: April 29, 2020, 10:17:40 AM »
Additionally, the second section in the window seems to be excessive. Is there any reason for this?
I fixed this issue and threw a pull request. please confirm.
https://github.com/jamespetts/simutrans-extended/pull/156

It is the yellow part of the two that is duplicated that is removed.



Further, for rails it seems there are always two different info windows:
The first click will open a window that will always be titled as the rail type,
the second click will open a window with further information, including the whole first window. That one will be titled as "Bridge" in case it is a bridge, otherwise it will be titled as the track type.
I think this may be due to the two obj->show_info() judgment expressions in simtool.cc line 329-331 and line 378-380.
But I don't know why it doesn't open on the road but on other ways. It would be nice if someone could check it. (´・ω・`)

EDIT:
By the way, the code of the relevant part has not changed from standard. But standard does not open another useless dialog.
« Last Edit: April 29, 2020, 12:10:08 PM by Ranran »

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20685
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Bug] bridge/tunnel/way info window chaos
« Reply #7 on: May 13, 2020, 02:51:32 PM »
I believe that I merged this fix some time ago: my apologies for not having acknowledged this until now. Thank you Ranran for working on this.

Offline Ranran

  • Devotee
  • *
  • Posts: 1432
  • Languages: ja
Re: [Bug] bridge/tunnel/way info window chaos
« Reply #8 on: May 13, 2020, 08:50:01 PM »
Regarding the remaining issues:
I am guessing than the track is treated as having double objects in extended, which causes two dialogs to open, but I'm not sure where that is happening.