Age | Commit message (Collapse) | Author |
|
vehicles having a certain depot in their orders
It got one known issue though. The top bar got a plural issue so expect to see stuff like "1 trains" until we figure out why it behaves this way
Added the button to the depot windows. Made the autoreplace button bigger while I was moving some widgets anyway
Made road vehicle depot windows start with one more row to make room for the buttons
|
|
allocation over and over if possible (like BuildDepotVehicleList() )
This will prevent some reallocations when sorting vehicle list windows
It also prevents moving the whole array into a new one each time the list is generated/updated (it used to make the list in one array and then move it into another one each time)
Also ensured that neither GenerateVehicleSortList() or BuildDepotVehicleList() will never allocate lists longer than the total number of vehicles in the game
|
|
when drawing the bottom row of buttons
|
|
vehicle lists
|
|
|
|
It made no sense to maintain 8 nearly identically arrays when a single one can do the job
Also made the two buttons always use half of the bottom width each, even when resizing
|
|
code into two new functions to make it easier to see what goes on where
|
|
reflect what it does.
|
|
|
|
This was requested by peter1138
|
|
WindowEvent, which is now a struct
|
|
ReplaceVehicleWndProc()
|
|
deselect the engine instead of selecting the first in the list (consistent with all other windows)
-Fix: [autoreplace GUI] engine info is now drawn in the right side even if the left list is empty
|
|
info text in the autoreplace window
|
|
from each time the window is redrawn
To do this, the player struct contains an array, that contains the count of each engine type that the player owns
Those arrays are updated each time a vehicle is build or deleted and is calculated on load (it's not saved)
It's possible to access the arrays outside of the autoreplace GUI, so feel free to read from them in other patches as well
|
|
locomotives consisting of more than one unit will only be counted once
This also cleaned up the counting loop alot and it will also (hopefully) be faster (didn't benchmark it)
|
|
more uniform.
-Cleanup: whitespace alignment of a few tables.
|
|
to 'data'.
|
|
|
|
every WE_PAINT
-Codechange: Initialize sorting-type on WE_CREATE instead of checking every time.
-Codechange: Update custom vehiclelist_d with standard list_d struct, more static
|
|
superfluous header includes
-Codechange: Unify the Sorting struct both for vehicle-lists and network-lists.
|
|
PlayerVehWndProc() into WE_CREATE
|
|
PlayerVehWndProc()
This is possible now that the window number is known when running WE_CREATE and it's a nicer solution
|
|
goto depot button
-Codechange: unified the code for mass goto depot to avoid duplicated code
-Fix: Vehicles already on the way to depots will not be cancelled by mass goto depot (made it really hard to send all vehicles at once)
|
|
|
|
vehicle list windows
this list is also used by mass goto depot to ensure that they use the same vehicles
right now only the list of all vehicles use this for goto depot, but eventually all the types will use this
|
|
|
|
|
|
resizing to smaller windows (AsterixMG)
|
|
vehicle list windows (spotted by Darkvater)
|
|
(forgot to disable the button in this condition)
-Code cleanup r6246: simplified SendAllVehiclesToDepot() and moved an { in PlayerVehWndProc()
|
|
depot" button
it's located in the vehicle list screen and does the same as in the shared orders window (send all vehicles in list to a depot)
it will still not inform the player if a vehicle failed to find a depot, so don't take for granted that all of them go
|
|
one is not used in any other files either (Thanks Tron for pointing this out)
|
|
any other files anymore
added window_type to arguments and used it to replace an if cascade with a switch case
|
|
|
|
w->resize.step_height
it was only used twice, so there was no reason to calculate it for each event
|
|
code to delete an empty shared orders list is now much simpler
cleaned up the code to handle button clicks
fixed an assert if widget 9 was pressed on a list with vehicles for another company
|
|
this will try to send all vehicles in the list to depots/hangars
currently if one fails to find a depot, it will not tell the player
|
|
the window
Since the order is no more, the player will not need that particular window anymore
this could happen if the player opened the window and then sold all the vehicles (or crashed them)
A crash could happen if a new order gets the same (now freed) OrderID and the vehicle using it is not of the same type as the window expect
|
|
this makes the list type detection much easier and allowed an if cascade to be turned into a switch case
this also makes it easier to add more list types
|
|
Player(vehicle)WndProc into PlayerVehWndProc
Those 4 unified functions were really much alike, so there was no reason to have so much dublicated code
|
|
{' -> '} else {', tabs between code and comment, etc.
|
|
'/*' or '*/' in '//' style comments.
|
|
8) with SHARE_FLAG
|
|
the list is available in the orders window and looks like the list buttons from the station windows (small vehicle)
The button is disabled if the vehicle do not have any shared orders or it got shared orders, but an empty order list
based on a patch by nycom, thought it ended up getting heavily modified
Thanks to TrueLight for proofreading and suggestions
|
|
-Codechange: introduced DestinationID, which is in fact an union of several types
Used in Order struct, so no longer StationID is abused for all targets.
Hangars are a big exception, as they use a station-id with GOTO_DEPOT (go figure)
|
|
(or, will do that).
It isn't the best name, but we couldn't find any better.
This unifies the pool-system even more.
|
|
whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
|
|
of r5907.
|
|
fix some bogus warnings on MSVC by using (void*) casts
|