MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / saveConfig

Method saveConfig

tools/launcher/launcherwindow.cpp:318–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318void LauncherWindow::saveConfig()
319{
320 saveScalingOptions();
321
322 const auto &comboBox = *ui->resolutionBox;
323 // Index 0 is always custom resolution
324 if (comboBox.currentIndex() == 0)
325 {
326 auto &widthBox = *ui->customResolutionX;
327 auto &heightBox = *ui->customResolutionY;
328 const auto x = widthBox.text().toInt();
329 const auto y = heightBox.text().toInt();
330 OpenApoc::Options::screenWidthOption.set(x);
331 OpenApoc::Options::screenHeightOption.set(y);
332 }
333 else
334 {
335 const auto &selectionVariant = comboBox.currentData();
336 const auto &size = selectionVariant.toSize();
337 OpenApoc::Options::screenWidthOption.set(size.width());
338 OpenApoc::Options::screenHeightOption.set(size.height());
339 }
340
341 OpenApoc::Options::screenModeOption.set(ui->screenModeBox->currentText().toStdString());
342 OpenApoc::Options::screenDisplayNumberOption.set(ui->displayNumBox->currentIndex());
343 OpenApoc::Options::cdPathOption.set(ui->cdPath->text().toStdString());
344 OpenApoc::Options::dataPathOption.set(ui->dataPath->text().toStdString());
345 OpenApoc::Options::languageOption.set(selectedLanguageID);
346 OpenApoc::config().save();
347 this->rebuildModList();
348}
349
350void LauncherWindow::play()
351{

Callers 1

exitMethod · 0.95

Calls 3

rebuildModListMethod · 0.95
setMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected