From 2f4c6a6b0e1fc6f9a797ac8676b129f15dc15ddf Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 9 Oct 2016 22:13:01 +0000 Subject: [PATCH] Add "Toggle Construction" to context menu. --- src/mouse.cpp | 8 +++++++- src/ui.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mouse.cpp b/src/mouse.cpp index c6f2178e..a3a59032 100644 --- a/src/mouse.cpp +++ b/src/mouse.cpp @@ -570,7 +570,6 @@ void GraphicsWindow::MouseRightUp(double x, double y) { AddContextMenuItem("Snap to Grid", ContextCommand::SNAP_TO_GRID); } - if(gs.points == 1 && gs.point[0].isFromRequest()) { Request *r = SK.GetRequest(gs.point[0].request()); int index = r->IndexOfPoint(gs.point[0]); @@ -590,6 +589,9 @@ void GraphicsWindow::MouseRightUp(double x, double y) { AddContextMenuItem("Add Spline Point", ContextCommand::ADD_SPLINE_PT); } } + if(gs.entities == gs.n) { + AddContextMenuItem("Toggle Construction", ContextCommand::CONSTRUCTION); + } if(gs.points == 1) { Entity *p = SK.GetEntity(gs.point[0]); @@ -702,6 +704,10 @@ void GraphicsWindow::MouseRightUp(double x, double y) { MenuEdit(Command::SNAP_TO_GRID); break; + case ContextCommand::CONSTRUCTION: + MenuRequest(Command::CONSTRUCTION); + break; + case ContextCommand::REMOVE_SPLINE_PT: { hRequest hr = gs.point[0].request(); Request *r = SK.GetRequest(hr); diff --git a/src/ui.h b/src/ui.h index 569c4b8d..e3e8115a 100644 --- a/src/ui.h +++ b/src/ui.h @@ -139,6 +139,7 @@ enum class ContextCommand : uint32_t { SNAP_TO_GRID, REMOVE_SPLINE_PT, ADD_SPLINE_PT, + CONSTRUCTION, FIRST_STYLE = 0x40000000 };