News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

[Fixed] Subtle bug in "Apply Line" in depot window

Started by neroden, April 27, 2010, 12:38:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

neroden

This is occuring in -devel.  It might have been occurring as early as 7.3, but it's intermittent.

*Sometimes*, not always, when I hit "Apply Line" in the depot window to apply (say) Line 1 to a convoy, it will spontaneously create a new line (line 2) and pop up a "Line Management" dialogue to set the schedule for it.  Line 1 *will* be applied to the convoy.

This feels like accidental fallthrough in a case statement, frankly -- but it only happens sometimes!

jamespetts

Hmm, the odd thing is that this is not code that has been affected by Simutrans-Experimental (although I have some recollection of Bernd merging some code from Standard that affected this area, pre 7.2...).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

neroden

Quote from: jamespetts on April 27, 2010, 10:43:21 AM
Hmm, the odd thing is that this is not code that has been affected by Simutrans-Experimental (although I have some recollection of Bernd merging some code from Standard that affected this area, pre 7.2...).

Well, I can't say for sure that this doesn't occur in Standard!  It occurs infrequently enough, and I play Standard infrequently enough, that it might.

Can you point me to the right section of code?  What routine gets triggered when you hit a button in a depot?

jamespetts

Hmm, I can't even remember off the top of my head. I think that it's something like depot_frame_t::action_triggered()...
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

neroden

I figured this one out -- but I still don't know how to fix it.  It is subtle.

Under certain circumstances, hitting "Apply Line" causes the depot window to automatically change width -- to get wider.  This happens when the constructed convoy is too wide for the window (due to having oodles of cars).  When this happens, the width of the buttons also changes.  If I pressed the mouse down on the left side of the Apply Line button, after the widening it is on the right side of the New Line button, and it proceeds to activate "New Line".

This is a fundamental problem in the core UI code, which is simply exposed by the longer convoys allowed in experimental.  I don't know exactly why it's doing this, but it seems to be triggering on mousedown instead of mouseup, or some such.  :-X

jamespetts

Neroden,

thank you for working this one out! What is supposed to happen is that the depot window expands as more vehicles are added, instead of when you press the "apply line" button. I have fixed this now in -devel so that this does, indeed, occur. Thank you for the investigations!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.