summaryrefslogtreecommitdiff
path: root/src/viewport.cpp
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2011-08-01 18:41:21 +0000
committerplanetmaker <planetmaker@openttd.org>2011-08-01 18:41:21 +0000
commit3fb66890eeb3689e645fa6d520aecc0c0908031f (patch)
tree695d9f02f415bb5510338170b622b22dca8ea256 /src/viewport.cpp
parent536fc4246189cb13a8848dc71bedc00a79c7031a (diff)
downloadopenttd-3fb66890eeb3689e645fa6d520aecc0c0908031f.tar.xz
(svn r22708) -Feature [FS#4701]: Display option to hide competitors' signs and station names (Zuu)
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r--src/viewport.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp
index 16e6bb0b5..dcfe4cf01 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -1186,6 +1186,9 @@ static void ViewportAddStationNames(DrawPixelInfo *dpi)
/* Don't draw if the display options are disabled */
if (!HasBit(_display_opt, is_station ? DO_SHOW_STATION_NAMES : DO_SHOW_WAYPOINT_NAMES)) continue;
+ /* Don't draw if station is owned by another company and competitor station names are hidden. Stations owned by none are never ignored. */
+ if (!HasBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS) && _local_company != st->owner && st->owner != OWNER_NONE) continue;
+
ViewportAddString(dpi, ZOOM_LVL_OUT_4X, &st->sign,
is_station ? STR_VIEWPORT_STATION : STR_VIEWPORT_WAYPOINT,
(is_station ? STR_VIEWPORT_STATION : STR_VIEWPORT_WAYPOINT) + 1, STR_NULL,
@@ -1201,6 +1204,11 @@ static void ViewportAddSigns(DrawPixelInfo *dpi)
const Sign *si;
FOR_ALL_SIGNS(si) {
+ /* Don't draw if sign is owned by another company and competitor signs should be hidden.
+ * Note: It is intentional that also signs owned by OWNER_NONE are hidden. Bankrupt
+ * companies can leave OWNER_NONE signs after them. */
+ if (!HasBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS) && _local_company != si->owner) continue;
+
ViewportAddString(dpi, ZOOM_LVL_OUT_4X, &si->sign,
STR_WHITE_SIGN,
IsTransparencySet(TO_SIGNS) ? STR_VIEWPORT_SIGN_SMALL_WHITE : STR_VIEWPORT_SIGN_SMALL_BLACK, STR_NULL,