From ec91dc5ffcf0eaac777e1f87edec61d0899193e5 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 26 May 2012 14:16:23 +0000 Subject: (svn r24287) -Feature [FS#2688]: News item for exclusive transport rights. (based on patch by Grantovich) --- src/lang/english.txt | 2 ++ src/town_cmd.cpp | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/src/lang/english.txt b/src/lang/english.txt index f2864e8a1..5d79c0690 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -852,6 +852,8 @@ STR_NEWS_SERVICE_SUBSIDY_AWARDED_TRIPLE :{BIG_FONT}{BLAC STR_NEWS_SERVICE_SUBSIDY_AWARDED_QUADRUPLE :{BIG_FONT}{BLACK}Service subsidy awarded to {RAW_STRING}!{}{}{STRING} service from {STRING2} to {STRING2} will pay quadruple rates for the next year! STR_NEWS_ROAD_REBUILDING :{BIG_FONT}{BLACK}Traffic chaos in {TOWN}!{}{}Road rebuilding programme funded by {RAW_STRING} brings 6 months of misery to motorists! +STR_NEWS_EXCLUSIVE_RIGHTS_TITLE :{BIG_FONT}{BLACK}Transport monopoly! +STR_NEWS_EXCLUSIVE_RIGHTS_DESCRIPTION :{BIG_FONT}{BLACK}Local authority of {TOWN} signs contract with {RAW_STRING} for one year of exclusive transport rights! # Extra view window STR_EXTRA_VIEW_PORT_TITLE :{WHITE}Viewport {COMMA} diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 341aaeb0c..dbff6dbc5 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -2824,6 +2824,15 @@ static CommandCost TownActionBuyRights(Town *t, DoCommandFlag flags) ModifyStationRatingAround(t->xy, _current_company, 130, 17); SetWindowClassesDirty(WC_STATION_VIEW); + + /* Spawn news message */ + CompanyNewsInformation *cni = MallocT(1); + cni->FillData(Company::Get(_current_company)); + SetDParam(0, STR_NEWS_EXCLUSIVE_RIGHTS_TITLE); + SetDParam(1, STR_NEWS_EXCLUSIVE_RIGHTS_DESCRIPTION); + SetDParam(2, t->index); + SetDParamStr(3, cni->company_name); + AddNewsItem(STR_MESSAGE_NEWS_FORMAT, NT_GENERAL, NF_COMPANY, NR_TOWN, t->index, NR_NONE, UINT32_MAX, cni); } return CommandCost(); } -- cgit v1.2.3-70-g09d2