Skip to content

Commit

Permalink
#401: disable "Create Decal Patches" if no faces selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Mott committed Jul 27, 2022
1 parent 4c3a5d6 commit fc7807d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions radiantcore/selection/algorithm/General.cpp
Expand Up @@ -1005,9 +1005,12 @@ void registerCommands()

GlobalCommandSystem().addCommand("ExportSelectedAsCollisionModel", createCMFromSelection, { cmd::ARGTYPE_STRING });

GlobalCommandSystem().addCommand("CreateDecalsForFaces", createDecalsForSelectedFaces);
GlobalCommandSystem().addWithCheck(
"CreateDecalsForFaces", [](const cmd::ArgumentList&) { createDecalsForSelectedFaces(); },
[] { return !FaceInstance::Selection().empty(); }
);

GlobalCommandSystem().addCommand("Copy", clipboard::copy);
GlobalCommandSystem().addCommand("Copy", clipboard::copy);
GlobalCommandSystem().addCommand("Cut", clipboard::cut);
GlobalCommandSystem().addCommand("Paste", clipboard::paste);
GlobalCommandSystem().addCommand("PasteToCamera", clipboard::pasteToCamera);
Expand Down
2 changes: 1 addition & 1 deletion radiantcore/selection/algorithm/Primitives.cpp
Expand Up @@ -347,7 +347,7 @@ class DecalPatchCreator
}
};

void createDecalsForSelectedFaces(const cmd::ArgumentList& args)
void createDecalsForSelectedFaces()
{
// Sanity check
if (FaceInstance::Selection().empty())
Expand Down
2 changes: 1 addition & 1 deletion radiantcore/selection/algorithm/Primitives.h
Expand Up @@ -81,7 +81,7 @@ namespace selection {

/** greebo: Creates a coplanar patch for each selected face instance.
*/
void createDecalsForSelectedFaces(const cmd::ArgumentList& args);
void createDecalsForSelectedFaces();

/**
* greebo: Applies the visportal/nodraw texture combo to the selected brushes.
Expand Down

0 comments on commit fc7807d

Please sign in to comment.