From 3fb66890eeb3689e645fa6d520aecc0c0908031f Mon Sep 17 00:00:00 2001 From: planetmaker Date: Mon, 1 Aug 2011 18:41:21 +0000 Subject: (svn r22708) -Feature [FS#4701]: Display option to hide competitors' signs and station names (Zuu) --- src/viewport.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/viewport.cpp') 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, -- cgit v1.2.3-54-g00ecf