Commit Graph

156 Commits (f9f6b5f341b8b296e58fa33a719bfd1ede5ebd05)

Author SHA1 Message Date
Darkvater fc1a90b663 (svn r7313) -Codechange: Calling invalidate data on a window will surely warrant a redraw, so call
that after the WE_INVALIDATE_DATA event and remove (some of) the superflouous calls.
18 years ago
Darkvater 22ab60c9cb (svn r7206) -Codechange: Remove (some of) the magic needed for windows that could be invalid after
a call to DeleteWindow() somewhere else. Also do some cleanup with AllowWindowDescFront()
18 years ago
glx bc512e719f (svn r7142) -Fix: disable clone button in vehicle view for not owned vehicles (was already done for trains) 18 years ago
Darkvater 73b8d80036 (svn r7129) -Codechange: Get rid of a global variable that only sets a window's number. 18 years ago
Darkvater e786cd5c6b (svn r7128) -Codechange: Replace magic numbers by magic enums (windowdesc positioning WDP_AUTO = -1) 18 years ago
Darkvater 02a6df391d (svn r6926) -Codechange: Rename WWT_4 to WWT_TEXTBTN_2 and WWT_6 to WWT_INSET (credits to peter1138
for the aptly found name)
-Codechange: Remove the explicit numbering from WindowWidgetTypes
18 years ago
Darkvater c7c65ce6d5 (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
WWT_IMGBTN must contain an image for drawing. Renamed WWT_PANEL_2 to WWT_IMGBTN_2
 because that is what it is. Added WWT_PUSHBTN that is either just a pushable button,
 or a textbutton, which text's drawn dynamically independent of widget.
18 years ago
Darkvater 13df23c586 (svn r6924) -Codechange: Give the last (in the widget arrays at least) sprites meaningful names. 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
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
bjarni 67ac92e652 (svn r6715) -Fix r6714: roadvehicle and ship building windows are now also marked dirty when getting a WE_INVALIDATE_DATA event
This will make the windows mark dirty again when a new vehicle is available or one is removed from the list (again)
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 e397df0e0d (svn r6693) -Fix: [ship view window] disable the refit button when the ship is not refitable or not stopped in a depot 18 years ago
bjarni b0cc6f4022 (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.
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
bjarni dea1edd024 (svn r6442) -Fix: ship depots windows now only draws the ships inside the depot instead of all ships in the depot tile
This bug was visible when a ship left. The window redraw was called, but it still saw the ship since it didn't leave the tile yet and it left a ghost in the depot window
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
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
tron 38d34d3def (svn r6208) Reduce the number of induction variables for clarity 18 years ago
belugas 1f660a8175 (svn r6205) -CodeChange : use a switch case instead of a cascade of if
-CodeChange : rename var Engine *e to Engine *eng, since we have WindowEvent *e in same fnct
-CodeChange : fix a broken tabulation on a switch case. SOme breathing spaces too
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
bjarni 2930781bea (svn r6182) -Code cleanup: replaced one (1 << 8) with SHARE_FLAG (missed in r6167) 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 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
bjarni f938db6619 (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
18 years ago
truelight 65f5ec13f6 (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)
18 years ago
belugas 650b9be724 (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
18 years ago
rubidium 908d3bcfe6 (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. 18 years ago
rubidium db397d5a75 (svn r6002) -Cleanup: remove the now redundant BASE_YEAR constant. 18 years ago
truelight d3f2180438 (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
allow certain patterns (like numbers only)
18 years ago
rubidium e87e065e41 (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
18 years ago
rubidium 7d2ceb2063 (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.
18 years ago