mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-24 01:26:30 -05:00
Merge remote-tracking branch 'origin/master' into better-map-zoom
This commit is contained in:
@@ -50,7 +50,10 @@ public:
|
||||
void setRecentMap(QString map);
|
||||
void setMapSortOrder(MapSortOrder order);
|
||||
void setPrettyCursors(bool enabled);
|
||||
void setGeometry(QByteArray, QByteArray, QByteArray, QByteArray);
|
||||
void setMainGeometry(QByteArray, QByteArray, QByteArray, QByteArray);
|
||||
void setTilesetEditorGeometry(QByteArray, QByteArray);
|
||||
void setPaletteEditorGeometry(QByteArray, QByteArray);
|
||||
void setRegionMapEditorGeometry(QByteArray, QByteArray);
|
||||
void setCollisionOpacity(int opacity);
|
||||
void setMetatilesZoom(int zoom);
|
||||
void setShowPlayerView(bool enabled);
|
||||
@@ -62,7 +65,10 @@ public:
|
||||
QString getRecentMap();
|
||||
MapSortOrder getMapSortOrder();
|
||||
bool getPrettyCursors();
|
||||
QMap<QString, QByteArray> getGeometry();
|
||||
QMap<QString, QByteArray> getMainGeometry();
|
||||
QMap<QString, QByteArray> getTilesetEditorGeometry();
|
||||
QMap<QString, QByteArray> getPaletteEditorGeometry();
|
||||
QMap<QString, QByteArray> getRegionMapEditorGeometry();
|
||||
int getCollisionOpacity();
|
||||
int getMetatilesZoom();
|
||||
bool getShowPlayerView();
|
||||
@@ -83,11 +89,17 @@ private:
|
||||
QByteArray bytesFromString(QString);
|
||||
MapSortOrder mapSortOrder;
|
||||
bool prettyCursors;
|
||||
QByteArray windowGeometry;
|
||||
QByteArray windowState;
|
||||
QByteArray mainWindowGeometry;
|
||||
QByteArray mainWindowState;
|
||||
QByteArray mapSplitterState;
|
||||
QByteArray eventsSlpitterState;
|
||||
QByteArray mainSplitterState;
|
||||
QByteArray tilesetEditorGeometry;
|
||||
QByteArray tilesetEditorState;
|
||||
QByteArray paletteEditorGeometry;
|
||||
QByteArray paletteEditorState;
|
||||
QByteArray regionMapEditorGeometry;
|
||||
QByteArray regionMapEditorState;
|
||||
int collisionOpacity;
|
||||
int metatilesZoom;
|
||||
bool showPlayerView;
|
||||
|
||||
@@ -20,5 +20,6 @@ void logError(QString message);
|
||||
void log(QString message, LogType type);
|
||||
QString getLogPath();
|
||||
QString getMostRecentError();
|
||||
bool cleanupLargeLog();
|
||||
|
||||
#endif // LOG_H
|
||||
|
||||
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