rubidium@9826: /* $Id$ */ rubidium@9826: rubidium@9826: /** @file news_type.h Types related to news. */ rubidium@9826: rubidium@9826: #ifndef NEWS_TYPE_H rubidium@9826: #define NEWS_TYPE_H rubidium@9826: rubidium@9826: #include "date_type.h" rubidium@9826: #include "strings_type.h" glx@10294: #include "sound_type.h" rubidium@9826: rubidium@9826: /** rubidium@9826: * Type of news. rubidium@9826: */ rubidium@9826: enum NewsType { rubidium@9826: NT_ARRIVAL_PLAYER, ///< Cargo arrived for player rubidium@9826: NT_ARRIVAL_OTHER, ///< Cargo arrived for competitor rubidium@9826: NT_ACCIDENT, ///< An accident or disaster has occurred rubidium@9826: NT_COMPANY_INFO, ///< Company info (new companies, bankrupcy messages) rubidium@9826: NT_OPENCLOSE, ///< Opening and closing of industries rubidium@9826: NT_ECONOMY, ///< Economic changes (recession, industry up/dowm) rubidium@9826: NT_INDUSTRY_PLAYER, ///< Production changes of industry serviced by local player rubidium@9826: NT_INDUSTRY_OTHER, ///< Production changes of industry serviced by competitor(s) rubidium@9826: NT_INDUSTRY_NOBODY, ///< Other industry production changes rubidium@9826: NT_ADVICE, ///< Bits of news about vehicles of the player rubidium@9826: NT_NEW_VEHICLES, ///< New vehicle has become available rubidium@9826: NT_ACCEPTANCE, ///< A type of cargo is (no longer) accepted rubidium@9826: NT_SUBSIDIES, ///< News about subsidies (announcements, expirations, acceptance) rubidium@9826: NT_GENERAL, ///< General news (from towns) rubidium@9826: NT_END, ///< end-of-array marker rubidium@9826: }; rubidium@9826: rubidium@9826: /** glx@10645: * News subtypes. glx@10645: */ glx@10645: enum NewsSubtype { glx@10645: NS_ARRIVAL_PLAYER, ///< NT_ARRIVAL_PLAYER glx@10645: NS_ARRIVAL_OTHER, ///< NT_ARRIVAL_OTHER glx@10645: NS_ACCIDENT_TILE, ///< NT_ACCIDENT (tile) glx@10645: NS_ACCIDENT_VEHICLE, ///< NT_ACCIDENT (vehicle) glx@10645: NS_COMPANY_TROUBLE, ///< NT_COMPANY_INFO (trouble) glx@10645: NS_COMPANY_MERGER, ///< NT_COMPANY_INFO (merger) glx@10645: NS_COMPANY_BANKRUPT, ///< NT_COMPANY_INFO (bankrupt) glx@10645: NS_COMPANY_NEW, ///< NT_COMPANY_INFO (new company) glx@10645: NS_OPENCLOSE, ///< NT_OPENCLOSE glx@10645: NS_ECONOMY, ///< NT_ECONOMY glx@10645: NS_INDUSTRY_PLAYER, ///< NT_INDUSTRY_PLAYER glx@10645: NS_INDUSTRY_OTHER, ///< NT_INDUSTRY_OTHER glx@10645: NS_INDUSTRY_NOBODY, ///< NT_INDUSTRY_NOBODY glx@10645: NS_ADVICE, ///< NT_ADVICE glx@10645: NS_NEW_VEHICLES, ///< NT_NEW_VEHICLES glx@10645: NS_ACCEPTANCE, ///< NT_ACCEPTANCE glx@10645: NS_SUBSIDIES, ///< NT_SUBSIDIES glx@10645: NS_GENERAL, ///< NT_GENERAL glx@10645: NS_END, ///< end-of-array marker glx@10645: }; glx@10645: glx@10645: /** rubidium@9826: * News mode. rubidium@9826: */ rubidium@9826: enum NewsMode { rubidium@9826: NM_SMALL = 0, ///< Show only a small popup informing us about vehicle age for example rubidium@9826: NM_NORMAL = 1, ///< Show a simple news message (height 170 pixels) rubidium@9826: NM_THIN = 2, ///< Show a simple news message (height 130 pixels) rubidium@9826: NM_CALLBACK = 3, ///< Do some special processing before displaying news message. Which callback to call is in NewsCallback rubidium@9826: }; rubidium@9826: rubidium@9826: /** rubidium@9826: * Various OR-able news-item flags. rubidium@9826: * note: NF_INCOLOR is set automatically if needed rubidium@9826: */ rubidium@9826: enum NewsFlag { rubidium@9826: NF_NONE = 0, ///< No flag is set. rubidium@9826: NF_VIEWPORT = (1 << 1), ///< Does the news message have a viewport? (ingame picture of happening) rubidium@10513: NF_TILE = (1 << 2), ///< When clicked on the news message scroll to a given tile? Tile is in data_a rubidium@9826: NF_VEHICLE = (1 << 3), ///< When clicked on the message scroll to the vehicle? VehicleID is in data_a rubidium@9826: NF_FORCE_BIG = (1 << 4), ///< Force the appearance of a news message if it has already been shown (internal) rubidium@9826: NF_INCOLOR = (1 << 5), ///< Show the newsmessage in colour, otherwise it defaults to black & white rubidium@10513: NF_TILE2 = (1 << 6), ///< There is a second tile to scroll to; tile is in data_b rubidium@9826: }; rubidium@9826: DECLARE_ENUM_AS_BIT_SET(NewsFlag); rubidium@9826: rubidium@9826: rubidium@9826: /** glx@10294: * News display options glx@10294: */ glx@10294: enum NewsDisplay { glx@10294: ND_OFF, ///< Only show a reminder in the status bar glx@10294: ND_SUMMARY, ///< Show ticker glx@10294: ND_FULL, ///< Show newspaper glx@10294: }; glx@10294: glx@10294: /** glx@10294: * Per-NewsType data glx@10294: */ glx@10294: struct NewsTypeData { glx@10294: const char *const name; ///< Name glx@10294: const byte age; ///< Maximum age of news items (in days) glx@10294: const SoundFx sound; ///< Sound glx@10294: NewsDisplay display; ///< Display mode (off, summary, full) glx@10294: }; glx@10294: rubidium@9826: struct NewsItem { glx@10645: StringID string_id; ///< Message text rubidium@9826: uint16 duration; ///< Remaining time for showing this news message rubidium@9826: Date date; ///< Date of the news glx@10645: NewsSubtype subtype; ///< News subtype @see NewsSubtype rubidium@9826: NewsFlag flags; ///< NewsFlags bits @see NewsFlag rubidium@9826: glx@10645: uint data_a; ///< Custom data 1 (usually tile or vehicle) glx@10645: uint data_b; ///< Custom data 2 rubidium@9826: rubidium@9826: uint64 params[10]; rubidium@9826: }; rubidium@9826: rubidium@9826: #endif /* NEWS_TYPE_H */