summaryrefslogtreecommitdiffstats
path: root/logic/OneSixLibrary.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-09-22 04:21:36 +0200
committerPetr Mrázek <peterix@gmail.com>2013-09-22 04:21:36 +0200
commitceca6959d2a7f258d62ac4f589095b65084706c3 (patch)
tree8ce02eb4713bf8e770e02e97c99ad45f492cc688 /logic/OneSixLibrary.h
parentc2c7293083de8e8d40190992ccd6a65b613a4d06 (diff)
downloadMultiMC-ceca6959d2a7f258d62ac4f589095b65084706c3.tar
MultiMC-ceca6959d2a7f258d62ac4f589095b65084706c3.tar.gz
MultiMC-ceca6959d2a7f258d62ac4f589095b65084706c3.tar.lz
MultiMC-ceca6959d2a7f258d62ac4f589095b65084706c3.tar.xz
MultiMC-ceca6959d2a7f258d62ac4f589095b65084706c3.zip
Working 1.6 modding (currently only forge)
Diffstat (limited to 'logic/OneSixLibrary.h')
-rw-r--r--logic/OneSixLibrary.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/logic/OneSixLibrary.h b/logic/OneSixLibrary.h
index ac16d3d3..f3106483 100644
--- a/logic/OneSixLibrary.h
+++ b/logic/OneSixLibrary.h
@@ -3,6 +3,7 @@
#include <QStringList>
#include <QMap>
#include <QSharedPointer>
+#include <QJsonObject>
#include "OpSys.h"
class Rule;
@@ -12,9 +13,13 @@ class OneSixLibrary
private:
// basic values used internally (so far)
QString m_name;
- QString m_base_url;
+ QString m_base_url = "https://s3.amazonaws.com/Minecraft.Download/libraries/";
QList<QSharedPointer<Rule> > m_rules;
-
+
+ // custom values
+ /// absolute URL. takes precedence over m_download_path, if defined
+ QString m_absolute_url;
+
// derived values used for real things
/// a decent name fit for display
QString m_decentname;
@@ -25,11 +30,11 @@ private:
/// where to store the lib locally
QString m_storage_path;
/// where to download the lib from
- QString m_download_path;
+ QString m_download_url;
/// is this lib actually active on the current OS?
- bool m_is_active;
+ bool m_is_active = false;
/// is the library a native?
- bool m_is_native;
+ bool m_is_native = false;
/// native suffixes per OS
QMap<OpSys, QString> m_native_suffixes;
public:
@@ -39,12 +44,11 @@ public:
/// Constructor
OneSixLibrary(QString name)
{
- m_is_native = false;
- m_is_active = false;
m_name = name;
- m_base_url = "https://s3.amazonaws.com/Minecraft.Download/libraries/";
}
+ QJsonObject toJson();
+
/**
* finalize the library, processing the input values into derived values and state
*
@@ -84,7 +88,11 @@ public:
/// Returns true if the library is native
bool isNative();
/// Get the URL to download the library from
- QString downloadPath();
+ QString downloadUrl();
/// Get the relative path where the library should be saved
QString storagePath();
+
+ /// set an absolute URL for the library. This is an MMC extension.
+ void setAbsoluteUrl(QString absolute_url);
+ QString absoluteUrl();
};