MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / applySettings

Method applySettings

launcher/ui/pages/instance/InstanceSettingsPage.cpp:109–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void InstanceSettingsPage::applySettings()
110{
111 SettingsObject::Lock lock(m_settings);
112
113 // Miscellaneous
114 bool miscellaneous = ui->miscellaneousSettingsBox->isChecked();
115 m_settings->set("OverrideMiscellaneous", miscellaneous);
116 if (miscellaneous)
117 {
118 m_settings->set("CloseAfterLaunch", ui->closeAfterLaunchCheck->isChecked());
119 m_settings->set("QuitAfterGameStop", ui->quitAfterGameStopCheck->isChecked());
120 }
121 else
122 {
123 m_settings->reset("CloseAfterLaunch");
124 m_settings->reset("QuitAfterGameStop");
125 }
126
127 // Console
128 bool console = ui->consoleSettingsBox->isChecked();
129 m_settings->set("OverrideConsole", console);
130 if (console)
131 {
132 m_settings->set("ShowConsole", ui->showConsoleCheck->isChecked());
133 m_settings->set("AutoCloseConsole", ui->autoCloseConsoleCheck->isChecked());
134 m_settings->set("ShowConsoleOnError", ui->showConsoleErrorCheck->isChecked());
135 }
136 else
137 {
138 m_settings->reset("ShowConsole");
139 m_settings->reset("AutoCloseConsole");
140 m_settings->reset("ShowConsoleOnError");
141 }
142
143 // Window Size
144 bool window = ui->windowSizeGroupBox->isChecked();
145 m_settings->set("OverrideWindow", window);
146 if (window)
147 {
148 m_settings->set("LaunchMaximized", ui->maximizedCheckBox->isChecked());
149 m_settings->set("MinecraftWinWidth", ui->windowWidthSpinBox->value());
150 m_settings->set("MinecraftWinHeight", ui->windowHeightSpinBox->value());
151 }
152 else
153 {
154 m_settings->reset("LaunchMaximized");
155 m_settings->reset("MinecraftWinWidth");
156 m_settings->reset("MinecraftWinHeight");
157 }
158
159 // Memory
160 bool memory = ui->memoryGroupBox->isChecked();
161 m_settings->set("OverrideMemory", memory);
162 if (memory)
163 {
164 int min = ui->minMemSpinBox->value();
165 int max = ui->maxMemSpinBox->value();
166 if(min < max)

Callers

nothing calls this directly

Calls 12

toPlainTextMethod · 0.80
checkedMethod · 0.80
prelaunchCommandMethod · 0.80
wrapperCommandMethod · 0.80
postexitCommandMethod · 0.80
setMethod · 0.45
resetMethod · 0.45
textMethod · 0.45
replaceMethod · 0.45
isValidMethod · 0.45
toStringMethod · 0.45
updateRuntimeContextMethod · 0.45

Tested by

no test coverage detected