Nessuna descrizione

project.h 3.2KB

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