From 967121a34bbc60e6b46c7ec470b151f668ef1fef Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 23 Jun 2013 18:30:21 +0200 Subject: Replace C++ mainmenu by formspec powered one --- src/mods.h | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'src/mods.h') diff --git a/src/mods.h b/src/mods.h index a8100fcfd..eb453bf6a 100644 --- a/src/mods.h +++ b/src/mods.h @@ -29,6 +29,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include +#include "json/json.h" +#include "config.h" + +#if USE_CURL +#include +#endif #define MODNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyz0123456789_" @@ -154,4 +160,66 @@ private: }; +#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 ModStoreModDetails { + /* version_set?? */ + std::vector categories; + ModAuthorInfo author; + ModLicenseInfo license; + 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 -- cgit v1.2.3