From c7ea37b0a1ee067b475e62255e9edacaf082f222 Mon Sep 17 00:00:00 2001 From: codeimp Date: Wed, 25 Feb 2009 15:37:57 +0000 Subject: [PATCH] Insert in Sectors and Linedefs mode now start the Drawing mode --- Source/BuilderModes/ClassicModes/LinedefsMode.cs | 16 ++++++++++++++-- Source/BuilderModes/ClassicModes/SectorsMode.cs | 14 +++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Source/BuilderModes/ClassicModes/LinedefsMode.cs b/Source/BuilderModes/ClassicModes/LinedefsMode.cs index 9d838642..eb18f7da 100644 --- a/Source/BuilderModes/ClassicModes/LinedefsMode.cs +++ b/Source/BuilderModes/ClassicModes/LinedefsMode.cs @@ -524,8 +524,20 @@ namespace CodeImp.DoomBuilder.BuilderModes // This creates a new vertex at the mouse position [BeginAction("insertitem", BaseAction = true)] - public virtual void InsertVertexAction() { VerticesMode.InsertVertex(mousemappos, renderer.Scale); } - + public virtual void InsertVertexAction() + { + // Start drawing mode + DrawGeometryMode drawmode = new DrawGeometryMode(); + if(mouseinside) + { + bool snaptogrid = General.Interface.ShiftState ^ General.Interface.SnapToGrid; + bool snaptonearest = General.Interface.CtrlState ^ General.Interface.AutoMerge; + DrawnVertex v = DrawGeometryMode.GetCurrentPosition(mousemappos, snaptonearest, snaptogrid, renderer, new List()); + drawmode.DrawPointAt(v); + } + General.Editing.ChangeMode(drawmode); + } + [BeginAction("deleteitem", BaseAction = true)] public void DeleteItem() { diff --git a/Source/BuilderModes/ClassicModes/SectorsMode.cs b/Source/BuilderModes/ClassicModes/SectorsMode.cs index 88bfe2f7..5783a6ef 100644 --- a/Source/BuilderModes/ClassicModes/SectorsMode.cs +++ b/Source/BuilderModes/ClassicModes/SectorsMode.cs @@ -681,7 +681,19 @@ namespace CodeImp.DoomBuilder.BuilderModes // This creates a new vertex at the mouse position [BeginAction("insertitem", BaseAction = true)] - public virtual void InsertVertexAction() { VerticesMode.InsertVertex(mousemappos, renderer.Scale); } + public virtual void InsertVertexAction() + { + // Start drawing mode + DrawGeometryMode drawmode = new DrawGeometryMode(); + if(mouseinside) + { + bool snaptogrid = General.Interface.ShiftState ^ General.Interface.SnapToGrid; + bool snaptonearest = General.Interface.CtrlState ^ General.Interface.AutoMerge; + DrawnVertex v = DrawGeometryMode.GetCurrentPosition(mousemappos, snaptonearest, snaptogrid, renderer, new List()); + drawmode.DrawPointAt(v); + } + General.Editing.ChangeMode(drawmode); + } [BeginAction("makedoor")] public void MakeDoor()