No Description

project.h 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #ifndef PROJECT_H
  2. #define PROJECT_H
  3. #include "map.h"
  4. #include "blockdata.h"
  5. #include <QStringList>
  6. #include <QList>
  7. #include <QStandardItem>
  8. class Project
  9. {
  10. public:
  11. Project();
  12. QString root;
  13. QStringList *groupNames = NULL;
  14. QMap<QString, int> *map_groups;
  15. QList<QStringList> groupedMapNames;
  16. QStringList *mapNames = NULL;
  17. QMap<QString, QString>* mapConstantsToMapNames;
  18. QMap<QString, QString>* mapNamesToMapConstants;
  19. QMap<int, QString> mapAttributesTable;
  20. QMap<int, QString> mapAttributesTableMaster;
  21. QMap<QString, QMap<QString, QString>> mapAttributes;
  22. QMap<QString, QMap<QString, QString>> mapAttributesMaster;
  23. QMap<QString, Map*> *map_cache;
  24. Map* loadMap(QString);
  25. Map* getMap(QString);
  26. QMap<QString, Tileset*> *tileset_cache = NULL;
  27. Tileset* loadTileset(QString);
  28. Tileset* getTileset(QString);
  29. Blockdata* readBlockdata(QString);
  30. void loadBlockdata(Map*);
  31. QString readTextFile(QString path);
  32. void saveTextFile(QString path, QString text);
  33. void appendTextFile(QString path, QString text);
  34. void readMapGroups();
  35. Map* addNewMapToGroup(QString mapName, int groupNum);
  36. QString getNewMapName();
  37. QString getProjectTitle();
  38. QList<QStringList>* getLabelMacros(QList<QStringList>*, QString);
  39. QStringList* getLabelValues(QList<QStringList>*, QString);
  40. void readMapHeader(Map*);
  41. void readMapAttributesTable();
  42. void readAllMapAttributes();
  43. void readMapAttributes(Map*);
  44. void getTilesets(Map*);
  45. void loadTilesetAssets(Tileset*);
  46. void setNewMapHeader(Map* map, int mapIndex);
  47. void setNewMapAttributes(Map* map);
  48. void setNewMapBlockdata(Map* map);
  49. void setNewMapBorder(Map *map);
  50. void setNewMapEvents(Map *map);
  51. void setNewMapConnections(Map *map);
  52. QString getBlockdataPath(Map*);
  53. void saveBlockdata(Map*);
  54. void saveMapBorder(Map*);
  55. void writeBlockdata(QString, Blockdata*);
  56. void saveAllMaps();
  57. void saveMap(Map*);
  58. void saveAllDataStructures();
  59. void saveAllMapAttributes();
  60. void saveMapGroupsTable();
  61. void saveMapConstantsHeader();
  62. QList<QStringList>* parse(QString text);
  63. QStringList getSongNames();
  64. QString getSongName(int);
  65. QStringList getLocations();
  66. QStringList getVisibilities();
  67. QStringList getWeathers();
  68. QStringList getMapTypes();
  69. QStringList getBattleScenes();
  70. void loadObjectPixmaps(QList<Event*> objects);
  71. QMap<QString, int> getMapObjGfxConstants();
  72. QString fixGraphicPath(QString path);
  73. void readMapEvents(Map *map);
  74. void loadMapConnections(Map *map);
  75. void loadMapBorder(Map *map);
  76. QString getMapBorderPath(Map *map);
  77. void saveMapEvents(Map *map);
  78. QStringList readCArray(QString text, QString label);
  79. QString readCIncbin(QString text, QString label);
  80. QMap<QString, int> readCDefines(QString text, QStringList prefixes);
  81. private:
  82. QString getMapAttributesTableFilepath();
  83. QString getMapAssetsFilepath();
  84. void saveMapHeader(Map*);
  85. void saveMapAttributesTable();
  86. void updateMapAttributes(Map* map);
  87. };
  88. #endif // PROJECT_H