tron@2186: /* $Id$ */ tron@2186: 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: truelight@0: uint32 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: truelight@0: #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); tron@427: void NewsLoop(void); tron@427: void DrawNewsBorder(const Window *w); tron@427: void InitNewsItemStructs(void); truelight@0: truelight@0: VARDEF NewsItem _statusbar_news_item; truelight@0: Darkvater@4873: enum NewsType { truelight@0: NT_ARRIVAL_PLAYER = 0, rubidium@4344: NT_ARRIVAL_OTHER = 1, rubidium@4344: NT_ACCIDENT = 2, rubidium@4344: NT_COMPANY_INFO = 3, rubidium@4344: NT_ECONOMY = 4, rubidium@4344: NT_ADVICE = 5, rubidium@4344: NT_NEW_VEHICLES = 6, rubidium@4344: NT_ACCEPTANCE = 7, rubidium@4344: NT_SUBSIDIES = 8, rubidium@4344: NT_GENERAL = 9, truelight@0: }; truelight@0: 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 { Darkvater@4873: DNC_TRAINAVAIL = 0, ///< Show new train available message. StringID is EngineID Darkvater@4873: DNC_ROADAVAIL = 1, ///< Show new road vehicle available message. StringID is EngineID Darkvater@4873: DNC_SHIPAVAIL = 2, ///< Show new ship available message. StringID is EngineID Darkvater@4873: DNC_AIRCRAFTAVAIL = 3, ///< Show new aircraft available message. StringID is EngineID Darkvater@4873: DNC_BANKRUPCY = 4, ///< 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 */