mirror of
https://github.com/huderlem/porymap.git
synced 2026-10-01 12:26:37 -05:00
Add map list sorting and filtering
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "map.h"
|
||||
#include "editor.h"
|
||||
#include "tileseteditor.h"
|
||||
#include "filterchildrenproxymodel.h"
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
@@ -128,19 +129,32 @@ private slots:
|
||||
|
||||
void on_actionTileset_Editor_triggered();
|
||||
|
||||
void mapSortOrder_changed(QAction *action);
|
||||
|
||||
void on_lineEdit_filterBox_textChanged(const QString &arg1);
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
TilesetEditor *tilesetEditor = nullptr;
|
||||
FilterChildrenProxyModel *mapListProxyModel;
|
||||
QStandardItemModel *mapListModel;
|
||||
QList<QStandardItem*> *mapGroupsModel;
|
||||
QList<QStandardItem*> *mapGroupItemsList;
|
||||
QMap<QString, QModelIndex> mapListIndexes;
|
||||
Editor *editor = nullptr;
|
||||
QIcon* mapIcon;
|
||||
QIcon* mapEditedIcon;
|
||||
|
||||
enum MapSortOrder {
|
||||
Group = 0,
|
||||
Name = 1,
|
||||
Layout = 2,
|
||||
} mapSortOrder;
|
||||
|
||||
void setMap(QString, bool scrollTreeView = false);
|
||||
void redrawMapScene();
|
||||
void loadDataStructures();
|
||||
void populateMapList();
|
||||
void sortMapList();
|
||||
QString getExistingDirectory(QString);
|
||||
void openProject(QString dir);
|
||||
QString getDefaultMap();
|
||||
@@ -157,14 +171,18 @@ private:
|
||||
void initExtraShortcuts();
|
||||
void initExtraSignals();
|
||||
void initEditor();
|
||||
void initMiscHeapObjects();
|
||||
void initMapSortOrder();
|
||||
void loadUserSettings();
|
||||
void openRecentProject();
|
||||
void updateTilesetEditor();
|
||||
|
||||
bool isProjectOpen();
|
||||
};
|
||||
|
||||
enum MapListUserRoles {
|
||||
GroupRole = Qt::UserRole + 1, // Used to hold the map group number.
|
||||
TypeRole = Qt::UserRole + 2, // Used to differentiate between the different layers of the map list tree view.
|
||||
TypeRole, // Used to differentiate between the different layers of the map list tree view.
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
||||
@@ -64,6 +64,9 @@ public:
|
||||
QString getNewMapName();
|
||||
QString getProjectTitle();
|
||||
|
||||
QString readMapLayoutId(QString map_name);
|
||||
QString readMapLocation(QString map_name);
|
||||
|
||||
QList<QStringList>* getLabelMacros(QList<QStringList>*, QString);
|
||||
QStringList* getLabelValues(QList<QStringList>*, QString);
|
||||
void readMapHeader(Map*);
|
||||
|
||||
Reference in New Issue
Block a user