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)
2006-09-24 15:01:02 +00:00
belugas
98ba395277
(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
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
2006-09-22 23:13:12 +00:00
Darkvater
2ca590ab75
(svn r6379) -Codechange: cast 'remove babel' on widget's unkA and rename it to 'data'.
2006-09-04 15:44:28 +00:00
bjarni
718255a700
(svn r6370) -Codechange: moved all the remaining setup for PlayerVehWndProc() into WE_CREATE
2006-09-03 23:14:39 +00:00
tron
69ee8a6840
(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
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
2006-09-03 08:25:27 +00:00
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
2006-09-02 21:16:46 +00:00
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)
2006-09-01 10:24:15 +00:00
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
2006-08-31 15:57:38 +00:00
tron
27b2a58964
(svn r6277) Clean up the train details drawing routine
2006-08-31 15:22:03 +00:00
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
2006-08-30 16:32:00 +00:00
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
2006-08-29 21:36:39 +00:00
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
2006-08-29 17:41:13 +00:00
rubidium
86dc219b4b
(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
tron
3306d9829f
(svn r6184) Remove the unused (because it was NULL in all callers) second parameter of FillDrawPixelInfo() and simplify some expressions
2006-08-28 07:33:51 +00:00
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)
2006-08-28 06:13:16 +00:00
bjarni
de742d597e
(svn r6168) -Code cleanup r6161: removed a newline and added a tab. Thanks TrueLight
2006-08-27 10:04:02 +00:00
bjarni
3af65b79e7
(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
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
2006-08-27 09:28:52 +00:00
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
2006-08-26 22:28:40 +00:00
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)
2006-08-26 16:34:03 +00:00
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
2006-08-22 15:23:25 +00:00
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.
2006-08-22 14:38:37 +00:00
rubidium
db397d5a75
(svn r6002) -Cleanup: remove the now redundant BASE_YEAR constant.
2006-08-20 19:05:28 +00:00
truelight
d3f2180438
(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
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
2006-08-16 11:39:55 +00:00
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.
2006-08-15 16:49:48 +00:00
rubidium
c55962f8a2
(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
b293c7a4e1
(svn r5910) Fix some more warnings on MSVC by using (void*) casts. Followup of r5907.
2006-08-15 09:28:27 +00:00
tron
bdb843950a
(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
9fc837ad85
(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
bjarni
1e47593786
(svn r5853) -Fix: [elrails] FS#178 Electric Trains can leave Conventional Depot
...
now the user will get an error if he tries to start the train and the status bar will say "no power" instead of "stopped"
Electric trains already driving in and out of non-electrified depots will still do so, but you can't start new ones
2006-08-12 10:41:29 +00:00
belugas
40a8964911
(svn r5609) CodeChange : Apply coding style
2006-07-26 03:33:12 +00:00
belugas
d2b3e9b2a1
(svn r5404) Fix (r5391) : Yet another typo. Nothing specatular :)
...
Spotted by gigajum
2006-06-28 17:46:55 +00:00
tron
772fbda3e3
(svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
2006-06-27 21:25:53 +00:00
peter1138
34ba92b488
(svn r5318) - Allow room for a single pixel overflow on the first engine when drawing a train's image.
...
- Draw the depot highlight box after drawing all engines on a line, so that the box isn't hidden.
2006-06-20 07:07:28 +00:00
tron
000497273c
(svn r5309) Partially fix the rail header dependency fiasco: rail_map.h now depends on rail.h and not the other way round anymore
2006-06-18 15:28:29 +00:00
tron
8cae4d1214
(svn r5225) Some windows periodically check if their parent exists - if not they close themselves
...
This is unnecessary, because their parents already close them when they get closed
Therefore remove the code for the periodic checks
2006-06-11 14:56:21 +00:00
tron
a2362674e3
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
2006-06-10 08:37:41 +00:00
tron
9ee944cabb
(svn r5094) Remove _new_{aircraft,roadveh,ship,train,wagon}_id. _new_vehicle_id is enough.
2006-06-04 09:28:33 +00:00
peter1138
e859b54250
(svn r5046) - Implement smooth horizontal depot scrolling by setting up a clipping area to draw the train image. This fixes a couple of usability issues when shorter wagons are used in the depot; shorter wagons scrolled at a different speed, and not all wagons were visible sometimes.
2006-05-30 21:19:46 +00:00
tron
d9e968e759
(svn r4943) uint tile -> TileIndex tile, byte player -> PlayerID player
2006-05-21 16:18:58 +00:00
tron
e774caca2a
(svn r4940) Remove the dubious feature of remembering the last built depot. It serves no real purpose except causing confusion
2006-05-21 13:51:36 +00:00
peter1138
feed914b97
(svn r4869) - NewGRF: support setting train list vehicle width to 32 instead of 29 pixels, for sets which use 32 pixel long engines/wagons.
2006-05-14 20:58:12 +00:00
peter1138
90af6ee14f
(svn r4868) - Codechange: in the train detail window, don't call DrawTrainImage() for each row, as we already loop to find the vehicles to
...
draw. Fixes a potential issue of extraneous wagons being drawn, if they are very short.
2006-05-14 20:38:09 +00:00
peter1138
05e2c6b886
(svn r4781) - NewGRF: give _traininfo_vehicle_pitch a proper declaration
2006-05-08 10:01:34 +00:00
peter1138
9415828900
(svn r4610) - If a wagon has a capacity of 0 (zero), display it in the purchase list as N/A.
2006-04-28 19:56:18 +00:00
peter1138
4a8bcad56a
(svn r4562) - NewGRF: Add additional vehicle text to train engine and wagon purchase information. Other vehicle types to come.
2006-04-23 22:35:37 +00:00
tron
35e93e451f
(svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
...
Remove DoCommandByTile(), because now it does the same as DoCommand()
2006-04-10 07:15:58 +00:00
peter1138
59ace676eb
(svn r4322) - Codechange: Remove conversion of kmh to mph from gui code to within the units conversion system, in string.c. This means displaying kmh requires no conversion, instead of being convert from kmh to mph, and then back to kmh again.
2006-04-08 12:04:23 +00:00
peter1138
a2ea99dc66
(svn r4211) - Removed measuring units from the names of two strings.
...
- Use {POWER} and {WEIGHT_S} tags for all strings instead of "{COMMA}units".
2006-03-31 17:40:31 +00:00
peter1138
eb15688358
(svn r4201) - Codechange: Do for _engine_info[] what we do for _*_vehicle_info[]; create and use a function to retrieve data, and ensure constness.
2006-03-31 12:59:43 +00:00
peter1138
bc3f98c4dd
(svn r4192) - Fix: In the depot, moving wagons from the end of a very long train to a short train where the short train was scrolled off the window would cause a game crash. (Thanks to SimonRC for reporting.)
2006-03-31 08:39:10 +00:00
celestar
6c44bf5012
(svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
2006-03-29 16:30:26 +00:00
bjarni
aa22bfb178
(svn r3944) -Feature: it's now possible to turn a single unit in a train
...
control-click on a unit in a train in a depot will make the click unit turn around
this is useful if you want "normal" engines to act as dualheaded (one each way) or similar
this only works on single unit units. Multiheaded and articulated engines get a red error box
this is based on a quick hack peter1138 while I made it network safe and correctly handling of multible unit engines
2006-03-18 13:00:32 +00:00
tron
7b1c7c31fb
(svn r3916) Get/Set the rail type by [GS]etRailType{Crossing,OnBridge,}()
2006-03-17 10:10:31 +00:00
tron
8cfcdaa733
(svn r3783) Replace further ints and magic numbers by Direction, DiagDirection and friends
2006-03-08 06:55:33 +00:00
peter1138
97559a9df9
(svn r3631) - 2cc: Remove use of some temporary variables and perform minor optimization in the form of the ternary operator.
2006-02-20 21:49:31 +00:00
peter1138
b5cd24f05d
(svn r3620) - 2cc: Replace use of macro to determine colour map with a function call for drawing of vehicles.
2006-02-20 09:26:07 +00:00
peter1138
f9b4537228
(svn r3588) - Refit: Use only one global to return the refit capacity rather than one per vehicle type.
2006-02-11 09:24:51 +00:00
peter1138
2d67fc8741
(svn r3546) - NewGRF feature: Implement rail vehicle 'property' 0x1A: allows shuffling order of rail vehicle purchase list (and replace vehicle list)
2006-02-04 21:48:46 +00:00
peter1138
6c28b1cec7
(svn r3524) - Split newgrf features from engine.[ch] into newgrf_engine.[ch], and add the new files to project files.
2006-02-03 12:55:21 +00:00
peter1138
8e16eee137
(svn r3521) - Feature: Allow trains details view to be resized.
2006-02-02 08:03:10 +00:00
tron
17ec6ed70d
(svn r3520) Remove unused parameters from some functions
2006-02-02 07:15:46 +00:00
tron
1c3e8630fe
(svn r3511) More whitespace ([FS#46] by Rubidium)
2006-02-01 07:36:15 +00:00
tron
9712d6f639
(svn r3510) Fiddle with whitespace and parentheses
2006-02-01 06:32:03 +00:00
peter1138
ca8a27a592
(svn r3415) - Fix: Disable the clone and refit buttons in the train view when viewing another player's vehicles, or as a spectator. (thanks to UnderBuilder for pointing this out)
2006-01-21 22:09:25 +00:00
peter1138
e1f9b72c82
(svn r3388) - NewGRF: Allow train running cost class to differ from engine class. Also fix typo in r3384.
2006-01-07 16:47:59 +00:00
peter1138
fd3a596c82
(svn r3370) Improve alignment of text within total cargo tab of train view window
2006-01-06 09:50:43 +00:00
tron
2053685fb5
(svn r3367) Unify the 4 distinct CMD_CHANGE_{AIRCRAFT,ROADVEH,SHIP,TRAIN}_SERVICE_INT commands into one CMD_CHANGE_SERVICE_INT command.
...
As side effect this is a
-Fix: The default AI tried to change the service intervals of vehicles via the CMD_CHANGE_TRAIN_SERVICE_INT command - regardless of the type of the vehicle - which of course failed for non-trains
2006-01-05 21:35:54 +00:00
tron
24d56f889d
(svn r3354) Fix a typo, which survived for about 3000 revisions: s/SRT_SORT_BY/STR_SORT_BY/ (noticed by chu)
2005-12-29 19:06:44 +00:00
peter1138
139d1ed1eb
(svn r3351) Make sort criteria selection widgets in player train list consistent with those widgets in other vehicle type lists. (Stops "Total capacity per cargo type" overflowing)
2005-12-28 09:40:26 +00:00
peter1138
5f3dc36983
(svn r3270) Correct all (mis)uses of WWT_CLOSEBOX / WWT_TEXTBTN to reflect their actual use, and add "Close Window" tooltip where missing.
2005-12-07 15:48:52 +00:00
bjarni
16e65960b9
(svn r3218) -Feature: Multiheaded train engines will now stay in the same train
...
This means that any user attempt to remove a rear engine will tell the user to move the front engine instead
This fixes the assert when moving multiheaded engines (introduced in r3144)
Note: to make old savegames use this feature, some engines might be turned around in order to link engines in pairs
-Codechange: train subtype is now a bitmask
This allows fast access to info like if it is a wagon or engine and if it is in front and so on
Note: savegame version bump
2005-11-18 23:41:03 +00:00
tron
9d0e7b6458
(svn r3181) -Bracing
...
-Indentation
-Whitespace
-DeMorgan's Law
-Test with NULL or 0 for non-booleans
-'\0' instead of 0 for chars
-Remove redundantly redundant comments (like DoFoo(); // Do foo)
-Join multiple short lines with a single statement
-Split single lines with multiple statements
-Avoid assignments in if
2005-11-14 19:48:04 +00:00
tron
81e5b16d71
(svn r3172) static, const
2005-11-13 13:43:55 +00:00
peter1138
34c503cabf
(svn r3148) -NewGRF, Feature: Add support for cargo refitting specification by cargo classes.
2005-11-06 13:42:26 +00:00
peter1138
0d9379f904
(svn r3139) -NewGRF, Feature: support for articulated rail vehicles. This is used, for example, by coal tenders.
2005-11-05 16:07:26 +00:00
peter1138
748cde25c4
(svn r3130) Calculate shorter wagon lengths more precisely in train depot window. This affects wagon position, the scroll bar, and the train length counter. No trial and error is required to get the correct length now.
2005-11-04 07:38:26 +00:00
peter1138
f50ec50d9b
(svn r3107) -NewGRF: Move train y-position offset adjustment to remove code duplication, and make it apply only to vehicles with a custom image.
2005-10-30 21:47:42 +00:00
tron
4caa0e593d
(svn r3099) Copy&pasto in r3098
2005-10-29 20:28:43 +00:00
tron
7c14b86aaf
(svn r3098) static, const, uint -> TileIndex, indentation, bracing, unused return values, ... mostly related to the clone vehicle GUI
2005-10-28 20:04:54 +00:00
tron
181d586a7c
(svn r3078) Some more stuff, which piled up:
...
- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
2005-10-23 13:04:44 +00:00
tron
0b936c3222
(svn r3077) static, const, bracing, indentation, 0 -> '\0'/NULL, typos in comments, excess empty lines, minor other changes
...
nothing spectacular, just some stuff, which piled up
2005-10-22 06:39:32 +00:00
tron
e3d1e43559
(svn r3049) Replace byte/int/uint by RailType where appropriate
2005-10-16 09:13:04 +00:00
tron
10489083c7
(svn r3047) The parameters for the railtype check got flipped in the train build window (this caused no visible problem so far, therefore no Fix tag)
2005-10-15 16:43:18 +00:00
tron
53a4a6a0f4
(svn r3046) Replace some numbers with sprite names and fix a typo in the sprite list
2005-10-15 11:06:54 +00:00
tron
8980891b09
(svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants
2005-10-07 07:35:15 +00:00
tron
39f5dbfd3b
(svn r3019) -Codechange: Replace explicit shifting/anding/oring with GB and SB
2005-10-05 07:20:26 +00:00
tron
6d7c7e67b2
(svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them
2005-10-03 21:20:01 +00:00
tron
0ad3902acf
(svn r3003) Change int, uint, uin16 and byte to EngineID where appropriate, plus some related changes (mostly casts)
2005-10-01 12:43:34 +00:00
tron
f608232673
(svn r2992) Use PlayerID, StationID and INVALID_STATION instead of int, int and -1
2005-09-27 18:51:04 +00:00
peter1138
5dcb1e34fd
(svn r2982) Newgrf: Added patch option for wagon speed limits. This is enabled by default.
2005-09-24 13:56:39 +00:00
peter1138
bc602aa6d2
(svn r2969) -Newgrf: Show a wagon's speed limit in purchase list.
2005-09-22 10:31:09 +00:00
Darkvater
4a58250cb9
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
...
- change a lot of byte player types to PlayerID
- beautify header files, same "#endif /* filename */" ending
2005-09-18 20:56:44 +00:00
tron
2aa27f9ecb
(svn r2932) Give the strings consisting of an up/a down arrow symbolic names
2005-09-10 07:38:03 +00:00
tron
c2178ab832
(svn r2799) Make the only two non-const widget lists const
2005-08-03 13:07:29 +00:00
ludde
9a060a0f24
(svn r2781) Fix some of the issues with variables in .h files.
2005-08-01 16:31:19 +00:00
tron
0ab62e7498
(svn r2772) Simplify the age notice in the vehicle details window
2005-07-31 22:28:49 +00:00