Commit Graph

169 Commits (34a395e6e82f43e6e4053edf9e501e43dae8fa35)

Author SHA1 Message Date
belugas cf210fdf6b (svn r6619) -Codechange: Use accessors for disabled_state.
Another step toward merging XTDwidget.
The only two files not converted (window.h and widget.c) will be done at the very last commit)
18 years ago
peter1138 09ba17f51c (svn r6615) - Fix (r6601): Fix bug that prevented subtypes appearing in some cases. 18 years ago
bjarni b20a23d25d (svn r6614) -Fix: added check to see if a newly opened refit window is different from NULL before assigning data to it 18 years ago
belugas f5ee5bdb0e (svn r6612) -Codechange: Use accessors for hidden_state.
Another step toward merging XTDwidget.
The only two files not converted (window.h and widget.c) will be done at the very last commit)
18 years ago
peter1138 778fd53671 (svn r6608) - Fix (r6601): The scroll bar could fall out of the window... more gui-fu needed... 18 years ago
peter1138 02806778df (svn r6607) - Fix (r6601): Fix selection of refit type when the list is scrolled. 18 years ago
peter1138 e4c59a44d3 (svn r6602) - Feature: we now support NewGRF livery refits, as used by DBsetXL, amongst others. This requires a savegame bump to save the cargo subtype. 18 years ago
peter1138 53efef1f7b (svn r6601) - Codechange: Support cargo subtypes in the refit window. The refit window has been altered to support resizing and scrolling. Note that the cargo subtype isn't yet passed for actual refitting yet. (Based on mart3p's patch) 18 years ago
bjarni da6b015b04 (svn r6591) -Codechange: changed strings that used the word "depot" into one for each vehicle type
This is a request from translators as depot is not valid for all vehicle types in all translations
   This will cause a lot of warnings when generating the lang files. MiHaMiX will fix them in a moment (hopefully)
