Skip to content
Open
Show file tree
Hide file tree
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
22 changes: 19 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "core.h"
#include "ui/main_window.h"
#include <QApplication>
#include <QCommandLineParser>
#include <QDir>
#include <QSplashScreen>
#include <QTranslator>
#include <QTimer>
Expand Down Expand Up @@ -104,9 +106,23 @@ int main(int argc, char *argv[]) {
s.showMessage("Loading main window...");
app.processEvents();
MainWindow w;
s.showMessage("Loading last project...");
app.processEvents();
w.LoadLastProject();

// a project folder on the command line, else the last opened project
QCommandLineParser parser;
parser.setApplicationDescription("EasyRPG Editor");
parser.addHelpOption();
parser.addPositionalArgument("project", QCoreApplication::translate("main", "Project folder to open (EasyRPG or RPG Maker 2000/2003)."), "[project]");
parser.process(app);
const QStringList args = parser.positionalArguments();
if (!args.isEmpty()) {
s.showMessage("Loading project...");
app.processEvents();
w.LoadProject(QDir(args.first()).absolutePath());
} else {
s.showMessage("Loading last project...");
app.processEvents();
w.LoadLastProject();
}
s.clearMessage();
w.show();
#ifndef NDEBUG
Expand Down
4 changes: 4 additions & 0 deletions src/qmlbinding/json_internals/json_t_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@

#include <QObject>
#include <QVariant>
// glaze uses `emit` as a name, which Qt defines as a keyword macro
#pragma push_macro("emit")
#undef emit
#include <glaze/json/generic.hpp>
#pragma pop_macro("emit")

#include "common/dbstring.h"
#include "lcf_glaze.h"
Expand Down
4 changes: 4 additions & 0 deletions src/qmlbinding/lcf_glaze.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#pragma once

#include <QString>
// glaze uses `emit` as a name, which Qt defines as a keyword macro
#pragma push_macro("emit")
#undef emit
#include <glaze/glaze.hpp>
#pragma pop_macro("emit")
#include <lcf/dbbitarray.h>
#include <lcf/dbstring.h>
#include <lcf/rpg/database.h>
Expand Down
Loading