src/news_type.h
branchnoai
changeset 10294 7798ae816af8
parent 10181 54df587fef5d
child 10513 33cb70ff2f5d
child 10724 68a692eacf22
equal deleted inserted replaced
10292:7856e972f8aa 10294:7798ae816af8
     6 #define NEWS_TYPE_H
     6 #define NEWS_TYPE_H
     7 
     7 
     8 #include "window_type.h"
     8 #include "window_type.h"
     9 #include "date_type.h"
     9 #include "date_type.h"
    10 #include "strings_type.h"
    10 #include "strings_type.h"
       
    11 #include "sound_type.h"
    11 
    12 
    12 /**
    13 /**
    13  * Type of news.
    14  * Type of news.
    14  */
    15  */
    15 enum NewsType {
    16 enum NewsType {
    73 	NB_BMERGER     = (2 << 4), ///< Company has been bought by another company
    74 	NB_BMERGER     = (2 << 4), ///< Company has been bought by another company
    74 	NB_BBANKRUPT   = (3 << 4), ///< Company has gone bankrupt
    75 	NB_BBANKRUPT   = (3 << 4), ///< Company has gone bankrupt
    75 	NB_BNEWCOMPANY = (4 << 4), ///< A new company has been started
    76 	NB_BNEWCOMPANY = (4 << 4), ///< A new company has been started
    76 };
    77 };
    77 
    78 
       
    79 /**
       
    80  * News display options
       
    81  */
       
    82 enum NewsDisplay {
       
    83 	ND_OFF,        ///< Only show a reminder in the status bar
       
    84 	ND_SUMMARY,    ///< Show ticker
       
    85 	ND_FULL,       ///< Show newspaper
       
    86 };
       
    87 
       
    88 /**
       
    89  * Per-NewsType data
       
    90  */
       
    91 struct NewsTypeData {
       
    92 	const char *const name; ///< Name
       
    93 	const byte age;         ///< Maximum age of news items (in days)
       
    94 	const SoundFx sound;    ///< Sound
       
    95 	NewsDisplay display;    ///< Display mode (off, summary, full)
       
    96 };
       
    97 
    78 struct NewsItem {
    98 struct NewsItem {
    79 	StringID string_id;    ///< Message text (sometimes also used for storing other info)
    99 	StringID string_id;    ///< Message text (sometimes also used for storing other info)
    80 	uint16 duration;       ///< Remaining time for showing this news message
   100 	uint16 duration;       ///< Remaining time for showing this news message
    81 	Date date;             ///< Date of the news
   101 	Date date;             ///< Date of the news
    82 	NewsFlag flags;        ///< NewsFlags bits @see NewsFlag
   102 	NewsFlag flags;        ///< NewsFlags bits @see NewsFlag