From 92abe4c603e1f4931cd02ae6b752cb7054d8e30d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 10 May 2014 01:53:32 +0200 Subject: All of the broken legacy things work. --- logic/minecraft/MinecraftVersion.h | 102 ++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 53 deletions(-) (limited to 'logic/minecraft/MinecraftVersion.h') 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 #include +#include + +#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 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 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(); + }; }; -- cgit v1.2.3