forked from wario-land/WL4Editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptInterface.h
More file actions
56 lines (45 loc) · 1.83 KB
/
ScriptInterface.h
File metadata and controls
56 lines (45 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef SCRIPTINTERFACE_H
#define SCRIPTINTERFACE_H
#include <QObject>
#include <QInputDialog>
#include <QFileDialog>
#include <QMessageBox>
#include <string>
#include <QTextStream>
class ScriptInterface : public QObject
{
Q_OBJECT
public:
explicit ScriptInterface(QObject *parent = nullptr);
// Getter
Q_INVOKABLE int GetCurRoomLayerWidth(int layerId);
Q_INVOKABLE int GetCurRoomLayerHeight(int layerId);
Q_INVOKABLE int GetCurRoomTile16(int layerID, int x, int y);
Q_INVOKABLE int GetCurRoomTile8(int layerID, int x, int y);
Q_INVOKABLE int GetRoomNum();
Q_INVOKABLE int GetCurRoomId();
Q_INVOKABLE QString GetEntityListData(int entitylistid = -1);
// Test
Q_INVOKABLE void _DecompressData(int mappingtype, int address);
Q_INVOKABLE unsigned int _GetLayerDecomdataPointer(int layerId);
Q_INVOKABLE void _PrintRoomHeader();
Q_INVOKABLE void _ExportLayerData(QString filePath = QString(""), int layerid = -1);
Q_INVOKABLE void _ImportLayerData(QString fileName = QString(""), int layerid = -1);
// Setter
Q_INVOKABLE void SetCurrentRoomId(int roomid);
Q_INVOKABLE void SetCurRoomTile16(int layerID, int TileID, int x, int y);
Q_INVOKABLE void SetRoomSize(int roomwidth, int roomheight, int layer0width, int layer0height);
Q_INVOKABLE void SetEntityListData(QString entitylistdata, int entitylistid = -1);
// Localize JS function
Q_INVOKABLE void alert(QString message);
Q_INVOKABLE void clear();
Q_INVOKABLE void log(QString message);
Q_INVOKABLE QString prompt(QString message, QString defaultInput);
// UI
Q_INVOKABLE void UpdateRoomGFXFull();
// File operations
Q_INVOKABLE void WriteTxtFile(QString filePath = QString(""), QString test = "");
Q_INVOKABLE QString ReadTxtFile(QString filepath);
signals:
};
#endif // SCRIPTINTERFACE_H