diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-09-04 02:10:29 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-09-04 02:10:29 +0200 |
commit | cd108fd02975eac3a3fed2fde26c58de5cbdaf1c (patch) | |
tree | c19f22573086901238b7feacd9b265d249195700 /logic/minecraft/MinecraftInstance.cpp | |
parent | 151a0ca11ec658525e151b7130543a364c41a3e8 (diff) | |
download | MultiMC-cd108fd02975eac3a3fed2fde26c58de5cbdaf1c.tar MultiMC-cd108fd02975eac3a3fed2fde26c58de5cbdaf1c.tar.gz MultiMC-cd108fd02975eac3a3fed2fde26c58de5cbdaf1c.tar.lz MultiMC-cd108fd02975eac3a3fed2fde26c58de5cbdaf1c.tar.xz MultiMC-cd108fd02975eac3a3fed2fde26c58de5cbdaf1c.zip |
GH-1223 fix override settings
They now work more like passthrough settings, except not passing through set and reset
Diffstat (limited to 'logic/minecraft/MinecraftInstance.cpp')
-rw-r--r-- | logic/minecraft/MinecraftInstance.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/logic/minecraft/MinecraftInstance.cpp b/logic/minecraft/MinecraftInstance.cpp index d61801c9..e694045b 100644 --- a/logic/minecraft/MinecraftInstance.cpp +++ b/logic/minecraft/MinecraftInstance.cpp @@ -39,26 +39,30 @@ MinecraftInstance::MinecraftInstance(SettingsObjectPtr globalSettings, SettingsO // Java Settings auto javaOverride = m_settings->registerSetting("OverrideJava", false); auto locationOverride = m_settings->registerSetting("OverrideJavaLocation", false); + auto argsOverride = m_settings->registerSetting("OverrideJavaArgs", false); + + // combinations auto javaOrLocation = std::make_shared<OrSetting>("JavaOrLocationOverride", javaOverride, locationOverride); - m_settings->registerSetting("OverrideJavaArgs", false); - m_settings->registerOverride(globalSettings->getSetting("JavaPath")); - m_settings->registerOverride(globalSettings->getSetting("JvmArgs")); + auto javaOrArgs = std::make_shared<OrSetting>("JavaOrArgsOverride", javaOverride, argsOverride); + + m_settings->registerOverride(globalSettings->getSetting("JavaPath"), javaOrLocation); + m_settings->registerOverride(globalSettings->getSetting("JvmArgs"), javaOrArgs); // special! m_settings->registerPassthrough(globalSettings->getSetting("JavaTimestamp"), javaOrLocation); m_settings->registerPassthrough(globalSettings->getSetting("JavaVersion"), javaOrLocation); // Window Size - m_settings->registerSetting("OverrideWindow", false); - m_settings->registerOverride(globalSettings->getSetting("LaunchMaximized")); - m_settings->registerOverride(globalSettings->getSetting("MinecraftWinWidth")); - m_settings->registerOverride(globalSettings->getSetting("MinecraftWinHeight")); + auto windowSetting = m_settings->registerSetting("OverrideWindow", false); + m_settings->registerOverride(globalSettings->getSetting("LaunchMaximized"), windowSetting); + m_settings->registerOverride(globalSettings->getSetting("MinecraftWinWidth"), windowSetting); + m_settings->registerOverride(globalSettings->getSetting("MinecraftWinHeight"), windowSetting); // Memory - m_settings->registerSetting("OverrideMemory", false); - m_settings->registerOverride(globalSettings->getSetting("MinMemAlloc")); - m_settings->registerOverride(globalSettings->getSetting("MaxMemAlloc")); - m_settings->registerOverride(globalSettings->getSetting("PermGen")); + auto memorySetting = m_settings->registerSetting("OverrideMemory", false); + m_settings->registerOverride(globalSettings->getSetting("MinMemAlloc"), memorySetting); + m_settings->registerOverride(globalSettings->getSetting("MaxMemAlloc"), memorySetting); + m_settings->registerOverride(globalSettings->getSetting("PermGen"), memorySetting); } QString MinecraftInstance::minecraftRoot() const |