The International Simutrans Forum

 

Author Topic: Default set 'Serves Line' to a route currently shown in 'Line Management'  (Read 1846 times)

0 Members and 1 Guest are viewing this topic.

Offline saaws

  • *
  • Posts: 13
  • Languages: EN
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

« Last Edit: April 15, 2014, 03:49:52 AM by saaws »

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5454
  • Languages: EN, NO
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.
« Last Edit: April 15, 2014, 12:16:08 PM by Ters »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9438
  • Languages: De,EN,JP
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.

Offline saaws

  • *
  • Posts: 13
  • Languages: EN
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.