The International Simutrans Forum


Author Topic: gui_routebar_t  (Read 327 times)

0 Members and 1 Guest are viewing this topic.

Offline Ranran

  • Devotee
  • *
  • Posts: 1658
  • 今日は兎汁よー
  • Languages: ja
« on: September 20, 2020, 01:17:50 PM »
I brought a patch that I'm trying to introduce to extended.
Now that the code in my extended branch is relatively close to standard, I think it's easy to merge to standard.

In this patch, the routebar is independent from the gui_speedbar_t and has its own original design.
The convoy info dialog has three speedbars of the same design. With this independence, the route bar claims to be the route (progress) bar and gains the player's understanding.

Demo image (in extended):

Please note that the image quality is significantly degraded due to the characteristics of the gif. (The only thing that makes the triangle appear to disappear is that the stupid gif erased it.)

There is still some room for improvement. But sensei always urges me not to try to finish it completely from the beginning.
For example, you can specify those colors by theme, subdivide the scale, finely adjust the size, triangular shape, etc.
The scale is fixed in 4 divisions, but this is not bothersome if the width is about 100px. On the other hand, some people may find it unsatisfactory to extend it.
There was also an idea to change the color that was passed through depending on the waytype.
Also, the shape updates only when the bar moves, which is not ideal behavior. Unfortunately I couldn't fix it. It may not be a big problem, but I hope it can be fixed.
Ideally, I wanted to change the color depending on status such as stuck, but independence is the first step anyway.
So it's up to you to make fine adjustments and incorporate it. Thank you (´・ω・`)

There was an error in the code, so I fixed the attachment file.

The extended's convoi_info is still using the old engine and has not been tested with the new GUI engine.
I'm currently testing the extended's convoi_info with a new GUI engine, but it seems to have display issues...

There was no problem with the code itself.
Code: [Select]
route_bar.set_height(9);You need to set a reasonable height as described above. It looks better if you set it a little larger than the speedbar to display squares and triangles.

I changed to a method that updates the shape and color. But unfortunately this part makes a difference between standard and extended.
Stuck displays an orange square() and no route displays a red square ().
I have set a condition that seems to be available in standard as well. set_state is currently assigned a value directly in uint8, but I think it will be easier to read if you customize it by making it an enumeration type. Since there are many types of states in extended, I think there will be a difference in this part. So from this point onward, extended will separate it into different code.
« Last Edit: September 22, 2020, 03:30:00 AM by Ranran »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10820
  • Languages: De,EN,JP
Re: gui_routebar_t
« Reply #1 on: September 27, 2020, 12:35:40 PM »
Incorporated in r9256, Thank you.