Skip to content

Commit

Permalink
#401: disable "Make Visportal" if no brushes selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Mott committed Jul 27, 2022
1 parent 4a1b9ed commit 4c3a5d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions radiantcore/brush/BrushModule.cpp
Expand Up @@ -11,6 +11,7 @@
#include "brush/BrushClipPlane.h"
#include "brush/BrushVisit.h"
#include "gamelib.h"
#include "selectionlib.h"

#include "registry/registry.h"
#include "ipreferencesystem.h"
Expand Down Expand Up @@ -145,8 +146,11 @@ void BrushModuleImpl::registerBrushCommands()
GlobalCommandSystem().addCommand("BrushMakeSided", selection::algorithm::brushMakeSided, { cmd::ARGTYPE_INT });

GlobalCommandSystem().addCommand("TextureNatural", selection::algorithm::naturalTexture);
GlobalCommandSystem().addCommand("MakeVisportal", selection::algorithm::makeVisportal);
GlobalCommandSystem().addCommand("SurroundWithMonsterclip", selection::algorithm::surroundWithMonsterclip);
GlobalCommandSystem().addWithCheck(
"MakeVisportal", [](const cmd::ArgumentList&) { selection::algorithm::makeVisportal(); },
selection::pred::haveSelectedBrush
);
GlobalCommandSystem().addCommand("SurroundWithMonsterclip", selection::algorithm::surroundWithMonsterclip);

GlobalCommandSystem().addCommand("ResizeSelectedBrushesToBounds", selection::algorithm::resizeSelectedBrushesToBounds,
{ cmd::ARGTYPE_VECTOR3, cmd::ARGTYPE_VECTOR3, cmd::ARGTYPE_STRING });
Expand Down
2 changes: 1 addition & 1 deletion radiantcore/selection/algorithm/Primitives.cpp
Expand Up @@ -379,7 +379,7 @@ void createDecalsForSelectedFaces(const cmd::ArgumentList& args)
}
}

void makeVisportal(const cmd::ArgumentList& args)
void makeVisportal()
{
BrushPtrVector brushes = getSelectedBrushes();

Expand Down
2 changes: 1 addition & 1 deletion radiantcore/selection/algorithm/Primitives.h
Expand Up @@ -86,7 +86,7 @@ namespace selection {
/**
* greebo: Applies the visportal/nodraw texture combo to the selected brushes.
*/
void makeVisportal(const cmd::ArgumentList& args);
void makeVisportal();

/**
* greebo: Surrounds the current model selection with a monsterclip brush.
Expand Down

0 comments on commit 4c3a5d6

Please sign in to comment.