| 316 | } |
| 317 | |
| 318 | void 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 | |
| 350 | void LauncherWindow::play() |
| 351 | { |
no test coverage detected