#include "window_type.h"
#include "vehicle_type.h"
#include "tile_type.h"
#include "date_type.h"
#include "strings_type.h"
Go to the source code of this file.
Data Structures | |
struct | NewsItem |
Defines | |
#define | NEWS_FLAGS(mode, flag, type, cb) ((cb) << 24 | (type) << 16 | (flag) << 8 | (mode)) |
Macro for creating news flags. | |
Typedefs | |
typedef bool | ValidationProc (uint data_a, uint data_b) |
typedef void | DrawNewsCallbackProc (Window *w) |
typedef StringID | GetNewsStringCallbackProc (const NewsItem *ni) |
Enumerations | |
enum | NewsType { NT_ARRIVAL_PLAYER, NT_ARRIVAL_OTHER, NT_ACCIDENT, NT_COMPANY_INFO, NT_OPENCLOSE, NT_ECONOMY, NT_INDUSTRY_PLAYER, NT_INDUSTRY_OTHER, NT_INDUSTRY_NOBODY, NT_ADVICE, NT_NEW_VEHICLES, NT_ACCEPTANCE, NT_SUBSIDIES, NT_GENERAL, NT_END } |
Type of news. More... | |
enum | NewsMode { NM_SMALL = 0, NM_NORMAL = 1, NM_THIN = 2, NM_CALLBACK = 3 } |
News mode. More... | |
enum | NewsFlags { NF_VIEWPORT = (1 << 1), NF_TILE = (1 << 2), NF_VEHICLE = (1 << 3), NF_FORCE_BIG = (1 << 4), NF_INCOLOR = (1 << 5) } |
Various OR-able news-item flags. More... | |
enum | NewsCallback { DNC_VEHICLEAVAIL = 0, DNC_BANKRUPCY = 1 } |
Special news items. More... | |
enum | NewsBankrupcy { NB_BTROUBLE = (1 << 4), NB_BMERGER = (2 << 4), NB_BBANKRUPT = (3 << 4), NB_BNEWCOMPANY = (4 << 4) } |
Kinds of bankrupcy. More... | |
Functions | |
void | AddNewsItem (StringID string, uint32 flags, uint data_a, uint data_b) |
Add a new newsitem to be shown. | |
void | NewsLoop () |
void | DrawNewsBorder (const Window *w) |
void | InitNewsItemStructs () |
Initialize the news-items data structures. | |
void | DeleteVehicleNews (VehicleID, StringID news) |
Delete a news item type about a vehicle if the news item type is INVALID_STRING_ID all news about the vehicle get deleted. | |
Variables | |
NewsItem | _statusbar_news_item |
uint32 | _news_display_opt |
bool | _news_ticker_sound |
const char * | _news_display_name [NT_END] |
Definition in file news.h.
#define NEWS_FLAGS | ( | mode, | |||
flag, | |||||
type, | |||||
cb | ) | ((cb) << 24 | (type) << 16 | (flag) << 8 | (mode)) |
Macro for creating news flags.
mode | (bits 0 - 7) Display_mode, one of the NewsMode enums (NM_) | |
flag | (bits 8 - 15) OR-able news flags, any of the NewsFlags enums (NF_) | |
type | (bits 16-23) News category, one of the NewsType enums (NT_) | |
cb | (bits 24-31) Call-back function, one of the NewsCallback enums (DNC_) or 0 if no callback |
Definition at line 45 of file news.h.
Referenced by AircraftEntersTerminal(), ChangeIndustryProduction(), CheckOrders(), CheckSwitchToEuro(), CheckTrainCollision(), CmdBuildIndustry(), CmdPlayerCtrl(), Disaster_CoalMine_Init(), DisasterTick_Airplane(), DisasterTick_Big_Ufo(), DisasterTick_Helicopter(), DisasterTick_Ufo(), DisasterTick_Zeppeliner(), MaybeNewIndustry(), ReportNewsProductionChangeIndustry(), and ShowRejectOrAcceptNews().
enum NewsBankrupcy |
enum NewsCallback |
enum NewsFlags |
Various OR-able news-item flags.
note: NF_INCOLOR is set automatically if needed
NF_VIEWPORT | Does the news message have a viewport? (ingame picture of happening). |
NF_TILE | When clicked on the news message scroll to a given tile? Tile is in data_a/data_b. |
NF_VEHICLE | When clicked on the message scroll to the vehicle? VehicleID is in data_a. |
NF_FORCE_BIG | Force the appearance of a news message if it has already been shown (internal). |
NF_INCOLOR | Show the newsmessage in colour, otherwise it defaults to black & white. |
enum NewsMode |
News mode.
enum NewsType |
Type of news.
void AddNewsItem | ( | StringID | string, | |
uint32 | flags, | |||
uint | data_a, | |||
uint | data_b | |||
) |
Add a new newsitem to be shown.
string | String to display, can have special values based on parameter flags | |
flags | various control bits that will show various news-types. See macro NEWS_FLAGS() | |
data_a | news-specific value based on news type | |
data_b | news-specific value based on news type |
Definition at line 281 of file news_gui.cpp.
References _current_news, _forced_news, _latest_news, _news_items, _oldest_news, _total_news, increaseIndex(), MAX_NEWS, MoveToNextItem(), NF_INCOLOR, and SetWindowDirty().
Referenced by AircraftEntersTerminal(), ChangeIndustryProduction(), CheckOrders(), CheckSwitchToEuro(), CheckTrainCollision(), CmdBuildIndustry(), CmdPlayerCtrl(), Disaster_CoalMine_Init(), DisasterTick_Airplane(), DisasterTick_Big_Ufo(), DisasterTick_Helicopter(), DisasterTick_Ufo(), DisasterTick_Zeppeliner(), MaybeNewIndustry(), ReportNewsProductionChangeIndustry(), and ShowRejectOrAcceptNews().