mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r17199) -Codechange: Remove NF_VIEWPORT since it is implied by the news mode.
This commit is contained in:
parent
098756b84b
commit
3409385e1d
|
@ -123,25 +123,25 @@ struct NewsSubtypeData {
|
||||||
* Data common to all news items of a given subtype (actual data)
|
* Data common to all news items of a given subtype (actual data)
|
||||||
*/
|
*/
|
||||||
static const NewsSubtypeData _news_subtype_data[] = {
|
static const NewsSubtypeData _news_subtype_data[] = {
|
||||||
/* type, display_mode, flags, callback */
|
/* type, display_mode, flags, callback */
|
||||||
{ NT_ARRIVAL_COMPANY, NM_THIN, NF_VIEWPORT, NULL }, ///< NS_ARRIVAL_COMPANY
|
{ NT_ARRIVAL_COMPANY, NM_THIN, NF_NONE, NULL }, ///< NS_ARRIVAL_COMPANY
|
||||||
{ NT_ARRIVAL_OTHER, NM_THIN, NF_VIEWPORT, NULL }, ///< NS_ARRIVAL_OTHER
|
{ NT_ARRIVAL_OTHER, NM_THIN, NF_NONE, NULL }, ///< NS_ARRIVAL_OTHER
|
||||||
{ NT_ACCIDENT, NM_THIN, NF_VIEWPORT, NULL }, ///< NS_ACCIDENT
|
{ NT_ACCIDENT, NM_THIN, NF_NONE, NULL }, ///< NS_ACCIDENT
|
||||||
{ NT_COMPANY_INFO, NM_NORMAL, NF_NONE, DrawNewsBankrupcy }, ///< NS_COMPANY_TROUBLE
|
{ 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_MERGER
|
||||||
{ NT_COMPANY_INFO, NM_NORMAL, NF_NONE, DrawNewsBankrupcy }, ///< NS_COMPANY_BANKRUPT
|
{ NT_COMPANY_INFO, NM_NORMAL, NF_NONE, DrawNewsBankrupcy }, ///< NS_COMPANY_BANKRUPT
|
||||||
{ NT_COMPANY_INFO, NM_NORMAL, NF_NONE, DrawNewsBankrupcy }, ///< NS_COMPANY_NEW
|
{ NT_COMPANY_INFO, NM_NORMAL, NF_NONE, DrawNewsBankrupcy }, ///< NS_COMPANY_NEW
|
||||||
{ NT_INDUSTRY_OPEN, NM_THIN, NF_VIEWPORT, NULL }, ///< NS_INDUSTRY_OPEN
|
{ NT_INDUSTRY_OPEN, NM_THIN, NF_NONE, NULL }, ///< NS_INDUSTRY_OPEN
|
||||||
{ NT_INDUSTRY_CLOSE, NM_THIN, NF_VIEWPORT, NULL }, ///< NS_INDUSTRY_CLOSE
|
{ NT_INDUSTRY_CLOSE, NM_THIN, NF_NONE, NULL }, ///< NS_INDUSTRY_CLOSE
|
||||||
{ NT_ECONOMY, NM_NORMAL, NF_NONE, NULL }, ///< NS_ECONOMY
|
{ NT_ECONOMY, NM_NORMAL, NF_NONE, NULL }, ///< NS_ECONOMY
|
||||||
{ NT_INDUSTRY_COMPANY, NM_THIN, NF_VIEWPORT, NULL }, ///< NS_INDUSTRY_COMPANY
|
{ NT_INDUSTRY_COMPANY, NM_THIN, NF_NONE, NULL }, ///< NS_INDUSTRY_COMPANY
|
||||||
{ NT_INDUSTRY_OTHER, NM_THIN, NF_VIEWPORT, NULL }, ///< NS_INDUSTRY_OTHER
|
{ NT_INDUSTRY_OTHER, NM_THIN, NF_NONE, NULL }, ///< NS_INDUSTRY_OTHER
|
||||||
{ NT_INDUSTRY_NOBODY, NM_THIN, NF_VIEWPORT, NULL }, ///< NS_INDUSTRY_NOBODY
|
{ NT_INDUSTRY_NOBODY, NM_THIN, NF_NONE, NULL }, ///< NS_INDUSTRY_NOBODY
|
||||||
{ NT_ADVICE, NM_SMALL, NF_VIEWPORT, NULL }, ///< NS_ADVICE
|
{ NT_ADVICE, NM_SMALL, NF_NONE, NULL }, ///< NS_ADVICE
|
||||||
{ NT_NEW_VEHICLES, NM_NORMAL, NF_NONE, DrawNewsNewVehicleAvail }, ///< NS_NEW_VEHICLES
|
{ NT_NEW_VEHICLES, NM_NORMAL, NF_NONE, DrawNewsNewVehicleAvail }, ///< NS_NEW_VEHICLES
|
||||||
{ NT_ACCEPTANCE, NM_SMALL, NF_VIEWPORT, NULL }, ///< NS_ACCEPTANCE
|
{ NT_ACCEPTANCE, NM_SMALL, NF_NONE, NULL }, ///< NS_ACCEPTANCE
|
||||||
{ NT_SUBSIDIES, NM_NORMAL, NF_NONE, NULL }, ///< NS_SUBSIDIES
|
{ NT_SUBSIDIES, NM_NORMAL, NF_NONE, NULL }, ///< NS_SUBSIDIES
|
||||||
{ NT_GENERAL, NM_NORMAL, NF_NONE, NULL }, ///< NS_GENERAL
|
{ NT_GENERAL, NM_NORMAL, NF_NONE, NULL }, ///< NS_GENERAL
|
||||||
};
|
};
|
||||||
|
|
||||||
assert_compile(lengthof(_news_subtype_data) == NS_END);
|
assert_compile(lengthof(_news_subtype_data) == NS_END);
|
||||||
|
@ -231,7 +231,7 @@ struct NewsWindow : Window {
|
||||||
SetDParam(0, this->ni->date);
|
SetDParam(0, this->ni->date);
|
||||||
DrawString(2, this->width - 2, 1, STR_DATE_LONG_SMALL, TC_FROMSTRING, SA_RIGHT);
|
DrawString(2, this->width - 2, 1, STR_DATE_LONG_SMALL, TC_FROMSTRING, SA_RIGHT);
|
||||||
|
|
||||||
if (!(this->ni->flags & NF_VIEWPORT)) {
|
if (display_mode == NM_NORMAL) {
|
||||||
CopyInDParam(0, this->ni->params, lengthof(this->ni->params));
|
CopyInDParam(0, this->ni->params, lengthof(this->ni->params));
|
||||||
DrawStringMultiLine(2, this->width - 2, 20, this->height, this->ni->string_id, TC_FROMSTRING, SA_CENTER);
|
DrawStringMultiLine(2, this->width - 2, 20, this->height, this->ni->string_id, TC_FROMSTRING, SA_CENTER);
|
||||||
} else {
|
} else {
|
||||||
|
@ -256,14 +256,9 @@ struct NewsWindow : Window {
|
||||||
|
|
||||||
case NM_SMALL:
|
case NM_SMALL:
|
||||||
this->DrawWidgets();
|
this->DrawWidgets();
|
||||||
if (!(this->ni->flags & NF_VIEWPORT)) {
|
this->DrawViewport();
|
||||||
CopyInDParam(0, this->ni->params, lengthof(this->ni->params));
|
CopyInDParam(0, this->ni->params, lengthof(this->ni->params));
|
||||||
DrawStringMultiLine(2, 278, 38, this->ni->string_id, SA_CENTER);
|
DrawStringMultiLine(2, this->width - 2, 64, this->height, this->ni->string_id, TC_FROMSTRING, SA_CENTER);
|
||||||
} else {
|
|
||||||
this->DrawViewport();
|
|
||||||
CopyInDParam(0, this->ni->params, lengthof(this->ni->params));
|
|
||||||
DrawStringMultiLine(2, this->width - 2, 64, this->height, this->ni->string_id, TC_FROMSTRING, SA_CENTER);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: NOT_REACHED();
|
default: NOT_REACHED();
|
||||||
|
@ -430,28 +425,22 @@ static void ShowNewspaper(NewsItem *ni)
|
||||||
case NM_NORMAL:
|
case NM_NORMAL:
|
||||||
_normal_news_desc.top = top;
|
_normal_news_desc.top = top;
|
||||||
w = new NewsWindow(&_normal_news_desc, ni);
|
w = new NewsWindow(&_normal_news_desc, ni);
|
||||||
if (ni->flags & NF_VIEWPORT) {
|
|
||||||
InitializeWindowViewport(w, 2, 58, 426, 110,
|
|
||||||
ni->reftype1 == NR_VEHICLE ? 0x80000000 | ni->ref1 : GetReferenceTile(ni->reftype1, ni->ref1), ZOOM_LVL_NEWS);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NM_THIN:
|
case NM_THIN:
|
||||||
_thin_news_desc.top = top;
|
_thin_news_desc.top = top;
|
||||||
w = new NewsWindow(&_thin_news_desc, ni);
|
w = new NewsWindow(&_thin_news_desc, ni);
|
||||||
if (ni->flags & NF_VIEWPORT) {
|
|
||||||
InitializeWindowViewport(w, 2, 58, 426, 70,
|
InitializeWindowViewport(w, 2, 58, 426, 70,
|
||||||
ni->reftype1 == NR_VEHICLE ? 0x80000000 | ni->ref1 : GetReferenceTile(ni->reftype1, ni->ref1), ZOOM_LVL_NEWS);
|
ni->reftype1 == NR_VEHICLE ? 0x80000000 | ni->ref1 : GetReferenceTile(ni->reftype1, ni->ref1), ZOOM_LVL_NEWS);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NM_SMALL:
|
case NM_SMALL:
|
||||||
_smalll_news_desc.top = top;
|
_smalll_news_desc.top = top;
|
||||||
w = new NewsWindow(&_smalll_news_desc, ni);
|
w = new NewsWindow(&_smalll_news_desc, ni);
|
||||||
if (ni->flags & NF_VIEWPORT) {
|
|
||||||
InitializeWindowViewport(w, 3, 17, 274, 47,
|
InitializeWindowViewport(w, 3, 17, 274, 47,
|
||||||
ni->reftype1 == NR_VEHICLE ? 0x80000000 | ni->ref1 : GetReferenceTile(ni->reftype1, ni->ref1), ZOOM_LVL_NEWS);
|
ni->reftype1 == NR_VEHICLE ? 0x80000000 | ni->ref1 : GetReferenceTile(ni->reftype1, ni->ref1), ZOOM_LVL_NEWS);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: NOT_REACHED();
|
default: NOT_REACHED();
|
||||||
|
|
|
@ -61,9 +61,9 @@ enum NewsSubtype {
|
||||||
* News mode.
|
* News mode.
|
||||||
*/
|
*/
|
||||||
enum NewsMode {
|
enum NewsMode {
|
||||||
NM_SMALL = 0, ///< Show only a small popup informing us about vehicle age for example
|
NM_SMALL = 0, ///< Show only a small popup informing us about vehicle age for example, with a viewport.
|
||||||
NM_NORMAL = 1, ///< Show a simple news message (height 170 pixels)
|
NM_NORMAL = 1, ///< Show a simple news message without viewport (height 170 pixels).
|
||||||
NM_THIN = 2, ///< Show a simple news message (height 130 pixels)
|
NM_THIN = 2, ///< Show a simple news message with a viewport (height 130 pixels).
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -87,12 +87,11 @@ enum NewsReferenceType {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Various OR-able news-item flags.
|
* Various OR-able news-item flags.
|
||||||
* note: NF_INCOLOUR is set automatically if needed
|
* @note #NF_INCOLOUR is set automatically if needed.
|
||||||
*/
|
*/
|
||||||
enum NewsFlag {
|
enum NewsFlag {
|
||||||
NF_NONE = 0, ///< No flag is set.
|
NF_NONE = 0, ///< No flag is set.
|
||||||
NF_VIEWPORT = 1 << 1, ///< Does the news message have a viewport? (ingame picture of happening)
|
NF_INCOLOUR = 1 << 0, ///< Show the newsmessage in colour, otherwise it defaults to black & white.
|
||||||
NF_INCOLOUR = 1 << 2, ///< Show the newsmessage in colour, otherwise it defaults to black & white
|
|
||||||
};
|
};
|
||||||
DECLARE_ENUM_AS_BIT_SET(NewsFlag);
|
DECLARE_ENUM_AS_BIT_SET(NewsFlag);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue