porymap/project.h

104 lines
3 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;
2017-11-28 04:46:27 +00:00
QList<QStringList*> *groupedMapNames = NULL;
QStringList *mapNames = NULL;
QMap<QString, QString> *mapConstantsToMapNames;
QMap<QString, QString> *mapNamesToMapConstants;
2018-02-16 02:38:19 +00:00
QMap<int, QString> *mapAttributesTable;
QMap<QString, QMap<QString, QString>*> *mapAttributes;
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);
2016-09-07 04:50:47 +01:00
void readMapGroups();
void 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-02-16 02:38:19 +00:00
void readMapAttributesTable();
void readAllMapAttributes();
2016-09-07 04:50:47 +01:00
void readMapAttributes(Map*);
void getTilesets(Map*);
void loadTilesetAssets(Tileset*);
void setNewMapHeader(Map* map, int mapIndex);
void setNewMapAttributes(Map* map);
void setNewMapBlockdata(Map* map);
void setNewMapBorder(Map *map);
void setNewMapEvents(Map *map);
void setNewMapConnections(Map *map);
2016-09-07 04:50:47 +01:00
QString getBlockdataPath(Map*);
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();
void saveAllMapAttributes();
2018-02-18 00:29:38 +00:00
void saveMapGroupsTable();
2016-09-07 04:50:47 +01:00
QList<QStringList>* parse(QString text);
QStringList getSongNames();
QString getSongName(int);
QStringList getLocations();
QStringList getVisibilities();
QStringList getWeathers();
QStringList getMapTypes();
QStringList getBattleScenes();
2017-11-28 04:46:27 +00:00
void loadObjectPixmaps(QList<Event*> objects);
2016-09-07 04:50:47 +01:00
QMap<QString, int> getMapObjGfxConstants();
QString fixGraphicPath(QString path);
void readMapEvents(Map *map);
void loadMapConnections(Map *map);
void loadMapBorder(Map *map);
QString getMapBorderPath(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:
QString getMapAttributesTableFilepath();
QString getMapAssetsFilepath();
2018-02-16 02:38:19 +00:00
void saveMapHeader(Map*);
void saveMapAttributesTable();
2016-09-07 04:50:47 +01:00
};
#endif // PROJECT_H