Brak opisu

project.h 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. QStringList *itemNames = NULL;
  24. QStringList *flagNames = NULL;
  25. QStringList *varNames = NULL;
  26. QMap<QString, Map*> *map_cache;
  27. Map* loadMap(QString);
  28. Map* getMap(QString);
  29. QMap<QString, Tileset*> *tileset_cache = NULL;
  30. Tileset* loadTileset(QString);
  31. Tileset* getTileset(QString);
  32. Blockdata* readBlockdata(QString);
  33. void loadBlockdata(Map*);
  34. QString readTextFile(QString path);
  35. void saveTextFile(QString path, QString text);
  36. void appendTextFile(QString path, QString text);
  37. void readMapGroups();
  38. Map* addNewMapToGroup(QString mapName, int groupNum);
  39. QString getNewMapName();
  40. QString getProjectTitle();
  41. QList<QStringList>* getLabelMacros(QList<QStringList>*, QString);
  42. QStringList* getLabelValues(QList<QStringList>*, QString);
  43. void readMapHeader(Map*);
  44. void readMapAttributesTable();
  45. void readAllMapAttributes();
  46. void readMapAttributes(Map*);
  47. void getTilesets(Map*);
  48. void loadTilesetAssets(Tileset*);
  49. QString getBlockdataPath(Map*);
  50. void saveBlockdata(Map*);
  51. void saveMapBorder(Map*);
  52. void writeBlockdata(QString, Blockdata*);
  53. void saveAllMaps();
  54. void saveMap(Map*);
  55. void saveAllDataStructures();
  56. void saveAllMapAttributes();
  57. void saveMapGroupsTable();
  58. void saveMapConstantsHeader();
  59. QList<QStringList>* parseAsm(QString text);
  60. QStringList getSongNames();
  61. QStringList getLocations();
  62. QStringList getVisibilities();
  63. QStringList getWeathers();
  64. QStringList getMapTypes();
  65. QStringList getBattleScenes();
  66. void readItemNames();
  67. void readFlagNames();
  68. void readVarNames();
  69. void loadObjectPixmaps(QList<Event*> objects);
  70. QMap<QString, int> getMapObjGfxConstants();
  71. QString fixGraphicPath(QString path);
  72. void readMapEvents(Map *map);
  73. void loadMapConnections(Map *map);
  74. void loadMapBorder(Map *map);
  75. QString getMapBorderPath(Map *map);
  76. void saveMapEvents(Map *map);
  77. QStringList readCArray(QString text, QString label);
  78. QString readCIncbin(QString text, QString label);
  79. QMap<QString, int> readCDefines(QString text, QStringList prefixes);
  80. private:
  81. QString getMapAttributesTableFilepath();
  82. QString getMapAssetsFilepath();
  83. void saveMapHeader(Map*);
  84. void saveMapAttributesTable();
  85. void updateMapAttributes(Map* map);
  86. void readCDefinesSorted(QString, QStringList, QStringList*);
  87. void readCDefinesSorted(QString, QStringList, QStringList*, QString, int);
  88. void setNewMapHeader(Map* map, int mapIndex);
  89. void setNewMapAttributes(Map* map);
  90. void setNewMapBlockdata(Map* map);
  91. void setNewMapBorder(Map *map);
  92. void setNewMapEvents(Map *map);
  93. void setNewMapConnections(Map *map);
  94. };
  95. #endif // PROJECT_H