summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-06-05 16:55:00 +0000
committerrubidium <rubidium@openttd.org>2008-06-05 16:55:00 +0000
commit5176319dd5145138604dd48c44b056693d900b10 (patch)
tree92da1088e8b4dff853a3ec762efea60c8297d9d6
parent261018fc8c0d8a1d366de834d71865bce55bfde3 (diff)
downloadopenttd-5176319dd5145138604dd48c44b056693d900b10.tar.xz
(svn r13389) -Codechange: remove NM_CALLBACK because that information could be gathered from the fact that a callback has been specified. Patch by Cirdan.
-rw-r--r--src/news_gui.cpp21
-rw-r--r--src/news_type.h1
2 files changed, 10 insertions, 12 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index 9aefd3ef4..33713f45f 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -128,17 +128,17 @@ static const struct NewsSubtypeData _news_subtype_data[NS_END] = {
{ NT_ARRIVAL_OTHER, NM_THIN, NF_VIEWPORT|NF_VEHICLE, NULL }, ///< NS_ARRIVAL_OTHER
{ NT_ACCIDENT, NM_THIN, NF_VIEWPORT|NF_TILE, NULL }, ///< NS_ACCIDENT_TILE
{ NT_ACCIDENT, NM_THIN, NF_VIEWPORT|NF_VEHICLE, NULL }, ///< NS_ACCIDENT_VEHICLE
- { NT_COMPANY_INFO, NM_CALLBACK, NF_NONE, DrawNewsBankrupcy }, ///< NS_COMPANY_TROUBLE
- { NT_COMPANY_INFO, NM_CALLBACK, NF_NONE, DrawNewsBankrupcy }, ///< NS_COMPANY_MERGER
- { NT_COMPANY_INFO, NM_CALLBACK, NF_NONE, DrawNewsBankrupcy }, ///< NS_COMPANY_BANKRUPT
- { NT_COMPANY_INFO, NM_CALLBACK, NF_TILE, DrawNewsBankrupcy }, ///< NS_COMPANY_NEW
+ { NT_COMPANY_INFO, NM_NORMAL, NF_NONE, DrawNewsBankrupcy }, ///< NS_COMPANY_TROUBLE
+ { NT_COMPANY_INFO, NM_NORMAL, NF_NONE, DrawNewsBankrupcy }, ///< NS_COMPANY_MERGER
+ { NT_COMPANY_INFO, NM_NORMAL, NF_NONE, DrawNewsBankrupcy }, ///< NS_COMPANY_BANKRUPT
+ { NT_COMPANY_INFO, NM_NORMAL, NF_TILE, DrawNewsBankrupcy }, ///< NS_COMPANY_NEW
{ NT_OPENCLOSE, NM_THIN, NF_VIEWPORT|NF_TILE, NULL }, ///< NS_OPENCLOSE
{ NT_ECONOMY, NM_NORMAL, NF_NONE, NULL }, ///< NS_ECONOMY
{ NT_INDUSTRY_PLAYER, NM_THIN, NF_VIEWPORT|NF_TILE, NULL }, ///< NS_INDUSTRY_PLAYER
{ NT_INDUSTRY_OTHER, NM_THIN, NF_VIEWPORT|NF_TILE, NULL }, ///< NS_INDUSTRY_OTHER
{ NT_INDUSTRY_NOBODY, NM_THIN, NF_VIEWPORT|NF_TILE, NULL }, ///< NS_INDUSTRY_NOBODY
{ NT_ADVICE, NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NULL }, ///< NS_ADVICE
- { NT_NEW_VEHICLES, NM_CALLBACK, NF_NONE, DrawNewsNewVehicleAvail }, ///< NS_NEW_VEHICLES
+ { NT_NEW_VEHICLES, NM_NORMAL, NF_NONE, DrawNewsNewVehicleAvail }, ///< NS_NEW_VEHICLES
{ NT_ACCEPTANCE, NM_SMALL, NF_VIEWPORT|NF_TILE, NULL }, ///< NS_ACCEPTANCE
{ NT_SUBSIDIES, NM_NORMAL, NF_TILE|NF_TILE2, NULL }, ///< NS_SUBSIDIES
{ NT_GENERAL, NM_NORMAL, NF_TILE, NULL }, ///< NS_GENERAL
@@ -208,6 +208,11 @@ struct NewsWindow : Window {
case NM_THIN: {
this->DrawNewsBorder();
+ if (_news_subtype_data[this->ni->subtype].callback != NULL) {
+ (_news_subtype_data[this->ni->subtype].callback)(this, ni);
+ break;
+ }
+
DrawString(2, 1, STR_00C6, TC_FROMSTRING);
SetDParam(0, this->ni->date);
@@ -237,11 +242,6 @@ struct NewsWindow : Window {
break;
}
- case NM_CALLBACK:
- this->DrawNewsBorder();
- (_news_subtype_data[this->ni->subtype].callback)(this, ni);
- break;
-
default:
this->DrawWidgets();
if (!(this->ni->flags & NF_VIEWPORT)) {
@@ -371,7 +371,6 @@ static void ShowNewspaper(NewsItem *ni)
Window *w;
switch (_news_subtype_data[ni->subtype].display_mode) {
case NM_NORMAL:
- case NM_CALLBACK:
_news_type13_desc.top = top;
w = new NewsWindow(&_news_type13_desc, ni);
if (ni->flags & NF_VIEWPORT) {
diff --git a/src/news_type.h b/src/news_type.h
index b00115e39..975011899 100644
--- a/src/news_type.h
+++ b/src/news_type.h
@@ -62,7 +62,6 @@ enum NewsMode {
NM_SMALL = 0, ///< Show only a small popup informing us about vehicle age for example
NM_NORMAL = 1, ///< Show a simple news message (height 170 pixels)
NM_THIN = 2, ///< Show a simple news message (height 130 pixels)
- NM_CALLBACK = 3, ///< Do some special processing before displaying news message. Which callback to call is in NewsCallback
};
/**