From c8a08caf81f17ec0f421e341b38afa80af1df5dd Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 1 Jan 2009 14:06:36 +0000 Subject: [PATCH] CloneSelection: don't overwrite names of target/targetname by holding Shift while pressing space, you get the old behaviour back git-svn-id: svn://svn.icculus.org/netradiant/trunk@145 61c419a2-8eb2-4b30-bcec-8cead039b335 --- radiant/mainframe.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 031f2b47..eb8734cf 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -1186,7 +1186,9 @@ void SelectFaceMode() class CloneSelected : public scene::Graph::Walker { + bool doFixNames; public: + CloneSelected(bool d): doFixNames(d) { } bool pre(const scene::Path& path, scene::Instance& instance) const { if(path.size() == 1) @@ -1223,9 +1225,9 @@ public: } }; -void Scene_Clone_Selected(scene::Graph& graph) +void Scene_Clone_Selected(scene::Graph& graph, bool doFixNames) { - graph.traverse(CloneSelected()); + graph.traverse(CloneSelected(doFixNames)); Map_mergeClonedNames(); } @@ -1297,7 +1299,20 @@ void Selection_Clone() { UndoableCommand undo("cloneSelected"); - Scene_Clone_Selected(GlobalSceneGraph()); + Scene_Clone_Selected(GlobalSceneGraph(), false); + + //NudgeSelection(eNudgeRight, GetGridSize(), GlobalXYWnd_getCurrentViewType()); + //NudgeSelection(eNudgeDown, GetGridSize(), GlobalXYWnd_getCurrentViewType()); + } +} + +void Selection_Clone_FixNames() +{ + if(GlobalSelectionSystem().Mode() == SelectionSystem::ePrimitive) + { + UndoableCommand undo("cloneSelected"); + + Scene_Clone_Selected(GlobalSceneGraph(), true); //NudgeSelection(eNudgeRight, GetGridSize(), GlobalXYWnd_getCurrentViewType()); //NudgeSelection(eNudgeDown, GetGridSize(), GlobalXYWnd_getCurrentViewType()); @@ -3393,6 +3408,7 @@ void MainFrame_Construct() GlobalCommands_insert("Paste", FreeCaller(), Accelerator('V', (GdkModifierType)GDK_CONTROL_MASK)); GlobalCommands_insert("PasteToCamera", FreeCaller(), Accelerator('V', (GdkModifierType)GDK_MOD1_MASK)); GlobalCommands_insert("CloneSelection", FreeCaller(), Accelerator(GDK_space)); + GlobalCommands_insert("CloneSelectionAndFixNames", FreeCaller(), Accelerator(GDK_space, (GdkModifierType)GDK_SHIFT_MASK)); GlobalCommands_insert("DeleteSelection", FreeCaller(), Accelerator(GDK_BackSpace)); GlobalCommands_insert("ParentSelection", FreeCaller()); GlobalCommands_insert("UnSelectSelection", FreeCaller(), Accelerator(GDK_Escape)); -- 2.39.2