diff --git a/data/_ui/interfaces.txt b/data/_ui/interfaces.txt index a3bfbf16ef18..39eb74dbfdf8 100644 --- a/data/_ui/interfaces.txt +++ b/data/_ui/interfaces.txt @@ -11,6 +11,7 @@ # You should have received a copy of the GNU General Public License along with # this program. If not, see . + # Colors used to reflect the active or hovered interface button. color "hover" 1. 1. 1. 0. color "active" .75 .75 .75 0. @@ -194,6 +195,11 @@ color "map wormhole" .5 .2 .9 1. color "map orbits fleet destination" 1. 1. 1. 1. color "map danger none" .1 .6 0. .4 +# Colors used for the routing issue text in the map panel when +# a route to the selected system cannot be determined. +color "map route error text" 1. 0. 0. 1. +color "map route error shadow" 0. 0. 0. 1. + # Miscellaneous colors color "wormholes: Ember Waste" .7 .1 .3 @@ -1431,6 +1437,16 @@ interface "map" value "max zoom" 2 value "min zoom" -2 + anchor top + string "route error" + center 1 59 + size 18 + color "map route error shadow" + string "route error" + center 0 58 + size 18 + color "map route error text" + interface "info panel" diff --git a/source/MapPanel.cpp b/source/MapPanel.cpp index 9405174bfe57..e9aa6ba6d370 100644 --- a/source/MapPanel.cpp +++ b/source/MapPanel.cpp @@ -131,7 +131,6 @@ namespace { } const Color black(0.f, 1.f); - const Color red(1.f, 0.f, 0.f, 1.f); // Hovering an escort pip for this many frames activates the tooltip. const int HOVER_TIME = 60; @@ -411,13 +410,11 @@ void MapPanel::FinishDrawing(const string &buttonCondition) { static const string UNAVAILABLE = "You have no available route to this system."; static const string UNKNOWN = "You have not yet mapped a route to this system."; - const Font &font = FontSet::Get(18); - const string &message = player.CanView(*selectedSystem) ? UNAVAILABLE : UNKNOWN; - Point point(-font.Width(message) / 2, Screen::Top() + 40); - font.Draw(message, point + Point(1, 1), black); - font.Draw(message, point, red); + info.SetString("route error", message); } + + mapInterface->Draw(info, this); }