mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-11 11:26:00 -05:00
Implement proof of concept for scripting capabilities
This commit is contained in:
31
include/scripting.h
Normal file
31
include/scripting.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef SCRIPTING_H
|
||||
#define SCRIPTING_H
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "block.h"
|
||||
|
||||
#include <QStringList>
|
||||
#include <QJSEngine>
|
||||
|
||||
enum CallbackType {
|
||||
OnBlockChanged,
|
||||
};
|
||||
|
||||
class Scripting
|
||||
{
|
||||
public:
|
||||
Scripting(MainWindow *mainWindow);
|
||||
QJSValue newBlockObject(Block block);
|
||||
static void init(MainWindow *mainWindow);
|
||||
static void cb_MetatileChanged(int x, int y, Block prevBlock, Block newBlock);
|
||||
|
||||
private:
|
||||
QJSEngine *engine;
|
||||
QStringList filepaths;
|
||||
QList<QJSValue> modules;
|
||||
|
||||
void loadModules(QStringList moduleFiles);
|
||||
void invokeCallback(CallbackType type, QJSValueList args);
|
||||
};
|
||||
|
||||
#endif // SCRIPTING_H
|
||||
Reference in New Issue
Block a user