Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5231: Refactor export as CM functions.
- Loading branch information
1 parent
c118ba4
commit a182126
Showing
10 changed files
with
133 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "ExportCollisionModelDialog.h" | ||
|
||
#include "i18n.h" | ||
#include "selectionlib.h" | ||
#include "command/ExecutionNotPossible.h" | ||
#include "ui/modelselector/ModelSelector.h" | ||
|
||
namespace ui | ||
{ | ||
|
||
void ExportCollisionModelDialog::Show(const cmd::ArgumentList& args) | ||
{ | ||
// Check the current selection state | ||
const SelectionInfo& info = GlobalSelectionSystem().getSelectionInfo(); | ||
|
||
if (info.totalCount != info.entityCount || info.entityCount != 1) | ||
{ | ||
throw cmd::ExecutionNotPossible(_("Can't export, create and select a func_* entity\ | ||
containing the collision hull primitives.")); | ||
} | ||
|
||
auto modelAndSkin = ModelSelector::chooseModel("", false, false); | ||
|
||
if (modelAndSkin.model.empty()) | ||
{ | ||
return; | ||
} | ||
|
||
GlobalCommandSystem().executeCommand("ExportSelectedAsCollisionModel", modelAndSkin.model); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#include "icommandsystem.h" | ||
|
||
namespace ui | ||
{ | ||
|
||
class ExportCollisionModelDialog | ||
{ | ||
public: | ||
static void Show(const cmd::ArgumentList& args); | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters