summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
authorSky <git@bunnies.cc>2013-10-08 17:07:54 +0100
committerSky <git@bunnies.cc>2013-10-08 17:07:54 +0100
commit60e7e019fe62f48ebdb5cea0ab83ab58f3379fdf (patch)
tree58d0e17abdc44529e0952b0e9849b7ac485a1960 /logic
parent05e2da51d8d25374140dce3c1646a2a1a0a2a553 (diff)
downloadMultiMC-60e7e019fe62f48ebdb5cea0ab83ab58f3379fdf.tar
MultiMC-60e7e019fe62f48ebdb5cea0ab83ab58f3379fdf.tar.gz
MultiMC-60e7e019fe62f48ebdb5cea0ab83ab58f3379fdf.tar.lz
MultiMC-60e7e019fe62f48ebdb5cea0ab83ab58f3379fdf.tar.xz
MultiMC-60e7e019fe62f48ebdb5cea0ab83ab58f3379fdf.zip
Start mcmod.info panel. Needs to be its own widget and included in legacy mod edit window, text labels need eliding
Diffstat (limited to 'logic')
-rw-r--r--logic/Mod.cpp12
-rw-r--r--logic/Mod.h18
2 files changed, 30 insertions, 0 deletions
diff --git a/logic/Mod.cpp b/logic/Mod.cpp
index 825e663f..c45e3ad2 100644
--- a/logic/Mod.cpp
+++ b/logic/Mod.cpp
@@ -119,6 +119,18 @@ void Mod::ReadMCModInfo(QByteArray contents)
m_name = firstObj.value("name").toString();
m_version = firstObj.value("version").toString();
m_homeurl = firstObj.value("url").toString();
+ m_description = firstObj.value("description").toString();
+ QJsonArray authors = firstObj.value("authors").toArray();
+ if(authors.size() == 0) m_authors = "";
+ else if(authors.size() >= 1)
+ {
+ m_authors = authors.at(0).toString();
+ for(int i = 1; i < authors.size(); i++)
+ {
+ m_authors += ", " + authors.at(i).toString();
+ }
+ }
+ m_credits = firstObj.value("credits").toString();
return;
}
;
diff --git a/logic/Mod.h b/logic/Mod.h
index 9831fdc0..f3aaf18b 100644
--- a/logic/Mod.h
+++ b/logic/Mod.h
@@ -63,6 +63,21 @@ public:
return m_homeurl;
}
+ QString description() const
+ {
+ return m_description;
+ }
+
+ QString authors() const
+ {
+ return m_authors;
+ }
+
+ QString credits() const
+ {
+ return m_credits;
+ }
+
// delete all the files of this mod
bool destroy();
// replace this mod with a copy of the other
@@ -99,6 +114,9 @@ protected:
QString m_version;
QString m_mcversion;
QString m_homeurl;
+ QString m_description;
+ QString m_authors;
+ QString m_credits;
ModType m_type;
};