diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-09-16 00:54:39 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-09-16 00:54:39 +0200 |
commit | d38b90530b3ba3a49c4eb072eb344ae2b0836913 (patch) | |
tree | 5dd07e59ae1bc8392a773ec8fec6b6a3aa7e4840 /logic/OneSixInstance.cpp | |
parent | 7721c57e5e1093a3d8597b6b6f30c97d2aa3d8a5 (diff) | |
download | MultiMC-d38b90530b3ba3a49c4eb072eb344ae2b0836913.tar MultiMC-d38b90530b3ba3a49c4eb072eb344ae2b0836913.tar.gz MultiMC-d38b90530b3ba3a49c4eb072eb344ae2b0836913.tar.lz MultiMC-d38b90530b3ba3a49c4eb072eb344ae2b0836913.tar.xz MultiMC-d38b90530b3ba3a49c4eb072eb344ae2b0836913.zip |
Forge version list implementation. Needs integration and testing.
Diffstat (limited to 'logic/OneSixInstance.cpp')
-rw-r--r-- | logic/OneSixInstance.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp index c926df60..7b038c46 100644 --- a/logic/OneSixInstance.cpp +++ b/logic/OneSixInstance.cpp @@ -214,6 +214,13 @@ bool OneSixInstance::shouldUpdate() const return true; } +bool OneSixInstance::versionIsCustom() +{ + QString verpath_custom = PathCombine(instanceRoot(), "custom.json"); + QFile versionfile(verpath_custom); + return versionfile.exists(); +} + QString OneSixInstance::currentVersionId() const { return intendedVersionId(); @@ -224,6 +231,13 @@ bool OneSixInstance::reloadFullVersion() I_D(OneSixInstance); QString verpath = PathCombine(instanceRoot(), "version.json"); + { + QString verpath_custom = PathCombine(instanceRoot(), "custom.json"); + QFile versionfile(verpath_custom); + if(versionfile.exists()) + verpath = verpath_custom; + } + QFile versionfile(verpath); if(versionfile.exists() && versionfile.open(QIODevice::ReadOnly)) { @@ -264,7 +278,12 @@ bool OneSixInstance::menuActionEnabled ( QString action_name ) const QString OneSixInstance::getStatusbarDescription() { - return "One Six : " + intendedVersionId(); + QString descr = "One Six : " + intendedVersionId(); + if(versionIsCustom()) + { + descr + " (custom)"; + } + return descr; } QString OneSixInstance::loaderModsDir() const |