The International Simutrans Forum

Development => Extension Requests => Topic started by: saaws on April 15, 2014, 03:36:24 AM

Title: Default set 'Serves Line' to a route currently shown in 'Line Management'
Post by: saaws on April 15, 2014, 03:36:24 AM
Hello Everyone!

I'm playing a really big game and With iterally hundreds of Airline routes, it's a pain in the **** to set a route to an airplane.

1. Currently, when you a set a route to a vehicle in one hangar, the next time you add a vehicle, the previously chosen route is at the top of options.

2. What if, When A route is shown on a Line management window AND then you add a vehicle to a hangar, Instead/Additionally, the route on the line management is at the top of (or the second in addition to the last chosen route) available options?

I guess a pseudocode would look like soemthing like this; (Disclaimer; I don't really know much C++)

Function ServeLineClicked {

If (LineManagementWindow.open == 1 && routeShownInLineManagementWindow != null && [routeToShow.TypeVehicle equals(currentVehicleInHangar)])

[HangarRouteList addToTop(routeShownInLineManagementWindow)]

}

I love this game! hope everyone has a good day :D

(http://i.imgur.com/mq7FEbs.jpg)
Title: Re: Default set 'Serves Line' to a route currently shown in 'Line Management'
Post by: Ters on April 15, 2014, 09:57:56 AM
This is not the first time this is requested, since in some ways, this is how it used to work, except that you had to click an "Assign line" button. (There used to be several buttons for actions that can now be found in the drop down list itself.)

Update:
Just to clarify, this only refers to point 1. Point 2 is something new.
Title: Re: Default set 'Serves Line' to a route currently shown in 'Line Management'
Post by: prissi on April 15, 2014, 11:01:12 AM
The function is still somewhat broken, because if zou define a line first and then buy a vehicle to assign this line, it is also not near the top. Thus at opening time the depot could certainly check of a line is selected (either in line window or probably open in a convoi schedule). If so, put this line to the top. Same, if a new line has been defined in said depot window.
Title: Re: Default set 'Serves Line' to a route currently shown in 'Line Management'
Post by: saaws on April 15, 2014, 01:24:42 PM
Quote from: prissi on April 15, 2014, 11:01:12 AM
The function is still somewhat broken, because if zou define a line first and then buy a vehicle to assign this line, it is also not near the top. Thus at opening time the depot could certainly check of a line is selected (either in line window or probably open in a convoi schedule). If so, put this line to the top. Same, if a new line has been defined in said depot window.

Yes, I did notice that if I created a line without a convoy assigned first, when I buy a vehicle the line selection is reset.

So, for the point 2, I guess it has to do with;

   void set_last_selected_line(const linehandle_t last_line) { last_selected_line=last_line; }
   linehandle_t get_last_selected_line() const { return last_selected_line; }

I found this defined in simdepot.h, but I guess it is actually implemented in depot_frame.cc ? I wish I didn't stop studying computer programing after college. gah.