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