diff --git a/include/imap.h b/include/imap.h index 9211d69584..dbf8b7230a 100644 --- a/include/imap.h +++ b/include/imap.h @@ -172,11 +172,16 @@ class IMap : // Exports the current selection to the given output stream, using the given map format virtual void exportSelected(std::ostream& out, const map::MapFormatPtr& format) = 0; + /* POINTFILE MANAGEMENT */ + /// Functor to receive pointfile paths using PointfileFunctor = std::function; /// Enumerate pointfiles associated with the current map virtual void forEachPointfile(PointfileFunctor func) const = 0; + + /// Return true if a point trace is currently visible + virtual bool isPointTraceVisible() const = 0; }; typedef std::shared_ptr IMapPtr; diff --git a/radiant/ui/PointFileChooser.cpp b/radiant/ui/PointFileChooser.cpp index 48491f1814..2cba8be731 100644 --- a/radiant/ui/PointFileChooser.cpp +++ b/radiant/ui/PointFileChooser.cpp @@ -43,7 +43,7 @@ void PointFileChooser::chooseAndToggle() throw cmd::ExecutionFailure("No pointfiles found for current map."); // If there is a choice to make, show the dialog - if (pointfiles.size() > 1) + if (!GlobalMapModule().isPointTraceVisible() && pointfiles.size() > 1) { // Construct list of wxString filenames wxArrayString filenames; diff --git a/radiantcore/map/Map.cpp b/radiantcore/map/Map.cpp index 8f71b0a0b0..e73b78802e 100644 --- a/radiantcore/map/Map.cpp +++ b/radiantcore/map/Map.cpp @@ -241,6 +241,11 @@ void Map::forEachPointfile(PointfileFunctor func) const func(p); } +bool Map::isPointTraceVisible() const +{ + return _pointTrace->isVisible(); +} + void Map::onSceneNodeErase(const scene::INodePtr& node) { // Detect when worldspawn is removed from the map diff --git a/radiantcore/map/Map.h b/radiantcore/map/Map.h index 2c2ab3b803..33931b11f6 100644 --- a/radiantcore/map/Map.h +++ b/radiantcore/map/Map.h @@ -91,6 +91,7 @@ class Map : std::string getMapName() const override; sigc::signal& signal_mapNameChanged() override; void forEachPointfile(PointfileFunctor func) const override; + bool isPointTraceVisible() const override; /** * greebo: Saves the current map, doesn't ask for any filenames,