Skip to content

Commit

Permalink
#5231: Fix insert prefab command invocations
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jul 18, 2020
1 parent 5a11be8 commit 673bc98
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion radiant/ui/MapCommands.cpp
Expand Up @@ -11,7 +11,8 @@ void loadPrefabDialog(const cmd::ArgumentList& args)

if (!result.prefabPath.empty())
{
GlobalCommandSystem().executeCommand(LOAD_PREFAB_AT_CMD, Vector3(0, 0, 0));
GlobalCommandSystem().executeCommand(LOAD_PREFAB_AT_CMD,
result.prefabPath, Vector3(0, 0, 0), result.insertAsGroup);
}
}

Expand Down
11 changes: 9 additions & 2 deletions radiant/ui/ortho/OrthoContextMenu.cpp
Expand Up @@ -20,6 +20,7 @@

#include "ui/modelselector/ModelSelector.h"
#include "ui/entitychooser/EntityClassChooser.h"
#include "ui/prefabselector/PrefabSelector.h"

#include "string/convert.h"
#include "scene/GroupNodeChecker.h"
Expand Down Expand Up @@ -329,8 +330,14 @@ void OrthoContextMenu::callbackAddLight()

void OrthoContextMenu::callbackAddPrefab()
{
// Pass the call to the map algorithm and give the lastPoint coordinate as argument
GlobalCommandSystem().executeCommand(LOAD_PREFAB_AT_CMD, _lastPoint);
auto result = PrefabSelector::ChoosePrefab();

if (!result.prefabPath.empty())
{
// Pass the call to the map algorithm and give the lastPoint coordinate as argument
GlobalCommandSystem().executeCommand(LOAD_PREFAB_AT_CMD,
result.prefabPath, _lastPoint, result.insertAsGroup);
}
}

void OrthoContextMenu::callbackAddSpeaker()
Expand Down

0 comments on commit 673bc98

Please sign in to comment.