mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-09 09:25:36 -05:00
Load and display prefabs in UI
This commit is contained in:
@@ -18,4 +18,6 @@ public:
|
||||
void setMap(Map *map) { this->map = map; }
|
||||
};
|
||||
|
||||
QPixmap drawMetatileSelection(MetatileSelection selection, Map *map);
|
||||
|
||||
#endif // CURRENTSELECTEDMETATILESPIXMAPITEM_H
|
||||
|
||||
31
include/ui/prefab.h
Normal file
31
include/ui/prefab.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef PREFAB_H
|
||||
#define PREFAB_H
|
||||
|
||||
#include "ui/metatileselector.h"
|
||||
#include "map.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QLabel>
|
||||
|
||||
struct PrefabItem
|
||||
{
|
||||
QString name;
|
||||
QString primaryTileset;
|
||||
QString secondaryTileset;
|
||||
MetatileSelection selection;
|
||||
};
|
||||
|
||||
class Prefab
|
||||
{
|
||||
public:
|
||||
void initPrefabUI(QWidget *prefabWidget, QLabel *emptyPrefabLabel, QString primaryTileset, QString secondaryTileset, Map *map);
|
||||
|
||||
private:
|
||||
QList<PrefabItem> items;
|
||||
void loadPrefabs();
|
||||
QList<PrefabItem> getPrefabsForTilesets(QString primaryTileset, QString secondaryTileset);
|
||||
};
|
||||
|
||||
extern Prefab prefab;
|
||||
|
||||
#endif // PREFAB_H
|
||||
22
include/ui/prefabframe.h
Normal file
22
include/ui/prefabframe.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef PREFABFRAME_H
|
||||
#define PREFABFRAME_H
|
||||
|
||||
#include <QFrame>
|
||||
|
||||
namespace Ui {
|
||||
class PrefabFrame;
|
||||
}
|
||||
|
||||
class PrefabFrame : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PrefabFrame(QWidget *parent = nullptr);
|
||||
~PrefabFrame();
|
||||
|
||||
public:
|
||||
Ui::PrefabFrame *ui;
|
||||
};
|
||||
|
||||
#endif // PREFABFRAME_H
|
||||
Reference in New Issue
Block a user