From 373343cef606e940bfc99aa813cd05d36b15cb45 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 15 May 2008 13:39:36 +0000 Subject: (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls. --- src/news_type.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'src/news_type.h') diff --git a/src/news_type.h b/src/news_type.h index cc25835c7..1f98d40c7 100644 --- a/src/news_type.h +++ b/src/news_type.h @@ -31,6 +31,31 @@ enum NewsType { NT_END, ///< end-of-array marker }; +/** + * News subtypes. + */ +enum NewsSubtype { + NS_ARRIVAL_PLAYER, ///< NT_ARRIVAL_PLAYER + NS_ARRIVAL_OTHER, ///< NT_ARRIVAL_OTHER + NS_ACCIDENT_TILE, ///< NT_ACCIDENT (tile) + NS_ACCIDENT_VEHICLE, ///< NT_ACCIDENT (vehicle) + NS_COMPANY_TROUBLE, ///< NT_COMPANY_INFO (trouble) + NS_COMPANY_MERGER, ///< NT_COMPANY_INFO (merger) + NS_COMPANY_BANKRUPT, ///< NT_COMPANY_INFO (bankrupt) + NS_COMPANY_NEW, ///< NT_COMPANY_INFO (new company) + NS_OPENCLOSE, ///< NT_OPENCLOSE + NS_ECONOMY, ///< NT_ECONOMY + NS_INDUSTRY_PLAYER, ///< NT_INDUSTRY_PLAYER + NS_INDUSTRY_OTHER, ///< NT_INDUSTRY_OTHER + NS_INDUSTRY_NOBODY, ///< NT_INDUSTRY_NOBODY + NS_ADVICE, ///< NT_ADVICE + NS_NEW_VEHICLES, ///< NT_NEW_VEHICLES + NS_ACCEPTANCE, ///< NT_ACCEPTANCE + NS_SUBSIDIES, ///< NT_SUBSIDIES + NS_GENERAL, ///< NT_GENERAL + NS_END, ///< end-of-array marker +}; + /** * News mode. */ @@ -100,10 +125,8 @@ struct NewsItem { StringID string_id; ///< Message text uint16 duration; ///< Remaining time for showing this news message Date date; ///< Date of the news + NewsSubtype subtype; ///< News subtype @see NewsSubtype NewsFlag flags; ///< NewsFlags bits @see NewsFlag - NewsMode display_mode; ///< Display mode value @see NewsMode - NewsType type; ///< News category @see NewsType - NewsCallback callback; ///< Call-back function uint data_a; ///< Custom data 1 (usually tile or vehicle) uint data_b; ///< Custom data 2 -- cgit v1.2.3-70-g09d2