porymap/include/ui/tileseteditor.h

82 lines
2.3 KiB
C
Raw Normal View History

2018-09-29 20:13:07 +01:00
#ifndef TILESETEDITOR_H
#define TILESETEDITOR_H
#include <QMainWindow>
#include "project.h"
#include "tileseteditormetatileselector.h"
#include "tileseteditortileselector.h"
2018-09-30 22:15:04 +01:00
#include "metatilelayersitem.h"
2018-09-29 20:13:07 +01:00
namespace Ui {
class TilesetEditor;
}
class TilesetEditor : public QMainWindow
{
Q_OBJECT
public:
explicit TilesetEditor(Project*, QString, QString, QWidget *parent = nullptr);
2018-09-29 20:13:07 +01:00
~TilesetEditor();
void setTilesets(QString, QString);
void init(Project*, QString, QString);
2018-09-29 20:13:07 +01:00
private slots:
void onHoveredMetatileChanged(uint16_t);
void onHoveredMetatileCleared();
void onSelectedMetatileChanged(uint16_t);
void onHoveredTileChanged(uint16_t);
void onHoveredTileCleared();
void onSelectedTilesChanged();
void onMetatileLayerTileChanged(int, int);
void on_spinBox_paletteSelector_valueChanged(int arg1);
void on_checkBox_xFlip_stateChanged(int arg1);
void on_checkBox_yFlip_stateChanged(int arg1);
void on_comboBox_metatileBehaviors_currentIndexChanged(const QString &arg1);
void on_comboBox_layerType_currentIndexChanged(int index);
void on_actionSave_Tileset_triggered();
2018-10-03 01:01:24 +01:00
void on_actionImport_Primary_Tiles_triggered();
void on_actionImport_Secondary_Tiles_triggered();
2018-09-29 20:13:07 +01:00
private:
void closeEvent(QCloseEvent*);
void initMetatileSelector();
void initTileSelector();
void initSelectedTileItem();
2018-09-30 22:15:04 +01:00
void initMetatileLayersItem();
void drawSelectedTiles();
2018-10-03 01:01:24 +01:00
void importTilesetTiles(Tileset*, bool);
void refresh();
2018-09-29 20:13:07 +01:00
Ui::TilesetEditor *ui;
2018-09-30 22:15:04 +01:00
TilesetEditorMetatileSelector *metatileSelector = nullptr;
TilesetEditorTileSelector *tileSelector = nullptr;
MetatileLayersItem *metatileLayersItem = nullptr;
Project *project = nullptr;
Metatile *metatile = nullptr;
int paletteId;
bool tileXFlip;
bool tileYFlip;
bool hasUnsavedChanges;
Tileset *primaryTileset = nullptr;
Tileset *secondaryTileset = nullptr;
QGraphicsScene *metatilesScene = nullptr;
QGraphicsScene *tilesScene = nullptr;
QGraphicsScene *selectedTileScene = nullptr;
QGraphicsPixmapItem *selectedTilePixmapItem = nullptr;
2018-09-30 22:15:04 +01:00
QGraphicsScene *metatileLayersScene = nullptr;
2018-10-03 01:01:15 +01:00
signals:
void tilesetsSaved(QString, QString);
void closed();
2018-09-29 20:13:07 +01:00
};
#endif // TILESETEDITOR_H