Add warn and error to script API

This commit is contained in:
GriffinR 2021-12-02 13:41:05 -05:00 committed by huderlem
parent 6c1e5b516d
commit ac988968b3
2 changed files with 10 additions and 0 deletions

View file

@ -121,6 +121,8 @@ public:
Q_INVOKABLE void setTimeout(QJSValue callback, int milliseconds); Q_INVOKABLE void setTimeout(QJSValue callback, int milliseconds);
void invokeCallback(QJSValue callback); void invokeCallback(QJSValue callback);
Q_INVOKABLE void log(QString message); Q_INVOKABLE void log(QString message);
Q_INVOKABLE void warn(QString message);
Q_INVOKABLE void error(QString message);
Q_INVOKABLE QList<int> getMetatileLayerOrder(); Q_INVOKABLE QList<int> getMetatileLayerOrder();
Q_INVOKABLE void setMetatileLayerOrder(QList<int> order); Q_INVOKABLE void setMetatileLayerOrder(QList<int> order);
Q_INVOKABLE QList<float> getMetatileLayerOpacity(); Q_INVOKABLE QList<float> getMetatileLayerOpacity();

View file

@ -651,6 +651,14 @@ void MainWindow::log(QString message) {
logInfo(message); logInfo(message);
} }
void MainWindow::warn(QString message) {
logWarn(message);
}
void MainWindow::error(QString message) {
logError(message);
}
QList<int> MainWindow::getMetatileLayerOrder() { QList<int> MainWindow::getMetatileLayerOrder() {
if (!this->editor || !this->editor->map) if (!this->editor || !this->editor->map)
return QList<int>(); return QList<int>();