The International Simutrans Forum

 

Author Topic: r2005 - Buttons on station detail window need long time to work  (Read 3040 times)

0 Members and 1 Guest are viewing this topic.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
r2005 - Buttons on station detail window need long time to work
« on: September 07, 2008, 10:55:59 AM »
(splited topic from http://forum.simutrans.com/index.php?topic=334.msg2470#msg2470 )


What I did.
1. Load a saved game
2. Open station detail window
3. Click one of jump button

In this case, button image didn't change to pressed image and nothing happened.
But it started working after 20 seconds.

Same thing happened when I rotated the map.

What I did.
1. Open station detail window
2. Rotate map
3. Click one of jump button

During first 15 seconds
 - button image change to pressed image, but jump to old coordinate
During next 30 seconds
 - button image don't change to pressed image, and don't jump

After 45 seconds, jump button start working again to new coordinate


Redrawing this window is called when flag "halt-is_rerouting()" is true.
But this flag is useless for redrawing.
This flag means:
"rebuild_destinations" or "reroute_goods" is demanded, but still waiting its order.

If "rebuild_destinations" and "reroute_goods" were done, flag "halt-is_rerouting()" will return false. Then it don't redraw new state.

So, redrawing happens during waiting its order, again and again. During that time, we can't click button.

And in some cases, rotating or reroute_goods, we don't need to wait halt status update, imho.
« Last Edit: September 07, 2008, 11:11:49 AM by z9999 »

Online prissi

  • Developer
  • Administrator
  • *
  • Posts: 10681
  • Languages: De,EN,JP
Re: r2005 - Buttons on station detail window need long time to work
« Reply #1 on: September 07, 2008, 07:29:49 PM »
The station does not immeadiately know its new destination. It is done in a two step process. First, the destination is updated. Then, several steps later, the goods are rerouted. This can easily take again up to 60s. (It must be spread like this, otherwise there can be long delays on big maps. This was one of the reasons older version often froze at the beginning of a new month.)

But only a single redraw is needed. I will think of a better way to enforce it.

EDIT: done
« Last Edit: September 07, 2008, 07:45:17 PM by prissi »

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
[solved]Re: r2005 - Buttons on station detail window need long time to work
« Reply #2 on: September 08, 2008, 12:33:42 PM »
Thank you.