mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-28 03:25:30 -05:00
Add sorting options to the Locations and Layouts list
This commit is contained in:
@@ -97,6 +97,8 @@ public:
|
||||
int mapListTab;
|
||||
bool mapListEditGroupsEnabled;
|
||||
QMap<int, bool> mapListHideEmptyEnabled;
|
||||
bool mapListLayoutsSorted;
|
||||
bool mapListLocationsSorted;
|
||||
bool prettyCursors;
|
||||
bool mirrorConnectingMaps;
|
||||
bool showDiveEmergeMaps;
|
||||
|
||||
@@ -393,10 +393,10 @@ private:
|
||||
void openDuplicateMapOrLayoutDialog();
|
||||
void openNewMapGroupDialog();
|
||||
void openNewLocationDialog();
|
||||
void scrollMapList(MapTree *list, const QString &itemName);
|
||||
void scrollMapList(MapTree *list, const QString &itemName, bool expandItem = true);
|
||||
void scrollMapListToCurrentMap(MapTree *list);
|
||||
void scrollMapListToCurrentLayout(MapTree *list);
|
||||
void scrollCurrentMapListToItem(const QString &itemName);
|
||||
void scrollCurrentMapListToItem(const QString &itemName, bool expandItem = true);
|
||||
void showFileWatcherWarning();
|
||||
bool openProject(QString dir, bool initial = false);
|
||||
bool closeProject();
|
||||
@@ -410,6 +410,7 @@ private:
|
||||
|
||||
void rebuildMapList_Locations();
|
||||
void rebuildMapList_Layouts();
|
||||
void setMapListSorted(MapTree *list, bool sort);
|
||||
void updateMapList();
|
||||
void openMapListItem(const QModelIndex &index);
|
||||
void onMapListTabChanged(int index);
|
||||
|
||||
@@ -52,8 +52,6 @@ public:
|
||||
QStringList bgEventFacingDirections;
|
||||
QStringList trainerTypes;
|
||||
QStringList globalScriptLabels;
|
||||
QStringList mapSectionIdNamesSaveOrder;
|
||||
QStringList mapSectionIdNames;
|
||||
QMap<uint32_t, QString> encounterTypeToName;
|
||||
QMap<uint32_t, QString> terrainTypeToName;
|
||||
QMap<QString, QMap<QString, uint16_t>> metatileLabelsMap;
|
||||
@@ -83,6 +81,7 @@ public:
|
||||
Map* loadMap(const QString &mapName);
|
||||
|
||||
const QStringList& layoutIds() const { return this->alphabeticalLayoutIds; }
|
||||
const QStringList& layoutIdsOrdered() const { return this->orderedLayoutIds; }
|
||||
bool isKnownLayout(const QString &layoutId) const { return this->mapLayouts.contains(layoutId); }
|
||||
bool isLoadedLayout(const QString &layoutId) const { return this->loadedLayoutIds.contains(layoutId); }
|
||||
bool isUnsavedLayout(const QString &layoutId) const;
|
||||
@@ -93,6 +92,12 @@ public:
|
||||
Layout* getLayout(const QString &layoutId) const { return this->mapLayouts.value(layoutId); }
|
||||
Layout* loadLayout(const QString &layoutId);
|
||||
|
||||
const QStringList& locationNames() const { return this->mapSectionIdNames; }
|
||||
const QStringList& locationNamesOrdered() const { return this->mapSectionIdNamesSaveOrder; }
|
||||
|
||||
QString getLocationName(int locationValue) const { return this->mapSectionIdNamesSaveOrder.value(locationValue, getEmptyMapsecName()); }
|
||||
int getLocationValue(const QString &locationName) const { return this->mapSectionIdNamesSaveOrder.indexOf(locationName); }
|
||||
|
||||
void clearMaps();
|
||||
void clearTilesetCache();
|
||||
void clearMapLayouts();
|
||||
@@ -284,6 +289,8 @@ private:
|
||||
QStringList orderedLayoutIdsMaster;
|
||||
QHash<QString, Layout*> mapLayouts;
|
||||
QHash<QString, Layout*> mapLayoutsMaster;
|
||||
QStringList mapSectionIdNamesSaveOrder;
|
||||
QStringList mapSectionIdNames;
|
||||
|
||||
// Fields for preserving top-level JSON data that Porymap isn't expecting.
|
||||
QJsonObject customLayoutsData;
|
||||
|
||||
Reference in New Issue
Block a user