mirror of
https://github.com/huderlem/porymap.git
synced 2026-11-16 07:22:36 -06:00
Allow compiling without the qml module
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#ifdef QT_QML_LIB
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "scripting.h"
|
||||
@@ -963,3 +964,5 @@ void MainWindow::setFloorNumber(int floorNumber) {
|
||||
this->editor->map->header()->setFloorNumber(floorNumber);
|
||||
}
|
||||
|
||||
|
||||
#endif // QT_QML_LIB
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifdef QT_QML_LIB
|
||||
#include "mapview.h"
|
||||
#include "scripting.h"
|
||||
#include "imageproviders.h"
|
||||
#include "editor.h"
|
||||
|
||||
void MapView::updateScene() {
|
||||
if (this->scene()) {
|
||||
@@ -300,3 +302,5 @@ void MapView::addMetatileImage(int x, int y, int metatileId, bool setTransparenc
|
||||
if (this->getOverlay(layer)->addImage(x, y, image))
|
||||
this->updateScene();
|
||||
}
|
||||
|
||||
#endif // QT_QML_LIB
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
#ifdef QT_QML_LIB
|
||||
#include "scriptutility.h"
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "scripting.h"
|
||||
#include "config.h"
|
||||
|
||||
ScriptUtility::ScriptUtility(MainWindow *mainWindow) {
|
||||
this->window = mainWindow;
|
||||
}
|
||||
|
||||
ScriptUtility::~ScriptUtility() {
|
||||
if (window && window->ui && window->ui->menuTools) {
|
||||
for (auto action : this->registeredActions) {
|
||||
@@ -318,3 +316,5 @@ bool ScriptUtility::isPrimaryTileset(QString tilesetName) {
|
||||
bool ScriptUtility::isSecondaryTileset(QString tilesetName) {
|
||||
return getSecondaryTilesetNames().contains(tilesetName);
|
||||
}
|
||||
|
||||
#endif // QT_QML_LIB
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#if __has_include(<QQmlEngine>)
|
||||
#include <QQmlEngine>
|
||||
|
||||
#include "scripting.h"
|
||||
#include "log.h"
|
||||
#include "config.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
const QMap<CallbackType, QString> callbackFunctions = {
|
||||
{OnProjectOpened, "onProjectOpened"},
|
||||
@@ -422,3 +424,6 @@ const QImage * Scripting::getImage(const QString &inputFilepath, bool useCache)
|
||||
instance->imageCache.insert(inputFilepath, image);
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
#endif // __has_include(<QQmlEngine>)
|
||||
|
||||
Reference in New Issue
Block a user