early-access version 1884
This commit is contained in:
@@ -311,16 +311,6 @@ void Config::WriteBasicSetting(const Settings::BasicSetting<std::string>& settin
|
||||
qt_config->setValue(name, QString::fromStdString(value));
|
||||
}
|
||||
|
||||
// Explicit float definition: use a double as Qt doesn't write legible floats to config files
|
||||
template <>
|
||||
void Config::WriteBasicSetting(const Settings::BasicSetting<float>& setting) {
|
||||
const QString name = QString::fromStdString(setting.GetLabel());
|
||||
const double value = setting.GetValue();
|
||||
qt_config->setValue(name + QStringLiteral("/default"),
|
||||
setting.GetValue() == setting.GetDefault());
|
||||
qt_config->setValue(name, value);
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
void Config::WriteBasicSetting(const Settings::BasicSetting<Type>& setting) {
|
||||
const QString name = QString::fromStdString(setting.GetLabel());
|
||||
@@ -329,21 +319,6 @@ void Config::WriteBasicSetting(const Settings::BasicSetting<Type>& setting) {
|
||||
qt_config->setValue(name, value);
|
||||
}
|
||||
|
||||
// Explicit float definition: use a double as Qt doesn't write legible floats to config files
|
||||
template <>
|
||||
void Config::WriteGlobalSetting(const Settings::Setting<float>& setting) {
|
||||
const QString name = QString::fromStdString(setting.GetLabel());
|
||||
const double value = setting.GetValue(global);
|
||||
if (!global) {
|
||||
qt_config->setValue(name + QStringLiteral("/use_global"), setting.UsingGlobal());
|
||||
}
|
||||
if (global || !setting.UsingGlobal()) {
|
||||
qt_config->setValue(name + QStringLiteral("/default"),
|
||||
setting.GetValue(global) == setting.GetDefault());
|
||||
qt_config->setValue(name, value);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
void Config::WriteGlobalSetting(const Settings::Setting<Type>& setting) {
|
||||
const QString name = QString::fromStdString(setting.GetLabel());
|
||||
|
||||
@@ -47,7 +47,8 @@ void ConfigureAudio::SetConfiguration() {
|
||||
|
||||
SetAudioDeviceFromDeviceID();
|
||||
|
||||
ui->volume_slider->setValue(Settings::values.volume.GetValue() * ui->volume_slider->maximum());
|
||||
const auto volume_value = static_cast<int>(Settings::values.volume.GetValue());
|
||||
ui->volume_slider->setValue(volume_value);
|
||||
|
||||
ui->toggle_audio_stretching->setChecked(Settings::values.enable_audio_stretching.GetValue());
|
||||
|
||||
@@ -112,18 +113,16 @@ void ConfigureAudio::ApplyConfiguration() {
|
||||
|
||||
// Guard if during game and set to game-specific value
|
||||
if (Settings::values.volume.UsingGlobal()) {
|
||||
Settings::values.volume.SetValue(
|
||||
static_cast<float>(ui->volume_slider->sliderPosition()) /
|
||||
ui->volume_slider->maximum());
|
||||
const auto volume = static_cast<u8>(ui->volume_slider->value());
|
||||
Settings::values.volume.SetValue(volume);
|
||||
}
|
||||
} else {
|
||||
if (ui->volume_combo_box->currentIndex() == 0) {
|
||||
Settings::values.volume.SetGlobal(true);
|
||||
} else {
|
||||
Settings::values.volume.SetGlobal(false);
|
||||
Settings::values.volume.SetValue(
|
||||
static_cast<float>(ui->volume_slider->sliderPosition()) /
|
||||
ui->volume_slider->maximum());
|
||||
const auto volume = static_cast<u8>(ui->volume_slider->value());
|
||||
Settings::values.volume.SetValue(volume);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,10 +119,9 @@ void ConfigureGraphics::SetConfiguration() {
|
||||
ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal());
|
||||
ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal());
|
||||
}
|
||||
|
||||
UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red.GetValue(),
|
||||
Settings::values.bg_green.GetValue(),
|
||||
Settings::values.bg_blue.GetValue()));
|
||||
UpdateBackgroundColorButton(QColor::fromRgb(Settings::values.bg_red.GetValue(),
|
||||
Settings::values.bg_green.GetValue(),
|
||||
Settings::values.bg_blue.GetValue()));
|
||||
UpdateAPILayout();
|
||||
}
|
||||
|
||||
@@ -154,9 +153,9 @@ void ConfigureGraphics::ApplyConfiguration() {
|
||||
Settings::values.vulkan_device.SetValue(vulkan_device);
|
||||
}
|
||||
if (Settings::values.bg_red.UsingGlobal()) {
|
||||
Settings::values.bg_red.SetValue(static_cast<float>(bg_color.redF()));
|
||||
Settings::values.bg_green.SetValue(static_cast<float>(bg_color.greenF()));
|
||||
Settings::values.bg_blue.SetValue(static_cast<float>(bg_color.blueF()));
|
||||
Settings::values.bg_red.SetValue(static_cast<u8>(bg_color.red()));
|
||||
Settings::values.bg_green.SetValue(static_cast<u8>(bg_color.green()));
|
||||
Settings::values.bg_blue.SetValue(static_cast<u8>(bg_color.blue()));
|
||||
}
|
||||
} else {
|
||||
if (ui->api->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
|
||||
@@ -188,9 +187,9 @@ void ConfigureGraphics::ApplyConfiguration() {
|
||||
Settings::values.bg_red.SetGlobal(false);
|
||||
Settings::values.bg_green.SetGlobal(false);
|
||||
Settings::values.bg_blue.SetGlobal(false);
|
||||
Settings::values.bg_red.SetValue(static_cast<float>(bg_color.redF()));
|
||||
Settings::values.bg_green.SetValue(static_cast<float>(bg_color.greenF()));
|
||||
Settings::values.bg_blue.SetValue(static_cast<float>(bg_color.blueF()));
|
||||
Settings::values.bg_red.SetValue(static_cast<u8>(bg_color.red()));
|
||||
Settings::values.bg_green.SetValue(static_cast<u8>(bg_color.green()));
|
||||
Settings::values.bg_blue.SetValue(static_cast<u8>(bg_color.blue()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2573,27 +2573,24 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QDoubleSpinBox" name="mouse_panning_sensitivity">
|
||||
<widget class="QSpinBox" name="mouse_panning_sensitivity">
|
||||
<property name="toolTip">
|
||||
<string>Mouse sensitivity</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
<property name="suffix">
|
||||
<string>%</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.100000000000000</double>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>16.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.010000000000000</double>
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>1.000000000000000</double>
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -149,8 +149,9 @@ QString ButtonToText(const Common::ParamPackage& param) {
|
||||
|
||||
if (param.Has("button")) {
|
||||
const QString button_str = QString::fromStdString(param.Get("button", ""));
|
||||
const QString toggle = QString::fromStdString(param.Get("toggle", false) ? "~" : "");
|
||||
|
||||
return QObject::tr("Button %1").arg(button_str);
|
||||
return QObject::tr("%1Button %2").arg(toggle, button_str);
|
||||
}
|
||||
|
||||
if (param.Has("motion")) {
|
||||
@@ -313,6 +314,16 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
|
||||
buttons_param[button_id].Set("toggle", toggle_value);
|
||||
button_map[button_id]->setText(ButtonToText(buttons_param[button_id]));
|
||||
});
|
||||
if (buttons_param[button_id].Has("threshold")) {
|
||||
context_menu.addAction(tr("Set threshold"), [&] {
|
||||
const int button_threshold = static_cast<int>(
|
||||
buttons_param[button_id].Get("threshold", 0.5f) * 100.0f);
|
||||
const int new_threshold = QInputDialog::getInt(
|
||||
this, tr("Set threshold"), tr("Choose a value between 0% and 100%"),
|
||||
button_threshold, 0, 100);
|
||||
buttons_param[button_id].Set("threshold", new_threshold / 100.0f);
|
||||
});
|
||||
}
|
||||
context_menu.exec(button_map[button_id]->mapToGlobal(menu_location));
|
||||
ui->controllerFrame->SetPlayerInput(player_index, buttons_param, analogs_param);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user