| 1 | AdvancedSettings* advancedSettings = nullptr; |
| 2 | |
| 3 | AdvancedSettings::AdvancedSettings() { |
| 4 | driverTitle.setFont(program->boldFont); |
| 5 | driverTitle.setText("Driver Selection:"); |
| 6 | videoLabel.setText("Video:"); |
| 7 | audioLabel.setText("Audio:"); |
| 8 | inputLabel.setText("Input:"); |
| 9 | libraryTitle.setFont(program->boldFont); |
| 10 | libraryTitle.setText("Game Library:"); |
| 11 | libraryLabel.setText("Path:"); |
| 12 | libraryPath.setEditable(false); |
| 13 | libraryPath.setText(utility->libraryPath()); |
| 14 | libraryBrowse.setText("Browse ..."); |
| 15 | libraryShowOnStartup.setChecked(config->library.showOnStartup); |
| 16 | libraryShowOnStartup.setText("Show game library on program start"); |
| 17 | information.setText("Note: changing advanced settings requires program restart to take effect."); |
| 18 | infoLabel.setFont(program->boldFont); |
| 19 | infoLabel.setText({ |
| 20 | Emulator::Name, " v", Emulator::Version, "\n", |
| 21 | " ", Emulator::Profile, " Profile\n", |
| 22 | " Author: ", Emulator::Author, "\n", |
| 23 | " License: ", Emulator::License, "\n", |
| 24 | " Website: ", Emulator::Website |
| 25 | }); |
| 26 | |
| 27 | lstring list; |
| 28 | |
| 29 | list.split(";", video.availableDrivers()); |
| 30 | for(unsigned n = 0; n < list.size(); n++) { |
| 31 | videoDriver.append(list[n]); |
| 32 | if(list[n] == config->video.driver) videoDriver.setSelection(n); |
| 33 | } |
| 34 | |
| 35 | list.split(";", audio.availableDrivers()); |
| 36 | for(unsigned n = 0; n < list.size(); n++) { |
| 37 | audioDriver.append(list[n]); |
| 38 | if(list[n] == config->audio.driver) audioDriver.setSelection(n); |
| 39 | } |
| 40 | |
| 41 | list.split(";", input.availableDrivers()); |
| 42 | for(unsigned n = 0; n < list.size(); n++) { |
| 43 | inputDriver.append(list[n]); |
| 44 | if(list[n] == config->input.driver) inputDriver.setSelection(n); |
| 45 | } |
| 46 | |
| 47 | append(driverTitle, {~0, 0}); |
| 48 | append(driverLayout, {~0, 0}, 15); |
| 49 | driverLayout.append(videoLabel, {0, 0}, 5); |
| 50 | driverLayout.append(videoDriver, {~0, 0}, 5); |
| 51 | driverLayout.append(audioLabel, {0, 0}, 5); |
| 52 | driverLayout.append(audioDriver, {~0, 0}, 5); |
| 53 | driverLayout.append(inputLabel, {0, 0}, 5); |
| 54 | driverLayout.append(inputDriver, {~0, 0}); |
| 55 | append(libraryTitle, {~0, 0}); |
| 56 | append(libraryLayout, {~0, 0}); |
| 57 | libraryLayout.append(libraryLabel, {0, 0}, 5); |
| 58 | libraryLayout.append(libraryPath, {~0, 0}, 5); |
| 59 | libraryLayout.append(libraryBrowse, {80, 0}); |
| 60 | append(libraryShowOnStartup, {~0, 0}, 15); |
| 61 | append(information, {~0, 0}, 15); |
| 62 | if(Intrinsics::platform() != Intrinsics::Platform::MacOSX) { |
| 63 | append(spacer, {~0, ~0}); |
| 64 | append(infoLabel, {~0, 0}); |
| 65 | } |
| 66 | |
| 67 | videoDriver.onChange = [&] { config->video.driver = videoDriver.text(); }; |
| 68 | audioDriver.onChange = [&] { config->audio.driver = audioDriver.text(); }; |
| 69 | inputDriver.onChange = [&] { config->input.driver = inputDriver.text(); }; |
| 70 | |
| 71 | libraryBrowse.onActivate = [&] { |
| 72 | string path = BrowserWindow().setParent(*settings).setPath(userpath()).directory(); |
| 73 | if(path.empty()) return; |
| 74 | file::write({configpath(), "higan/library.bml"}, {"Path: ", path, "\n"}); |
| 75 | libraryPath.setText(path); |
| 76 | }; |
| 77 | |
| 78 | libraryShowOnStartup.onToggle = [&] { |
| 79 | config->library.showOnStartup = libraryShowOnStartup.checked(); |
| 80 | }; |
| 81 | } |