summaryrefslogtreecommitdiffstats
path: root/logic/VersionFinal.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-03-19 23:23:59 +0100
committerPetr Mrázek <peterix@gmail.com>2014-03-19 23:23:59 +0100
commit4901985db64c91e7cfafc3b9bf710423b90538cd (patch)
tree178ff7b72c25df4df24f379fe104cb403a7db760 /logic/VersionFinal.cpp
parent1705832febb86181e52222fdbfe87d8d2d0ba5b7 (diff)
downloadMultiMC-4901985db64c91e7cfafc3b9bf710423b90538cd.tar
MultiMC-4901985db64c91e7cfafc3b9bf710423b90538cd.tar.gz
MultiMC-4901985db64c91e7cfafc3b9bf710423b90538cd.tar.lz
MultiMC-4901985db64c91e7cfafc3b9bf710423b90538cd.tar.xz
MultiMC-4901985db64c91e7cfafc3b9bf710423b90538cd.zip
Finalize version on reload.
Diffstat (limited to 'logic/VersionFinal.cpp')
-rw-r--r--logic/VersionFinal.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/logic/VersionFinal.cpp b/logic/VersionFinal.cpp
index d0e85c15..b465df68 100644
--- a/logic/VersionFinal.cpp
+++ b/logic/VersionFinal.cpp
@@ -310,9 +310,35 @@ void VersionFinal::reapply(const bool alreadyReseting)
file->applyTo(this);
}
versionFiles.swap(newVersionFiles);
-
+ finalize();
if (!alreadyReseting)
{
endResetModel();
}
}
+
+void VersionFinal::finalize()
+{
+ if (assets.isEmpty())
+ {
+ assets = "legacy";
+ }
+ if (minecraftArguments.isEmpty())
+ {
+ QString toCompare = processArguments.toLower();
+ if (toCompare == "legacy")
+ {
+ minecraftArguments = " ${auth_player_name} ${auth_session}";
+ }
+ else if (toCompare == "username_session")
+ {
+ minecraftArguments = "--username ${auth_player_name} --session ${auth_session}";
+ }
+ else if (toCompare == "username_session_version")
+ {
+ minecraftArguments = "--username ${auth_player_name} "
+ "--session ${auth_session} "
+ "--version ${profile_name}";
+ }
+ }
+}