diff --git a/apps/opencs/view/render/pathgridmode.cpp b/apps/opencs/view/render/pathgridmode.cpp index e9d608099..714c548a7 100644 --- a/apps/opencs/view/render/pathgridmode.cpp +++ b/apps/opencs/view/render/pathgridmode.cpp @@ -5,6 +5,8 @@ #include +#include "../../model/prefs/state.hpp" + #include "../../model/world/commands.hpp" #include "../../model/world/commandmacro.hpp" #include "../../model/world/idtable.hpp" @@ -53,9 +55,12 @@ namespace CSVRender void PathgridMode::primaryEditPressed(const WorldspaceHitResult& hitResult) { - // Get pathgrid cell - Cell* cell = getWorldspaceWidget().getCell (hitResult.worldPos); - if (cell) + if (CSMPrefs::get()["3D Scene Input"]["context-select"].isTrue() && + dynamic_cast(hitResult.tag.get())) + { + primarySelectPressed(hitResult); + } + else if (Cell* cell = getWorldspaceWidget().getCell (hitResult.worldPos)) { // Add node QUndoStack& undoStack = getWorldspaceWidget().getDocument().getUndoStack(); @@ -127,6 +132,17 @@ namespace CSVRender { std::vector > selection = getWorldspaceWidget().getSelection (Mask_Pathgrid); + if (CSMPrefs::get()["3D Scene Input"]["context-select"].isTrue()) + { + WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask()); + + if (dynamic_cast(hit.tag.get())) + { + primarySelectPressed(hit); + selection = getWorldspaceWidget().getSelection (Mask_Pathgrid); + } + } + if (!selection.empty()) { mDragMode = DragMode_Move;