mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-28 03:25:30 -05:00
Support custom fields for all event types
This commit is contained in:
@@ -23,6 +23,7 @@ class Event
|
||||
{
|
||||
public:
|
||||
Event();
|
||||
Event(QJsonObject, QString);
|
||||
public:
|
||||
int x() {
|
||||
return getInt("x");
|
||||
@@ -75,8 +76,12 @@ public:
|
||||
void setPixmapFromSpritesheet(QImage, int, int);
|
||||
int getPixelX();
|
||||
int getPixelY();
|
||||
QMap<QString, bool> getExpectedFields();
|
||||
void readCustomValues(QJsonObject values);
|
||||
void addCustomValuesTo(QJsonObject *obj);
|
||||
|
||||
QMap<QString, QString> values;
|
||||
QMap<QString, QString> customValues;
|
||||
QPixmap pixmap;
|
||||
int spriteWidth;
|
||||
int spriteHeight;
|
||||
|
||||
22
include/ui/customattributestable.h
Normal file
22
include/ui/customattributestable.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef CUSTOMATTRIBUTESTABLE_H
|
||||
#define CUSTOMATTRIBUTESTABLE_H
|
||||
|
||||
#include "event.h"
|
||||
#include <QObject>
|
||||
#include <QFrame>
|
||||
#include <QTableWidget>
|
||||
|
||||
class CustomAttributesTable : public QFrame
|
||||
{
|
||||
public:
|
||||
explicit CustomAttributesTable(Event *event, QWidget *parent = nullptr);
|
||||
~CustomAttributesTable();
|
||||
|
||||
private:
|
||||
Event *event;
|
||||
QTableWidget *table;
|
||||
void resizeVertically();
|
||||
QMap<QString, QString> getTableFields();
|
||||
};
|
||||
|
||||
#endif // CUSTOMATTRIBUTESTABLE_H
|
||||
Reference in New Issue
Block a user