summaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 9183dab58c..815e940a0a 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -599,6 +599,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
auto_build_solutions = true;
editor = true;
+ } else if (I->get() == "--export" || I->get() == "--export-debug") { // Export project
+
+ editor = true;
+ main_args.push_back(I->get());
#endif
} else if (I->get() == "--path") { // set path of project to start or edit
@@ -1343,20 +1347,10 @@ bool Main::start() {
removal_docs.push_back(args[j]);
} else if (args[i] == "--export") {
editor = true; //needs editor
- if (i + 1 < args.size()) {
- _export_preset = args[i + 1];
- } else {
- ERR_PRINT("Export preset name not specified");
- return false;
- }
+ _export_preset = args[i + 1];
} else if (args[i] == "--export-debug") {
editor = true; //needs editor
- if (i + 1 < args.size()) {
- _export_preset = args[i + 1];
- } else {
- ERR_PRINT("Export preset name not specified");
- return false;
- }
+ _export_preset = args[i + 1];
export_debug = true;
#endif
} else {
@@ -1375,6 +1369,8 @@ bool Main::start() {
#ifdef TOOLS_ENABLED
if (doc_tool != "") {
+ Engine::get_singleton()->set_editor_hint(true); // Needed to instance editor-only classes for their default values
+
{
DirAccessRef da = DirAccess::open(doc_tool);
if (!da) {