18 years ago
bjarni 5b2f08260b (svn r6586) -Feature: [depot window] added a vehicle list window with all 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
18 years ago
bjarni dbbf71a4e7 (svn r6582) -Codechange: changed GenerateVehicleSortList() to reuse the same 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
18 years ago
bjarni d721227ade (svn r6581) -Fix r6562: [vehicle list windows] fixed an off by one issue when drawing the bottom row of buttons 18 years ago
bjarni d4be0eb4c9 (svn r6570) -Feature: added "start all" and "stop all" buttons to the vehicle lists 18 years ago
peter1138 bffa202b48 (svn r6565) - Fix (r6562): Missing newline at EOF caused a compiler warning 18 years ago
bjarni 1f2ed9d731 (svn r6562) -Codechange: merged the vehicle list window widget arrays
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
18 years ago
bjarni d525bf4278 (svn r6559) -Codechange: [vehicle list windows] moved creation and drawing code into two new functions to make it easier to see what goes on where 18 years ago
peter1138 2df539e30d (svn r6544) - Codechange: Rename CmdReplaceVehicle to CmdSetAutoReplace, to reflect what it does. 18 years ago
bjarni 98c23dac75 (svn r6519) -Code cleanup r6518: changed a line to apply to the coding style 18 years ago
bjarni 502e6d4c7f (svn r6518) -Codechange: unified the vehicle refit windows
This was requested by peter1138
18 years ago
belugas 98ba395277 (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct 18 years ago
bjarni ee05c4cd93 (svn r6431) -Fix r6424: removed a declaration after statement in ReplaceVehicleWndProc() 18 years ago
bjarni 7d9ab2e4e2 (svn r6429) -Fix: [autoreplace GUI] selecting an empty line will now 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
18 years ago
bjarni d9e07719f4 (svn r6428) -Codechange: [autoreplace] removed duplicated code to draw the info text in the autoreplace window 18 years ago
bjarni c545edf46f (svn r6424) -Codechange: [autoreplace] removed a loop though all vehicles 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
18 years ago
bjarni 3980db4623 (svn r6418) -Fix: [autoreplace] now multiheaded engines and other 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)
18 years ago
rubidium 21ac20aeca (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
-Cleanup: whitespace alignment of a few tables.
18 years ago
Darkvater 2ca590ab75 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'. 18 years ago
Darkvater 52fa30022a (svn r6378) -Codechange: Rename VLW_FLAGS to VLW_MASK as it is a mask 18 years ago
Darkvater acdfefaad1 (svn r6377) -Codechange: Set up the widgets in the WE_CREATE instead of on 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
18 years ago
Darkvater eb9a2dd3f6 (svn r6372) -Codechange: static, unneeded decleration in headers, superfluous header includes
-Codechange: Unify the Sorting struct both for vehicle-lists and network-lists.
18 years ago
bjarni 718255a700 (svn r6370) -Codechange: moved all the remaining setup for PlayerVehWndProc() into WE_CREATE 18 years ago
bjarni edd5f92568 (svn r6350) -Codechange: moved some setup stuff into WE_CREATE in PlayerVehWndProc()
This is possible now that the window number is known when running WE_CREATE and it's a nicer solution
18 years ago
bjarni 71da9f3abc (svn r6291) -Feature: Vehicle lists from the station window now also got the 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)
18 years ago
bjarni 38963a6ed0 (svn r6283) -Code cleanup: fixed wrong indent in PlayerVehWndProc() 18 years ago
bjarni 7d6692d41d (svn r6282) -Codechange: made a function to create the vehicle list for 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
18 years ago
tron fd308ca889 (svn r6271) Remove stale comment 18 years ago
tron 7acc9ea1a7 (svn r6270) Remove the "unsorted" vehicle sorter, because it's plain useless 18 years ago
bjarni c471ddf4b6 (svn r6269) -Fix r6240: fixed incorrect row count in vehicle lists when resizing to smaller windows (AsterixMG) 18 years ago
bjarni 7aa94f0d4f (svn r6261) -Fix r6246: fixed sprite related crash related to other player's vehicle list windows (spotted by Darkvater) 18 years ago
bjarni e2f8ef4f72 (svn r6249) -Fix: fixed assert when pressing goto depot in an empty list (forgot to disable the button in this condition)
-Code cleanup r6246: simplified SendAllVehiclesToDepot() and moved an { in PlayerVehWndProc()
18 years ago
bjarni 1d011b57d2 (svn r6246) -Feature: added the many times requested "send all vehicle to 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
18 years ago
bjarni ba3cc51d5b (svn r6243) -Codechange: made SortVehicleList() static as well since that one is not used in any other files either (Thanks Tron for pointing this out) 18 years ago
bjarni 118409fb8c (svn r6242) -Codechange: made BuildVehicleList static as it is not used in any other files anymore
added window_type to arguments and used it to replace an if cascade with a switch case
18 years ago
bjarni 76dd9bf928 (svn r6241) -Fix r6240: missed altering one line in last commit 18 years ago
bjarni 9e42d2c51b (svn r6240) -Code cleanup: in PlayerVehWndProc: replaced size_of_row with w->resize.step_height
it was only used twice, so there was no reason to calculate it for each event
18 years ago
bjarni ce24a73673 (svn r6239) -Code cleanup: cleaned up PlayerVehWndProc
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
18 years ago
bjarni 386468dc72 (svn r6229) -Feature: Shared order lists now got a "goto depot" button
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
18 years ago
bjarni 1305b2365f (svn r6228) -Fix: redrawing an empty list of shared vehicles will now close 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
18 years ago
bjarni c820704f11 (svn r6227) -Codechange: added window type flags to use with PlayerVehWndProc
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
18 years ago
bjarni ecf8edf033 (svn r6215) -Codechange: [vehicle list windows] unified Player(vehicle)WndProc into PlayerVehWndProc
Those 4 unified functions were really much alike, so there was no reason to have so much dublicated code
18 years ago