mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-19 23:25:09 -05:00
add options to count metatiles to tileset editor
- count the total number of usages across all maps of specific metatiles - display the count and/or display unused metatiles - this does not account for metatiles used in code (most of these are labeled)
This commit is contained in:
@@ -75,6 +75,9 @@ private slots:
|
||||
|
||||
void on_actionChange_Palettes_triggered();
|
||||
|
||||
void on_actionShow_Unused_toggled(bool checked);
|
||||
void on_actionShow_Counts_toggled(bool checked);
|
||||
|
||||
void on_actionUndo_triggered();
|
||||
|
||||
void on_actionRedo_triggered();
|
||||
@@ -119,6 +122,7 @@ private:
|
||||
void refresh();
|
||||
void saveMetatileLabel();
|
||||
void closeEvent(QCloseEvent*);
|
||||
void countMetatileUsage();
|
||||
|
||||
Ui::TilesetEditor *ui;
|
||||
History<MetatileHistoryItem*> metatileHistory;
|
||||
|
||||
@@ -8,21 +8,20 @@
|
||||
class TilesetEditorMetatileSelector: public SelectablePixmapItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
TilesetEditorMetatileSelector(Tileset *primaryTileset, Tileset *secondaryTileset, Map *map): SelectablePixmapItem(32, 32, 1, 1) {
|
||||
this->primaryTileset = primaryTileset;
|
||||
this->secondaryTileset = secondaryTileset;
|
||||
this->numMetatilesWide = 8;
|
||||
this->map = map;
|
||||
setAcceptHoverEvents(true);
|
||||
}
|
||||
TilesetEditorMetatileSelector(Tileset *primaryTileset, Tileset *secondaryTileset, Map *map);
|
||||
Map *map = nullptr;
|
||||
void draw();
|
||||
bool select(uint16_t metatileId);
|
||||
void setTilesets(Tileset*, Tileset*);
|
||||
void setTilesets(Tileset*, Tileset*, bool draw = true);
|
||||
uint16_t getSelectedMetatile();
|
||||
void updateSelectedMetatile();
|
||||
QPoint getMetatileIdCoordsOnWidget(uint16_t metatileId);
|
||||
|
||||
//
|
||||
QVector<uint16_t> usedMetatiles;
|
||||
bool selectorShowUnused = false;
|
||||
bool selectorShowCounts = false;
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent*);
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent*);
|
||||
@@ -39,6 +38,10 @@ private:
|
||||
QPoint getMetatileIdCoords(uint16_t);
|
||||
bool shouldAcceptEvent(QGraphicsSceneMouseEvent*);
|
||||
|
||||
void drawFilters();
|
||||
void drawUnused();
|
||||
void drawCounts();
|
||||
|
||||
signals:
|
||||
void hoveredMetatileChanged(uint16_t);
|
||||
void hoveredMetatileCleared();
|
||||
|
||||
Reference in New Issue
Block a user