summaryrefslogtreecommitdiff
path: root/vehicle_gui.c
AgeCommit message (Collapse)Author
2006-04-01(svn r4229) [elrail & autoreplace] Always show compatible rail vehicles in ↵peter1138
the left list, and only the selected rail type in the right list, to allow converting electric engines to non-electric.
2006-03-31(svn r4201) - Codechange: Do for _engine_info[] what we do for ↵peter1138
_*_vehicle_info[]; create and use a function to retrieve data, and ensure constness.
2006-03-29(svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of ↵celestar
code and proofreading, thanks to peter1138 for another lot of code and ideas.
2006-02-20(svn r3620) - 2cc: Replace use of macro to determine colour map with a ↵peter1138
function call for drawing of vehicles.
2006-02-17(svn r3610) And one more (see r3608/r3609)tron
2006-02-17(svn r3609) Some more simplification in the same function as r3608tron
2006-02-17(svn r3608) No functional change, just make some code more comprehensible: ↵tron
Reduce variable scope, remove write-only variables, turn do-while-loops with multiple induction variables into canonical for-loops
2006-02-14(svn r3605) - Remove silly macro and fix indenting in DrawVehicleRefitWindow()peter1138
2006-02-06(svn r3564) Several smaller changes:tron
- Don't treat non-booleans as booleans - Reduce variable scope - Bracing - Use DeMorgan's law to make conditionals easier to read - if cascade -> switch - Replace some magic numbers by symbolic names - Avoid assignments within other statements
2006-02-04(svn r3546) - NewGRF feature: Implement rail vehicle 'property' 0x1A: allows ↵peter1138
shuffling order of rail vehicle purchase list (and replace vehicle list)
2006-02-04(svn r3535) -Feature: [autoreplace] allow autoreplacing of train wagonsbjarni
currently ALL available wagons are displayed in the right menu in the replace window however the replacement will only be done if the new wagon can be refitted to carry same cargo as the old one is currently carrying Since the standard vehicles do not have any valid wagon replacements, this feature can only be used when using newgrf sets
2006-02-03(svn r3528) - Feature: Allow sorting of vehicle lists by model or value ↵peter1138
(based on meush's work)
2006-02-03(svn r3524) - Split newgrf features from engine.[ch] into ↵peter1138
newgrf_engine.[ch], and add the new files to project files.
2006-02-01(svn r3510) Fiddle with whitespace and parenthesestron
2006-01-12(svn r3396) - Autoreplace changes:peter1138
- Change fixed array per player to a single pool. This avoids future problems with vehicle numbers and decreases savegame size. Engine replacements from previous savegames will be lost. - Move engine replacement code from players.c to engine.c. (thanks to blathijs for rewriting this)
2006-01-05(svn r3366) Make an unnecessarily global variable localtron
2006-01-02(svn r3359) - Autoreplace GUI: When starting or stopping a replacement, ↵peter1138
redraw the replace window after the command has completed, rather than after calling the command.
2005-12-29(svn r3353) Simplify the automatic length adjustment algorithm for replacing ↵tron
trains: Use the length of the train before the replacement as reference length
2005-12-14(svn r3298) Remove unused and write-only variablestron
2005-12-13(svn r3292) - Autoreplace: Disallow replacing to an engine type that already ↵peter1138
has a replacement set up; this stops loops being set up.
2005-12-13(svn r3291) - Codechange, Autoreplace: Replace int with EngineID and -1 with ↵peter1138
INVALID_ENGINE, as appropriate.
2005-12-07(svn r3270) Correct all (mis)uses of WWT_CLOSEBOX / WWT_TEXTBTN to reflect ↵peter1138
their actual use, and add "Close Window" tooltip where missing.
2005-11-26(svn r3239) - Codechange: Introduce and use helper functions for engine ↵peter1138
replacement code.
2005-11-18(svn r3218) -Feature: Multiheaded train engines will now stay in the same trainbjarni
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-14(svn r3181) -Bracingtron
-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-13(svn r3172) static, consttron
2005-11-07(svn r3155) -Feature: [autoreplace] autoreplace can now remove cars from too ↵bjarni
long trains -Trains will now remember the length of stations it visits and sell cars when being autoreplaced if they became too long -If it needs to remove cars, then it starts from the front and sells all it can find until the train is short enough -This only works for trains, that knows the station length of the route so a full uninterrupted run is needed -a train needs 1-2 runs to detect if the shortest station is expanded -This feature can be turned on and off in the train replace window and each company can have it's own setting -NOTE: minor savegame version bump
2005-11-06(svn r3148) -NewGRF, Feature: Add support for cargo refitting specification ↵peter1138
by cargo classes.
2005-10-30(svn r3106) -Autoreplace feature: Continue to show old vehicles in replace ↵peter1138
window after all player's vehicles of that type have been replaced. This allows the replacement to be removed. These vehicles are shown in grey instead of the player's colour.
2005-10-25(svn r3089) Fix possible issue with out-of-bounds array access in replace ↵peter1138
vehicle gui, and add brief commenting.
2005-10-24(svn r3082) made ChangeVehicleViewWindow() more readable (added in last commit)bjarni
2005-10-24(svn r3081) -Codechange: [autoreplace] complete rewrite of autoreplacebjarni
this is a complete rewrite, that makes use of existing commands like build and sell this means that multiheaded train engines are replaced correctly
2005-10-23(svn r3078) Some more stuff, which piled up:tron
- 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-18(svn r3059) Use bitfields to encode railtype and climates of engines instead ↵tron
of manual shifting/anding
2005-10-16(svn r3049) Replace byte/int/uint by RailType where appropriatetron
2005-10-16(svn r3048) Replace 0/1/2 by RAILTYPE_RAIL/MONO/MAGLEV where appropriatetron
2005-10-01(svn r3003) Change int, uint, uin16 and byte to EngineID where appropriate, ↵tron
plus some related changes (mostly casts)
2005-09-27(svn r2992) Use PlayerID, StationID and INVALID_STATION instead of int, int ↵tron
and -1
2005-09-26(svn r2988) static where static is duetron
2005-09-23(svn r2974) -Fix: Drag and drop selection on drop down boxes didn't select ↵peter1138
correct item when some items were hidden. -Separate disabled and hidden masks in drop downs to support both hidden and disabled items.
2005-09-18(svn r2962) - const correctness for all Get* functions and most Draw* ↵Darkvater
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-08-29(svn r2901) Refix 'replace window' with wrong string-etc. coordinates. Also ↵Darkvater
clean up, and make window-title a bit more meaningful (specify vehicle type replaced)
2005-08-20(svn r2880) Fix graphical glitch in replace window (text at wrong coordinates)Darkvater
2005-08-06(svn r2817) -Codechange: [autoreplace]: moved autoreplace and autorenew to ↵bjarni
serverside -This means that one company can only have one setting for renew and replacing more clients will not fight due to different settings anymore -This is a needed step in the line to fix autoreplacing dualheaded locomotives NOTE: savegame revision bump (peter1138 + me in coop)
2005-08-05(svn r2812) Move variables, which only vehicle_gui.c needs to know about, theretron
2005-07-27(svn r2724) -Fix: [Autoreplace] made the pulldown menu read ↵bjarni
GetPlayer(_local_player)->avail_railtypes - this removes the need for updating this code if we add more railtypes and it also allows the menu to show maglev when monorail is not available
2005-07-24(svn r2701) Insert Id tags into all source filestron
2005-07-22(svn r2673) Include functions.h directly, not globally via openttd.htron
2005-07-21(svn r2669) Shuffle some more stuff around to reduce dependenciestron
2005-07-21(svn r2664) Remove depedency on player.h from variables.htron