tron@2186: /* $Id$ */ tron@2186: glx@9505: /** @file news.h */ glx@9505: truelight@0: #ifndef NEWS_H truelight@0: #define NEWS_H truelight@0: truelight@0: struct NewsItem { truelight@0: StringID string_id; truelight@0: uint16 duration; rubidium@4289: Date date; truelight@0: byte flags; truelight@0: byte display_mode; truelight@0: byte type; truelight@0: byte callback; truelight@0: truelight@0: TileIndex data_a; truelight@0: TileIndex data_b; truelight@0: glx@9629: uint64 params[10]; truelight@0: }; truelight@0: dominik@715: typedef bool ValidationProc ( uint data_a, uint data_b ); dominik@715: typedef void DrawNewsCallbackProc(Window *w); Darkvater@2101: typedef StringID GetNewsStringCallbackProc(const NewsItem *ni); truelight@0: rubidium@9601: #define NEWS_FLAGS(mode, flag, type, cb) ((cb) << 24 | (type) << 16 | (flag) << 8 | (mode)) truelight@0: void AddNewsItem(StringID string, uint32 flags, uint data_a, uint data_b); rubidium@6573: void NewsLoop(); tron@427: void DrawNewsBorder(const Window *w); rubidium@6573: void InitNewsItemStructs(); truelight@0: truelight@0: VARDEF NewsItem _statusbar_news_item; truelight@0: Darkvater@4873: enum NewsType { belugas@6605: NT_ARRIVAL_PLAYER, belugas@6605: NT_ARRIVAL_OTHER, belugas@6605: NT_ACCIDENT, belugas@6605: NT_COMPANY_INFO, truelight@6609: NT_OPENCLOSE, belugas@6605: NT_ECONOMY, belugas@6605: NT_ADVICE, belugas@6605: NT_NEW_VEHICLES, belugas@6605: NT_ACCEPTANCE, belugas@6605: NT_SUBSIDIES, belugas@6605: NT_GENERAL, belugas@6605: NT_END, truelight@0: }; truelight@0: truelight@6609: extern const char *_news_display_name[NT_END]; truelight@6609: truelight@0: enum NewsMode { Darkvater@4873: NM_SMALL = 0, ///< Show only a small popup informing us about vehicle age for example Darkvater@4873: NM_NORMAL = 1, ///< Show a simple news message (height 170 pixels) Darkvater@4873: NM_THIN = 2, ///< Show a simple news message (height 130 pixels) Darkvater@4873: NM_CALLBACK = 3, ///< Do some special processing before displaying news message. Which callback to call is in NewsCallback truelight@0: }; truelight@0: truelight@0: enum NewsFlags { Darkvater@4873: NF_VIEWPORT = (1 << 1), ///< Does the news message have a viewport? (ingame picture of happening) Darkvater@4873: NF_TILE = (1 << 2), ///< When clicked on the news message scroll to a given tile? Tile is in data_a/data_b Darkvater@4873: NF_VEHICLE = (1 << 3), ///< When clicked on the message scroll to the vehicle? VehicleID is in data_a Darkvater@4873: NF_FORCE_BIG = (1 << 4), ///< Force the appearance of a news message if it has already been shown (internal) Darkvater@4874: NF_INCOLOR = (1 << 5), ///< Show the newsmessage in colour, otherwise it defaults to black & white truelight@0: }; truelight@0: Darkvater@4873: enum NewsCallback { rubidium@6535: DNC_VEHICLEAVAIL = 0, ///< Show new vehicle available message. StringID is EngineID rubidium@6535: DNC_BANKRUPCY = 1, ///< Show bankrupcy message. StringID is PlayerID (0-3) and NewsBankrupcy (4-7) Darkvater@4873: }; Darkvater@4873: Darkvater@4873: enum NewsBankrupcy { Darkvater@4873: NB_BTROUBLE = (1 << 4), ///< Company is in trouble (warning) Darkvater@4873: NB_BMERGER = (2 << 4), ///< Company has been bought by another company Darkvater@4873: NB_BBANKRUPT = (3 << 4), ///< Company has gone bankrupt Darkvater@4873: NB_BNEWCOMPANY = (4 << 4), ///< A new company has been started truelight@0: }; truelight@0: tron@3139: /** tron@3139: * Delete a news item type about a vehicle tron@3139: * if the news item type is INVALID_STRING_ID all news about the vehicle get tron@3139: * deleted tron@3139: */ tron@3139: void DeleteVehicleNews(VehicleID, StringID news); tron@3139: truelight@0: #endif /* NEWS_H */