mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2025-12-16 12:08:49 +00:00
qt: Increase emulation speed limit to 9999% and hide slider
This commit is contained in:
parent
684cdafea5
commit
4e2bad4052
@ -28,16 +28,9 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent)
|
||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureGeneral>()) {
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->turbo_limit, &QSlider::valueChanged, this, [&](double value) {
|
||||
Settings::values.turbo_limit.SetValue(SliderToSettings(value));
|
||||
ui->turbo_limit_display_label->setText(
|
||||
QStringLiteral("%1%").arg(Settings::values.turbo_limit.GetValue()));
|
||||
});
|
||||
|
||||
// Set a minimum width for the label to prevent the slider from changing size.
|
||||
// This scales across DPIs, and is acceptable for uncapitalized strings.
|
||||
const auto width = static_cast<int>(tr("unthrottled").size() * 6);
|
||||
ui->emulation_speed_display_label->setMinimumWidth(width);
|
||||
ui->emulation_speed_combo->setVisible(!Settings::IsConfiguringGlobal());
|
||||
ui->screenshot_combo->setVisible(!Settings::IsConfiguringGlobal());
|
||||
#ifndef __unix__
|
||||
@ -53,17 +46,6 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent)
|
||||
connect(ui->button_reset_defaults, &QPushButton::clicked, this,
|
||||
&ConfigureGeneral::ResetDefaults);
|
||||
|
||||
connect(ui->frame_limit, &QSlider::valueChanged, this, [&](int value) {
|
||||
if (value == ui->frame_limit->maximum()) {
|
||||
ui->emulation_speed_display_label->setText(tr("unthrottled"));
|
||||
} else {
|
||||
ui->emulation_speed_display_label->setText(
|
||||
QStringLiteral("%1%")
|
||||
.arg(SliderToSettings(value))
|
||||
.rightJustified(tr("unthrottled").size()));
|
||||
}
|
||||
});
|
||||
|
||||
connect(ui->change_screenshot_dir, &QToolButton::clicked, this, [this] {
|
||||
ui->change_screenshot_dir->setEnabled(false);
|
||||
const QString dir_path = QFileDialog::getExistingDirectory(
|
||||
@ -80,9 +62,7 @@ ConfigureGeneral::~ConfigureGeneral() = default;
|
||||
|
||||
void ConfigureGeneral::SetConfiguration() {
|
||||
if (Settings::IsConfiguringGlobal()) {
|
||||
ui->turbo_limit->setValue(SettingsToSlider(Settings::values.turbo_limit.GetValue()));
|
||||
ui->turbo_limit_display_label->setText(
|
||||
QStringLiteral("%1%").arg(Settings::values.turbo_limit.GetValue()));
|
||||
ui->turbo_limit->setValue(Settings::values.turbo_limit.GetValue());
|
||||
|
||||
ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing.GetValue());
|
||||
ui->toggle_background_pause->setChecked(
|
||||
@ -97,19 +77,7 @@ void ConfigureGeneral::SetConfiguration() {
|
||||
#endif
|
||||
}
|
||||
|
||||
if (Settings::values.frame_limit.GetValue() == 0) {
|
||||
ui->frame_limit->setValue(ui->frame_limit->maximum());
|
||||
} else {
|
||||
ui->frame_limit->setValue(SettingsToSlider(Settings::values.frame_limit.GetValue()));
|
||||
}
|
||||
if (ui->frame_limit->value() == ui->frame_limit->maximum()) {
|
||||
ui->emulation_speed_display_label->setText(tr("unthrottled"));
|
||||
} else {
|
||||
ui->emulation_speed_display_label->setText(
|
||||
QStringLiteral("%1%")
|
||||
.arg(SliderToSettings(ui->frame_limit->value()))
|
||||
.rightJustified(tr("unthrottled").size()));
|
||||
}
|
||||
ui->frame_limit->setValue(Settings::values.frame_limit.GetValue());
|
||||
|
||||
if (!Settings::IsConfiguringGlobal()) {
|
||||
if (Settings::values.frame_limit.UsingGlobal()) {
|
||||
@ -163,11 +131,9 @@ void ConfigureGeneral::ResetDefaults() {
|
||||
}
|
||||
|
||||
void ConfigureGeneral::ApplyConfiguration() {
|
||||
ConfigurationShared::ApplyPerGameSetting(
|
||||
&Settings::values.frame_limit, ui->emulation_speed_combo, [this](s32) {
|
||||
const bool is_maximum = ui->frame_limit->value() == ui->frame_limit->maximum();
|
||||
return is_maximum ? 0 : SliderToSettings(ui->frame_limit->value());
|
||||
});
|
||||
ConfigurationShared::ApplyPerGameSetting(&Settings::values.frame_limit,
|
||||
ui->emulation_speed_combo,
|
||||
[this](s32) { return ui->frame_limit->value(); });
|
||||
|
||||
ConfigurationShared::ApplyPerGameSetting(
|
||||
&UISettings::values.screenshot_path, ui->screenshot_combo,
|
||||
@ -182,6 +148,7 @@ void ConfigureGeneral::ApplyConfiguration() {
|
||||
#ifdef __unix__
|
||||
Settings::values.enable_gamemode = ui->toggle_gamemode->isChecked();
|
||||
#endif
|
||||
Settings::values.turbo_limit = ui->turbo_limit->value();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -105,44 +105,32 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_emulation_speed">
|
||||
<property name="text">
|
||||
<string>Emulation Speed</string>
|
||||
<string>Emulation Speed:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="frame_limit">
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QSpinBox" name="frame_limit">
|
||||
<property name="maximum">
|
||||
<number>199</number>
|
||||
<number>9999</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>19</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksBelow</enum>
|
||||
<property name="suffix">
|
||||
<string>%</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="emulation_speed_display_label">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@ -170,56 +158,28 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="turbo_limit">
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QSpinBox" name="turbo_limit">
|
||||
<property name="maximum">
|
||||
<number>198</number>
|
||||
<number>9999</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>19</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksBelow</enum>
|
||||
<property name="suffix">
|
||||
<string>%</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="turbo_limit_display_label">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -287,7 +247,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignRight">
|
||||
<item alignment="Qt::AlignmentFlag::AlignRight">
|
||||
<widget class="QPushButton" name="button_reset_defaults">
|
||||
<property name="text">
|
||||
<string>Reset All Settings</string>
|
||||
@ -297,7 +257,7 @@
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
||||
@ -509,8 +509,8 @@ struct Values {
|
||||
SwitchableSetting<bool> use_vsync{true, "use_vsync"};
|
||||
Setting<bool> use_shader_jit{true, "use_shader_jit"};
|
||||
SwitchableSetting<u32, true> resolution_factor{1, 0, 10, "resolution_factor"};
|
||||
SwitchableSetting<double, true> frame_limit{100, 0, 1000, "frame_limit"};
|
||||
SwitchableSetting<double, true> turbo_limit{200, 0, 1000, "turbo_limit"};
|
||||
SwitchableSetting<double, true> frame_limit{100, 1, 9999, "frame_limit"};
|
||||
SwitchableSetting<double, true> turbo_limit{200, 1, 9999, "turbo_limit"};
|
||||
SwitchableSetting<TextureFilter> texture_filter{TextureFilter::NoFilter, "texture_filter"};
|
||||
SwitchableSetting<TextureSampling> texture_sampling{TextureSampling::GameControlled,
|
||||
"texture_sampling"};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user