Commit Graph

215 Commits (2d9fa602d1c4bbafd197c81b44343174bf12191c)

Author SHA1 Message Date
peter1138 e965ac67b3 (svn r6920) - Codechange: Ignore refit options of an engine if it has no capacity. 18 years ago
peter1138 6b3abe6508 (svn r6912) - Feature: Show a list of cargo types that a vehicle is refittable to in the purchase information window. (mart3p) 18 years ago
peter1138 259cad1985 (svn r6911) - Codechange: Add extra space to all purchase windows (and the replace window) to allow room for more text. (mart3p) 18 years ago
peter1138 4c11b5aef5 (svn r6910) - Codechange: Supply width of area when drawing purchase info instead of using hardcoded values. (mart3p) 18 years ago
Darkvater 494c56475f (svn r6884) -Codechange: Add strict bounds checking in string formatting system.
The last parameter should point to the end of the buffer (eg lastof(buf))
 Courtesy of Tron.
18 years ago
peter1138 53f8e99169 (svn r6858) - Fix (r6855): Handle rail vehicles with no capacity (N/A) by setting cargo type to CT_INVALID and handling it later. STR_8838_N_A is not a valid cargo type... 18 years ago
peter1138 68dda86c5b (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. 18 years ago
peter1138 813b67312a (svn r6801) - Fix (r6619): Always disable the train refit button. It will be enabled later if refitting is possible. 18 years ago
peter1138 26a91c55c7 (svn r6794) - Fix: In the train detail window, split up articulated parts if they can contain cargo. This allows us to show the full cargo contents. 18 years ago
Darkvater c0d2598ce4 (svn r6760) -Codechange: Do a case insensitive sort of train engine names and just normally
check a boolean; no special magic needed
18 years ago
Darkvater bc20a1539a (svn r6759) -Codechange: Remove the brainheaded usage of STR_JUST_STRING to pass a StringID 18 years ago
peter1138 a43bdefc28 (svn r6737) - Codechange: Sort train engines by their NewGRF specified list position instead of plain EngineID. This brings us back the custom order that was lost when generalized sorting was introduced. 18 years ago
bjarni 239991944d (svn r6716) -Code cleanup: [aircraft/train build windows] fixed a spelling mistake in the widget names (the game itself is unaffected by this) 18 years ago
bjarni 3dfe48b189 (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
18 years ago
bjarni cea27e2622 (svn r6712) -Code cleanup: renamed buildtrain_d to buildvehicle_d as it's used for all vehicle types 18 years ago
bjarni d620997bb3 (svn r6709) -Fix r6679: [build train window] solved an issue that could lead to trailing empty blocks in the list array
Since they were freed with the rest of the array, it only meant that we wasted a few bytes (max 16) while the window were open and we didn't leak memory
18 years ago
bjarni 306178e0b3 (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
18 years ago
bjarni c362b3e919 (svn r6684) -Feature: [train build window] added sorting options for the engines 18 years ago
KUDr 64c0fe7e99 (svn r6683) -Fix: '<' signed unsigned mismatch produced by VC8 18 years ago
bjarni 2bb7f1da6c (svn r6681) -Fix: when vehicles never expire they will stay at peak reliability instead of the lowest to make them useful even when old
-Fix: when retiring an engine design, invalidate the build windows and invalidate the build window data
-Fix: mark build windows dirty when engine reliability changes
18 years ago
bjarni bc1070654a (svn r6680) -Codechange r6679: [train build window] only generate the list when the window data is invalidated or the window is generated, not on each redraw 18 years ago
bjarni e1ad1102f2 (svn r6679) -Feature: [train build window] added filter for wagons, engines or both in the display
-Codechange: [train build window] to get rid of a really ugly hack, the train build list is now generated in one loop and stored in an array
18 years ago
bjarni 1aa41be3e2 (svn r6678) -Code cleanup: [train build window] made an enum with widget names and fixed some incorrect indents 18 years ago
peter1138 e713754f63 (svn r6649) - Codechange: Show more correct capacity of articulated wagons in the train purchase list. 18 years ago
bjarni 71ca65588c (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
18 years ago
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
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
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 502e6d4c7f (svn r6518) -Codechange: unified the vehicle refit windows
This was requested by peter1138
18 years ago
bjarni 40eecb3391 (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
18 years ago
bjarni b0101164e4 (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)
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 e20c8be172 (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
18 years ago
Darkvater 2ca590ab75 (svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'. 18 years ago
bjarni 718255a700 (svn r6370) -Codechange: moved all the remaining setup for PlayerVehWndProc() into WE_CREATE 18 years ago
tron 69ee8a6840 (svn r6359) -Fix: Do not reset the current cursor action when centering on a depot/hangar (noticed by Neonox) 18 years ago
tron d5e5a78cf4 (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
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
Darkvater 6919e7f8ea (svn r6280) -Codechange: Use the same naming for trains as for other vehicles:
CMD_SEND_TRAIN_TO_DEPOT instead of CMD_TRAIN_GOTO_DEPOT
18 years ago
tron 27b2a58964 (svn r6277) Clean up the train details drawing routine 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 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
rubidium 86dc219b4b (svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc. 18 years ago
tron 3306d9829f (svn r6184) Remove the unused (because it was NULL in all callers) second parameter of FillDrawPixelInfo() and simplify some expressions 18 years ago
bjarni 19cd783979 (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) 18 years ago
bjarni de742d597e (svn r6168) -Code cleanup r6161: removed a newline and added a tab. Thanks TrueLight 18 years ago
bjarni 3af65b79e7 (svn r6167) -Code cleanup r6161: replaced some uint16 with OrderID and (1 << 8) with SHARE_FLAG 18 years ago
bjarni 422d073910 (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
18 years ago