Commit Graph

258 Commits (0ebd5af86f2ab9dcd556e930feddd526bb93264d)

Author SHA1 Message Date
rubidium 92aac531c2 (svn r13005) -Codechange: prepare AllocateWindowDescFront for subclassing of Window. 16 years ago
smatz 8a422e34df (svn r12995) -Codechange: use std::vector for EngineList instead of C/C++ wrapper for CBlobT 16 years ago
rubidium 9db77e3808 (svn r12976) -Codechange: use w->SetDirty() instead of SetWindowDirty(w) when it's certain that w != NULL. 16 years ago
rubidium 1ce0b03bf0 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description. 16 years ago
peter1138 45034bc522 (svn r12924) -Feature: Introducing the so called 'engine pool' which primarily removes the fixed engine type limits and also happens to allow (with the patch option 'dynamic_engines') multiple NewGRF vehicle sets to coexist. 16 years ago
bjarni 80a0435ba8 (svn r12843) -Feature [FS#1945]: The autoreplace window is now resizable in both directions
The code to open this window is also unified for all vehicle types
16 years ago
rubidium 6d063c3ad6 (svn r12754) -Codechange: split depot.h into depot_map.h, depot_func.h and depot_base.h and remove quite a lot of unneeded (before this) includes of depot.h. 16 years ago
rubidium df1d9bd880 (svn r12490) -Codechange: rename engine.h to engine_func.h and remove unneeded inclusions of engine.h and/or replace them with engine_type.h. 16 years ago
rubidium c51b81c247 (svn r12489) -Codechange: split station.h into station_base.h and station_func.h. 16 years ago
peter1138 f6e4dc4d8c (svn r12209) -Fix: [NewGRF] Support using any base price for rail and road vehicles' running cost, and show running cost of wagons if they have it. 17 years ago
peter1138 0e997be11e (svn r12205) -Codechange: rename RailVehicleInfo::running_cost_base to running_cost, inline with other vehicle types (It is the factor, not the base) 17 years ago
peter1138 89e0b522e2 (svn r12164) -Fix (r12137, FS#1775]: Variable scope bug crept in 17 years ago
peter1138 6d333e5d3e (svn r12137) -Fix [FS#1769]: Show cargo capacity for articulated vehicles correctly in the purchase list. Multiple cargo types can also now been shown. 17 years ago
peter1138 71b0d5f091 (svn r12054) -Cleanup: Use VehicleType instead of byte for vehicle types... 17 years ago
peter1138 c5b749f983 (svn r11988) -Codechange: Add a generic way of changing a widget's size and adjust the widgets around it to suit. 17 years ago
peter1138 622f251197 (svn r11959) -Codechange: Use macro to loop for specific engine types instead of using specific indexes each time.
-Codechange: Minor scope changes in said loops.
17 years ago
peter1138 aa556f123d (svn r11918) -Codechange: Draw engine lists at widget positions instead of fixed pixel positions 17 years ago
peter1138 04da1e1d45 (svn r11915) -Codechange: Add a function to draw a sort button's up/down arrow. Arrows are now drawn in a consistent position based on the widget, instead of randomly positioned by pixel. 17 years ago
peter1138 727d07c67e (svn r11904) -Codechange: use dropdown widget in 3 more windows, build vehicle, group vehicle list and station list. 17 years ago
peter1138 1fa2285327 (svn r11848) -Codechange: New class-based drop down list functionality. Lists are now dynamically generated, and can include parameters, or be extended however needed. 17 years ago
rubidium 90acd52f22 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h. 17 years ago
rubidium 2fc62eab05 (svn r11818) -Codechange: split player.h into smaller pieces. 17 years ago
rubidium 64d691bacc (svn r11787) -Codechange: more header rewrites. This time related to viewport.h. 17 years ago
rubidium c08bff8931 (svn r11785) -Codechange: remove some unneeded includes. 17 years ago
peter1138 8c7bd8fef4 (svn r11781) -Codechange: variable scope and initialization 17 years ago
rubidium 444e77d8bc (svn r11774) -Change: do not include variables.h in a header when it is not needed. 17 years ago
bjarni 2c62136ace (svn r11710) -Feature: [build vehicles windows] added sorting for cost, running costs and speed to road vehicles and ships build windows 17 years ago
rubidium 722613f7f3 (svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes. 17 years ago
rubidium db73addb43 (svn r11702) -Codechange: move all date related stuff to date*. 17 years ago
rubidium 81bf9f8503 (svn r11692) -Codechange: move some functions from 'functions.h' to a more logical place and remove about 50% of the includes of 'functions.h' 17 years ago
rubidium 1f6043458c (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type. 17 years ago
rubidium 766551b0bc (svn r11677) -Codechange: move price and command related types/functions to their respective places. 17 years ago
rubidium 8427b8bad2 (svn r11675) -Codechange: split the string types from the string functions. 17 years ago
rubidium 2cf7d5b2cb (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found. 17 years ago
rubidium 8bfbfd0031 (svn r11667) -Codechange: split window.h into a header that defines some 'global' window related types, on that defined 'global' window functions and one that defines functions and types only used by *_gui.cpps. 17 years ago
rubidium 92cb0e45ca (svn r11555) -Codechange: use the new members introduced in r11551. 17 years ago
skidd13 c0a2c0c23e (svn r11481) -Codechange: Rename the HASBIT function to fit with the naming style 17 years ago
belugas e2c0f1faf7 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
Patch heavily based on BiBB's work (FS#1383)
17 years ago
rubidium eadd6765e1 (svn r11312) -Codechange: implement a overflow safe integer and use that for money and don't misuses CommandCost to have a overflow safe integer. Based on a patch by Noldo. 17 years ago
glx 342025d0e1 (svn r11214) -Fix [FS#1296]: planes can't use heliports so refuse these orders 17 years ago
rubidium f41c8ab3aa (svn r11122) -Fix [FS#1234]: crash when building a NewGRF vehicle when the articulated build vehicle callback returneed a different value for the purchase window than the normal build. Thanks for Dalestan and _minime_ for pointers to possible causes. 17 years ago
rubidium 45900925c3 (svn r10992) -Fix [FS#1132]: huge amount of vehicles in the "ungrouped" group. Patch by frosch. 17 years ago
rubidium d1590e8f07 (svn r10731) -Codechange: allow smaller initial "build <vehicle type>" windows. 17 years ago
rubidium 13ab17bca8 (svn r10704) -Codechange: provide an infrastructure to have resizable windows that are smaller than the default window size. 17 years ago
peter1138 61e41b24b4 (svn r10603) -Codechange: avoid direct access to _engine_info 17 years ago
rubidium 13692798e6 (svn r10567) -Add [FS#915]: a "group" with ungrouped vehicles. Patch by Matthias Wolf. 17 years ago
truelight 988d9b8da8 (svn r10552) -Fix [FS#1034, r10546]: opening Available Aircrafts segfaulted 17 years ago
truelight 1845b5633d (svn r10546) -Fix [FS#1026]: you can now have both Available Train as Available Ship window open 17 years ago
peter1138 76874f34bf (svn r10324) -Codechange: reference engine names by index 17 years ago
truelight dc82eeb2ae (svn r10265) -Feature: allow double-clicking on certain places: build-vehicle and town-action 17 years ago
rubidium d0fa4eb9de (svn r10258) -Codechange: as we are now using int64 all over the place, it's better to use int64 variables in the string generating too instead of packing them into two int32s.
-Fix: some displays of money were wrong.
17 years ago
rubidium 1b27095c83 (svn r10247) -Fix (r10210): *always* call SetDParamMoney when you want to place money in some string. 17 years ago
rubidium 0d8e82b7d7 (svn r10246) -Fix (r10297): some forgotten money conversions and truncation issues. Thanks to benc for providing the patch. 17 years ago
bjarni 07e7a80a05 (svn r10025) -Fix: [build windows] sorting planes for capacity didn't check mail capacity. Now mail capacity is used if passenger capacity is the same
The sort will still resort to EngineID if both mail and passenger capacities are the same
17 years ago
bjarni 65ff472991 (svn r10024) -Feature: [build windows] trains, road vehicles and ships can now be sorted by cargo capacity (planes already had this option) 17 years ago
maedhros 2181e11c18 (svn r10008) -Codechange: Move a couple of functions related to articulated vehicles to a file of their own. 17 years ago
rubidium 21546a66f3 (svn r9917) -Codechange: prepare some more areas for more road types. 17 years ago
rubidium 8f0f090c51 (svn r9874) -Feature: advanced vehicle lists a.k.a. group interface. Now you can make groups of vehicles and perform all kinds of tasks on that given group. Original code by nycom and graphics by skidd13. 17 years ago
rubidium c8d05162c2 (svn r9869) -Codechange: replace some bytes with VehicleType, i.e. more type strictness. 17 years ago
peter1138 e16ea9b758 (svn r9828) -Codechange: [NewGRF] Add support for changing cargo capacity with callback 36. This is set on construction for ships and roadvehicles, and whenever carriages are attached for trains. 17 years ago
peter1138 4cfef9b7f5 (svn r9809) -Codechange: [NewGRF] Add callback 36 properties to purchase lists and add running cost changing for ships. 17 years ago
peter1138 ebe81b98ce (svn r9806) -Codechange: [NewGRF] Add callback 36 support for purchase cost, for all vehicle types. 17 years ago
peter1138 9763b5bf8b (svn r9703) -Codechange: support callback 36 in vehicle purchase lists 17 years ago
rubidium 7577954ced (svn r9672) -Cleanup: lots of coding style fixes around operands. 17 years ago
maedhros 2eed59028f (svn r9476) -Codechange: Make build windows for all vehicle types the same width. 18 years ago
maedhros 822ce5661d (svn r9475) -Codechange: Allow the purchase details widget to expand dynamically if there's still not enough room for the text. 18 years ago
maedhros 9339c954e1 (svn r9474) -Fix (r8378): Expand the details widget in the vehicle build windows again to make room for all the text. 18 years ago
rubidium 36cea84b11 (svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code). 18 years ago
bjarni 13c72c07d6 (svn r9040) -Codechange: the build window and CmdBuildAircraft() now shares the code to figure out if an aircraft is buildable in the hangar in question
This should help ensuring that the build command and the list are consistent in what aircraft are buildable
18 years ago
celestar 5828617a07 (svn r8973) -Feature/Codechange: Changed the internal unit for aircraft velocities to from 8mph to 1km/h (peter1138), also give aircraft realsitic velocities (so that 1km/h is 1km/h independent of vehicle type) (peter1138). Introduce a flag to reduce aircraft speed in holding patterns to some realistic velocity. Use this flag for the city airport for the time being and make use of the different entry points for this airport type. 18 years ago
belugas 4160d85cd2 (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style. 18 years ago
peter1138 3d581f4f89 (svn r8826) -Codechange: Replace _cargoc's separate arrays with a regular struct array (with accessor) and implement new initialization method using cargo labels. 18 years ago
tron 27f48c5dda (svn r8822) -Fix
Variable scope, const
18 years ago
bjarni da422574ad (svn r8787) -Change r8771: allow fast aircraft in small airports
We should keep the list in sync with the build command as hacked clients can avoid a block in the GUI only
18 years ago
bjarni 8175371eee (svn r8783) -Fix r8771: aircraft vehicle subtype and aircraft engine subtype aren't the same (even though they both tell if it's a plane or helicopter) 18 years ago
bjarni 6bbe135446 (svn r8771) -Fix r8343: build aircraft windows will no longer show aircraft that can't use the airport in question
Now it's even better than ever because unless the no jetcrash cheat is enabled, the small airports will not show fast aircraft
18 years ago
tron 128caa5050 (svn r8755) -Fix
Abbreviate GetAirport(st->airport_type) to st->Airport()
18 years ago
bjarni a7c92492df (svn r8749) -Regression r8331: fixed signed/unsigned issue that could create too many lines in build vehicle windows and crash the game 18 years ago
tron 16df378623 (svn r8747) -Fix
-Codechange: Make the encoding of accepted aircraft types of airports a bit more sensible and move the enum into struct AirportFTAClass
18 years ago
bjarni ab08096aab (svn r8746) -Regression r8331: build train window could sort incorrectly by EngineID with certain newGRF sets 18 years ago
bjarni d40886903d (svn r8621) -Codechange: assigned new numbers to the VEH_(type) enum so that VEH_Train is 0, VEH_Road is 1 and so on
This means that "v->type" can be used as array indexes instead of VehTypeToIndex() (or "v->type - VEH_Train/0x10 as the code still used in some places)
  Surprisingly this can be done without changing the savegame format
18 years ago
bjarni f626458af7 (svn r8610) -Codechange/Feature: rewrote the list handling in the autoreplace window
-The user will notice the following changes:
      All vehicle types behaves in the same way
      Adding/removing an engine (new design and so on) can no longer result in the window selecting a new engine
      All valid replacements will be displayed since it looks at refitting options as well (this solves the missing ships with the newships GRF)
      Since you can't replace an engine into itself, the engine selected in the left list will no longer appear in the right list

   -The code changes:
      Instead of looping all engines all the time, each list generates a list like the build windows
        This ensures consistent list generation since only one function can loop all engines
      Unified code for all vehicle types
      It now use the lists to call the drawing code in the build vehicle window
      Works on selected EngineIDs instead of selected index in the list
18 years ago
rubidium 2a9851a3ad (svn r8511) -Codechange: make WindowClass an enumerated value. 18 years ago
peter1138 4438b99ae4 (svn r8464) -Revert (r4322): Change back to converting to mph in the GUI code, as 1 mph == 1.6 km/h is too far out for some people. 18 years ago
bjarni a97d87be9a (svn r8460) -Fix (r8455): the build train window put locomotives and wagons in appeantly random order 18 years ago
belugas e8af755d7f (svn r8455) -Codechange: Give a more meaningful name (railveh_type)to member flags of RailVehInfo, as well as changing the code to reflect the fact that it was not a flag but rather a one value only variable. Doing so, some evaluations have been simplified.
-Codechange: Add and use RAILVEH_SINGLEHEAD when railveh_type is set to 0, which was implicit before.
-Cleanup: Remove some extraneous parenthesis.
18 years ago
bjarni 058df1b99f (svn r8390) -Codechange (r8384): Rewrote ResizeButtons()
Now it only works on first and last widget to resize
  It now works with offsets correctly (no longer assumes the left is 0)
  It's no longer needed to have a widget right of the ones you resize
  Can handle any number of widgets
18 years ago
tron 7fffe8b3d4 (svn r8385) -Fix
-Regression (r8314): I only did half the necessary changes to move railtype from Engine to RailVehicleInfo. Now do the rest.
18 years ago
bjarni 4dd0d007b1 (svn r8384) -Codechange: [GUI] instead of writing a resize button function for each window, a global ResizeButtons() is added 18 years ago
bjarni e40723568a (svn r8381) -Fix (r8377): [build vehicle window] cleaned up the train refitable detection. It had two variables doing the same thing, but not always set to the same (oops) 18 years ago
bjarni ff2ce417a3 (svn r8379) -Cleanup: [build vehicle window] removed overloading with DrawVehiclePurchaseInfo() and renamed them into type specific names 18 years ago
bjarni 116cbcedb1 (svn r8378) -Fix (r8331): [build vehicle window] extended the widget with the details with one line since some newgrf trains needs it 18 years ago
bjarni 5a47d11689 (svn r8377) -Fix (r8331): [build vehicle window] train cargo capacity now only add "(refitable)" if the engine in question is refitable 18 years ago
bjarni aa2b69262b (svn r8364) -Codechange (r8362): added an assert to catch conditions where a request wants to draw more vehicles than the list contains 18 years ago
bjarni a6a65f6c3e (svn r8362) -Codechange: [vehicle build window] moved the engine drawing loop to a function of it's own
-Fix (r8335): [vehicle build window] ship sprites were moved two pixels to the left
18 years ago
bjarni f19c84dc25 (svn r8343) -Cleanup: [build vehicle windows] added a few comments and removed two switch-cases, that we can do without 18 years ago
belugas bfa5822bd8 (svn r8339) -Fix(r8331): MSVC seems to be a little more strict (or less intelligent) then other compilers when it comes to operator precedence.
A copy of code from train_gui.cpp to build_vehicle_gui.cpp was not exactly the same.
The earlier version did not require parenthesis to specify correct operator precedence.
18 years ago
bjarni 71d22b2f5e (svn r8338) -Codechange: merged road vehicle build window into the other ones
Note: now all build vehicle windows are merged into build_vehicle_gui.cpp
18 years ago
bjarni 09c9fe501f (svn r8337) -Cleanup: removed some more switch-cases in build_vehicle_gui.cpp and added arrays + VehTypeToIndex() instead 18 years ago
bjarni be5f289275 (svn r8336) -Codechange: added function to translate vehicle types to 0,1,2... for use for index to arrays
Used this function to get rid of some switch-cases in build_vehicle_gui.cpp
-Fix (r8335): ship build window didn't remember assending/decending sort setting
18 years ago
bjarni c39e513076 (svn r8335) -Feature: the build ship window is now also resizable horizontally and contains sorting options
-Codechange: the build ship window is merged into build_vehicle_gui.cpp
18 years ago
bjarni e6e1334eb3 (svn r8334) -Fix (r8331): build window buttons now both resize as intended 18 years ago
bjarni ade2af8ac6 (svn r8333) -Codechange: when invalidating a build window list, set a flag instead of rebuilding the list and then rebuild it the next time it's redrawn
This should save CPU time in the (maybe unlikely) event that the list is invalidated more than once between two redraws
18 years ago
bjarni f87494587e (svn r8332) -Codechange: moved DrawAircraftImage() and CcBuildAircraft() from build_vehicle_gui.cpp to aircraft_gui.cpp 18 years ago
bjarni 884af9d856 (svn r8331) -Feature: the train and aircraft build windows are now resizable in horizontal direction as well
-Codechange: merged train and aircraft build window code
18 years ago
peter1138 ca9843424b (svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
This lets us increase the sprite width from 14 to up to 29 bits, 
effectively nulling the old sprite limit. Table changes in next commit.
18 years ago
rubidium a7d0cdf95f (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b. 18 years ago
KUDr 07c30785ab (svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp) 18 years ago