porymap/project.h

120 lines
3.6 KiB
C
Raw Normal View History

2016-09-07 04:50:47 +01:00
#ifndef PROJECT_H
#define PROJECT_H
#include "map.h"
#include "blockdata.h"
#include <QStringList>
#include <QList>
#include <QStandardItem>
2016-09-07 04:50:47 +01:00
class Project
{
public:
Project();
QString root;
2017-11-28 04:46:27 +00:00
QStringList *groupNames = NULL;
QMap<QString, int> *map_groups;
QList<QStringList> groupedMapNames;
2017-11-28 04:46:27 +00:00
QStringList *mapNames = NULL;
QMap<QString, QString>* mapConstantsToMapNames;
QMap<QString, QString>* mapNamesToMapConstants;
2018-06-20 23:43:20 +01:00
QList<QString> mapLayoutsTable;
QList<QString> mapLayoutsTableMaster;
QMap<QString, MapLayout*> mapLayouts;
QMap<QString, MapLayout*> mapLayoutsMaster;
QStringList *itemNames = NULL;
QStringList *flagNames = NULL;
QStringList *varNames = NULL;
QStringList mapsWithConnections;
2016-09-07 04:50:47 +01:00
QMap<QString, Map*> *map_cache;
Map* loadMap(QString);
Map* getMap(QString);
2017-11-28 04:46:27 +00:00
QMap<QString, Tileset*> *tileset_cache = NULL;
2016-09-07 04:50:47 +01:00
Tileset* loadTileset(QString);
Tileset* getTileset(QString);
Blockdata* readBlockdata(QString);
void loadBlockdata(Map*);
QString readTextFile(QString path);
void saveTextFile(QString path, QString text);
void appendTextFile(QString path, QString text);
void deleteFile(QString path);
2016-09-07 04:50:47 +01:00
void readMapGroups();
Map* addNewMapToGroup(QString mapName, int groupNum);
QString getNewMapName();
2016-09-07 04:50:47 +01:00
QString getProjectTitle();
QList<QStringList>* getLabelMacros(QList<QStringList>*, QString);
QStringList* getLabelValues(QList<QStringList>*, QString);
void readMapHeader(Map*);
2018-06-20 23:43:20 +01:00
void readMapLayoutsTable();
void readAllMapLayouts();
QStringList* readLayoutValues(QString layoutName);
void readMapLayout(Map*);
void readMapsWithConnections();
2018-07-08 17:17:43 +01:00
void loadMapTilesets(Map*);
2016-09-07 04:50:47 +01:00
void loadTilesetAssets(Tileset*);
void saveBlockdata(Map*);
void saveMapBorder(Map*);
2016-09-07 04:50:47 +01:00
void writeBlockdata(QString, Blockdata*);
void saveAllMaps();
void saveMap(Map*);
2018-02-16 02:38:19 +00:00
void saveAllDataStructures();
2018-06-20 23:43:20 +01:00
void saveAllMapLayouts();
2018-02-18 00:29:38 +00:00
void saveMapGroupsTable();
void saveMapConstantsHeader();
2016-09-07 04:50:47 +01:00
QList<QStringList>* parseAsm(QString text);
2016-09-07 04:50:47 +01:00
QStringList getSongNames();
QStringList getLocations();
QStringList getVisibilities();
QMap<QString, QStringList> getTilesets();
2016-09-07 04:50:47 +01:00
QStringList getWeathers();
QStringList getMapTypes();
QStringList getBattleScenes();
void readItemNames();
void readFlagNames();
void readVarNames();
2016-09-07 04:50:47 +01:00
void loadEventPixmaps(QList<Event*> objects);
QMap<QString, int> getEventObjGfxConstants();
2016-09-07 04:50:47 +01:00
QString fixGraphicPath(QString path);
void readMapEvents(Map *map);
void loadMapConnections(Map *map);
void loadMapBorder(Map *map);
2017-11-28 04:46:27 +00:00
void saveMapEvents(Map *map);
QStringList readCArray(QString text, QString label);
QString readCIncbin(QString text, QString label);
2018-02-12 02:24:48 +00:00
QMap<QString, int> readCDefines(QString text, QStringList prefixes);
2018-02-16 02:38:19 +00:00
private:
2018-06-20 23:43:20 +01:00
QString getMapLayoutsTableFilepath();
QString getMapLayoutFilepath(QString);
2018-02-16 02:38:19 +00:00
void saveMapHeader(Map*);
2018-03-08 05:05:35 +00:00
void saveMapConnections(Map*);
void updateMapsWithConnections(Map*);
void saveMapsWithConnections();
2018-06-20 23:43:20 +01:00
void saveMapLayoutsTable();
void updateMapLayout(Map*);
void readCDefinesSorted(QString, QStringList, QStringList*);
void readCDefinesSorted(QString, QStringList, QStringList*, QString, int);
2018-02-18 18:32:30 +00:00
void setNewMapHeader(Map* map, int mapIndex);
2018-06-20 23:43:20 +01:00
void setNewMapLayout(Map* map);
2018-02-18 18:32:30 +00:00
void setNewMapBlockdata(Map* map);
void setNewMapBorder(Map *map);
void setNewMapEvents(Map *map);
void setNewMapConnections(Map *map);
2016-09-07 04:50:47 +01:00
};
#endif // PROJECT_H