mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-26 10:35:55 -05:00
Merge branch 'master' into ruler-tool
This commit is contained in:
37
include/ui/flowlayout.h
Normal file
37
include/ui/flowlayout.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef FLOWLAYOUT_H
|
||||
#define FLOWLAYOUT_H
|
||||
|
||||
#include <QLayout>
|
||||
#include <QStyle>
|
||||
|
||||
|
||||
class FlowLayout : public QLayout
|
||||
{
|
||||
public:
|
||||
explicit FlowLayout(QWidget *parent, int margin = -1, int hSpacing = -1, int vSpacing = -1);
|
||||
explicit FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
|
||||
~FlowLayout();
|
||||
|
||||
void addItem(QLayoutItem *item) override;
|
||||
int horizontalSpacing() const;
|
||||
int verticalSpacing() const;
|
||||
Qt::Orientations expandingDirections() const override;
|
||||
bool hasHeightForWidth() const override;
|
||||
int heightForWidth(int) const override;
|
||||
int count() const override;
|
||||
QLayoutItem *itemAt(int index) const override;
|
||||
QSize minimumSize() const override;
|
||||
void setGeometry(const QRect &rect) override;
|
||||
QSize sizeHint() const override;
|
||||
QLayoutItem *takeAt(int index) override;
|
||||
|
||||
private:
|
||||
int doLayout(const QRect &rect, bool testOnly) const;
|
||||
int smartSpacing(QStyle::PixelMetric pm) const;
|
||||
|
||||
QList<QLayoutItem *> itemList;
|
||||
int horzSpace;
|
||||
int vertSpace;
|
||||
};
|
||||
|
||||
#endif // FLOWLAYOUT_H
|
||||
@@ -45,7 +45,9 @@ private:
|
||||
void refreshColor(int);
|
||||
void setColor(int);
|
||||
void commitEditHistory(int paletteid);
|
||||
void restoreWindowState();
|
||||
void setColorsFromHistory(PaletteHistoryItem*, int);
|
||||
void closeEvent(QCloseEvent*);
|
||||
|
||||
signals:
|
||||
void closed();
|
||||
|
||||
@@ -97,6 +97,7 @@ private:
|
||||
bool createCityMap(QString name);
|
||||
bool tryInsertNewMapEntry(QString);
|
||||
|
||||
void restoreWindowState();
|
||||
void closeEvent(QCloseEvent* event);
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -37,8 +37,9 @@ class TilesetEditor : public QMainWindow
|
||||
public:
|
||||
explicit TilesetEditor(Project*, Map*, QWidget *parent = nullptr);
|
||||
~TilesetEditor();
|
||||
void setMap(Map*);
|
||||
void setTilesets(QString, QString);
|
||||
void update(Map *map, QString primaryTilsetLabel, QString secondaryTilesetLabel);
|
||||
void updateMap(Map *map);
|
||||
void updateTilesets(QString primaryTilsetLabel, QString secondaryTilesetLabel);
|
||||
bool selectMetatile(uint16_t metatileId);
|
||||
|
||||
private slots:
|
||||
@@ -92,17 +93,25 @@ private slots:
|
||||
void on_actionImport_Secondary_Metatiles_triggered();
|
||||
|
||||
private:
|
||||
void init(Project*, Map*);
|
||||
void closeEvent(QCloseEvent*);
|
||||
void initMetatileSelector(Map*);
|
||||
void initUi();
|
||||
void setMetatileBehaviors();
|
||||
void setMetatileLayersUi();
|
||||
void setVersionSpecificUi();
|
||||
void setMetatileLabelValidator();
|
||||
void initMetatileSelector();
|
||||
void initTileSelector();
|
||||
void initSelectedTileItem();
|
||||
void initMetatileLayersItem();
|
||||
void restoreWindowState();
|
||||
void initMetatileHistory();
|
||||
void setTilesets(QString primaryTilesetLabel, QString secondaryTilesetLabel);
|
||||
void reset();
|
||||
void drawSelectedTiles();
|
||||
void importTilesetTiles(Tileset*, bool);
|
||||
void importTilesetMetatiles(Tileset*, bool);
|
||||
void refresh();
|
||||
void saveMetatileLabel();
|
||||
void closeEvent(QCloseEvent*);
|
||||
Ui::TilesetEditor *ui;
|
||||
History<MetatileHistoryItem*> metatileHistory;
|
||||
TilesetEditorMetatileSelector *metatileSelector = nullptr;
|
||||
@@ -110,6 +119,7 @@ private:
|
||||
MetatileLayersItem *metatileLayersItem = nullptr;
|
||||
PaletteEditor *paletteEditor = nullptr;
|
||||
Project *project = nullptr;
|
||||
Map *map = nullptr;
|
||||
Metatile *metatile = nullptr;
|
||||
int paletteId;
|
||||
bool tileXFlip;
|
||||
|
||||
Reference in New Issue
Block a user