X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmods.h;h=f35bd18dba0b5e01c8046c1d6d423f1171d08a04;hb=43bf4324d5f639f338f88a599fe862630f85f787;hp=a8100fcfd8f0ca27c1f93bfcaa126197c5d6ac73;hpb=e0564d5de01dd26f7b4f4d188415f5cf5a47b5d0;p=dragonfireclient.git diff --git a/src/mods.h b/src/mods.h index a8100fcfd..f35bd18db 100644 --- a/src/mods.h +++ b/src/mods.h @@ -21,14 +21,14 @@ with this program; if not, write to the Free Software Foundation, Inc., #define MODS_HEADER #include "irrlichttypes.h" -#include #include #include #include #include #include #include -#include +#include "json/json.h" +#include "config.h" #define MODNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyz0123456789_" @@ -62,7 +62,7 @@ struct ModSpec bool is_modpack; // if modpack: std::map modpack_content; - ModSpec(const std::string name_="", const std::string path_=""): + ModSpec(const std::string &name_="", const std::string &path_=""): name(name_), path(path_), depends(), @@ -100,7 +100,7 @@ class ModConfiguration m_name_conflicts() {} - + ModConfiguration(std::string worldpath); // checks if all dependencies are fullfilled. @@ -146,12 +146,81 @@ class ModConfiguration // exists. A name conflict happens when two or more mods // at the same level have the same name but different paths. // Levels (mods in higher levels override mods in lower levels): - // 1. common mod in modpack; 2. common mod; - // 3. game mod in modpack; 4. game mod; - // 5. world mod in modpack; 6. world mod; - // 7. addon mod in modpack; 8. addon mod. + // 1. game mod in modpack; 2. game mod; + // 3. world mod in modpack; 4. world mod; + // 5. addon mod in modpack; 6. addon mod. std::set m_name_conflicts; }; +#if USE_CURL +Json::Value getModstoreUrl(std::string url); +#else +inline Json::Value getModstoreUrl(std::string url) { + return Json::Value(); +} +#endif + +struct ModLicenseInfo { + int id; + std::string shortinfo; + std::string url; +}; + +struct ModAuthorInfo { + int id; + std::string username; +}; + +struct ModStoreMod { + int id; + std::string title; + std::string basename; + ModAuthorInfo author; + float rating; + bool valid; +}; + +struct ModStoreCategoryInfo { + int id; + std::string name; +}; + +struct ModStoreVersionEntry { + int id; + std::string date; + std::string file; + bool approved; + //ugly version number + int mtversion; +}; + +struct ModStoreTitlePic { + int id; + std::string file; + std::string description; + int mod; +}; + +struct ModStoreModDetails { + /* version_set?? */ + std::vector categories; + ModAuthorInfo author; + ModLicenseInfo license; + ModStoreTitlePic titlepic; + int id; + std::string title; + std::string basename; + std::string description; + std::string repository; + float rating; + std::vector depends; + std::vector softdeps; + + std::string download_url; + std::string screenshot_url; + std::vector versions; + bool valid; +}; + #endif