mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-12 19:05:37 -05:00
Redesign new tileset dialog
This commit is contained in:
@@ -38,8 +38,6 @@ public:
|
||||
QList<QList<QRgb>> palettes;
|
||||
QList<QList<QRgb>> palettePreviews;
|
||||
|
||||
bool hasUnsavedTilesImage;
|
||||
|
||||
static Tileset* getMetatileTileset(int, Tileset*, Tileset*);
|
||||
static Tileset* getTileTileset(int, Tileset*, Tileset*);
|
||||
static Metatile* getMetatile(int, Tileset*, Tileset*);
|
||||
@@ -56,10 +54,25 @@ public:
|
||||
static QHash<int, QString> getHeaderMemberMap(bool usingAsm);
|
||||
static QString getExpectedDir(QString tilesetName, bool isSecondary);
|
||||
QString getExpectedDir();
|
||||
|
||||
void load();
|
||||
void loadMetatiles();
|
||||
void loadMetatileAttributes();
|
||||
void loadTilesImage(QImage *importedImage = nullptr);
|
||||
void loadPalettes();
|
||||
|
||||
void save();
|
||||
void saveMetatileAttributes();
|
||||
void saveMetatiles();
|
||||
void saveTilesImage();
|
||||
void savePalettes();
|
||||
|
||||
bool appendToHeaders(QString root, QString friendlyName, bool usingAsm);
|
||||
bool appendToGraphics(QString root, QString friendlyName, bool usingAsm);
|
||||
bool appendToMetatiles(QString root, QString friendlyName, bool usingAsm);
|
||||
|
||||
void setTilesImage(const QImage &image);
|
||||
|
||||
void setMetatiles(const QList<Metatile*> &metatiles);
|
||||
void addMetatile(Metatile* metatile);
|
||||
|
||||
@@ -72,6 +85,7 @@ public:
|
||||
|
||||
private:
|
||||
QList<Metatile*> m_metatiles;
|
||||
bool m_hasUnsavedTilesImage = false;
|
||||
};
|
||||
|
||||
#endif // TILESET_H
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "mapimageexporter.h"
|
||||
#include "filterchildrenproxymodel.h"
|
||||
#include "maplistmodels.h"
|
||||
#include "newtilesetdialog.h"
|
||||
#include "shortcutseditor.h"
|
||||
#include "preferenceeditor.h"
|
||||
#include "projectsettingseditor.h"
|
||||
@@ -191,6 +190,7 @@ private slots:
|
||||
void onNewMapGroupCreated(const QString &groupName);
|
||||
void onNewMapSectionCreated(const QString &idName);
|
||||
void onNewLayoutCreated(Layout *layout);
|
||||
void onNewTilesetCreated(Tileset *tileset);
|
||||
void onMapLoaded(Map *map);
|
||||
void onMapRulerStatusChanged(const QString &);
|
||||
void applyUserShortcuts();
|
||||
@@ -412,7 +412,6 @@ private:
|
||||
|
||||
QObjectList shortcutableObjects() const;
|
||||
void addCustomHeaderValue(QString key, QJsonValue value, bool isNew = false);
|
||||
int insertTilesetLabel(QStringList * list, QString label);
|
||||
|
||||
void checkForUpdates(bool requestedByUser);
|
||||
void setDivingMapsVisible(bool visible);
|
||||
|
||||
@@ -139,6 +139,7 @@ public:
|
||||
|
||||
Map *createNewMap(const Project::NewMapSettings &mapSettings, const Map* toDuplicate = nullptr);
|
||||
Layout *createNewLayout(const Layout::Settings &layoutSettings, const Layout* toDuplicate = nullptr);
|
||||
Tileset *createNewTileset(const QString &friendlyName, bool secondary, bool checkerboardFill);
|
||||
bool isIdentifierUnique(const QString &identifier) const;
|
||||
QString getProjectTitle();
|
||||
|
||||
@@ -167,10 +168,7 @@ public:
|
||||
bool loadMapLayout(Map*);
|
||||
bool loadLayoutTilesets(Layout *);
|
||||
void loadTilesetAssets(Tileset*);
|
||||
void loadTilesetTiles(Tileset*, QImage);
|
||||
void loadTilesetMetatiles(Tileset*);
|
||||
void loadTilesetMetatileLabels(Tileset*);
|
||||
void loadTilesetPalettes(Tileset*);
|
||||
void readTilesetPaths(Tileset* tileset);
|
||||
|
||||
void saveLayout(Layout *);
|
||||
@@ -188,10 +186,6 @@ public:
|
||||
void saveHealLocations(Map*);
|
||||
void saveTilesets(Tileset*, Tileset*);
|
||||
void saveTilesetMetatileLabels(Tileset*, Tileset*);
|
||||
void saveTilesetMetatileAttributes(Tileset*);
|
||||
void saveTilesetMetatiles(Tileset*);
|
||||
void saveTilesetTilesImage(Tileset*);
|
||||
void saveTilesetPalettes(Tileset*);
|
||||
void appendTilesetLabel(const QString &label, const QString &isSecondaryStr);
|
||||
bool readTilesetLabels();
|
||||
bool readTilesetMetatileLabels();
|
||||
@@ -282,6 +276,7 @@ signals:
|
||||
void mapLoaded(Map *map);
|
||||
void mapCreated(Map *newMap, const QString &groupName);
|
||||
void layoutCreated(Layout *newLayout);
|
||||
void tilesetCreated(Tileset *newTileset);
|
||||
void mapGroupAdded(const QString &groupName);
|
||||
void mapSectionAdded(const QString &idName);
|
||||
void mapSectionIdNamesChanged(const QStringList &idNames);
|
||||
|
||||
@@ -39,7 +39,6 @@ private:
|
||||
|
||||
void refresh();
|
||||
void saveSettings();
|
||||
bool isExistingLayout() const;
|
||||
|
||||
private slots:
|
||||
void dialogButtonClicked(QAbstractButton *button);
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
#define NEWTILESETDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "project.h"
|
||||
#include <QAbstractButton>
|
||||
|
||||
class Project;
|
||||
class Tileset;
|
||||
|
||||
namespace Ui {
|
||||
class NewTilesetDialog;
|
||||
@@ -15,20 +18,17 @@ class NewTilesetDialog : public QDialog
|
||||
public:
|
||||
explicit NewTilesetDialog(Project *project, QWidget *parent = nullptr);
|
||||
~NewTilesetDialog();
|
||||
QString path;
|
||||
QString fullSymbolName;
|
||||
QString friendlyName;
|
||||
bool isSecondary;
|
||||
bool checkerboardFill;
|
||||
|
||||
private slots:
|
||||
void NameOrSecondaryChanged();
|
||||
void SecondaryChanged();
|
||||
void FillChanged();
|
||||
virtual void accept() override;
|
||||
|
||||
private:
|
||||
Ui::NewTilesetDialog *ui;
|
||||
Project *project = nullptr;
|
||||
const QString symbolPrefix;
|
||||
|
||||
bool validateName(bool allowEmpty = false);
|
||||
void onFriendlyNameChanged(const QString &friendlyName);
|
||||
void dialogButtonClicked(QAbstractButton *button);
|
||||
};
|
||||
|
||||
#endif // NEWTILESETDIALOG_H
|
||||
|
||||
Reference in New Issue
Block a user