summaryrefslogtreecommitdiffstats
path: root/logic/minecraft/MinecraftVersion.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-05-10 01:53:32 +0200
committerPetr Mrázek <peterix@gmail.com>2014-06-09 01:38:30 +0200
commit92abe4c603e1f4931cd02ae6b752cb7054d8e30d (patch)
tree571c6bc638b474af7e44f4db626f15e301286a65 /logic/minecraft/MinecraftVersion.h
parent9860d5ee12acde8f7893848dac53f59ea66da281 (diff)
downloadMultiMC-92abe4c603e1f4931cd02ae6b752cb7054d8e30d.tar
MultiMC-92abe4c603e1f4931cd02ae6b752cb7054d8e30d.tar.gz
MultiMC-92abe4c603e1f4931cd02ae6b752cb7054d8e30d.tar.lz
MultiMC-92abe4c603e1f4931cd02ae6b752cb7054d8e30d.tar.xz
MultiMC-92abe4c603e1f4931cd02ae6b752cb7054d8e30d.zip
All of the broken legacy things work.
Diffstat (limited to 'logic/minecraft/MinecraftVersion.h')
-rw-r--r--logic/minecraft/MinecraftVersion.h102
1 files changed, 49 insertions, 53 deletions
diff --git a/logic/minecraft/MinecraftVersion.h b/logic/minecraft/MinecraftVersion.h
index dab08bb1..6a1c54cb 100644
--- a/logic/minecraft/MinecraftVersion.h
+++ b/logic/minecraft/MinecraftVersion.h
@@ -15,16 +15,18 @@
#pragma once
-#include "logic/BaseVersion.h"
-#include "VersionPatch.h"
#include <QStringList>
#include <QSet>
+#include <QDateTime>
+
+#include "logic/BaseVersion.h"
+#include "VersionPatch.h"
+#include "VersionFile.h"
+
+class VersionFinal;
struct MinecraftVersion : public BaseVersion, public VersionPatch
{
- /// The version's timestamp - this is primarily used for sorting versions in a list.
- qint64 timestamp;
-
/// The URL that this version will be downloaded from. maybe.
QString download_url;
@@ -34,16 +36,20 @@ struct MinecraftVersion : public BaseVersion, public VersionPatch
/// is this a snapshot?
bool is_snapshot = false;
- /// is this a built-in version that comes with MultiMC?
- bool is_builtin = false;
-
+ /// where is this from?
+ enum VersionSource
+ {
+ Builtin,
+ Mojang
+ } m_versionSource = Builtin;
+
/// the human readable version name
QString m_name;
/// the version ID.
QString m_descriptor;
- /// version traits. generally launcher business...
+ /// version traits. added by MultiMC
QSet<QString> m_traits;
/// The main class this version uses (if any, can be empty).
@@ -52,57 +58,47 @@ struct MinecraftVersion : public BaseVersion, public VersionPatch
/// The applet class this version uses (if any, can be empty).
QString m_appletClass;
- bool usesLegacyLauncher()
- {
- return m_traits.contains("legacyLaunch") || m_traits.contains("aplhaLaunch");
- }
-
- virtual QString descriptor() override
- {
- return m_descriptor;
- }
+ /// The process arguments used by this version
+ QString m_processArguments;
- virtual QString name() override
- {
- return m_name;
- }
+ /// The type of this release
+ QString m_type;
- virtual QString typeString() const override
+ /// the time this version was actually released by Mojang, as string and as QDateTime
+ QString m_releaseTimeString;
+ QDateTime m_releaseTime;
+
+ /// the time this version was last updated by Mojang, as string and as QDateTime
+ QString m_updateTimeString;
+ QDateTime m_updateTime;
+
+ /// order of this file... default = -2
+ int order = -2;
+
+ bool usesLegacyLauncher();
+ virtual QString descriptor() override;
+ virtual QString name() override;
+ virtual QString typeString() const override;
+ virtual bool hasJarMods() override;
+ virtual bool isVanilla() override;
+ virtual void applyTo(VersionFinal *version) override;
+ virtual int getOrder();
+ virtual void setOrder(int order);
+ virtual QList<JarmodPtr> getJarMods() override;
+ virtual QString getPatchID()
{
- if (is_latest && is_snapshot)
- {
- return QObject::tr("Latest snapshot");
- }
- else if(is_latest)
- {
- return QObject::tr("Latest release");
- }
- else if(is_snapshot)
- {
- return QObject::tr("Snapshot");
- }
- else if(is_builtin)
- {
- return QObject::tr("Museum piece");
- }
- else
- {
- return QObject::tr("Regular release");
- }
+ return "net.minecraft";
}
-
- virtual bool hasJarMods() override
+ virtual QString getPatchVersion()
{
- return false;
+ return m_descriptor;
}
-
- virtual bool isVanilla() override
+ virtual QString getPatchName()
{
- return true;
+ return "Minecraft";
}
-
- virtual void applyTo(VersionFinal *version)
+ virtual QString getPatchFilename()
{
- // umm... what now?
- }
+ return QString();
+ };
};