Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/program/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "ui/MainWindow.h"
#include "ui/InputEditorWindow.h"
#include "ui/LuaConsoleWindow.h"
#include "Context.h"
#include "utils.h" // create_dir
#include "lua/Main.h"
Expand Down Expand Up @@ -99,6 +100,7 @@ static void print_usage(void)
std::cout << " --libtas-so-path Path to libtas.so (equivalent to setting LIBTAS_SO_PATH)" << std::endl;
std::cout << " --libtas32-so-path Path to libtas32.so (equivalent to setting LIBTAS32_SO_PATH)" << std::endl;
std::cout << " -i, --input-editor Open Input Editor window at startup" << std::endl;
std::cout << " -L, --lua-console Open Lua Console window at startup" << std::endl;
std::cout << " -h, --help Show this message" << std::endl;
}

Expand Down Expand Up @@ -136,13 +138,15 @@ int main(int argc, char **argv)
{"libtas32-so-path", required_argument, nullptr, 'P'},
{"help", no_argument, nullptr, 'h'},
{"input-editor", no_argument, nullptr, 'i'},
{"lua-console", no_argument, nullptr, 'L'},
{nullptr, 0, nullptr, 0}
};
int option_index = 0;
bool openInputEditor = false;
bool openLuaConsole = false;

// std::string libname;
while ((c = getopt_long (argc, argv, "+r:w:d:l:nhi", long_options, &option_index)) != -1) {
while ((c = getopt_long (argc, argv, "+r:w:d:l:nhiL", long_options, &option_index)) != -1) {
switch (c) {
case 'r':
case 'w':
Expand Down Expand Up @@ -191,6 +195,9 @@ int main(int argc, char **argv)
case 'i':
openInputEditor = true;
break;
case 'L':
openLuaConsole = true;
break;
default:
return -1;
}
Expand Down Expand Up @@ -464,6 +471,10 @@ int main(int argc, char **argv)
mainWin.inputEditorWindow->show();
}

if (openLuaConsole) {
mainWin.luaConsoleWindow->show();
}

app.exec();

context.config.save(context.gamepath);
Expand Down