# news.h

Go to the documentation of this file.

    00001 /* $Id: news.h 11834 2008-01-13 14:37:30Z rubidium $ */
    00002
    00005 #ifndef NEWS_H
    00006 #define NEWS_H
    00007
    00008 #include "window_type.h"
    00009 #include "vehicle_type.h"
    00010 #include "tile_type.h"
    00011 #include "date_type.h"
    00012 #include "strings_type.h"
    00013
    00014 struct NewsItem {
    00015   StringID string_id;
    00016   uint16 duration;
    00017   Date date;
    00018   byte flags;
    00019   byte display_mode;
    00020   byte type;
    00021   byte callback;
    00022
    00023   TileIndex data_a;
    00024   TileIndex data_b;
    00025
    00026   uint64 params[10];
    00027 };
    00028
    00029 typedef bool ValidationProc ( uint data_a, uint data_b );
    00030 typedef void DrawNewsCallbackProc(Window *w);
    00031 typedef StringID GetNewsStringCallbackProc(const NewsItem *ni);
    00032
    00045 #define NEWS_FLAGS(mode, flag, type, cb) ((cb) << 24 | (type) << 16 | (flag) << 8 | (mode))
    00046
    00047 void AddNewsItem(StringID string, uint32 flags, uint data_a, uint data_b);
    00048 void NewsLoop();
    00049 void DrawNewsBorder(const Window *w);
    00050 void InitNewsItemStructs();
    00051
    00052 extern NewsItem _statusbar_news_item;
    00053 extern uint32 _news_display_opt;
    00054 extern bool _news_ticker_sound;
    00055
    00057 enum NewsType {
    00058   NT_ARRIVAL_PLAYER,
    00059   NT_ARRIVAL_OTHER,
    00060   NT_ACCIDENT,
    00061   NT_COMPANY_INFO,
    00062   NT_OPENCLOSE,
    00063   NT_ECONOMY,
    00064   NT_INDUSTRY_PLAYER,
    00065   NT_INDUSTRY_OTHER,
    00066   NT_INDUSTRY_NOBODY,
    00067   NT_ADVICE,
    00068   NT_NEW_VEHICLES,
    00069   NT_ACCEPTANCE,
    00070   NT_SUBSIDIES,
    00071   NT_GENERAL,
    00072   NT_END,
    00073 };
    00074
    00075 extern const char *_news_display_name[NT_END];
    00076
    00081 enum NewsMode {
    00082   NM_SMALL    = 0,
    00083   NM_NORMAL   = 1,
    00084   NM_THIN     = 2,
    00085   NM_CALLBACK = 3,
    00086 };
    00087
    00093 enum NewsFlags {
    00094   NF_VIEWPORT  = (1 << 1),
    00095   NF_TILE      = (1 << 2),
    00096   NF_VEHICLE   = (1 << 3),
    00097   NF_FORCE_BIG = (1 << 4),
    00098   NF_INCOLOR   = (1 << 5),
    00099 };
    00100
    00102 enum NewsCallback {
    00103   DNC_VEHICLEAVAIL  = 0,
    00104   DNC_BANKRUPCY     = 1,
    00105 };
    00106
    00108 enum NewsBankrupcy {
    00109   NB_BTROUBLE    = (1 << 4),
    00110   NB_BMERGER     = (2 << 4),
    00111   NB_BBANKRUPT   = (3 << 4),
    00112   NB_BNEWCOMPANY = (4 << 4),
    00113 };
    00114
    00120 void DeleteVehicleNews(VehicleID, StringID news);
    00121
    00122 #endif /* NEWS_H */