diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-03-18 15:02:54 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-03-26 17:05:27 +0100 |
commit | b7d8e512f4184a755809fe9a964a04921f8abf7c (patch) | |
tree | 2d67f30a2c57743dac5fc9dc819e6c5d58b41962 /logic/minecraft/MinecraftProfile.h | |
parent | fb9dfcb951d9cf9c19fc868703cb66e15aa9a1e6 (diff) | |
download | MultiMC-b7d8e512f4184a755809fe9a964a04921f8abf7c.tar MultiMC-b7d8e512f4184a755809fe9a964a04921f8abf7c.tar.gz MultiMC-b7d8e512f4184a755809fe9a964a04921f8abf7c.tar.lz MultiMC-b7d8e512f4184a755809fe9a964a04921f8abf7c.tar.xz MultiMC-b7d8e512f4184a755809fe9a964a04921f8abf7c.zip |
NOISSUE Use patch problems and problem levels instead of exceptions for minecraft profiles.
Diffstat (limited to 'logic/minecraft/MinecraftProfile.h')
-rw-r--r-- | logic/minecraft/MinecraftProfile.h | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/logic/minecraft/MinecraftProfile.h b/logic/minecraft/MinecraftProfile.h index 529274d6..6e7e8f74 100644 --- a/logic/minecraft/MinecraftProfile.h +++ b/logic/minecraft/MinecraftProfile.h @@ -34,7 +34,6 @@ class OneSixInstance; class MULTIMC_LOGIC_EXPORT MinecraftProfile : public QAbstractListModel { Q_OBJECT - friend class ProfileStrategy; public: explicit MinecraftProfile(ProfileStrategy *strategy); @@ -82,13 +81,10 @@ public: /// clear the profile void clear(); - /// apply the patches. Throws all sorts of errors. - void reapply(); - /// apply the patches. Catches all the errors and returns true/false for success/failure - bool reapplySafe(); + bool reapplyPatches(); -public: +public: /* application of profile variables from patches */ void applyMinecraftVersion(const QString& id); void applyMainClass(const QString& mainClass); void applyAppletClass(const QString& appletClass); @@ -99,26 +95,24 @@ public: void applyTweakers(const QStringList &tweakers); void applyJarMods(const QList<JarmodPtr> &jarMods); void applyLibrary(LibraryPtr library); + void applyProblemSeverity(ProblemSeverity severity); -public: +public: /* getters for proifile variables */ QString getMinecraftVersion() const; QString getMainClass() const; QString getAppletClass() const; QString getMinecraftVersionType() const; QString getMinecraftAssets() const; QString getMinecraftArguments() const; - QString getVanillaMinecraftArguments() const; const QSet<QString> & getTraits() const; const QStringList & getTweakers() const; const QList<JarmodPtr> & getJarMods() const; const QList<LibraryPtr> & getLibraries() const; const QList<LibraryPtr> & getNativeLibraries() const; bool hasTrait(const QString & trait) const; + ProblemSeverity getProblemSeverity() const; public: - /// get file ID of the patch file at # - QString versionFileId(const int index) const; - /// get the profile patch by id ProfilePatchPtr versionPatch(const QString &id); @@ -134,15 +128,15 @@ public: /// Add the patch object to the internal list of patches void appendPatch(ProfilePatchPtr patch); -protected: /* data */ - /// the ID - determines which jar to use! ACTUALLY IMPORTANT! - QString id; +private: /* data */ + /// the version of Minecraft - jar to use + QString m_minecraftVersion; /// Release type - "release" or "snapshot" - QString type; + QString m_minecraftVersionType; /// Assets type - "legacy" or a version ID - QString assets; + QString m_minecraftAssets; /** * arguments that should be used for launching minecraft @@ -150,28 +144,30 @@ protected: /* data */ * ex: "--username ${auth_player_name} --session ${auth_session} * --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets}" */ - QString minecraftArguments; + QString m_minecraftArguments; /// A list of all tweaker classes - QStringList tweakers; + QStringList m_tweakers; /// The main class to load first - QString mainClass; + QString m_mainClass; /// The applet class, for some very old minecraft releases - QString appletClass; + QString m_appletClass; /// the list of libraries - QList<LibraryPtr> libraries; + QList<LibraryPtr> m_libraries; /// the list of native libraries - QList<LibraryPtr> nativeLibraries; + QList<LibraryPtr> m_nativeLibraries; /// traits, collected from all the version files (version files can only add) - QSet<QString> traits; + QSet<QString> m_traits; /// A list of jar mods. version files can add those. - QList<JarmodPtr> jarMods; + QList<JarmodPtr> m_jarMods; + + ProblemSeverity m_problemSeverity = PROBLEM_NONE; /* FIXME: add support for those rules here? Looks like a pile of quick hacks to me though. @@ -193,7 +189,10 @@ protected: /* data */ } */ // QList<Rule> rules; -private: - QList<ProfilePatchPtr> VersionPatches; + + /// list of attached profile patches + QList<ProfilePatchPtr> m_patches; + + /// strategy used for profile operations ProfileStrategy *m_strategy = nullptr; }; |