From 477a09d13edad166fd5fd3b60ded53b2c1d83c27 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 6 May 2012 11:38:52 +0000 Subject: [PATCH] (svn r24205) -Feature [FS#5178-ish]: Show a hint in the supplies tab of station windows, if the station is affected by exclusive transport rights. --- src/lang/english.txt | 3 +++ src/station_gui.cpp | 7 +++++++ src/town_cmd.cpp | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/lang/english.txt b/src/lang/english.txt index 3908339cd1..1fdc47d537 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2732,6 +2732,9 @@ STR_STATION_VIEW_ACCEPTS_BUTTON :{BLACK}Accepts STR_STATION_VIEW_ACCEPTS_TOOLTIP :{BLACK}Show list of accepted cargo STR_STATION_VIEW_ACCEPTS_CARGO :{BLACK}Accepts: {WHITE}{CARGO_LIST} +STR_STATIOV_VIEW_EXCLUSIVE_RIGHTS_SELF :{BLACK}This station has exclusive transport rights in this town. +STR_STATIOV_VIEW_EXCLUSIVE_RIGHTS_COMPANY :{YELLOW}{COMPANY}{BLACK} bought exclusive transport rights in this town. + STR_STATION_VIEW_RATINGS_BUTTON :{BLACK}Ratings STR_STATION_VIEW_RATINGS_TOOLTIP :{BLACK}Show station ratings STR_STATION_VIEW_CARGO_RATINGS_TITLE :{BLACK}Local rating of transport service: diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 7600e216d4..6d758fdcf0 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -29,6 +29,7 @@ #include "sortlist_type.h" #include "core/geometry_func.hpp" #include "vehiclelist.h" +#include "town.h" #include "widgets/station_widget.h" @@ -1082,6 +1083,12 @@ struct StationViewWindow : public Window { const Station *st = Station::Get(this->window_number); int y = r.top + WD_FRAMERECT_TOP; + if (st->town->exclusive_counter > 0) { + SetDParam(0, st->town->exclusivity); + y = DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, r.bottom, st->town->exclusivity == st->owner ? STR_STATIOV_VIEW_EXCLUSIVE_RIGHTS_SELF : STR_STATIOV_VIEW_EXCLUSIVE_RIGHTS_COMPANY); + y += WD_PAR_VSEP_WIDE; + } + DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_STATION_VIEW_CARGO_RATINGS_TITLE); y += FONT_HEIGHT_NORMAL; diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 7cd6770f1d..e42dd83629 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -2822,6 +2822,8 @@ static CommandCost TownActionBuyRights(Town *t, DoCommandFlag flags) t->exclusivity = _current_company; ModifyStationRatingAround(t->xy, _current_company, 130, 17); + + SetWindowClassesDirty(WC_STATION_VIEW); } return CommandCost(); }