diff --git a/install/menu.xml b/install/menu.xml
index 3148ea7c3d..ad819b8a3d 100644
--- a/install/menu.xml
+++ b/install/menu.xml
@@ -252,7 +252,7 @@
-
+
@@ -307,8 +307,8 @@
-
-
+
+
diff --git a/radiantcore/patch/PatchModule.cpp b/radiantcore/patch/PatchModule.cpp
index 78e75f32de..0fbad663b0 100644
--- a/radiantcore/patch/PatchModule.cpp
+++ b/radiantcore/patch/PatchModule.cpp
@@ -90,12 +90,27 @@ void PatchModule::registerPatchCommands()
GlobalCommandSystem().addCommand("CreateSimplePatchMesh", patch::algorithm::createSimplePatch,
{ cmd::ARGTYPE_INT, cmd::ARGTYPE_INT | cmd::ARGTYPE_OPTIONAL, cmd::ARGTYPE_INT | cmd::ARGTYPE_OPTIONAL }); // dimX, dimY, removeSelectedBrush
- GlobalCommandSystem().addCommand("PatchInsertColumnEnd", selection::algorithm::insertPatchColumnsAtEnd);
- GlobalCommandSystem().addCommand("PatchInsertColumnBeginning", selection::algorithm::insertPatchColumnsAtBeginning);
- GlobalCommandSystem().addCommand("PatchInsertRowEnd", selection::algorithm::insertPatchRowsAtEnd);
- GlobalCommandSystem().addCommand("PatchInsertRowBeginning", selection::algorithm::insertPatchRowsAtBeginning);
+ GlobalCommandSystem().addWithCheck(
+ "PatchInsertColumnEnd",
+ cmd::noArgs(selection::algorithm::insertPatchColumnsAtEnd),
+ selection::pred::havePatch
+ );
+ GlobalCommandSystem().addWithCheck(
+ "PatchInsertColumnBeginning",
+ cmd::noArgs(selection::algorithm::insertPatchColumnsAtBeginning),
+ selection::pred::havePatch);
+ GlobalCommandSystem().addWithCheck(
+ "PatchInsertRowEnd",
+ cmd::noArgs(selection::algorithm::insertPatchRowsAtEnd),
+ selection::pred::havePatch
+ );
+ GlobalCommandSystem().addWithCheck(
+ "PatchInsertRowBeginning",
+ cmd::noArgs(selection::algorithm::insertPatchRowsAtBeginning),
+ selection::pred::havePatch
+ );
- GlobalCommandSystem().addCommand("PatchDeleteColumnBeginning", selection::algorithm::deletePatchColumnsFromBeginning);
+ GlobalCommandSystem().addCommand("PatchDeleteColumnBeginning", selection::algorithm::deletePatchColumnsFromBeginning);
GlobalCommandSystem().addCommand("PatchDeleteColumnEnd", selection::algorithm::deletePatchColumnsFromEnd);
GlobalCommandSystem().addCommand("PatchDeleteRowBeginning", selection::algorithm::deletePatchRowsFromBeginning);
GlobalCommandSystem().addCommand("PatchDeleteRowEnd", selection::algorithm::deletePatchRowsFromEnd);
@@ -115,7 +130,8 @@ void PatchModule::registerPatchCommands()
"ThickenSelectedPatches", selection::algorithm::thickenPatches,
{cmd::ARGTYPE_DOUBLE, cmd::ARGTYPE_INT, cmd::ARGTYPE_INT} // thickness, create_seams, axis
);
- GlobalCommandSystem().addWithCheck("StitchPatchTexture", patch::algorithm::stitchTextures,
+ GlobalCommandSystem().addWithCheck("StitchPatchTexture",
+ cmd::noArgs(patch::algorithm::stitchTextures),
[] { return selection::pred::havePatchesExact(2); });
GlobalCommandSystem().addCommand("BulgePatch", patch::algorithm::bulge, {cmd::ARGTYPE_DOUBLE});
GlobalCommandSystem().addWithCheck("WeldSelectedPatches",
diff --git a/radiantcore/patch/algorithm/General.cpp b/radiantcore/patch/algorithm/General.cpp
index d8a9fd7b64..ce33494c64 100644
--- a/radiantcore/patch/algorithm/General.cpp
+++ b/radiantcore/patch/algorithm/General.cpp
@@ -89,7 +89,7 @@ void thicken(const PatchNodePtr& sourcePatch, float thickness, bool createSeams,
targetPatch->invertMatrix();
}
-void stitchTextures(const cmd::ArgumentList& args)
+void stitchTextures()
{
// Get all the selected patches
PatchPtrVector patchList = selection::algorithm::getSelectedPatches();
diff --git a/radiantcore/patch/algorithm/General.h b/radiantcore/patch/algorithm/General.h
index 437e9ea7d5..a721f86ebd 100644
--- a/radiantcore/patch/algorithm/General.h
+++ b/radiantcore/patch/algorithm/General.h
@@ -23,7 +23,7 @@ namespace algorithm
*/
void thicken(const PatchNodePtr& sourcePatch, float thickness, bool createSeams, int axis);
-void stitchTextures(const cmd::ArgumentList& args);
+void stitchTextures();
void bulge(const cmd::ArgumentList& args);
diff --git a/radiantcore/selection/algorithm/Patch.cpp b/radiantcore/selection/algorithm/Patch.cpp
index 165e1b4a5f..41e9b0f830 100644
--- a/radiantcore/selection/algorithm/Patch.cpp
+++ b/radiantcore/selection/algorithm/Patch.cpp
@@ -93,28 +93,28 @@ void capPatch(const cmd::ArgumentList& args)
}
}
-void insertPatchColumnsAtEnd(const cmd::ArgumentList& args)
+void insertPatchColumnsAtEnd()
{
UndoableCommand undo("patchInsertColumnsAtEnd");
// true = insert, true = columns, false = end
GlobalSelectionSystem().foreachPatch([&] (IPatch& patch) { patch.insertRemove(true, true, false); });
}
-void insertPatchColumnsAtBeginning(const cmd::ArgumentList& args)
+void insertPatchColumnsAtBeginning()
{
UndoableCommand undo("patchInsertColumnsAtBeginning");
// true = insert, true = columns, true = at beginning
GlobalSelectionSystem().foreachPatch([&] (IPatch& patch) { patch.insertRemove(true, true, true); });
}
-void insertPatchRowsAtEnd(const cmd::ArgumentList& args)
+void insertPatchRowsAtEnd()
{
UndoableCommand undo("patchInsertRowsAtEnd");
// true = insert, false = rows, false = at end
GlobalSelectionSystem().foreachPatch([&] (IPatch& patch) { patch.insertRemove(true, false, false); });
}
-void insertPatchRowsAtBeginning(const cmd::ArgumentList& args)
+void insertPatchRowsAtBeginning()
{
UndoableCommand undo("patchInsertRowsAtBeginning");
// true = insert, false = rows, true = at beginning
diff --git a/radiantcore/selection/algorithm/Patch.h b/radiantcore/selection/algorithm/Patch.h
index ac556ffffd..4b2a2f9b4a 100644
--- a/radiantcore/selection/algorithm/Patch.h
+++ b/radiantcore/selection/algorithm/Patch.h
@@ -18,10 +18,10 @@ void transposePatch(const cmd::ArgumentList& args);
void capPatch(const cmd::ArgumentList& args);
-void insertPatchColumnsAtEnd(const cmd::ArgumentList& args);
-void insertPatchColumnsAtBeginning(const cmd::ArgumentList& args);
-void insertPatchRowsAtEnd(const cmd::ArgumentList& args);
-void insertPatchRowsAtBeginning(const cmd::ArgumentList& args);
+void insertPatchColumnsAtEnd();
+void insertPatchColumnsAtBeginning();
+void insertPatchRowsAtEnd();
+void insertPatchRowsAtBeginning();
void deletePatchColumnsFromBeginning(const cmd::ArgumentList& args);
void deletePatchColumnsFromEnd(const cmd::ArgumentList& args);