2013-01-21 12:27:15 +00:00
|
|
|
AdvancedSettings *advancedSettings = nullptr;
|
|
|
|
|
|
|
|
AdvancedSettings::AdvancedSettings() {
|
2013-03-15 13:11:33 +00:00
|
|
|
driverTitle.setFont(program->titleFont);
|
2013-01-21 12:27:15 +00:00
|
|
|
driverTitle.setText("Driver Selection");
|
|
|
|
videoLabel.setText("Video:");
|
|
|
|
audioLabel.setText("Audio:");
|
|
|
|
inputLabel.setText("Input:");
|
2013-03-15 13:11:33 +00:00
|
|
|
libraryTitle.setFont(program->titleFont);
|
2013-01-21 12:27:15 +00:00
|
|
|
libraryTitle.setText("Game Library Path");
|
|
|
|
libraryLabel.setText("Path:");
|
|
|
|
libraryPath.setEditable(false);
|
2013-04-14 08:52:47 +00:00
|
|
|
string path = string::read({configpath(), "higan/library.bml"}).strip().ltrim<1>("Path: ").transform("\\", "/");
|
2013-01-21 12:27:15 +00:00
|
|
|
if(path.empty()) path = {userpath(), "Emulation/"};
|
|
|
|
if(path.endswith("/") == false) path.append("/");
|
|
|
|
libraryPath.setText(path);
|
|
|
|
libraryBrowse.setText("Browse ...");
|
2013-03-15 13:11:33 +00:00
|
|
|
infoLabel.setFont(program->boldFont);
|
2013-01-21 12:27:15 +00:00
|
|
|
infoLabel.setText({
|
|
|
|
Emulator::Name, " v", Emulator::Version, "\n",
|
2013-03-21 12:59:01 +00:00
|
|
|
" ", Emulator::Profile, " Profile\n",
|
2013-03-19 08:48:50 +00:00
|
|
|
" Author: ", Emulator::Author, "\n",
|
|
|
|
" License: ", Emulator::License, "\n",
|
|
|
|
" Website: ", Emulator::Website
|
2013-01-21 12:27:15 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
lstring list;
|
|
|
|
|
|
|
|
list.split(";", video.driver_list());
|
|
|
|
for(unsigned n = 0; n < list.size(); n++) {
|
|
|
|
videoDriver.append(list[n]);
|
|
|
|
if(list[n] == config->video.driver) videoDriver.setSelection(n);
|
|
|
|
}
|
|
|
|
|
|
|
|
list.split(";", audio.driver_list());
|
|
|
|
for(unsigned n = 0; n < list.size(); n++) {
|
|
|
|
audioDriver.append(list[n]);
|
|
|
|
if(list[n] == config->audio.driver) audioDriver.setSelection(n);
|
|
|
|
}
|
|
|
|
|
|
|
|
list.split(";", input.driver_list());
|
|
|
|
for(unsigned n = 0; n < list.size(); n++) {
|
|
|
|
inputDriver.append(list[n]);
|
|
|
|
if(list[n] == config->input.driver) inputDriver.setSelection(n);
|
|
|
|
}
|
|
|
|
|
|
|
|
append(driverTitle, {~0, 0}, 5);
|
|
|
|
append(driverLayout, {~0, 0}, 15);
|
|
|
|
driverLayout.append(videoLabel, {0, 0}, 5);
|
|
|
|
driverLayout.append(videoDriver, {~0, 0}, 5);
|
|
|
|
driverLayout.append(audioLabel, {0, 0}, 5);
|
|
|
|
driverLayout.append(audioDriver, {~0, 0}, 5);
|
|
|
|
driverLayout.append(inputLabel, {0, 0}, 5);
|
|
|
|
driverLayout.append(inputDriver, {~0, 0});
|
|
|
|
append(libraryTitle, {~0, 0}, 5);
|
|
|
|
append(libraryLayout, {~0, 0}, 15);
|
|
|
|
libraryLayout.append(libraryLabel, {0, 0}, 5);
|
|
|
|
libraryLayout.append(libraryPath, {~0, 0}, 5);
|
|
|
|
libraryLayout.append(libraryBrowse, {80, 0});
|
2013-03-19 08:48:50 +00:00
|
|
|
if(Intrinsics::platform() != Intrinsics::Platform::OSX) {
|
|
|
|
append(spacer, {~0, ~0});
|
|
|
|
append(infoLabel, {~0, 0});
|
|
|
|
}
|
2013-01-21 12:27:15 +00:00
|
|
|
|
|
|
|
videoDriver.onChange = [&] { config->video.driver = videoDriver.text(); };
|
|
|
|
audioDriver.onChange = [&] { config->audio.driver = audioDriver.text(); };
|
|
|
|
inputDriver.onChange = [&] { config->input.driver = inputDriver.text(); };
|
|
|
|
|
|
|
|
libraryBrowse.onActivate = [&] {
|
2013-03-19 08:48:50 +00:00
|
|
|
string path = BrowserWindow().setParent(*settings).setPath(userpath()).directory();
|
2013-01-21 12:27:15 +00:00
|
|
|
if(path.empty()) return;
|
2013-04-14 08:52:47 +00:00
|
|
|
file::write({configpath(), "higan/library.bml"}, {"Path: ", path, "\n"});
|
2013-01-21 12:27:15 +00:00
|
|
|
libraryPath.setText(path);
|
|
|
|
};
|
|
|
|
}
|