Files
@ r23289:ce4b5aef37cf
Branch filter:
Location: cpp/openttd-patchpack/source/src/vehicle_gui_base.h - annotation
r23289:ce4b5aef37cf
2.2 KiB
text/x-c
Fix: trains cancelling their pending reversal when ordered to go to a depot behind them
Previously, if a train had been ordered to reverse, and while it was slowing down, was
ordered to travel to a depot that is behind it, the train would continue forwards.
Also when a train had been ordered to reverse, and while it was slowing down, was
ordered to travel to a depot that is in front of it, the train would not cancel the
reversal.
In both cases the train would travel away from the target depot.
Trains in this situation now behave correctly and will travel towards the depot.
Previously, if a train had been ordered to reverse, and while it was slowing down, was
ordered to travel to a depot that is behind it, the train would continue forwards.
Also when a train had been ordered to reverse, and while it was slowing down, was
ordered to travel to a depot that is in front of it, the train would not cancel the
reversal.
In both cases the train would travel away from the target depot.
Trains in this situation now behave correctly and will travel towards the depot.
r10122:8be97f532491 r10122:8be97f532491 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r10122:8be97f532491 r10122:8be97f532491 r10122:8be97f532491 r10122:8be97f532491 r10122:8be97f532491 r10122:8be97f532491 r16068:f32ba8cfc408 r14248:a9050881acd7 r15505:306dfef4fc70 r10122:8be97f532491 r10122:8be97f532491 r10122:8be97f532491 r13602:30f9b380fb13 r10122:8be97f532491 r10122:8be97f532491 r14023:0dbab10e82db r15769:4a935f419828 r16074:92f60cf5758b r10122:8be97f532491 r15505:306dfef4fc70 r15505:306dfef4fc70 r15505:306dfef4fc70 r15505:306dfef4fc70 r15505:306dfef4fc70 r15505:306dfef4fc70 r15505:306dfef4fc70 r15505:306dfef4fc70 r15507:d6cc390ab191 r10122:8be97f532491 r11371:4a7632225c6c r10122:8be97f532491 r22470:ad7ada400287 r13348:a18e66ad9ec7 r13348:a18e66ad9ec7 r13348:a18e66ad9ec7 r13348:a18e66ad9ec7 r13348:a18e66ad9ec7 r10122:8be97f532491 r16074:92f60cf5758b r15508:ba762c312927 r15508:ba762c312927 r10122:8be97f532491 r10122:8be97f532491 r13596:83142daf4c93 r13596:83142daf4c93 r10122:8be97f532491 r10122:8be97f532491 r10122:8be97f532491 r10122:8be97f532491 r10122:8be97f532491 r10122:8be97f532491 r10122:8be97f532491 r10122:8be97f532491 r10122:8be97f532491 r10122:8be97f532491 | /* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file vehicle_gui_base.h Functions/classes shared between the different vehicle list GUIs. */
#ifndef VEHICLE_GUI_BASE_H
#define VEHICLE_GUI_BASE_H
#include "sortlist_type.h"
#include "vehiclelist.h"
#include "window_gui.h"
#include "widgets/dropdown_type.h"
typedef GUIList<const Vehicle*> GUIVehicleList;
struct BaseVehicleListWindow : public Window {
GUIVehicleList vehicles; ///< The list of vehicles
Listing *sorting; ///< Pointer to the vehicle type related sorting.
byte unitnumber_digits; ///< The number of digits of the highest unit number
Scrollbar *vscroll;
VehicleListIdentifier vli; ///< Identifier of the vehicle list we want to currently show.
enum ActionDropdownItem {
ADI_REPLACE,
ADI_SERVICE,
ADI_DEPOT,
ADI_ADD_SHARED,
ADI_REMOVE_ALL,
};
static const StringID vehicle_depot_name[];
static const StringID vehicle_sorter_names[];
static GUIVehicleList::SortFunction * const vehicle_sorter_funcs[];
BaseVehicleListWindow(WindowDesc *desc, WindowNumber wno) : Window(desc), vli(VehicleListIdentifier::UnPack(wno))
{
this->vehicles.SetSortFuncs(this->vehicle_sorter_funcs);
}
void DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r) const;
void SortVehicleList();
void BuildVehicleList();
Dimension GetActionDropdownSize(bool show_autoreplace, bool show_group);
DropDownList *BuildActionDropdownList(bool show_autoreplace, bool show_group);
};
uint GetVehicleListHeight(VehicleType type, uint divisor = 1);
struct Sorting {
Listing aircraft;
Listing roadveh;
Listing ship;
Listing train;
};
extern Sorting _sorting;
#endif /* VEHICLE_GUI_BASE_H */
|