From 2e5866147eb24545e597d86f4e6621c2f2c63165 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Sat, 13 Nov 2021 22:14:30 -0500 Subject: Replace "Light" theme by "Default" This reflects the current behavior: Light = System default. If your system is set to dark theme, then Light = Dark, which is a bit confusing for the end user. In this PR, I propose to change "Light" with "Default". This way, the user has "Default" and "Default Colorful", which will apply the system theme. Now that the Flatpak respects the system theme, I think this makes much more sense. I also simplified the theme update. Before the code was branching between the default theme and the others, but I think we can have something simpler by forcing the default theme if no theme is defined in the settings, or if the selected theme doesn't exist. And if there's an error, tell the theme name in the error message. --- src/yuzu/main.cpp | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 4e5552d2a..cfda60997 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -3381,36 +3381,38 @@ void GMainWindow::filterBarSetChecked(bool state) { } void GMainWindow::UpdateUITheme() { - const QString default_icons = QStringLiteral("default"); - const QString& current_theme = UISettings::values.theme; - const bool is_default_theme = current_theme == QString::fromUtf8(UISettings::themes[0].second); + const QString default_theme = QStringLiteral("default"); + QString current_theme = UISettings::values.theme; QStringList theme_paths(default_theme_paths); - if (is_default_theme || current_theme.isEmpty()) { - const QString theme_uri(QStringLiteral(":default/style.qss")); + if (current_theme.isEmpty()) { + current_theme = default_theme; + } + + if (current_theme != default_theme) { + QString theme_uri{QStringLiteral(":%1/style.qss").arg(current_theme)}; QFile f(theme_uri); - if (f.open(QFile::ReadOnly | QFile::Text)) { - QTextStream ts(&f); - qApp->setStyleSheet(ts.readAll()); - setStyleSheet(ts.readAll()); - } else { - qApp->setStyleSheet({}); - setStyleSheet({}); + if (!f.open(QFile::ReadOnly | QFile::Text)) { + LOG_ERROR(Frontend, "Unable to open style \"{}\", fallback to the default theme", + UISettings::values.theme.toStdString()); + current_theme = default_theme; } - QIcon::setThemeName(default_icons); + } + + QString theme_uri{QStringLiteral(":%1/style.qss").arg(current_theme)}; + QFile f(theme_uri); + if (f.open(QFile::ReadOnly | QFile::Text)) { + QTextStream ts(&f); + qApp->setStyleSheet(ts.readAll()); + setStyleSheet(ts.readAll()); } else { - const QString theme_uri(QLatin1Char{':'} + current_theme + QStringLiteral("/style.qss")); - QFile f(theme_uri); - if (f.open(QFile::ReadOnly | QFile::Text)) { - QTextStream ts(&f); - qApp->setStyleSheet(ts.readAll()); - setStyleSheet(ts.readAll()); - } else { - LOG_ERROR(Frontend, "Unable to set style, stylesheet file not found"); - } - QIcon::setThemeName(current_theme); + LOG_ERROR(Frontend, "Unable to set style \"{}\", stylesheet file not found", + UISettings::values.theme.toStdString()); + qApp->setStyleSheet({}); + setStyleSheet({}); } + QIcon::setThemeName(current_theme); QIcon::setThemeSearchPaths(theme_paths); } -- cgit v1.2.3 From ffb79afd29afbb55b5d161286315f8bd9496776b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Locatti?= <42481638+goldenx86@users.noreply.github.com> Date: Tue, 16 Nov 2021 03:53:28 -0300 Subject: Replace keys error pop up Fight me. --- src/yuzu/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 4e5552d2a..21981f749 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -3194,9 +3194,9 @@ void GMainWindow::OnReinitializeKeys(ReinitializeKeyBehavior behavior) { if (!errors.isEmpty()) { QMessageBox::warning( this, tr("Derivation Components Missing"), - tr("Components are missing that may hinder key derivation from completing. " + tr("Encryption keys are missing. " "
Please follow the yuzu " - "quickstart guide to get all your keys and " + "quickstart guide to get all your keys, firmware and " "games.

(%1)") .arg(errors)); } -- cgit v1.2.3 From c76163b611350e2261a6a64f1853626af6f57ada Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Thu, 18 Nov 2021 23:04:06 -0500 Subject: main: Shorten AMD FSR status bar text AMD'S FIDELITYFX SR -> FSR --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 6071a222f..689746028 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -3106,7 +3106,7 @@ void GMainWindow::UpdateFilterText() { filter_status_button->setText(tr("SCALEFORCE")); break; case Settings::ScalingFilter::Fsr: - filter_status_button->setText(tr("AMD'S FIDELITYFX SR")); + filter_status_button->setText(tr("FSR")); break; default: filter_status_button->setText(tr("BILINEAR")); -- cgit v1.2.3 From bc5ed1aa1b41b9960657dddee658c3ce344cb501 Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Thu, 18 Nov 2021 23:22:32 -0500 Subject: main: Fix default AA name By default, no AA is applied, not FXAA --- src/yuzu/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 689746028..44800e165 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -3117,15 +3117,15 @@ void GMainWindow::UpdateFilterText() { void GMainWindow::UpdateAAText() { const auto aa_mode = Settings::values.anti_aliasing.GetValue(); switch (aa_mode) { - case Settings::AntiAliasing::Fxaa: - aa_status_button->setText(tr("FXAA")); - break; case Settings::AntiAliasing::None: aa_status_button->setText(tr("NO AA")); break; - default: + case Settings::AntiAliasing::Fxaa: aa_status_button->setText(tr("FXAA")); break; + default: + aa_status_button->setText(tr("NO AA")); + break; } } -- cgit v1.2.3 From f90d9808378092e208b431f467c54feb6952e91d Mon Sep 17 00:00:00 2001 From: Adam Heinermann Date: Sun, 21 Nov 2021 17:28:47 -0800 Subject: Added TAS controls to the menu under Tools --- src/yuzu/main.cpp | 100 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 71 insertions(+), 29 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index c4c76b094..73278f29f 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -965,6 +965,9 @@ void GMainWindow::InitializeHotkeys() { const QString toggle_status_bar = QStringLiteral("Toggle Status Bar"); const QString fullscreen = QStringLiteral("Fullscreen"); const QString capture_screenshot = QStringLiteral("Capture Screenshot"); + const QString tas_start_stop = QStringLiteral("TAS Start/Stop"); + const QString tas_record = QStringLiteral("TAS Record"); + const QString tas_reset = QStringLiteral("TAS Reset"); ui->action_Load_File->setShortcut(hotkey_registry.GetKeySequence(main_window, load_file)); ui->action_Load_File->setShortcutContext( @@ -1005,6 +1008,18 @@ void GMainWindow::InitializeHotkeys() { ui->action_Fullscreen->setShortcutContext( hotkey_registry.GetShortcutContext(main_window, fullscreen)); + ui->action_TAS_Start->setShortcut(hotkey_registry.GetKeySequence(main_window, tas_start_stop)); + ui->action_TAS_Start->setShortcutContext( + hotkey_registry.GetShortcutContext(main_window, tas_start_stop)); + + ui->action_TAS_Record->setShortcut(hotkey_registry.GetKeySequence(main_window, tas_record)); + ui->action_TAS_Record->setShortcutContext( + hotkey_registry.GetShortcutContext(main_window, tas_record)); + + ui->action_TAS_Reset->setShortcut(hotkey_registry.GetKeySequence(main_window, tas_reset)); + ui->action_TAS_Reset->setShortcutContext( + hotkey_registry.GetShortcutContext(main_window, tas_reset)); + connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Load File"), this), &QShortcut::activated, this, &GMainWindow::OnMenuLoadFile); connect( @@ -1095,28 +1110,6 @@ void GMainWindow::InitializeHotkeys() { render_window->setAttribute(Qt::WA_Hover, true); } }); - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("TAS Start/Stop"), this), - &QShortcut::activated, this, [&] { - if (!emulation_running) { - return; - } - input_subsystem->GetTas()->StartStop(); - }); - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("TAS Reset"), this), - &QShortcut::activated, this, [&] { input_subsystem->GetTas()->Reset(); }); - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("TAS Record"), this), - &QShortcut::activated, this, [&] { - if (!emulation_running) { - return; - } - bool is_recording = input_subsystem->GetTas()->Record(); - if (!is_recording) { - const auto res = QMessageBox::question(this, tr("TAS Recording"), - tr("Overwrite file of player 1?"), - QMessageBox::Yes | QMessageBox::No); - input_subsystem->GetTas()->SaveRecording(res == QMessageBox::Yes); - } - }); } void GMainWindow::SetDefaultUIGeometry() { @@ -1236,11 +1229,11 @@ void GMainWindow::ConnectMenuEvents() { connect(ui->action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); connect(ui->action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); - connect(ui->action_Configure_Tas, &QAction::triggered, this, &GMainWindow::OnConfigureTas); connect(ui->action_Configure_Current_Game, &QAction::triggered, this, &GMainWindow::OnConfigurePerGame); // View + connect(ui->action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); connect(ui->action_Single_Window_Mode, &QAction::triggered, this, &GMainWindow::ToggleWindowMode); connect(ui->action_Display_Dock_Widget_Headers, &QAction::triggered, this, @@ -1258,17 +1251,20 @@ void GMainWindow::ConnectMenuEvents() { ui->menu_Reset_Window_Size->addAction(ui->action_Reset_Window_Size_900); ui->menu_Reset_Window_Size->addAction(ui->action_Reset_Window_Size_1080); - // Fullscreen - connect(ui->action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); - - // Movie + // Tools + connect(ui->action_Rederive, &QAction::triggered, this, + std::bind(&GMainWindow::OnReinitializeKeys, this, ReinitializeKeyBehavior::Warning)); connect(ui->action_Capture_Screenshot, &QAction::triggered, this, &GMainWindow::OnCaptureScreenshot); + // TAS + connect(ui->action_TAS_Start, &QAction::triggered, this, &GMainWindow::OnTasStartStop); + connect(ui->action_TAS_Record, &QAction::triggered, this, &GMainWindow::OnTasRecord); + connect(ui->action_TAS_Reset, &QAction::triggered, this, &GMainWindow::OnTasReset); + connect(ui->action_Configure_Tas, &QAction::triggered, this, &GMainWindow::OnConfigureTas); + // Help connect(ui->action_Open_yuzu_Folder, &QAction::triggered, this, &GMainWindow::OnOpenYuzuFolder); - connect(ui->action_Rederive, &QAction::triggered, this, - std::bind(&GMainWindow::OnReinitializeKeys, this, ReinitializeKeyBehavior::Warning)); connect(ui->action_About, &QAction::triggered, this, &GMainWindow::OnAbout); } @@ -1582,6 +1578,7 @@ void GMainWindow::ShutdownGame() { game_list->SetFilterFocus(); tas_label->clear(); input_subsystem->GetTas()->Stop(); + OnTasStateChanged(); render_window->removeEventFilter(render_window); render_window->setAttribute(Qt::WA_Hover, false); @@ -2509,6 +2506,7 @@ void GMainWindow::OnStartGame() { ui->action_Restart->setEnabled(true); ui->action_Configure_Current_Game->setEnabled(true); ui->action_Report_Compatibility->setEnabled(true); + OnTasStateChanged(); discord_rpc->Update(); ui->action_Load_Amiibo->setEnabled(true); @@ -2821,6 +2819,33 @@ void GMainWindow::OnConfigureTas() { } } +void GMainWindow::OnTasStartStop() { + if (!emulation_running) { + return; + } + input_subsystem->GetTas()->StartStop(); + OnTasStateChanged(); +} + +void GMainWindow::OnTasRecord() { + if (!emulation_running) { + return; + } + bool is_recording = input_subsystem->GetTas()->Record(); + if (!is_recording) { + const auto res = + QMessageBox::question(this, tr("TAS Recording"), tr("Overwrite file of player 1?"), + QMessageBox::Yes | QMessageBox::No); + input_subsystem->GetTas()->SaveRecording(res == QMessageBox::Yes); + } + OnTasStateChanged(); +} + +void GMainWindow::OnTasReset() { + input_subsystem->GetTas()->Reset(); +} + + void GMainWindow::OnConfigurePerGame() { const u64 title_id = system->GetCurrentProcessProgramID(); OpenPerGameConfiguration(title_id, game_path.toStdString()); @@ -3014,6 +3039,23 @@ QString GMainWindow::GetTasStateDescription() const { } } +void GMainWindow::OnTasStateChanged() { + bool is_running = false; + bool is_recording = false; + if (emulation_running) { + TasInput::TasState tas_status = std::get<0>(input_subsystem->GetTas()->GetStatus()); + is_running = tas_status == TasInput::TasState::Running; + is_recording = tas_status == TasInput::TasState::Recording; + } + + ui->action_TAS_Start->setText(is_running ? tr("&Stop Running") : tr("&Start")); + ui->action_TAS_Record->setText(is_recording ? tr("Stop R&ecording") : tr("R&ecord")); + + ui->action_TAS_Start->setEnabled(emulation_running); + ui->action_TAS_Record->setEnabled(emulation_running); + ui->action_TAS_Reset->setEnabled(emulation_running); +} + void GMainWindow::UpdateStatusBar() { if (emu_thread == nullptr) { status_bar_update_timer.stop(); -- cgit v1.2.3 From b7a938e817be3801f2c2c9f1b693ea7d008373b1 Mon Sep 17 00:00:00 2001 From: Adam Heinermann Date: Sun, 21 Nov 2021 18:02:08 -0800 Subject: Apply clang format --- src/yuzu/main.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 73278f29f..42ee310cc 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -2845,7 +2845,6 @@ void GMainWindow::OnTasReset() { input_subsystem->GetTas()->Reset(); } - void GMainWindow::OnConfigurePerGame() { const u64 title_id = system->GetCurrentProcessProgramID(); OpenPerGameConfiguration(title_id, game_path.toStdString()); -- cgit v1.2.3 From 097de2febcf97da38c55235073eff834c529acac Mon Sep 17 00:00:00 2001 From: Adam Heinermann Date: Sun, 21 Nov 2021 18:07:37 -0800 Subject: const fixes --- src/yuzu/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 42ee310cc..5058c3e4e 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -2831,7 +2831,7 @@ void GMainWindow::OnTasRecord() { if (!emulation_running) { return; } - bool is_recording = input_subsystem->GetTas()->Record(); + const bool is_recording = input_subsystem->GetTas()->Record(); if (!is_recording) { const auto res = QMessageBox::question(this, tr("TAS Recording"), tr("Overwrite file of player 1?"), @@ -3042,7 +3042,7 @@ void GMainWindow::OnTasStateChanged() { bool is_running = false; bool is_recording = false; if (emulation_running) { - TasInput::TasState tas_status = std::get<0>(input_subsystem->GetTas()->GetStatus()); + const TasInput::TasState tas_status = std::get<0>(input_subsystem->GetTas()->GetStatus()); is_running = tas_status == TasInput::TasState::Running; is_recording = tas_status == TasInput::TasState::Recording; } -- cgit v1.2.3 From f078d3d212a4b272012695762f3ce62eaa0db2ab Mon Sep 17 00:00:00 2001 From: Adam Heinermann Date: Wed, 24 Nov 2021 18:27:25 -0800 Subject: Refactor menu states and shortcuts in GMainWindow. (#7419) Refactor menu states and shortcuts in GMainWindow. - Removed "Start", since it was always disabled unless it was "Continue" which has now been moved to "Pause". - Allow hotkeys to be used while in fullscreen. - Removed the load amiibo hotkey. --- src/yuzu/main.cpp | 397 +++++++++++++++++++++++------------------------------- 1 file changed, 169 insertions(+), 228 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 5058c3e4e..88e84e8f7 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -952,164 +952,80 @@ void GMainWindow::InitializeRecentFileMenuActions() { UpdateRecentFiles(); } +void GMainWindow::LinkActionShortcut(QAction* action, const QString& action_name) { + static const QString main_window = QStringLiteral("Main Window"); + action->setShortcut(hotkey_registry.GetKeySequence(main_window, action_name)); + action->setShortcutContext(hotkey_registry.GetShortcutContext(main_window, action_name)); + + this->addAction(action); +} + void GMainWindow::InitializeHotkeys() { hotkey_registry.LoadHotkeys(); - const QString main_window = QStringLiteral("Main Window"); - const QString load_file = QStringLiteral("Load File"); - const QString load_amiibo = QStringLiteral("Load Amiibo"); - const QString exit_yuzu = QStringLiteral("Exit yuzu"); - const QString restart_emulation = QStringLiteral("Restart Emulation"); - const QString stop_emulation = QStringLiteral("Stop Emulation"); - const QString toggle_filter_bar = QStringLiteral("Toggle Filter Bar"); - const QString toggle_status_bar = QStringLiteral("Toggle Status Bar"); - const QString fullscreen = QStringLiteral("Fullscreen"); - const QString capture_screenshot = QStringLiteral("Capture Screenshot"); - const QString tas_start_stop = QStringLiteral("TAS Start/Stop"); - const QString tas_record = QStringLiteral("TAS Record"); - const QString tas_reset = QStringLiteral("TAS Reset"); - - ui->action_Load_File->setShortcut(hotkey_registry.GetKeySequence(main_window, load_file)); - ui->action_Load_File->setShortcutContext( - hotkey_registry.GetShortcutContext(main_window, load_file)); - - ui->action_Load_Amiibo->setShortcut(hotkey_registry.GetKeySequence(main_window, load_amiibo)); - ui->action_Load_Amiibo->setShortcutContext( - hotkey_registry.GetShortcutContext(main_window, load_amiibo)); - - ui->action_Exit->setShortcut(hotkey_registry.GetKeySequence(main_window, exit_yuzu)); - ui->action_Exit->setShortcutContext(hotkey_registry.GetShortcutContext(main_window, exit_yuzu)); - - ui->action_Restart->setShortcut(hotkey_registry.GetKeySequence(main_window, restart_emulation)); - ui->action_Restart->setShortcutContext( - hotkey_registry.GetShortcutContext(main_window, restart_emulation)); - - ui->action_Stop->setShortcut(hotkey_registry.GetKeySequence(main_window, stop_emulation)); - ui->action_Stop->setShortcutContext( - hotkey_registry.GetShortcutContext(main_window, stop_emulation)); - - ui->action_Show_Filter_Bar->setShortcut( - hotkey_registry.GetKeySequence(main_window, toggle_filter_bar)); - ui->action_Show_Filter_Bar->setShortcutContext( - hotkey_registry.GetShortcutContext(main_window, toggle_filter_bar)); - - ui->action_Show_Status_Bar->setShortcut( - hotkey_registry.GetKeySequence(main_window, toggle_status_bar)); - ui->action_Show_Status_Bar->setShortcutContext( - hotkey_registry.GetShortcutContext(main_window, toggle_status_bar)); - - ui->action_Capture_Screenshot->setShortcut( - hotkey_registry.GetKeySequence(main_window, capture_screenshot)); - ui->action_Capture_Screenshot->setShortcutContext( - hotkey_registry.GetShortcutContext(main_window, capture_screenshot)); - - ui->action_Fullscreen->setShortcut( - hotkey_registry.GetHotkey(main_window, fullscreen, this)->key()); - ui->action_Fullscreen->setShortcutContext( - hotkey_registry.GetShortcutContext(main_window, fullscreen)); - - ui->action_TAS_Start->setShortcut(hotkey_registry.GetKeySequence(main_window, tas_start_stop)); - ui->action_TAS_Start->setShortcutContext( - hotkey_registry.GetShortcutContext(main_window, tas_start_stop)); - - ui->action_TAS_Record->setShortcut(hotkey_registry.GetKeySequence(main_window, tas_record)); - ui->action_TAS_Record->setShortcutContext( - hotkey_registry.GetShortcutContext(main_window, tas_record)); - - ui->action_TAS_Reset->setShortcut(hotkey_registry.GetKeySequence(main_window, tas_reset)); - ui->action_TAS_Reset->setShortcutContext( - hotkey_registry.GetShortcutContext(main_window, tas_reset)); - - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Load File"), this), - &QShortcut::activated, this, &GMainWindow::OnMenuLoadFile); - connect( - hotkey_registry.GetHotkey(main_window, QStringLiteral("Continue/Pause Emulation"), this), - &QShortcut::activated, this, [&] { - if (emulation_running) { - if (emu_thread->IsRunning()) { - OnPauseGame(); - } else { - OnStartGame(); - } - } - }); - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Restart Emulation"), this), - &QShortcut::activated, this, [this] { - if (!system->IsPoweredOn()) { - return; - } - BootGame(game_path); - }); - connect(hotkey_registry.GetHotkey(main_window, fullscreen, render_window), - &QShortcut::activated, ui->action_Fullscreen, &QAction::trigger); - connect(hotkey_registry.GetHotkey(main_window, fullscreen, render_window), - &QShortcut::activatedAmbiguously, ui->action_Fullscreen, &QAction::trigger); - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Exit Fullscreen"), this), - &QShortcut::activated, this, [&] { - if (emulation_running && ui->action_Fullscreen->isChecked()) { - ui->action_Fullscreen->setChecked(false); - ToggleFullscreen(); - } - }); - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Speed Limit"), this), - &QShortcut::activated, this, [&] { - Settings::values.use_speed_limit.SetValue( - !Settings::values.use_speed_limit.GetValue()); - UpdateStatusBar(); - }); + LinkActionShortcut(ui->action_Load_File, QStringLiteral("Load File")); + LinkActionShortcut(ui->action_Load_Amiibo, QStringLiteral("Load Amiibo")); + LinkActionShortcut(ui->action_Exit, QStringLiteral("Exit yuzu")); + LinkActionShortcut(ui->action_Restart, QStringLiteral("Restart Emulation")); + LinkActionShortcut(ui->action_Pause, QStringLiteral("Continue/Pause Emulation")); + LinkActionShortcut(ui->action_Stop, QStringLiteral("Stop Emulation")); + LinkActionShortcut(ui->action_Show_Filter_Bar, QStringLiteral("Toggle Filter Bar")); + LinkActionShortcut(ui->action_Show_Status_Bar, QStringLiteral("Toggle Status Bar")); + LinkActionShortcut(ui->action_Fullscreen, QStringLiteral("Fullscreen")); + LinkActionShortcut(ui->action_Capture_Screenshot, QStringLiteral("Capture Screenshot")); + LinkActionShortcut(ui->action_TAS_Start, QStringLiteral("TAS Start/Stop")); + LinkActionShortcut(ui->action_TAS_Record, QStringLiteral("TAS Record")); + LinkActionShortcut(ui->action_TAS_Reset, QStringLiteral("TAS Reset")); + + static const QString main_window = QStringLiteral("Main Window"); + const auto connect_shortcut = [&](const QString& action_name, const Fn& function) { + const QShortcut* hotkey = hotkey_registry.GetHotkey(main_window, action_name, this); + connect(hotkey, &QShortcut::activated, this, function); + }; + + connect_shortcut(QStringLiteral("Exit Fullscreen"), [&] { + if (emulation_running && ui->action_Fullscreen->isChecked()) { + ui->action_Fullscreen->setChecked(false); + ToggleFullscreen(); + } + }); + connect_shortcut(QStringLiteral("Toggle Speed Limit"), [&] { + Settings::values.use_speed_limit.SetValue(!Settings::values.use_speed_limit.GetValue()); + UpdateStatusBar(); + }); constexpr u16 SPEED_LIMIT_STEP = 5; - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Increase Speed Limit"), this), - &QShortcut::activated, this, [&] { - if (Settings::values.speed_limit.GetValue() < 9999 - SPEED_LIMIT_STEP) { - Settings::values.speed_limit.SetValue(SPEED_LIMIT_STEP + - Settings::values.speed_limit.GetValue()); - UpdateStatusBar(); - } - }); - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Decrease Speed Limit"), this), - &QShortcut::activated, this, [&] { - if (Settings::values.speed_limit.GetValue() > SPEED_LIMIT_STEP) { - Settings::values.speed_limit.SetValue(Settings::values.speed_limit.GetValue() - - SPEED_LIMIT_STEP); - UpdateStatusBar(); - } - }); - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Load Amiibo"), this), - &QShortcut::activated, this, [&] { - if (ui->action_Load_Amiibo->isEnabled()) { - OnLoadAmiibo(); - } - }); - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Capture Screenshot"), this), - &QShortcut::activated, this, [&] { - if (emu_thread != nullptr && emu_thread->IsRunning()) { - OnCaptureScreenshot(); - } - }); - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Change Docked Mode"), this), - &QShortcut::activated, this, [&] { - Settings::values.use_docked_mode.SetValue( - !Settings::values.use_docked_mode.GetValue()); - OnDockedModeChanged(!Settings::values.use_docked_mode.GetValue(), - Settings::values.use_docked_mode.GetValue(), *system); - dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); - }); - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Mute Audio"), this), - &QShortcut::activated, this, - [] { Settings::values.audio_muted = !Settings::values.audio_muted; }); - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Framerate Limit"), this), - &QShortcut::activated, this, [] { - Settings::values.disable_fps_limit.SetValue( - !Settings::values.disable_fps_limit.GetValue()); - }); - connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Mouse Panning"), this), - &QShortcut::activated, this, [&] { - Settings::values.mouse_panning = !Settings::values.mouse_panning; - if (Settings::values.mouse_panning) { - render_window->installEventFilter(render_window); - render_window->setAttribute(Qt::WA_Hover, true); - } - }); + connect_shortcut(QStringLiteral("Increase Speed Limit"), [&] { + if (Settings::values.speed_limit.GetValue() < 9999 - SPEED_LIMIT_STEP) { + Settings::values.speed_limit.SetValue(SPEED_LIMIT_STEP + + Settings::values.speed_limit.GetValue()); + UpdateStatusBar(); + } + }); + connect_shortcut(QStringLiteral("Decrease Speed Limit"), [&] { + if (Settings::values.speed_limit.GetValue() > SPEED_LIMIT_STEP) { + Settings::values.speed_limit.SetValue(Settings::values.speed_limit.GetValue() - + SPEED_LIMIT_STEP); + UpdateStatusBar(); + } + }); + connect_shortcut(QStringLiteral("Change Docked Mode"), [&] { + Settings::values.use_docked_mode.SetValue(!Settings::values.use_docked_mode.GetValue()); + OnDockedModeChanged(!Settings::values.use_docked_mode.GetValue(), + Settings::values.use_docked_mode.GetValue(), *system); + dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); + }); + connect_shortcut(QStringLiteral("Mute Audio"), + [] { Settings::values.audio_muted = !Settings::values.audio_muted; }); + connect_shortcut(QStringLiteral("Toggle Framerate Limit"), [] { + Settings::values.disable_fps_limit.SetValue(!Settings::values.disable_fps_limit.GetValue()); + }); + connect_shortcut(QStringLiteral("Toggle Mouse Panning"), [&] { + Settings::values.mouse_panning = !Settings::values.mouse_panning; + if (Settings::values.mouse_panning) { + render_window->installEventFilter(render_window); + render_window->setAttribute(Qt::WA_Hover, true); + } + }); } void GMainWindow::SetDefaultUIGeometry() { @@ -1164,7 +1080,8 @@ void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) { (state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) { auto_paused = true; OnPauseGame(); - } else if (ui->action_Start->isEnabled() && auto_paused && state == Qt::ApplicationActive) { + } else if (emulation_running && !emu_thread->IsRunning() && auto_paused && + state == Qt::ApplicationActive) { auto_paused = false; OnStartGame(); } @@ -1208,64 +1125,86 @@ void GMainWindow::ConnectWidgetEvents() { } void GMainWindow::ConnectMenuEvents() { + const auto connect_menu = [&](QAction* action, const Fn& event_fn) { + connect(action, &QAction::triggered, this, event_fn); + // Add actions to this window so that hiding menus in fullscreen won't disable them + addAction(action); + // Add actions to the render window so that they work outside of single window mode + render_window->addAction(action); + }; + // File - connect(ui->action_Load_File, &QAction::triggered, this, &GMainWindow::OnMenuLoadFile); - connect(ui->action_Load_Folder, &QAction::triggered, this, &GMainWindow::OnMenuLoadFolder); - connect(ui->action_Install_File_NAND, &QAction::triggered, this, - &GMainWindow::OnMenuInstallToNAND); - connect(ui->action_Exit, &QAction::triggered, this, &QMainWindow::close); - connect(ui->action_Load_Amiibo, &QAction::triggered, this, &GMainWindow::OnLoadAmiibo); + connect_menu(ui->action_Load_File, &GMainWindow::OnMenuLoadFile); + connect_menu(ui->action_Load_Folder, &GMainWindow::OnMenuLoadFolder); + connect_menu(ui->action_Install_File_NAND, &GMainWindow::OnMenuInstallToNAND); + connect_menu(ui->action_Exit, &QMainWindow::close); + connect_menu(ui->action_Load_Amiibo, &GMainWindow::OnLoadAmiibo); // Emulation - connect(ui->action_Start, &QAction::triggered, this, &GMainWindow::OnStartGame); - connect(ui->action_Pause, &QAction::triggered, this, &GMainWindow::OnPauseGame); - connect(ui->action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame); - connect(ui->action_Report_Compatibility, &QAction::triggered, this, - &GMainWindow::OnMenuReportCompatibility); - connect(ui->action_Open_Mods_Page, &QAction::triggered, this, &GMainWindow::OnOpenModsPage); - connect(ui->action_Open_Quickstart_Guide, &QAction::triggered, this, - &GMainWindow::OnOpenQuickstartGuide); - connect(ui->action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnOpenFAQ); - connect(ui->action_Restart, &QAction::triggered, this, - [this] { BootGame(QString(game_path)); }); - connect(ui->action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); - connect(ui->action_Configure_Current_Game, &QAction::triggered, this, - &GMainWindow::OnConfigurePerGame); + connect_menu(ui->action_Pause, &GMainWindow::OnPauseContinueGame); + connect_menu(ui->action_Stop, &GMainWindow::OnStopGame); + connect_menu(ui->action_Report_Compatibility, &GMainWindow::OnMenuReportCompatibility); + connect_menu(ui->action_Open_Mods_Page, &GMainWindow::OnOpenModsPage); + connect_menu(ui->action_Open_Quickstart_Guide, &GMainWindow::OnOpenQuickstartGuide); + connect_menu(ui->action_Open_FAQ, &GMainWindow::OnOpenFAQ); + connect_menu(ui->action_Restart, &GMainWindow::OnRestartGame); + connect_menu(ui->action_Configure, &GMainWindow::OnConfigure); + connect_menu(ui->action_Configure_Current_Game, &GMainWindow::OnConfigurePerGame); // View - connect(ui->action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); - connect(ui->action_Single_Window_Mode, &QAction::triggered, this, - &GMainWindow::ToggleWindowMode); - connect(ui->action_Display_Dock_Widget_Headers, &QAction::triggered, this, - &GMainWindow::OnDisplayTitleBars); - connect(ui->action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); + connect_menu(ui->action_Fullscreen, &GMainWindow::ToggleFullscreen); + connect_menu(ui->action_Single_Window_Mode, &GMainWindow::ToggleWindowMode); + connect_menu(ui->action_Display_Dock_Widget_Headers, &GMainWindow::OnDisplayTitleBars); + connect_menu(ui->action_Show_Filter_Bar, &GMainWindow::OnToggleFilterBar); + connect(ui->action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); - connect(ui->action_Reset_Window_Size_720, &QAction::triggered, this, - &GMainWindow::ResetWindowSize720); - connect(ui->action_Reset_Window_Size_900, &QAction::triggered, this, - &GMainWindow::ResetWindowSize900); - connect(ui->action_Reset_Window_Size_1080, &QAction::triggered, this, - &GMainWindow::ResetWindowSize1080); - ui->menu_Reset_Window_Size->addAction(ui->action_Reset_Window_Size_720); - ui->menu_Reset_Window_Size->addAction(ui->action_Reset_Window_Size_900); - ui->menu_Reset_Window_Size->addAction(ui->action_Reset_Window_Size_1080); + connect_menu(ui->action_Reset_Window_Size_720, &GMainWindow::ResetWindowSize720); + connect_menu(ui->action_Reset_Window_Size_900, &GMainWindow::ResetWindowSize900); + connect_menu(ui->action_Reset_Window_Size_1080, &GMainWindow::ResetWindowSize1080); + ui->menu_Reset_Window_Size->addActions({ui->action_Reset_Window_Size_720, + ui->action_Reset_Window_Size_900, + ui->action_Reset_Window_Size_1080}); // Tools - connect(ui->action_Rederive, &QAction::triggered, this, - std::bind(&GMainWindow::OnReinitializeKeys, this, ReinitializeKeyBehavior::Warning)); - connect(ui->action_Capture_Screenshot, &QAction::triggered, this, - &GMainWindow::OnCaptureScreenshot); + connect_menu(ui->action_Rederive, std::bind(&GMainWindow::OnReinitializeKeys, this, + ReinitializeKeyBehavior::Warning)); + connect_menu(ui->action_Capture_Screenshot, &GMainWindow::OnCaptureScreenshot); // TAS - connect(ui->action_TAS_Start, &QAction::triggered, this, &GMainWindow::OnTasStartStop); - connect(ui->action_TAS_Record, &QAction::triggered, this, &GMainWindow::OnTasRecord); - connect(ui->action_TAS_Reset, &QAction::triggered, this, &GMainWindow::OnTasReset); - connect(ui->action_Configure_Tas, &QAction::triggered, this, &GMainWindow::OnConfigureTas); + connect_menu(ui->action_TAS_Start, &GMainWindow::OnTasStartStop); + connect_menu(ui->action_TAS_Record, &GMainWindow::OnTasRecord); + connect_menu(ui->action_TAS_Reset, &GMainWindow::OnTasReset); + connect_menu(ui->action_Configure_Tas, &GMainWindow::OnConfigureTas); // Help - connect(ui->action_Open_yuzu_Folder, &QAction::triggered, this, &GMainWindow::OnOpenYuzuFolder); - connect(ui->action_About, &QAction::triggered, this, &GMainWindow::OnAbout); + connect_menu(ui->action_Open_yuzu_Folder, &GMainWindow::OnOpenYuzuFolder); + connect_menu(ui->action_About, &GMainWindow::OnAbout); +} + +void GMainWindow::UpdateMenuState() { + const bool is_paused = emu_thread == nullptr || !emu_thread->IsRunning(); + + const std::array running_actions{ + ui->action_Stop, + ui->action_Restart, + ui->action_Configure_Current_Game, + ui->action_Report_Compatibility, + ui->action_Load_Amiibo, + ui->action_Pause, + }; + + for (QAction* action : running_actions) { + action->setEnabled(emulation_running); + } + + ui->action_Capture_Screenshot->setEnabled(emulation_running && !is_paused); + + if (emulation_running && is_paused) { + ui->action_Pause->setText(tr("&Continue")); + } else { + ui->action_Pause->setText(tr("&Pause")); + } } void GMainWindow::OnDisplayTitleBars(bool show) { @@ -1558,15 +1497,8 @@ void GMainWindow::ShutdownGame() { disconnect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame); // Update the GUI - ui->action_Start->setEnabled(false); - ui->action_Start->setText(tr("Start")); - ui->action_Pause->setEnabled(false); - ui->action_Stop->setEnabled(false); - ui->action_Restart->setEnabled(false); - ui->action_Configure_Current_Game->setEnabled(false); - ui->action_Report_Compatibility->setEnabled(false); - ui->action_Load_Amiibo->setEnabled(false); - ui->action_Capture_Screenshot->setEnabled(false); + UpdateMenuState(); + render_window->hide(); loading_screen->hide(); loading_screen->Clear(); @@ -2498,32 +2430,36 @@ void GMainWindow::OnStartGame() { connect(emu_thread.get(), &EmuThread::ErrorThrown, this, &GMainWindow::OnCoreError); - ui->action_Start->setEnabled(false); - ui->action_Start->setText(tr("&Continue")); - - ui->action_Pause->setEnabled(true); - ui->action_Stop->setEnabled(true); - ui->action_Restart->setEnabled(true); - ui->action_Configure_Current_Game->setEnabled(true); - ui->action_Report_Compatibility->setEnabled(true); + UpdateMenuState(); OnTasStateChanged(); discord_rpc->Update(); - ui->action_Load_Amiibo->setEnabled(true); - ui->action_Capture_Screenshot->setEnabled(true); +} + +void GMainWindow::OnRestartGame() { + if (!system->IsPoweredOn()) { + return; + } + // Make a copy since BootGame edits game_path + BootGame(QString(game_path)); } void GMainWindow::OnPauseGame() { emu_thread->SetRunning(false); - - ui->action_Start->setEnabled(true); - ui->action_Pause->setEnabled(false); - ui->action_Stop->setEnabled(true); - ui->action_Capture_Screenshot->setEnabled(false); - + UpdateMenuState(); AllowOSSleep(); } +void GMainWindow::OnPauseContinueGame() { + if (emulation_running) { + if (emu_thread->IsRunning()) { + OnPauseGame(); + } else { + OnStartGame(); + } + } +} + void GMainWindow::OnStopGame() { if (system->GetExitLock() && !ConfirmForceLockedExit()) { return; @@ -2882,6 +2818,10 @@ void GMainWindow::OpenPerGameConfiguration(u64 title_id, const std::string& file } void GMainWindow::OnLoadAmiibo() { + if (emu_thread == nullptr || !emu_thread->IsRunning()) { + return; + } + const QString extensions{QStringLiteral("*.bin")}; const QString file_filter = tr("Amiibo File (%1);; All Files (*.*)").arg(extensions); const QString filename = QFileDialog::getOpenFileName(this, tr("Load Amiibo"), {}, file_filter); @@ -2945,6 +2885,10 @@ void GMainWindow::OnToggleFilterBar() { } void GMainWindow::OnCaptureScreenshot() { + if (emu_thread == nullptr || !emu_thread->IsRunning()) { + return; + } + const u64 title_id = system->GetCurrentProcessProgramID(); const auto screenshot_path = QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::ScreenshotsDir)); @@ -3593,9 +3537,6 @@ void GMainWindow::OnLanguageChanged(const QString& locale) { LoadTranslation(); ui->retranslateUi(this); UpdateWindowTitle(); - - if (emulation_running) - ui->action_Start->setText(tr("&Continue")); } void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) { -- cgit v1.2.3 From 5a785ed794fff8c944283271bf25cb835c11700a Mon Sep 17 00:00:00 2001 From: german77 Date: Mon, 20 Sep 2021 17:18:40 -0500 Subject: input_common: Rewrite keyboard --- src/yuzu/main.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 88e84e8f7..663760a1e 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -2969,15 +2969,15 @@ void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_vie } QString GMainWindow::GetTasStateDescription() const { - auto [tas_status, current_tas_frame, total_tas_frames] = input_subsystem->GetTas()->GetStatus(); - switch (tas_status) { - case TasInput::TasState::Running: - return tr("TAS state: Running %1/%2").arg(current_tas_frame).arg(total_tas_frames); - case TasInput::TasState::Recording: - return tr("TAS state: Recording %1").arg(total_tas_frames); - case TasInput::TasState::Stopped: - return tr("TAS state: Idle %1/%2").arg(current_tas_frame).arg(total_tas_frames); - default: + //auto [tas_status, current_tas_frame, total_tas_frames] = input_subsystem->GetTas()->GetStatus(); + //switch (tas_status) { + //case TasInput::TasState::Running: + // return tr("TAS state: Running %1/%2").arg(current_tas_frame).arg(total_tas_frames); + //case TasInput::TasState::Recording: + // return tr("TAS state: Recording %1").arg(total_tas_frames); + //case TasInput::TasState::Stopped: + // return tr("TAS state: Idle %1/%2").arg(current_tas_frame).arg(total_tas_frames); + //default: return tr("TAS State: Invalid"); } } -- cgit v1.2.3 From 737d305f6324d28a7fde882077fb7e9a0e66311f Mon Sep 17 00:00:00 2001 From: german77 Date: Mon, 20 Sep 2021 19:39:08 -0500 Subject: yuzu: Use new input on main and bootmanager --- src/yuzu/main.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 663760a1e..7f36f6e2f 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -106,8 +106,8 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include "core/loader/loader.h" #include "core/perf_stats.h" #include "core/telemetry_session.h" +#include "input_common/drivers/tas_input.h" #include "input_common/main.h" -#include "input_common/tas/tas_input.h" #include "ui_main.h" #include "util/overlay_dialog.h" #include "video_core/gpu.h" @@ -838,7 +838,6 @@ void GMainWindow::InitializeWidgets() { controller_type = Settings::ControllerType::ProController; ConfigureDialog configure_dialog(this, hotkey_registry, input_subsystem.get(), *system); configure_dialog.ApplyConfiguration(); - controller_dialog->refreshConfiguration(); } Settings::values.use_docked_mode.SetValue(!is_docked); @@ -922,7 +921,7 @@ void GMainWindow::InitializeDebugWidgets() { waitTreeWidget->hide(); debug_menu->addAction(waitTreeWidget->toggleViewAction()); - controller_dialog = new ControllerDialog(this, input_subsystem.get()); + controller_dialog = new ControllerDialog(this); controller_dialog->hide(); debug_menu->addAction(controller_dialog->toggleViewAction()); @@ -2708,7 +2707,6 @@ void GMainWindow::OnConfigure() { ShowTelemetryCallout(); } - controller_dialog->refreshConfiguration(); InitializeHotkeys(); if (UISettings::values.theme != old_theme) { @@ -2969,15 +2967,15 @@ void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_vie } QString GMainWindow::GetTasStateDescription() const { - //auto [tas_status, current_tas_frame, total_tas_frames] = input_subsystem->GetTas()->GetStatus(); - //switch (tas_status) { - //case TasInput::TasState::Running: - // return tr("TAS state: Running %1/%2").arg(current_tas_frame).arg(total_tas_frames); - //case TasInput::TasState::Recording: - // return tr("TAS state: Recording %1").arg(total_tas_frames); - //case TasInput::TasState::Stopped: - // return tr("TAS state: Idle %1/%2").arg(current_tas_frame).arg(total_tas_frames); - //default: + auto [tas_status, current_tas_frame, total_tas_frames] = input_subsystem->GetTas()->GetStatus(); + switch (tas_status) { + case InputCommon::TasInput::TasState::Running: + return tr("TAS state: Running %1/%2").arg(current_tas_frame).arg(total_tas_frames); + case InputCommon::TasInput::TasState::Recording: + return tr("TAS state: Recording %1").arg(total_tas_frames); + case InputCommon::TasInput::TasState::Stopped: + return tr("TAS state: Idle %1/%2").arg(current_tas_frame).arg(total_tas_frames); + default: return tr("TAS State: Invalid"); } } @@ -3371,6 +3369,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) { UpdateUISettings(); game_list->SaveInterfaceLayout(); hotkey_registry.SaveHotkeys(); + Core::System::GetInstance().HIDCore().UnloadInputDevices(); // Shutdown session if the emu thread is active... if (emu_thread != nullptr) { -- cgit v1.2.3 From 967cca10ff5721cc942f557c3e0a20c07f5aa45e Mon Sep 17 00:00:00 2001 From: german77 Date: Mon, 20 Sep 2021 19:44:34 -0500 Subject: core: Register HID --- src/yuzu/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 7f36f6e2f..19cb5313f 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -26,6 +26,7 @@ #include "core/frontend/applets/controller.h" #include "core/frontend/applets/general_frontend.h" #include "core/frontend/applets/software_keyboard.h" +#include "core/hid/hid_core.h" #include "core/hle/service/acc/profile_manager.h" #include "core/hle/service/am/applet_ae.h" #include "core/hle/service/am/applet_oe.h" @@ -227,6 +228,8 @@ GMainWindow::GMainWindow() ConnectMenuEvents(); ConnectWidgetEvents(); + Core::System::GetInstance().HIDCore().ReloadInputDevices(); + const auto branch_name = std::string(Common::g_scm_branch); const auto description = std::string(Common::g_scm_desc); const auto build_id = std::string(Common::g_build_id); @@ -2969,7 +2972,7 @@ void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_vie QString GMainWindow::GetTasStateDescription() const { auto [tas_status, current_tas_frame, total_tas_frames] = input_subsystem->GetTas()->GetStatus(); switch (tas_status) { - case InputCommon::TasInput::TasState::Running: + case InputCommon::TasInput::TasState::Running : return tr("TAS state: Running %1/%2").arg(current_tas_frame).arg(total_tas_frames); case InputCommon::TasInput::TasState::Recording: return tr("TAS state: Recording %1").arg(total_tas_frames); -- cgit v1.2.3 From e0da5c1bbcdf85676f968b63c8ae2587f0464193 Mon Sep 17 00:00:00 2001 From: german77 Date: Fri, 15 Oct 2021 19:07:47 -0500 Subject: kraken: Fix errors from rebase and format files --- src/yuzu/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 19cb5313f..ae997ccfa 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -228,7 +228,7 @@ GMainWindow::GMainWindow() ConnectMenuEvents(); ConnectWidgetEvents(); - Core::System::GetInstance().HIDCore().ReloadInputDevices(); + system->HIDCore().ReloadInputDevices(); const auto branch_name = std::string(Common::g_scm_branch); const auto description = std::string(Common::g_scm_desc); @@ -924,7 +924,7 @@ void GMainWindow::InitializeDebugWidgets() { waitTreeWidget->hide(); debug_menu->addAction(waitTreeWidget->toggleViewAction()); - controller_dialog = new ControllerDialog(this); + controller_dialog = new ControllerDialog(*system, this); controller_dialog->hide(); debug_menu->addAction(controller_dialog->toggleViewAction()); @@ -3372,7 +3372,8 @@ void GMainWindow::closeEvent(QCloseEvent* event) { UpdateUISettings(); game_list->SaveInterfaceLayout(); hotkey_registry.SaveHotkeys(); - Core::System::GetInstance().HIDCore().UnloadInputDevices(); + controller_dialog->UnloadController(); + system->HIDCore().UnloadInputDevices(); // Shutdown session if the emu thread is active... if (emu_thread != nullptr) { -- cgit v1.2.3 From af55dd193533be577d0a3d01f93a4a3a2c27cd5d Mon Sep 17 00:00:00 2001 From: german77 Date: Wed, 20 Oct 2021 17:53:14 -0500 Subject: configuration: Migrate controller settings to emulated controller --- src/yuzu/main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index ae997ccfa..46a5f62ad 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -832,15 +832,16 @@ void GMainWindow::InitializeWidgets() { dock_status_button->setFocusPolicy(Qt::NoFocus); connect(dock_status_button, &QPushButton::clicked, [&] { const bool is_docked = Settings::values.use_docked_mode.GetValue(); - auto& controller_type = Settings::values.players.GetValue()[0].controller_type; + auto* player_1 = system->HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1); + auto* handheld = system->HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld); - if (!is_docked && controller_type == Settings::ControllerType::Handheld) { + if (!is_docked && handheld->IsConnected()) { QMessageBox::warning(this, tr("Invalid config detected"), tr("Handheld controller can't be used on docked mode. Pro " "controller will be selected.")); - controller_type = Settings::ControllerType::ProController; - ConfigureDialog configure_dialog(this, hotkey_registry, input_subsystem.get(), *system); - configure_dialog.ApplyConfiguration(); + handheld->Disconnect(); + player_1->SetNpadType(Core::HID::NpadType::ProController); + player_1->Connect(); } Settings::values.use_docked_mode.SetValue(!is_docked); -- cgit v1.2.3 From 85052b8662d9512077780f717fb2e168390ed705 Mon Sep 17 00:00:00 2001 From: german77 Date: Wed, 20 Oct 2021 23:18:04 -0500 Subject: service/hid: Fix gesture input --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 46a5f62ad..022d11cc4 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -2973,7 +2973,7 @@ void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_vie QString GMainWindow::GetTasStateDescription() const { auto [tas_status, current_tas_frame, total_tas_frames] = input_subsystem->GetTas()->GetStatus(); switch (tas_status) { - case InputCommon::TasInput::TasState::Running : + case InputCommon::TasInput::TasState::Running: return tr("TAS state: Running %1/%2").arg(current_tas_frame).arg(total_tas_frames); case InputCommon::TasInput::TasState::Recording: return tr("TAS state: Recording %1").arg(total_tas_frames); -- cgit v1.2.3 From 61d9eb9f690d6afe141f24ba75c99b54e122dfa3 Mon Sep 17 00:00:00 2001 From: german77 Date: Sat, 30 Oct 2021 20:16:10 -0500 Subject: input_common: Revert deleted TAS functions --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 022d11cc4..56db337a4 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -925,7 +925,7 @@ void GMainWindow::InitializeDebugWidgets() { waitTreeWidget->hide(); debug_menu->addAction(waitTreeWidget->toggleViewAction()); - controller_dialog = new ControllerDialog(*system, this); + controller_dialog = new ControllerDialog(*system, input_subsystem, this); controller_dialog->hide(); debug_menu->addAction(controller_dialog->toggleViewAction()); -- cgit v1.2.3 From 77fa4d4bf60526826ef8b53ee3870f7d2a761976 Mon Sep 17 00:00:00 2001 From: german77 Date: Mon, 1 Nov 2021 14:17:53 -0600 Subject: second commit lion review --- src/yuzu/main.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 56db337a4..7c95851b3 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -26,6 +26,7 @@ #include "core/frontend/applets/controller.h" #include "core/frontend/applets/general_frontend.h" #include "core/frontend/applets/software_keyboard.h" +#include "core/hid/emulated_controller.h" #include "core/hid/hid_core.h" #include "core/hle/service/acc/profile_manager.h" #include "core/hle/service/am/applet_ae.h" -- cgit v1.2.3 From 5d0f3540c4b085103afa27d6120ea29e0324a5a2 Mon Sep 17 00:00:00 2001 From: german77 Date: Thu, 4 Nov 2021 12:08:54 -0600 Subject: core/hid: Rename NpadType to NpadStyleIndex --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 7c95851b3..a10522f5f 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -841,7 +841,7 @@ void GMainWindow::InitializeWidgets() { tr("Handheld controller can't be used on docked mode. Pro " "controller will be selected.")); handheld->Disconnect(); - player_1->SetNpadType(Core::HID::NpadType::ProController); + player_1->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController); player_1->Connect(); } -- cgit v1.2.3 From d14e74132ceaa8b5efef8a7d543cb50429cb4fb3 Mon Sep 17 00:00:00 2001 From: german77 Date: Thu, 4 Nov 2021 13:08:30 -0600 Subject: settings: Fix controller preview not displaying the correct controller --- src/yuzu/main.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index a10522f5f..baf7b38b4 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -230,6 +230,7 @@ GMainWindow::GMainWindow() ConnectWidgetEvents(); system->HIDCore().ReloadInputDevices(); + controller_dialog->refreshConfiguration(); const auto branch_name = std::string(Common::g_scm_branch); const auto description = std::string(Common::g_scm_desc); @@ -843,6 +844,7 @@ void GMainWindow::InitializeWidgets() { handheld->Disconnect(); player_1->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController); player_1->Connect(); + controller_dialog->refreshConfiguration(); } Settings::values.use_docked_mode.SetValue(!is_docked); @@ -2744,6 +2746,7 @@ void GMainWindow::OnConfigure() { } UpdateStatusButtons(); + controller_dialog->refreshConfiguration(); } void GMainWindow::OnConfigureTas() { -- cgit v1.2.3 From e7eee36d52259321b938c350cb37a3b115953229 Mon Sep 17 00:00:00 2001 From: german77 Date: Thu, 4 Nov 2021 19:05:58 -0600 Subject: service/hid: Remove includes of core.h and settings.h --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index baf7b38b4..cd8ea221d 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -928,7 +928,7 @@ void GMainWindow::InitializeDebugWidgets() { waitTreeWidget->hide(); debug_menu->addAction(waitTreeWidget->toggleViewAction()); - controller_dialog = new ControllerDialog(*system, input_subsystem, this); + controller_dialog = new ControllerDialog(system->HIDCore(), input_subsystem, this); controller_dialog->hide(); debug_menu->addAction(controller_dialog->toggleViewAction()); -- cgit v1.2.3 From e64ee99f00c6d2d884113f79785d4aec9fc05db8 Mon Sep 17 00:00:00 2001 From: german77 Date: Sun, 21 Nov 2021 22:37:50 -0600 Subject: yuzu: Fix TAS from rebase --- src/yuzu/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index cd8ea221d..09ea21f5e 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -2992,9 +2992,10 @@ void GMainWindow::OnTasStateChanged() { bool is_running = false; bool is_recording = false; if (emulation_running) { - const TasInput::TasState tas_status = std::get<0>(input_subsystem->GetTas()->GetStatus()); - is_running = tas_status == TasInput::TasState::Running; - is_recording = tas_status == TasInput::TasState::Recording; + const InputCommon::TasInput::TasState tas_status = + std::get<0>(input_subsystem->GetTas()->GetStatus()); + is_running = tas_status == InputCommon::TasInput::TasState::Running; + is_recording = tas_status == InputCommon::TasInput::TasState::Recording; } ui->action_TAS_Start->setText(is_running ? tr("&Stop Running") : tr("&Start")); -- cgit v1.2.3 From 182cd9004f75df21979d0edd47910fecbd129b63 Mon Sep 17 00:00:00 2001 From: german77 Date: Fri, 26 Nov 2021 19:29:08 -0600 Subject: config: Remove vibration configuration --- src/yuzu/main.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 09ea21f5e..552db6387 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1380,8 +1380,6 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t Config per_game_config(*system, config_file_name, Config::ConfigType::PerGameConfig); } - ConfigureVibration::SetAllVibrationDevices(); - // Disable fps limit toggle when booting a new title Settings::values.disable_fps_limit.SetValue(false); -- cgit v1.2.3 From 5ba7b11ba49ecba530612248286482f94799672c Mon Sep 17 00:00:00 2001 From: german77 Date: Sat, 27 Nov 2021 23:26:51 -0600 Subject: yuzu: Implement basic controller navigation --- src/yuzu/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 9bd0db10a..f266fd963 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -449,7 +449,7 @@ void GMainWindow::ControllerSelectorReconfigureControllers( } void GMainWindow::ProfileSelectorSelectProfile() { - QtProfileSelectionDialog dialog(this); + QtProfileSelectionDialog dialog(system->HIDCore(), this); dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); @@ -1346,7 +1346,7 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p } void GMainWindow::SelectAndSetCurrentUser() { - QtProfileSelectionDialog dialog(this); + QtProfileSelectionDialog dialog(system->HIDCore(), this); dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); dialog.setWindowModality(Qt::WindowModal); @@ -1608,7 +1608,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target if (has_user_save) { // User save data const auto select_profile = [this] { - QtProfileSelectionDialog dialog(this); + QtProfileSelectionDialog dialog(system->HIDCore(), this); dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); dialog.setWindowModality(Qt::WindowModal); @@ -3376,7 +3376,10 @@ void GMainWindow::closeEvent(QCloseEvent* event) { UpdateUISettings(); game_list->SaveInterfaceLayout(); hotkey_registry.SaveHotkeys(); + + // Unload controllers early controller_dialog->UnloadController(); + game_list->UnloadController(); system->HIDCore().UnloadInputDevices(); // Shutdown session if the emu thread is active... -- cgit v1.2.3 From 7fe455e42ea1a8d5e702258212d54f21f1f31610 Mon Sep 17 00:00:00 2001 From: german77 Date: Sat, 4 Dec 2021 19:37:03 -0600 Subject: core/hid: Ensure only valid npad are connected --- src/yuzu/main.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index f266fd963..5a9dec8f3 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1516,6 +1516,9 @@ void GMainWindow::ShutdownGame() { input_subsystem->GetTas()->Stop(); OnTasStateChanged(); + // Enable all controllers + system->HIDCore().SetSupportedStyleTag({Core::HID::NpadStyleSet::All}); + render_window->removeEventFilter(render_window); render_window->setAttribute(Qt::WA_Hover, false); -- cgit v1.2.3 From 722005697415463d1708b896d903b592086f134e Mon Sep 17 00:00:00 2001 From: Adam Heinermann Date: Sat, 4 Dec 2021 23:06:56 -0800 Subject: Fixed #7502 --- src/yuzu/main.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index f266fd963..77f2375ea 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1082,14 +1082,15 @@ void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) { state != Qt::ApplicationActive) { LOG_DEBUG(Frontend, "ApplicationState unusual flag: {} ", state); } - if (ui->action_Pause->isEnabled() && - (state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) { - auto_paused = true; - OnPauseGame(); - } else if (emulation_running && !emu_thread->IsRunning() && auto_paused && - state == Qt::ApplicationActive) { - auto_paused = false; - OnStartGame(); + if (emulation_running) { + if (emu_thread->IsRunning() && + (state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) { + auto_paused = true; + OnPauseGame(); + } else if (!emu_thread->IsRunning() && auto_paused && state == Qt::ApplicationActive) { + auto_paused = false; + OnStartGame(); + } } } -- cgit v1.2.3 From 60bdedc7dd95c06a9277e580007a888453f8735a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Locatti?= <42481638+goldenx86@users.noreply.github.com> Date: Mon, 6 Dec 2021 21:17:02 -0300 Subject: main: Update video core popup Old version had formatting issues, and I want to provide an answer to the most common reason this pops up in the first place, outdated drivers. --- src/yuzu/main.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 5a9dec8f3..691fa71e3 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1301,16 +1301,13 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p case Core::SystemResultStatus::ErrorVideoCore: QMessageBox::critical( this, tr("An error occurred initializing the video core."), - tr("yuzu has encountered an error while running the video core, please see the " - "log for more details." + tr("yuzu has encountered an error while running the video core, " + "this is usually caused by outdated GPU drivers, including integrated ones. " + "Please see the log for more details. " "For more information on accessing the log, please see the following page: " - "How " - "to " - "Upload the Log File." - "Ensure that you have the latest graphics drivers for your GPU.")); - + "" + "How to Upload the Log File. ")); break; - default: if (result > Core::SystemResultStatus::ErrorLoader) { const u16 loader_id = static_cast(Core::SystemResultStatus::ErrorLoader); -- cgit v1.2.3 From 44b3abdfc0d746a13443b3c386f0ce971d0148ce Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Tue, 14 Dec 2021 23:49:25 -0800 Subject: yuzu/main: Fix host memory byte units. GB to GiB I have `134850146304` bytes of ram and Yuzu was saying that I had `125.59 GB` of ram. But `125.59` is actually the amount of gi**bi**bytes I have. In gi**ga**bytes I would have `134.9`. Additionally, I changed the `1024 / 1024 / 1024` here into the `_GiB` user-literals that I added a while ago(#6519). https://www.wolframalpha.com/input/?i=134850146304+bytes --- src/yuzu/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index cc84ea11c..df736513b 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -77,6 +77,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include "common/fs/fs.h" #include "common/fs/fs_paths.h" #include "common/fs/path_util.h" +#include "common/literals.h" #include "common/logging/backend.h" #include "common/logging/filter.h" #include "common/logging/log.h" @@ -134,6 +135,8 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include "yuzu/main.h" #include "yuzu/uisettings.h" +using namespace Common::Literals; + #ifdef USE_DISCORD_PRESENCE #include "yuzu/discord_impl.h" #endif @@ -259,10 +262,9 @@ GMainWindow::GMainWindow() LOG_INFO(Frontend, "Host CPU: {}", cpu_string); #endif LOG_INFO(Frontend, "Host OS: {}", QSysInfo::prettyProductName().toStdString()); - LOG_INFO(Frontend, "Host RAM: {:.2f} GB", - Common::GetMemInfo().TotalPhysicalMemory / 1024.0f / 1024 / 1024); - LOG_INFO(Frontend, "Host Swap: {:.2f} GB", - Common::GetMemInfo().TotalSwapMemory / 1024.0f / 1024 / 1024); + LOG_INFO(Frontend, "Host RAM: {:.2f} GiB", + Common::GetMemInfo().TotalPhysicalMemory / f64{1_GiB}); + LOG_INFO(Frontend, "Host Swap: {:.2f} GiB", Common::GetMemInfo().TotalSwapMemory / f64{1_GiB}); UpdateWindowTitle(); show(); -- cgit v1.2.3 From 1cdddd17d2b8b9a3889012c9d12324934492acc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Locatti?= <42481638+goldenx86@users.noreply.github.com> Date: Thu, 16 Dec 2021 02:40:30 -0300 Subject: Changed link --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 691fa71e3..56a9c75da 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1305,7 +1305,7 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p "this is usually caused by outdated GPU drivers, including integrated ones. " "Please see the log for more details. " "For more information on accessing the log, please see the following page: " - "" + "" "How to Upload the Log File. ")); break; default: -- cgit v1.2.3 From 333ccf23f8aedc6900131f6aa2720d61a01c73fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Locatti?= <42481638+goldenx86@users.noreply.github.com> Date: Thu, 16 Dec 2021 02:57:45 -0300 Subject: Suggestions from CrusadingNinja --- src/yuzu/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/yuzu/main.cpp') diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 56a9c75da..d012477e4 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1301,8 +1301,8 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p case Core::SystemResultStatus::ErrorVideoCore: QMessageBox::critical( this, tr("An error occurred initializing the video core."), - tr("yuzu has encountered an error while running the video core, " - "this is usually caused by outdated GPU drivers, including integrated ones. " + tr("yuzu has encountered an error while running the video core. " + "This is usually caused by outdated GPU drivers, including integrated ones. " "Please see the log for more details. " "For more information on accessing the log, please see the following page: " "" -- cgit v1.2.3