mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-04-19 11:10:44 -04:00
fix(hotkey): unlock framerate hotkey during gameplay
Signed-off-by: Collecting <collecting@noreply.localhost>
This commit is contained in:
@@ -1104,6 +1104,8 @@ void GMainWindow::InitializeWidgets() {
|
|||||||
if (emulation_running) {
|
if (emulation_running) {
|
||||||
render_window->show();
|
render_window->show();
|
||||||
render_window->setFocus();
|
render_window->setFocus();
|
||||||
|
// The only safe time to enable screenshots:
|
||||||
|
ui->action_Capture_Screenshot->setEnabled(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1473,9 +1475,6 @@ void GMainWindow::InitializeHotkeys() {
|
|||||||
connect_shortcut(QStringLiteral("Audio Mute/Unmute"), &GMainWindow::OnMute);
|
connect_shortcut(QStringLiteral("Audio Mute/Unmute"), &GMainWindow::OnMute);
|
||||||
connect_shortcut(QStringLiteral("Audio Volume Down"), &GMainWindow::OnDecreaseVolume);
|
connect_shortcut(QStringLiteral("Audio Volume Down"), &GMainWindow::OnDecreaseVolume);
|
||||||
connect_shortcut(QStringLiteral("Audio Volume Up"), &GMainWindow::OnIncreaseVolume);
|
connect_shortcut(QStringLiteral("Audio Volume Up"), &GMainWindow::OnIncreaseVolume);
|
||||||
connect_shortcut(QStringLiteral("Toggle Framerate Limit"), [] {
|
|
||||||
Settings::values.use_speed_limit.SetValue(!Settings::values.use_speed_limit.GetValue());
|
|
||||||
});
|
|
||||||
connect_shortcut(QStringLiteral("Toggle Renderdoc Capture"), [this] {
|
connect_shortcut(QStringLiteral("Toggle Renderdoc Capture"), [this] {
|
||||||
if (Settings::values.enable_renderdoc_hotkey) {
|
if (Settings::values.enable_renderdoc_hotkey) {
|
||||||
system->GetRenderdocAPI().ToggleCapture();
|
system->GetRenderdocAPI().ToggleCapture();
|
||||||
@@ -1614,6 +1613,12 @@ void GMainWindow::ConnectWidgetEvents() {
|
|||||||
connect(this, &GMainWindow::EmulationStopping, render_window,
|
connect(this, &GMainWindow::EmulationStopping, render_window,
|
||||||
&GRenderWindow::OnEmulationStopping);
|
&GRenderWindow::OnEmulationStopping);
|
||||||
|
|
||||||
|
connect(render_window, &GRenderWindow::UnlockFramerateHotkeyPressed, this, [this] {
|
||||||
|
if (system->IsPoweredOn()) {
|
||||||
|
Settings::values.use_speed_limit.SetValue(!Settings::values.use_speed_limit.GetValue());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Software Keyboard Applet
|
// Software Keyboard Applet
|
||||||
connect(this, &GMainWindow::EmulationStarting, this, &GMainWindow::SoftwareKeyboardExit);
|
connect(this, &GMainWindow::EmulationStarting, this, &GMainWindow::SoftwareKeyboardExit);
|
||||||
connect(this, &GMainWindow::EmulationStopping, this, &GMainWindow::SoftwareKeyboardExit);
|
connect(this, &GMainWindow::EmulationStopping, this, &GMainWindow::SoftwareKeyboardExit);
|
||||||
@@ -2059,6 +2064,8 @@ void GMainWindow::BootGame(const QString& filename, Service::AM::FrontendAppletP
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
current_title_id = title_id; // Store ID safely
|
||||||
|
|
||||||
if (type == StartGameType::Normal) {
|
if (type == StartGameType::Normal) {
|
||||||
// Load per game settings if it is a normal boot
|
// Load per game settings if it is a normal boot
|
||||||
const auto file_path =
|
const auto file_path =
|
||||||
@@ -5297,15 +5304,17 @@ void GMainWindow::OnOpenControllerMenu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::OnCaptureScreenshot() {
|
void GMainWindow::OnCaptureScreenshot() {
|
||||||
if (emu_thread == nullptr || !emu_thread->IsRunning()) {
|
if (emu_thread == nullptr || !emu_thread->IsRunning() || !render_window->IsLoadingComplete()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const u64 title_id = system->GetApplicationProcessProgramID();
|
const u64 title_id = current_title_id;
|
||||||
|
|
||||||
const auto screenshot_path =
|
const auto screenshot_path =
|
||||||
QString::fromStdString(Common::FS::GetCitronPathString(Common::FS::CitronPath::ScreenshotsDir));
|
QString::fromStdString(Common::FS::GetCitronPathString(Common::FS::CitronPath::ScreenshotsDir));
|
||||||
const auto date =
|
const auto date =
|
||||||
QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd_hh-mm-ss-zzz"));
|
QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd_hh-mm-ss-zzz"));
|
||||||
|
|
||||||
QString filename = QStringLiteral("%1/%2_%3.png")
|
QString filename = QStringLiteral("%1/%2_%3.png")
|
||||||
.arg(screenshot_path)
|
.arg(screenshot_path)
|
||||||
.arg(title_id, 16, 16, QLatin1Char{'0'})
|
.arg(title_id, 16, 16, QLatin1Char{'0'})
|
||||||
@@ -5326,6 +5335,7 @@ void GMainWindow::OnCaptureScreenshot() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
render_window->CaptureScreenshot(filename);
|
render_window->CaptureScreenshot(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user