tron@2186: /* $Id$ */ celestar@2536: /** @file openttd.h */ tron@2186: Darkvater@2075: #ifndef OPENTTD_H Darkvater@2075: #define OPENTTD_H truelight@0: truelight@0: #ifndef VARDEF truelight@0: #define VARDEF extern truelight@0: #endif truelight@0: rubidium@5587: #include "hal.h" rubidium@5587: #include "helpers.hpp" truelight@0: rubidium@6248: struct Oblong { Darkvater@4956: int x, y; Darkvater@4956: int width, height; rubidium@6248: }; Darkvater@4956: rubidium@6248: struct BoundingRect { Darkvater@4609: int width; Darkvater@4609: int height; rubidium@6248: }; Darkvater@4609: rubidium@6248: struct Pair { truelight@0: int a; truelight@0: int b; rubidium@6248: }; truelight@0: tron@2159: #include "map.h" tron@3636: #include "slope.h" truelight@0: truelight@0: // Forward declarations of structs. rubidium@6248: struct Vehicle; rubidium@6248: struct Depot; rubidium@6248: struct Waypoint; rubidium@6248: struct Window; rubidium@6248: struct Station; rubidium@6248: struct ViewPort; rubidium@6248: struct Town; rubidium@6248: struct NewsItem; rubidium@6248: struct Industry; rubidium@6248: struct DrawPixelInfo; rubidium@6643: struct Group; truelight@4401: typedef byte VehicleOrderID; ///< The index of an order within its current vehicle (not pool related) truelight@4401: typedef byte CargoID; truelight@4401: typedef byte LandscapeID; truelight@4401: typedef uint32 SpriteID; ///< The number of a sprite, without mapping bits and colortables rubidium@6248: struct PalSpriteID { peter1138@5668: SpriteID sprite; peter1138@5668: SpriteID pal; rubidium@6248: }; truelight@4401: typedef uint16 EngineID; truelight@4401: typedef uint16 UnitID; truelight@4401: typedef uint16 StringID; rubidium@6950: #define INVALID_STRING_ID 0xFFFF rubidium@6950: KUDr@5187: typedef EngineID *EngineList; ///< engine list type placeholder acceptable for C code (see helpers.cpp) truelight@4401: truelight@4401: /* IDs used in Pools */ truelight@0: typedef uint16 VehicleID; Darkvater@3347: typedef uint16 StationID; truelight@4397: typedef uint16 RoadStopID; Darkvater@3346: typedef uint16 TownID; rubidium@4330: typedef uint16 IndustryID; truelight@4388: typedef uint16 DepotID; truelight@4389: typedef uint16 WaypointID; truelight@4392: typedef uint16 OrderID; truelight@4401: typedef uint16 SignID; rubidium@6643: typedef uint16 GroupID; truelight@4348: typedef uint16 EngineRenewID; tron@4527: typedef uint16 DestinationID; rubidium@6955: typedef int64 Money; truelight@4389: tron@4527: /* DestinationID must be at least as large as every these below, because it can tron@4527: * be any of them tron@4527: */ tron@4527: assert_compile(sizeof(DestinationID) == sizeof(DepotID)); tron@4527: assert_compile(sizeof(DestinationID) == sizeof(WaypointID)); tron@4527: assert_compile(sizeof(DestinationID) == sizeof(StationID)); truelight@0: rubidium@5587: typedef int32 WindowNumber; truelight@0: rubidium@4293: enum { rubidium@4293: INVALID_YEAR = -1, rubidium@4326: INVALID_DATE = -1, rubidium@4293: }; rubidium@4293: rubidium@4326: typedef int32 Year; rubidium@4326: typedef int32 Date; rubidium@4261: truelight@0: truelight@0: enum SwitchModes { rubidium@4344: SM_NONE = 0, rubidium@4344: SM_NEWGAME = 1, rubidium@4344: SM_EDITOR = 2, rubidium@4344: SM_LOAD = 3, rubidium@4344: SM_MENU = 4, rubidium@4344: SM_SAVE = 5, rubidium@4344: SM_GENRANDLAND = 6, rubidium@4344: SM_LOAD_SCENARIO = 9, rubidium@4344: SM_START_SCENARIO = 10, truelight@4300: SM_START_HEIGHTMAP = 11, rubidium@4344: SM_LOAD_HEIGHTMAP = 12, truelight@0: }; truelight@0: truelight@2828: truelight@2828: /* Modes for GenerateWorld */ truelight@2828: enum GenerateWorldModes { truelight@4300: GW_NEWGAME = 0, /* Generate a map for a new game */ truelight@4300: GW_EMPTY = 1, /* Generate an empty map (sea-level) */ truelight@4300: GW_RANDOM = 2, /* Generate a random map for SE */ truelight@4300: GW_HEIGHTMAP = 3, /* Generate a newgame from a heightmap */ truelight@2828: }; truelight@2828: truelight@2828: /* Modes for InitializeGame, those are _bits_! */ truelight@2828: enum InitializeGameModes { truelight@2828: IG_NONE = 0, /* Don't do anything special */ truelight@2828: IG_DATE_RESET = 1, /* Reset the date when initializing a game */ truelight@2828: }; truelight@2828: rubidium@5587: enum Owner { rubidium@5587: PLAYER_INACTIVE_CLIENT = 253, rubidium@5587: PLAYER_NEW_COMPANY = 254, rubidium@5587: PLAYER_SPECTATOR = 255, rubidium@5587: OWNER_BEGIN = 0x00, rubidium@5587: PLAYER_FIRST = 0x00, rubidium@5587: MAX_PLAYERS = 8, rubidium@5587: OWNER_TOWN = 0x0F, // a town owns the tile rubidium@5587: OWNER_NONE = 0x10, // nobody owns the tile rubidium@5587: OWNER_WATER = 0x11, // "water" owns the tile rubidium@5587: OWNER_END = 0x12, rubidium@5587: INVALID_OWNER = 0xFF, rubidium@5587: INVALID_PLAYER = 0xFF, rubidium@5587: /* Player identifiers All players below MAX_PLAYERS are playable rubidium@5587: * players, above, they are special, computer controlled players */ rubidium@5587: }; rubidium@5587: rubidium@5587: typedef Owner PlayerID; rubidium@5587: rubidium@5587: DECLARE_POSTFIX_INCREMENT(Owner); rubidium@5587: rubidium@5587: /** Define basic enum properties */ rubidium@5587: template <> struct EnumPropsT : MakeEnumPropsT {}; rubidium@5587: typedef TinyEnumT OwnerByte; rubidium@5587: typedef OwnerByte PlayerByte; rubidium@5587: truelight@2828: rubidium@6248: enum TransportType { truelight@159: /* These constants are for now linked to the representation of bridges tron@3333: * and tunnels, so they can be used by GetTileTrackStatus_TunnelBridge. tron@3333: * In an ideal world, these constants would be used everywhere when tron@3333: * accessing tunnels and bridges. For now, you should just not change tron@3333: * the values for road and rail. truelight@159: */ rubidium@5587: TRANSPORT_BEGIN = 0, tron@3017: TRANSPORT_RAIL = 0, truelight@159: TRANSPORT_ROAD = 1, rubidium@4434: TRANSPORT_WATER, // = 2 matthijs@1967: TRANSPORT_END, matthijs@1967: INVALID_TRANSPORT = 0xff, rubidium@6248: }; truelight@159: rubidium@5587: /** Define basic enum properties */ rubidium@5587: template <> struct EnumPropsT : MakeEnumPropsT {}; rubidium@5587: typedef TinyEnumT TransportTypeByte; rubidium@5587: rubidium@5587: rubidium@6248: struct TileInfo { truelight@0: uint x; truelight@0: uint y; tron@3636: Slope tileh; tron@1977: TileIndex tile; truelight@0: uint z; rubidium@6248: }; truelight@0: truelight@0: truelight@0: /* Display Options */ truelight@0: enum { peter1138@6591: DO_SHOW_TOWN_NAMES = 0, peter1138@6591: DO_SHOW_STATION_NAMES = 1, peter1138@6591: DO_SHOW_SIGNS = 2, peter1138@6591: DO_FULL_ANIMATION = 3, peter1138@6591: DO_FULL_DETAIL = 5, peter1138@6591: DO_WAYPOINTS = 6, peter1138@6427: }; peter1138@6427: peter1138@6427: enum { peter1138@6427: TO_SIGNS, peter1138@6427: TO_TREES, peter1138@6427: TO_HOUSES, peter1138@6427: TO_INDUSTRIES, peter1138@6427: TO_BUILDINGS, peter1138@6427: TO_BRIDGES, peter1138@6427: TO_STRUCTURES, truelight@6998: TO_LOADING, truelight@0: }; truelight@0: truelight@0: /* Landscape types */ truelight@0: enum { belugas@6357: LT_TEMPERATE = 0, belugas@6357: LT_ARCTIC = 1, belugas@6357: LT_TROPIC = 2, belugas@6357: LT_TOYLAND = 3, truelight@0: truelight@0: NUM_LANDSCAPE = 4, truelight@0: }; truelight@0: belugas@6571: /** belugas@6571: * Town Layouts belugas@6571: */ belugas@6571: enum TownLayout { belugas@6571: TL_NO_ROADS = 0, ///< Build no more roads, but still build houses belugas@6571: TL_ORIGINAL, ///< Original algorithm (min. 1 distance between roads) belugas@6571: TL_BETTER_ROADS, ///< Extended original algorithm (min. 2 distance between roads) belugas@6571: TL_2X2_GRID, ///< Geometric 2x2 grid algorithm belugas@6571: TL_3X3_GRID, ///< Geometric 3x3 grid algorithm belugas@6571: belugas@6571: NUM_TLS, ///< Number of town layouts belugas@6571: }; belugas@6571: glx@6577: /* It needs to be 8bits, because we save and load it as such */ glx@6577: /** Define basic enum properties */ glx@6577: template <> struct EnumPropsT : MakeEnumPropsT {}; glx@6577: typedef TinyEnumT TownLayoutByte; //typedefing-enumification of TownLayout glx@6577: truelight@0: enum { truelight@0: NUM_PRICES = 49, truelight@0: }; truelight@0: rubidium@6248: struct Prices { rubidium@6953: Money station_value; rubidium@6953: Money build_rail; rubidium@6953: Money build_road; rubidium@6953: Money build_signals; rubidium@6953: Money build_bridge; rubidium@6953: Money build_train_depot; rubidium@6953: Money build_road_depot; rubidium@6953: Money build_ship_depot; rubidium@6953: Money build_tunnel; rubidium@6953: Money train_station_track; rubidium@6953: Money train_station_length; rubidium@6953: Money build_airport; rubidium@6953: Money build_bus_station; rubidium@6953: Money build_truck_station; rubidium@6953: Money build_dock; rubidium@6953: Money build_railvehicle; rubidium@6953: Money build_railwagon; rubidium@6953: Money aircraft_base; rubidium@6953: Money roadveh_base; rubidium@6953: Money ship_base; rubidium@6953: Money build_trees; rubidium@6953: Money terraform; rubidium@6953: Money clear_1; rubidium@6953: Money purchase_land; rubidium@6953: Money clear_2; rubidium@6953: Money clear_3; rubidium@6953: Money remove_trees; rubidium@6953: Money remove_rail; rubidium@6953: Money remove_signals; rubidium@6953: Money clear_bridge; rubidium@6953: Money remove_train_depot; rubidium@6953: Money remove_road_depot; rubidium@6953: Money remove_ship_depot; rubidium@6953: Money clear_tunnel; rubidium@6953: Money clear_water; rubidium@6953: Money remove_rail_station; rubidium@6953: Money remove_airport; rubidium@6953: Money remove_bus_station; rubidium@6953: Money remove_truck_station; rubidium@6953: Money remove_dock; rubidium@6953: Money remove_house; rubidium@6953: Money remove_road; rubidium@6953: Money running_rail[3]; rubidium@6953: Money aircraft_running; rubidium@6953: Money roadveh_running; rubidium@6953: Money ship_running; rubidium@6953: Money build_industry; rubidium@6248: }; truelight@0: truelight@0: #define GAME_DIFFICULTY_NUM 18 truelight@0: rubidium@6248: struct GameDifficulty { truelight@0: int max_no_competitors; truelight@0: int competitor_start_time; truelight@0: int number_towns; truelight@0: int number_industries; truelight@0: int max_loan; truelight@0: int initial_interest; truelight@0: int vehicle_costs; truelight@0: int competitor_speed; truelight@2395: int competitor_intelligence; // no longer in use truelight@0: int vehicle_breakdowns; truelight@0: int subsidy_multiplier; truelight@0: int construction_cost; truelight@0: int terrain_type; truelight@0: int quantity_sea_lakes; truelight@0: int economy; truelight@0: int line_reverse_mode; truelight@0: int disasters; rubidium@4434: int town_council_tolerance; // minimum required town ratings to be allowed to demolish stuff rubidium@6248: }; truelight@0: tron@473: enum { tron@473: // Temperate rubidium@4344: CT_PASSENGERS = 0, rubidium@4344: CT_COAL = 1, rubidium@4344: CT_MAIL = 2, rubidium@4344: CT_OIL = 3, rubidium@4344: CT_LIVESTOCK = 4, rubidium@4344: CT_GOODS = 5, rubidium@4344: CT_GRAIN = 6, rubidium@4344: CT_WOOD = 7, rubidium@4344: CT_IRON_ORE = 8, rubidium@4344: CT_STEEL = 9, rubidium@4344: CT_VALUABLES = 10, tron@473: tron@473: // Arctic rubidium@4344: CT_WHEAT = 6, rubidium@4344: CT_HILLY_UNUSED = 8, rubidium@4344: CT_PAPER = 9, rubidium@4344: CT_GOLD = 10, belugas@6480: CT_FOOD = 11, tron@473: tron@473: // Tropic rubidium@4344: CT_RUBBER = 1, rubidium@4344: CT_FRUIT = 4, rubidium@4344: CT_MAIZE = 6, rubidium@4344: CT_COPPER_ORE = 8, rubidium@4344: CT_WATER = 9, rubidium@4344: CT_DIAMONDS = 10, tron@473: tron@473: // Toyland rubidium@4344: CT_SUGAR = 1, rubidium@4344: CT_TOYS = 3, rubidium@4344: CT_BATTERIES = 4, rubidium@4344: CT_CANDY = 5, rubidium@4344: CT_TOFFEE = 6, rubidium@4344: CT_COLA = 7, rubidium@4344: CT_COTTON_CANDY = 8, rubidium@4344: CT_BUBBLES = 9, rubidium@4344: CT_PLASTIC = 10, tron@473: CT_FIZZY_DRINKS = 11, tron@473: peter1138@6463: NUM_CARGO = 32, miham@1004: bjarni@4554: CT_NO_REFIT = 0xFE, rubidium@4344: CT_INVALID = 0xFF tron@473: }; tron@473: tron@473: typedef uint AcceptedCargo[NUM_CARGO]; truelight@0: rubidium@6248: struct TileDesc { truelight@0: StringID str; Darkvater@4849: Owner owner; rubidium@4297: Date build_date; truelight@0: uint32 dparam[2]; rubidium@6248: }; truelight@0: rubidium@6248: struct ViewportSign { tron@849: int32 left; tron@849: int32 top; truelight@0: byte width_1, width_2; rubidium@6248: }; truelight@0: rubidium@6950: /** rubidium@6950: * Common return value for all commands. Wraps the cost and rubidium@6950: * a possible error message/state together. rubidium@6950: */ rubidium@6950: class CommandCost { rubidium@6953: Money cost; ///< The cost of this action rubidium@6950: StringID message; ///< Warning message for when success is unset rubidium@6950: bool success; ///< Whether the comment went fine up to this moment rubidium@6950: rubidium@6950: public: rubidium@6950: /** rubidium@6950: * Creates a command cost return with no cost and no error rubidium@6950: */ rubidium@6950: CommandCost() : cost(0), message(INVALID_STRING_ID), success(true) {} rubidium@6950: rubidium@6950: /** rubidium@6950: * Creates a command return value the is failed with the given message rubidium@6950: */ rubidium@6950: CommandCost(StringID msg) : cost(0), message(msg), success(false) {} rubidium@6950: rubidium@6950: /** rubidium@6950: * Creates a command return value with the given start cost rubidium@6950: * @param cst the initial cost of this command rubidium@6950: */ rubidium@6953: CommandCost(Money cst) : cost(cst), message(INVALID_STRING_ID), success(true) {} rubidium@6950: rubidium@6950: /** rubidium@6950: * Adds the cost of the given command return value to this cost. rubidium@6950: * Also takes a possible error message when it is set. rubidium@6950: * @param ret the command to add the cost of. rubidium@6950: * @return this class. rubidium@6950: */ rubidium@6950: CommandCost AddCost(CommandCost ret); rubidium@6950: rubidium@6950: /** rubidium@6950: * Adds the given cost to the cost of the command. rubidium@6950: * @param cost the cost to add rubidium@6950: * @return this class. rubidium@6950: */ rubidium@6953: CommandCost AddCost(Money cost); rubidium@6950: rubidium@6950: /** rubidium@6950: * Multiplies the cost of the command by the given factor. rubidium@6950: * @param cost factor to multiply the costs with rubidium@6950: * @return this class rubidium@6950: */ rubidium@6950: CommandCost MultiplyCost(int factor); rubidium@6950: rubidium@6950: /** rubidium@6950: * The costs as made up to this moment rubidium@6950: * @return the costs rubidium@6950: */ rubidium@6953: Money GetCost() const; rubidium@6950: rubidium@6950: /** rubidium@6950: * Sets the global error message *if* this class has one. rubidium@6950: */ rubidium@6950: void SetGlobalErrorMessage() const; rubidium@6950: rubidium@6950: /** rubidium@6950: * Did this command succeed? rubidium@6950: * @return true if and only if it succeeded rubidium@6950: */ rubidium@6950: bool Succeeded() const; rubidium@6950: rubidium@6950: /** rubidium@6950: * Did this command fail? rubidium@6950: * @return true if and only if it failed rubidium@6950: */ rubidium@6950: bool Failed() const; rubidium@6950: }; rubidium@6950: truelight@0: truelight@0: typedef void DrawTileProc(TileInfo *ti); tron@4231: typedef uint GetSlopeZProc(TileIndex tile, uint x, uint y); rubidium@6950: typedef CommandCost ClearTileProc(TileIndex tile, byte flags); tron@1977: typedef void GetAcceptedCargoProc(TileIndex tile, AcceptedCargo res); tron@1977: typedef void GetTileDescProc(TileIndex tile, TileDesc *td); rubidium@6683: /** rubidium@6683: * GetTileTrackStatusProcs return a value that contains the possible tracks truelight@159: * that can be taken on a given tile by a given transport. The return value is truelight@159: * composed as follows: 0xaabbccdd. ccdd and aabb are bitmasks of trackdirs, truelight@159: * where bit n corresponds to trackdir n. ccdd are the trackdirs that are truelight@159: * present in the tile (1==present, 0==not present), aabb is the signal truelight@159: * status, if applicable (0==green/no signal, 1==red, note that this is truelight@159: * reversed from map3/2[tile] for railway signals). truelight@159: * truelight@159: * The result (let's call it ts) is often used as follows: truelight@159: * tracks = (byte)(ts | ts >>8) truelight@159: * This effectively converts the present part of the result (ccdd) to a truelight@159: * track bitmask, which disregards directions. Normally, this is the same as just truelight@193: * doing (byte)ts I think, although I am not really sure truelight@159: * truelight@159: * A trackdir is combination of a track and a dir, where the lower three bits truelight@159: * are a track, the fourth bit is the direction. these give 12 (or 14) truelight@159: * possible options: 0-5 and 8-13, so we need 14 bits for a trackdir bitmask truelight@193: * above. rubidium@6683: * @param tile the tile to get the track status from rubidium@6683: * @param mode the mode of transportation rubidium@6683: * @param sub_mode used to differentiate between different kinds within the mode rubidium@6683: * @return the above mentions track status information truelight@159: */ rubidium@6683: typedef uint32 GetTileTrackStatusProc(TileIndex tile, TransportType mode, uint sub_mode); Darkvater@3344: typedef void GetProducedCargoProc(TileIndex tile, CargoID *b); tron@1977: typedef void ClickTileProc(TileIndex tile); tron@1977: typedef void AnimateTileProc(TileIndex tile); tron@1977: typedef void TileLoopProc(TileIndex tile); Darkvater@2436: typedef void ChangeTileOwnerProc(TileIndex tile, PlayerID old_player, PlayerID new_player); rubidium@5991: /** @see VehicleEnterTileStatus to see what the return values mean */ tron@1977: typedef uint32 VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y); tron@3636: typedef Slope GetSlopeTilehProc(TileIndex, Slope tileh); truelight@0: rubidium@6248: struct TileTypeProcs { truelight@0: DrawTileProc *draw_tile_proc; truelight@0: GetSlopeZProc *get_slope_z_proc; truelight@0: ClearTileProc *clear_tile_proc; truelight@0: GetAcceptedCargoProc *get_accepted_cargo_proc; truelight@0: GetTileDescProc *get_tile_desc_proc; truelight@0: GetTileTrackStatusProc *get_tile_track_status_proc; truelight@0: ClickTileProc *click_tile_proc; truelight@0: AnimateTileProc *animate_tile_proc; truelight@0: TileLoopProc *tile_loop_proc; truelight@0: ChangeTileOwnerProc *change_tile_owner_proc; truelight@0: GetProducedCargoProc *get_produced_cargo_proc; truelight@0: VehicleEnterTileProc *vehicle_enter_tile_proc; dominik@39: GetSlopeTilehProc *get_slope_tileh_proc; rubidium@6248: }; truelight@0: truelight@0: rubidium@5893: enum WindowClass { rubidium@5893: WC_NONE, rubidium@5893: WC_MAIN_WINDOW = WC_NONE, Darkvater@5413: WC_MAIN_TOOLBAR, Darkvater@5413: WC_STATUS_BAR, Darkvater@5413: WC_BUILD_TOOLBAR, Darkvater@5413: WC_NEWS_WINDOW, Darkvater@5413: WC_TOWN_DIRECTORY, Darkvater@5413: WC_STATION_LIST, Darkvater@5413: WC_TOWN_VIEW, Darkvater@5413: WC_SMALLMAP, Darkvater@5413: WC_TRAINS_LIST, Darkvater@5413: WC_ROADVEH_LIST, Darkvater@5413: WC_SHIPS_LIST, Darkvater@5413: WC_AIRCRAFT_LIST, Darkvater@5413: WC_VEHICLE_VIEW, Darkvater@5413: WC_VEHICLE_DETAILS, Darkvater@5413: WC_VEHICLE_REFIT, Darkvater@5413: WC_VEHICLE_ORDERS, Darkvater@5413: WC_STATION_VIEW, Darkvater@5413: WC_VEHICLE_DEPOT, Darkvater@5413: WC_BUILD_VEHICLE, Darkvater@5413: WC_BUILD_BRIDGE, Darkvater@5413: WC_ERRMSG, Darkvater@5413: WC_BUILD_STATION, Darkvater@5413: WC_BUS_STATION, Darkvater@5413: WC_TRUCK_STATION, Darkvater@5413: WC_BUILD_DEPOT, Darkvater@5413: WC_COMPANY, Darkvater@5413: WC_FINANCES, Darkvater@5413: WC_PLAYER_COLOR, Darkvater@5413: WC_QUERY_STRING, Darkvater@5413: WC_SAVELOAD, Darkvater@5413: WC_SELECT_GAME, Darkvater@5413: WC_TOOLBAR_MENU, Darkvater@5413: WC_INCOME_GRAPH, Darkvater@5413: WC_OPERATING_PROFIT, Darkvater@5413: WC_TOOLTIPS, Darkvater@5413: WC_INDUSTRY_VIEW, Darkvater@5413: WC_PLAYER_FACE, Darkvater@5413: WC_LAND_INFO, Darkvater@5413: WC_TOWN_AUTHORITY, Darkvater@5413: WC_SUBSIDIES_LIST, Darkvater@5413: WC_GRAPH_LEGEND, Darkvater@5413: WC_DELIVERED_CARGO, Darkvater@5413: WC_PERFORMANCE_HISTORY, Darkvater@5413: WC_COMPANY_VALUE, Darkvater@5413: WC_COMPANY_LEAGUE, Darkvater@5413: WC_BUY_COMPANY, Darkvater@5413: WC_PAYMENT_RATES, Darkvater@5413: WC_ENGINE_PREVIEW, Darkvater@5413: WC_MUSIC_WINDOW, Darkvater@5413: WC_MUSIC_TRACK_SELECTION, Darkvater@5413: WC_SCEN_LAND_GEN, Darkvater@5413: WC_SCEN_TOWN_GEN, Darkvater@5413: WC_SCEN_INDUSTRY, Darkvater@5413: WC_SCEN_BUILD_ROAD, Darkvater@5413: WC_BUILD_TREES, Darkvater@5413: WC_SEND_NETWORK_MSG, Darkvater@5413: WC_DROPDOWN_MENU, Darkvater@5413: WC_BUILD_INDUSTRY, Darkvater@5413: WC_GAME_OPTIONS, Darkvater@5413: WC_NETWORK_WINDOW, Darkvater@5413: WC_INDUSTRY_DIRECTORY, Darkvater@5413: WC_MESSAGE_HISTORY, Darkvater@5413: WC_CHEATS, Darkvater@5413: WC_PERFORMANCE_DETAIL, Darkvater@5413: WC_CONSOLE, Darkvater@5413: WC_EXTRA_VIEW_PORT, Darkvater@5413: WC_CLIENT_LIST, Darkvater@5413: WC_NETWORK_STATUS_WINDOW, Darkvater@5413: WC_CUSTOM_CURRENCY, Darkvater@5413: WC_REPLACE_VEHICLE, Darkvater@5413: WC_HIGHSCORE, Darkvater@5413: WC_ENDSCREEN, Darkvater@5413: WC_SIGN_LIST, Darkvater@5413: WC_GENERATE_LANDSCAPE, Darkvater@5413: WC_GENERATE_PROGRESS_WINDOW, Darkvater@5418: WC_CONFIRM_POPUP_QUERY, peter1138@6427: WC_TRANSPARENCY_TOOLBAR, maedhros@6980: WC_VEHICLE_TIMETABLE, truelight@0: }; truelight@0: truelight@0: rubidium@6562: enum ExpensesType { rubidium@4344: EXPENSES_CONSTRUCTION = 0, rubidium@4344: EXPENSES_NEW_VEHICLES = 1, rubidium@4344: EXPENSES_TRAIN_RUN = 2, rubidium@4344: EXPENSES_ROADVEH_RUN = 3, rubidium@4344: EXPENSES_AIRCRAFT_RUN = 4, rubidium@4344: EXPENSES_SHIP_RUN = 5, rubidium@4344: EXPENSES_PROPERTY = 6, rubidium@4344: EXPENSES_TRAIN_INC = 7, rubidium@4344: EXPENSES_ROADVEH_INC = 8, rubidium@4344: EXPENSES_AIRCRAFT_INC = 9, rubidium@4344: EXPENSES_SHIP_INC = 10, rubidium@4344: EXPENSES_LOAN_INT = 11, rubidium@4344: EXPENSES_OTHER = 12, truelight@0: }; truelight@0: peter1138@5108: enum { peter1138@5108: MAX_LANG = 64, peter1138@5108: }; peter1138@5108: truelight@0: // special string constants truelight@0: enum SpecialStrings { truelight@193: truelight@0: // special strings for town names. the town name is generated dynamically on request. rubidium@4344: SPECSTR_TOWNNAME_START = 0x20C0, rubidium@4344: SPECSTR_TOWNNAME_ENGLISH = SPECSTR_TOWNNAME_START, truelight@0: SPECSTR_TOWNNAME_FRENCH, truelight@0: SPECSTR_TOWNNAME_GERMAN, truelight@0: SPECSTR_TOWNNAME_AMERICAN, truelight@0: SPECSTR_TOWNNAME_LATIN, truelight@0: SPECSTR_TOWNNAME_SILLY, truelight@0: SPECSTR_TOWNNAME_SWEDISH, truelight@0: SPECSTR_TOWNNAME_DUTCH, truelight@0: SPECSTR_TOWNNAME_FINNISH, truelight@0: SPECSTR_TOWNNAME_POLISH, truelight@0: SPECSTR_TOWNNAME_SLOVAKISH, miham@948: SPECSTR_TOWNNAME_NORWEGIAN, truelight@0: SPECSTR_TOWNNAME_HUNGARIAN, dominik@265: SPECSTR_TOWNNAME_AUSTRIAN, dominik@265: SPECSTR_TOWNNAME_ROMANIAN, dominik@265: SPECSTR_TOWNNAME_CZECH, darkvater@1030: SPECSTR_TOWNNAME_SWISS, Darkvater@2431: SPECSTR_TOWNNAME_DANISH, celestar@3698: SPECSTR_TOWNNAME_TURKISH, belugas@4143: SPECSTR_TOWNNAME_ITALIAN, bjarni@4312: SPECSTR_TOWNNAME_CATALAN, rubidium@4344: SPECSTR_TOWNNAME_LAST = SPECSTR_TOWNNAME_CATALAN, truelight@0: truelight@0: // special strings for player names on the form "TownName transport". rubidium@4344: SPECSTR_PLAYERNAME_START = 0x70EA, truelight@0: SPECSTR_PLAYERNAME_ENGLISH = SPECSTR_PLAYERNAME_START, truelight@0: SPECSTR_PLAYERNAME_FRENCH, truelight@0: SPECSTR_PLAYERNAME_GERMAN, truelight@0: SPECSTR_PLAYERNAME_AMERICAN, truelight@0: SPECSTR_PLAYERNAME_LATIN, truelight@0: SPECSTR_PLAYERNAME_SILLY, rubidium@4344: SPECSTR_PLAYERNAME_LAST = SPECSTR_PLAYERNAME_SILLY, truelight@0: rubidium@4344: SPECSTR_ANDCO_NAME = 0x70E6, rubidium@4344: SPECSTR_PRESIDENT_NAME = 0x70E7, rubidium@4344: SPECSTR_SONGNAME = 0x70E8, truelight@0: peter1138@5108: // reserve MAX_LANG strings for the *.lng files rubidium@4344: SPECSTR_LANGUAGE_START = 0x7100, peter1138@5108: SPECSTR_LANGUAGE_END = SPECSTR_LANGUAGE_START + MAX_LANG - 1, truelight@0: truelight@0: // reserve 32 strings for various screen resolutions peter1138@5108: SPECSTR_RESOLUTION_START = SPECSTR_LANGUAGE_END + 1, peter1138@5108: SPECSTR_RESOLUTION_END = SPECSTR_RESOLUTION_START + 0x1F, truelight@0: truelight@0: // reserve 32 strings for screenshot formats peter1138@5108: SPECSTR_SCREENSHOT_START = SPECSTR_RESOLUTION_END + 1, peter1138@5108: SPECSTR_SCREENSHOT_END = SPECSTR_SCREENSHOT_START + 0x1F, truelight@0: ludde@2055: // Used to implement SetDParamStr rubidium@4344: STR_SPEC_DYNSTRING = 0xF800, rubidium@4344: STR_SPEC_USERSTRING = 0xF808, truelight@0: }; truelight@0: tron@1977: typedef void PlaceProc(TileIndex tile); truelight@0: tron@2526: enum { tron@2526: SORT_ASCENDING = 0, tron@2526: SORT_DESCENDING = 1, tron@2526: SORT_BY_DATE = 0, tron@2526: SORT_BY_NAME = 2 tron@2526: }; tron@2526: truelight@0: VARDEF byte _savegame_sort_order; truelight@0: truelight@0: enum { rubidium@4344: MAX_SCREEN_WIDTH = 2048, truelight@0: MAX_SCREEN_HEIGHT = 1200, truelight@0: }; truelight@0: Darkvater@1397: /* In certain windows you navigate with the arrow keys. Do not scroll the Darkvater@1397: * gameview when here. Bitencoded variable that only allows scrolling if all Darkvater@1397: * elements are zero */ Darkvater@1397: enum { rubidium@4344: SCROLL_CON = 0, Darkvater@1397: SCROLL_EDIT = 1, Darkvater@1397: SCROLL_SAVE = 2, Darkvater@1843: SCROLL_CHAT = 4, Darkvater@1397: }; Darkvater@1397: VARDEF byte _no_scroll; Darkvater@1397: Darkvater@2380: /** To have a concurrently running thread interface with the main program, use Darkvater@2380: * the OTTD_SendThreadMessage() function. Actions to perform upon the message are handled Darkvater@2380: * in the ProcessSentMessage() function */ rubidium@6248: enum ThreadMsg { truelight@4323: MSG_OTTD_NO_MESSAGE, truelight@4323: MSG_OTTD_SAVETHREAD_DONE, truelight@4323: MSG_OTTD_SAVETHREAD_ERROR, rubidium@6248: }; Darkvater@2380: Darkvater@2380: void OTTD_SendThreadMessage(ThreadMsg msg); Darkvater@2380: Darkvater@2075: #endif /* OPENTTD_H */