Commit Graph

155 Commits

Author SHA1 Message Date
Darkvater 605036dbb4 (svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names. 2006-10-24 13:20:54 +00:00
peter1138 8411b3b9fe (svn r6855) - Codechange: When displaying a "quantity of cargo" string, use the {CARGO} command and supply the cargo type and quantity, instead of manually looking up the cargo type's string. 2006-10-20 11:53:29 +00:00
bjarni ba2be75c0c (svn r6722) -Codechange: [aircraft build window] moved aircraft build window to a file of it's own
Also made some changes to it so it should be easier to unify all the build vehicle windows
2006-10-10 15:02:38 +00:00
bjarni 3a94561f25 (svn r6716) -Code cleanup: [aircraft/train build windows] fixed a spelling mistake in the widget names (the game itself is unaffected by this) 2006-10-10 08:34:14 +00:00
bjarni 238b34e000 (svn r6714) -Codechange: replaced a direct manipulation of windows with InvalidateWindowData() in rail_cmd.c
Moved the actual modification of railtype to WE_INVALIDATE_DATA in the train depot handler
-Codechange: added SetWindowDirty() to WE_INVALIDATE_DATA as it made no sense to update the list without making the window dirty
2006-10-10 08:14:30 +00:00
bjarni 08789dd3e8 (svn r6712) -Code cleanup: renamed buildtrain_d to buildvehicle_d as it's used for all vehicle types 2006-10-10 07:56:23 +00:00
bjarni 407d979236 (svn r6708) -Feature: [build aircraft window] added sort options to the list
-Fix r6707: solved an issue where scrollcount was not always set correctly
2006-10-09 21:30:16 +00:00
bjarni b8e1f70751 (svn r6707) -Feature: [build aircraft window] added buttons to view propeller planes, jet planes or helicopters
-Codechange: the build aircraft window now generates 3 malleced lists and displays based on those list
    This is preparation for sorting aircraft
2006-10-09 20:16:56 +00:00
bjarni ff6f83b56c (svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code
This moved a few of the strings and sprites a few pixels. Hopefully this will work out ok.
2006-10-05 08:15:51 +00:00
bjarni ea63050d5f (svn r6624) -Feature: added ability to add refit commands to vehicle orders (can only be done in goto depot orders)
Example: make a train transport iron ore from A to B, then it visits a depot and refits to steel
     It then transport steel back to A or near A if there is a factory and then it visits another depot to refit to iron ore again

   This is controlled in the orders. If a goto depot order is lightlighted, then "Unload" changes to "Refit"
   Control click "Refit" removes the refit part of the order (as the tooltip says)
   The player will still pay the normal refit costs

   Known issues:
      If a vehicle is not in a depot, then the refit window will fail to tell refitted cargo capacity
      Refit costs in the refit window can sometimes print 0 when it should not because the refit calculation is unaware that the vehicle will be refitted in between

   Warning: autoreplace got a protection against replacing something so you get a new cargo type, but it can fail here. In the iron ore/steel example, it can see that
      the vehicle carries iron ore and the new one can be refitted to iron ore, then it will replace. It will not check to see that it's valid for steel as well.
      This is something to look into in the future
2006-10-03 14:52:39 +00:00
belugas 753b572400 (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)
2006-10-03 02:08:15 +00:00
belugas 2c45339e0a (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)
2006-10-02 00:28:31 +00:00
bjarni 4ccdb0686f (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
2006-09-28 23:05:03 +00:00
bjarni 0739d0c6f6 (svn r6518) -Codechange: unified the vehicle refit windows
This was requested by peter1138
2006-09-27 07:23:38 +00:00
bjarni f7769e885e (svn r6513) -Codechange: unified the code to draw depot windows
This change is intended to make it easier to make depot behaviour consistent
   and faster to code when adding more features in the future
   The user interface should hopefully not be affected by this
2006-09-26 16:47:51 +00:00
bjarni 8f4a4a81da (svn r6503) -Codechange: added a function to tell what vehicles a depot contains
This will ensure that you can always get the same list when checking for vehicles in a depot (no need to duplicate code for each place, that needs such a list)
   Since the vehicles are only looped once for each redraw, drawing speed is around twice as fast (measured to be 114%-121% faster depending on the number of vehicles in the game)
2006-09-24 15:01:02 +00:00
belugas 1c56a5ae0f (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct 2006-09-23 02:39:24 +00:00
bjarni 0f78b620fb (svn r6497) -Fix r6165: Vehicles heading for depots when their orders contained "service in depot" displayed the stopping in depot string
This turned out to be due to OFB_HALT_IN_DEPOT and OFB_SERVICE_IF_NEEDED using the same bit
   It appears that it doesn't matter for the code, so I adapted the string selection code to handle this
2006-09-22 23:13:12 +00:00
Darkvater 56d06ba0a7 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'. 2006-09-04 15:44:28 +00:00
bjarni e42d819b6a (svn r6370) -Codechange: moved all the remaining setup for PlayerVehWndProc() into WE_CREATE 2006-09-03 23:14:39 +00:00
tron cd5c6df5f7 (svn r6359) -Fix: Do not reset the current cursor action when centering on a depot/hangar (noticed by Neonox) 2006-09-03 19:09:17 +00:00
tron 1c21c645ae (svn r6353) -Codechange: Make DestinationID a typedef of uin16, which is as large as any type of destinataion (StationID, DepotID, WaypointID) it can hold
DestinationID being a union of these types is just hassle without benefit and cannot be handled correctly everywhere because of local lack of information
2006-09-03 08:25:27 +00:00
bjarni 0fc0586bbf (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
2006-09-02 21:16:46 +00:00
bjarni d7e1d08d53 (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)
2006-09-01 10:24:15 +00:00
bjarni 6cc29d5daf (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
2006-08-30 16:32:00 +00:00
bjarni a73b07561e (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
2006-08-29 21:36:39 +00:00
bjarni 92582f0960 (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
2006-08-29 17:41:13 +00:00
rubidium 27cee58ab8 (svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc. 2006-08-28 18:53:03 +00:00
bjarni 9e67d54c1c (svn r6181) -Fix r6161: The list of vehicles using a certain station got a bit of display code mixed up with the list of vehicles with shared orders (nycom) 2006-08-28 06:13:16 +00:00
bjarni 5dec21ff0f (svn r6168) -Code cleanup r6161: removed a newline and added a tab. Thanks TrueLight 2006-08-27 10:04:02 +00:00
bjarni 27534b3521 (svn r6167) -Code cleanup r6161: replaced some uint16 with OrderID and (1 << 8) with SHARE_FLAG 2006-08-27 09:55:54 +00:00
bjarni 6cbd4cc167 (svn r6165) -Feature: control click Goto Depot will now make the vehicle service
at the depot and leave right away.
 To tell the difference the status of stopping vehicles will be in red,
 while servicing vehicles will be green.
-Codechange: remove some dead code in CmdSendAircraftToHangar() since it is
 conflicting with new functionality. Now p2 means the same for all types
2006-08-27 09:28:52 +00:00
bjarni d576f799d5 (svn r6161) -Feature: List of vehicles with the same shared orders
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
2006-08-26 22:28:40 +00:00
truelight db8dfcd6e9 (svn r6142) -Codechange: added WaypointID (sorry DV, couldn't splits it anymore)
-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)
2006-08-26 16:34:03 +00:00
belugas 4c2abf1de5 (svn r6046) CodeChange : Rename WWT_5 Widget type to WWT_LABEL : a centered label
CodeChange : Move almost all fixed strings from ON_PAINT event to Widget array using WWT_LABEL.
Feature : All "Select Refit Cargo" are now centered, instead of been left aligned
2006-08-22 15:23:25 +00:00
rubidium 480af9c917 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct. 2006-08-22 14:38:37 +00:00
rubidium 893d4ba9d4 (svn r6002) -Cleanup: remove the now redundant BASE_YEAR constant. 2006-08-20 19:05:28 +00:00
truelight 83d56d6d79 (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
allow certain patterns (like numbers only)
2006-08-19 09:31:22 +00:00
rubidium 3cab5f30c0 (svn r5926) -Codechange: make _cur_year contain the full year, instead of the offset since 1920
-Codechange: store all year related variables that are _not_ stored in a savegame/transported over the network in the same format as _cur_year
2006-08-16 11:39:55 +00:00
rubidium 1cc6e186f0 (svn r5918) -Cleanup: rename ConvertDayToYMD/ConvertYMDToDay as they really convert a Date to/from a YearMonthDay.
-Cleanup: swap ConvertDateToYMD's parameters to make the order consistent with the name of the function.
2006-08-15 16:49:48 +00:00
rubidium 0d3ccad29f (svn r5916) -Cleanup: use MIN_YEAR/MAX_YEAR for the year boundaries and BASE_YEAR when comparing _cur_year with a 'full' year.
-Cleanup: replace some magic '1920' values with BASE_YEAR.
2006-08-15 15:18:03 +00:00
Darkvater b13a60db42 (svn r5910) Fix some more warnings on MSVC by using (void*) casts. Followup of r5907. 2006-08-15 09:28:27 +00:00
tron ba14683912 (svn r5894) Remove a totally unnecessary indirection in the vehicle sorter code. Less code, less data, simply better 2006-08-14 20:25:29 +00:00
rubidium 243872b4fd (svn r5887) -Cleanup: move date related functions, defines and variables to date.[ch]
-Cleanup: fix whitespace related coding style issues in date.[ch]
-Cleanup: make original comments doxygen compatible and remove/change outdated comments
2006-08-14 14:21:15 +00:00
peter1138 e0d8223355 (svn r5820) - NewGRF: Add support for extra vehicle text in the purchase list for road vehicles, aircraft and ships. 2006-08-09 21:02:06 +00:00
belugas 6082507fea (svn r5609) CodeChange : Apply coding style 2006-07-26 03:33:12 +00:00
tron bb3c0b8d13 (svn r5595) Show all aircraft in the dry-run build window of the global aircraft list again 2006-07-22 16:44:55 +00:00
tron fadc3a564c (svn r5594) Be more strict what's allowed to be built in a hangar: if the airport can't handle planes/helicopters don't present and disallow building planes/helicopters - the latter case wasn't covered yet.
Also remove an error message about building aircraft which can't be triggered by a normal client
2006-07-22 14:43:53 +00:00
richk 0f57c9037e (svn r5519) Fix: Only list helicopters in the new build window of helidepots and helistations.Suggested by peter1138 & Tron.
Demanded under threat of removal by Tron; no thanks given.
Last commit from here. Got better things to do with life.
2006-07-19 19:20:04 +00:00
tron 2b27073156 (svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular 2006-06-27 21:25:53 +00:00