| 1 | /* | 
 
 
 
 
 | 2 | * | 
 
 
 
 
 | 3 | Copyright (C) 2017  Fábio Bento (random-guy) | 
 
 
 
 
 | 4 |  | 
 
 
 
 
 | 5 | This program is free software: you can redistribute it and/or modify | 
 
 
 
 
 | 6 | it under the terms of the GNU General Public License as published by | 
 
 
 
 
 | 7 | the Free Software Foundation, either version 3 of the License, or | 
 
 
 
 
 | 8 | (at your option) any later version. | 
 
 
 
 
 | 9 |  | 
 
 
 
 
 | 10 | This program is distributed in the hope that it will be useful, | 
 
 
 
 
 | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 
 
 
 
 
 | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
 
 
 
 
 | 13 | GNU General Public License for more details. | 
 
 
 
 
 | 14 |  | 
 
 
 
 
 | 15 | You should have received a copy of the GNU General Public License | 
 
 
 
 
 | 16 | along with this program.  If not, see <http://www.gnu.org/licenses/>. | 
 
 
 
 
 | 17 | * | 
 
 
 
 
 | 18 | */ | 
 
 
 
 
 | 19 |  | 
 
 
 
 
 | 20 | #ifndef PROJECTFILEVAGO_H | 
 
 
 
 
 | 21 | #define PROJECTFILEVAGO_H | 
 
 
 
 
 | 22 |  | 
 
 
 
 
 | 23 | #include "utilvago.h" | 
 
 
 
 
 | 24 | #include <pugixml/pugixml.hpp> | 
 
 
 
 
 | 25 |  | 
 
 
 
 
 | 26 | class ProjectFileVago | 
 
 
 
 
 | 27 | { | 
 
 
 
 
 | 28 |  | 
 
 
 
 
 | 29 | public: | 
 
 
 
 
 | 30 |  | 
 
 
 
 
 | 31 | struct ProjectTableRow{ | 
 
 
 
 
 | 32 | QString fileFolder; | 
 
 
 
 
 | 33 | QString fromTo; | 
 
 
 
 
 | 34 | QString command; | 
 
 
 
 
 | 35 | bool isDisabled = false; | 
 
 
 
 
 | 36 | }; | 
 
 
 
 
 | 37 |  | 
 
 
 
 
 | 38 | struct ProjectTable{ | 
 
 
 
 
 | 39 | QVector<ProjectTableRow> rows; | 
 
 
 
 
 | 40 | QString from; | 
 
 
 
 
 | 41 | QString to; | 
 
 
 
 
 | 42 | }; | 
 
 
 
 
 | 43 |  | 
 
 
 
 
 | 44 | struct ProjectXMLTable : public ProjectTable{}; | 
 
 
 
 
 | 45 |  | 
 
 
 
 
 | 46 | struct ProjectTexturesTable: public ProjectTable{ | 
 
 
 
 
 | 47 | QString rbTexturesType; | 
 
 
 
 
 | 48 | bool cbGenMipMaps = false; | 
 
 
 
 
 | 49 | bool cbNoUwrap = false; | 
 
 
 
 
 | 50 | bool cbNoVwrap = false; | 
 
 
 
 
 | 51 | bool cbLarge = false; | 
 
 
 
 
 | 52 | bool cbEnvMap = false; | 
 
 
 
 
 | 53 | QString leEnvMapTexture; | 
 
 
 
 
 | 54 | }; | 
 
 
 
 
 | 55 |  | 
 
 
 
 
 | 56 | struct ProjectCharactersTable : public ProjectTable{ | 
 
 
 
 
 | 57 | bool cbCellShading = false; | 
 
 
 
 
 | 58 | bool cbNormals = false; | 
 
 
 
 
 | 59 | bool cbStandingPose = false; | 
 
 
 
 
 | 60 | bool cbWithTRBS_ONCC = false; | 
 
 
 
 
 | 61 | QString leTRBS_ONCC; | 
 
 
 
 
 | 62 | }; | 
 
 
 
 
 | 63 |  | 
 
 
 
 
 | 64 | struct ProjectObjectsTable : public ProjectTable{ | 
 
 
 
 
 | 65 | bool cbTexture = false; | 
 
 
 
 
 | 66 | QString leTextureName; | 
 
 
 
 
 | 67 | bool cbWithAnimation = false; | 
 
 
 
 
 | 68 | QString leAnimationName; | 
 
 
 
 
 | 69 | }; | 
 
 
 
 
 | 70 |  | 
 
 
 
 
 | 71 | struct ProjectLevelsTable : public ProjectTable{ | 
 
 
 
 
 | 72 | bool cbSpecificFilesLevels = false; | 
 
 
 
 
 | 73 | QString leSpecificFilesLevels; | 
 
 
 
 
 | 74 | bool cbDatLevels = false; | 
 
 
 
 
 | 75 | QString leTargetDatLevels; | 
 
 
 
 
 | 76 | bool cbBnvLevels = false; | 
 
 
 
 
 | 77 | QString leBnvLevels; | 
 
 
 
 
 | 78 | bool cbGridsLevels = false; | 
 
 
 
 
 | 79 | bool cbAdditionalSourcesLevels = false; | 
 
 
 
 
 | 80 | QString leAdditSourcesLevels; | 
 
 
 
 
 | 81 | }; | 
 
 
 
 
 | 82 |  | 
 
 
 
 
 | 83 | struct ProjectMiscTable : public ProjectTable{}; | 
 
 
 
 
 | 84 |  | 
 
 
 
 
 | 85 | struct ProjectData{ | 
 
 
 
 
 | 86 | ProjectXMLTable xmlTable; | 
 
 
 
 
 | 87 | ProjectTexturesTable texturesTable; | 
 
 
 
 
 | 88 | ProjectCharactersTable charactersTable; | 
 
 
 
 
 | 89 | ProjectObjectsTable objectsTable; | 
 
 
 
 
 | 90 | ProjectLevelsTable levelsTable; | 
 
 
 
 
 | 91 | ProjectMiscTable miscTable; | 
 
 
 
 
 | 92 | }; | 
 
 
 
 
 | 93 |  | 
 
 
 
 
 | 94 | public: | 
 
 
 
 
 | 95 | ProjectFileVago() = delete; | 
 
 
 
 
 | 96 | static ProjectFileVago::ProjectData readProjectDataFromFile(const QString &fileFullPath); | 
 
 
 
 
 | 97 | static void saveProjectDataToFile(const QString &fileFullPath, const ProjectData &newProjectData); | 
 
 
 
 
 | 98 | private: | 
 
 
 
 
 | 99 | static void upgradeProjectFileIfNecessary(const QString &filePath); | 
 
 
 
 
 | 100 | private: | 
 
 
 
 
 | 101 | static const QString XMLTableName; | 
 
 
 
 
 | 102 | static const QString TexturesTableName; | 
 
 
 
 
 | 103 | static const QString CharactersTableName; | 
 
 
 
 
 | 104 | static const QString ObjectsTableName; | 
 
 
 
 
 | 105 | static const QString LevelsTableName; | 
 
 
 
 
 | 106 | static const QString MiscTableName; | 
 
 
 
 
 | 107 | }; | 
 
 
 
 
 | 108 |  | 
 
 
 
 
 | 109 | #endif // PROJECTFILEVAGO_H |