diff options
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index f28268e9b..f233b065e 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -219,7 +219,7 @@ static void LogRuntimes() { #ifdef _MSC_VER // It is possible that the name of the dll will change. // vcruntime140.dll is for 2015 and onwards - constexpr char runtime_dll_name[] = "vcruntime140.dll"; + static constexpr char runtime_dll_name[] = "vcruntime140.dll"; UINT sz = GetFileVersionInfoSizeA(runtime_dll_name, nullptr); bool runtime_version_inspection_worked = false; if (sz > 0) { @@ -805,6 +805,8 @@ void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url, layout.screen.GetHeight() / scale_ratio); web_browser_view.move(layout.screen.left / scale_ratio, (layout.screen.top / scale_ratio) + menuBar()->height()); + web_browser_view.setZoomFactor(static_cast<qreal>(layout.screen.GetWidth() / scale_ratio) / + static_cast<qreal>(Layout::ScreenUndocked::Width)); web_browser_view.setFocus(); web_browser_view.show(); @@ -1163,6 +1165,14 @@ void GMainWindow::InitializeHotkeys() { Settings::values.use_speed_limit.SetValue(!Settings::values.use_speed_limit.GetValue()); }); connect_shortcut(QStringLiteral("Toggle Mouse Panning"), [&] { + if (Settings::values.mouse_enabled) { + Settings::values.mouse_panning = false; + QMessageBox::warning( + this, tr("Emulated mouse is enabled"), + tr("Real mouse input and mouse panning are incompatible. Please disable the " + "emulated mouse in input advanced settings to allow mouse panning.")); + return; + } Settings::values.mouse_panning = !Settings::values.mouse_panning; if (Settings::values.mouse_panning) { render_window->installEventFilter(render_window); @@ -1269,6 +1279,7 @@ void GMainWindow::ConnectWidgetEvents() { connect(game_list, &GameList::ShowList, this, &GMainWindow::OnGameListShowList); connect(game_list, &GameList::PopulatingCompleted, [this] { multiplayer_state->UpdateGameList(game_list->GetModel()); }); + connect(game_list, &GameList::SaveConfig, this, &GMainWindow::OnSaveConfig); connect(game_list, &GameList::OpenPerGameGeneralRequested, this, &GMainWindow::OnGameListOpenPerGameProperties); @@ -1777,7 +1788,7 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t std::filesystem::path{Common::U16StringFromBuffer(filename.utf16(), filename.size())} .filename()); } - const bool is_64bit = system->Kernel().CurrentProcess()->Is64BitProcess(); + const bool is_64bit = system->Kernel().ApplicationProcess()->Is64BitProcess(); const auto instruction_set_suffix = is_64bit ? tr("(64-bit)") : tr("(32-bit)"); title_name = tr("%1 %2", "%1 is the title name. %2 indicates if the title is 64-bit or 32-bit") .arg(QString::fromStdString(title_name), instruction_set_suffix) @@ -2652,6 +2663,8 @@ void GMainWindow::OnGameListAddDirectory() { } else { LOG_WARNING(Frontend, "Selected directory is already in the game list"); } + + OnSaveConfig(); } void GMainWindow::OnGameListShowList(bool show) { @@ -3013,8 +3026,10 @@ void GMainWindow::OnRestartGame() { if (!system->IsPoweredOn()) { return; } - // Make a copy since BootGame edits game_path - BootGame(QString(current_game_path)); + // Make a copy since ShutdownGame edits game_path + const auto current_game = QString(current_game_path); + ShutdownGame(); + BootGame(current_game); } void GMainWindow::OnPauseGame() { @@ -3378,6 +3393,7 @@ void GMainWindow::OnConfigureTas() { return; } else if (result == QDialog::Accepted) { dialog.ApplyConfiguration(); + OnSaveConfig(); } } @@ -3530,7 +3546,7 @@ void GMainWindow::OnToggleGraphicsAPI() { } void GMainWindow::OnConfigurePerGame() { - const u64 title_id = system->GetCurrentProcessProgramID(); + const u64 title_id = system->GetApplicationProcessProgramID(); OpenPerGameConfiguration(title_id, current_game_path.toStdString()); } @@ -3689,7 +3705,7 @@ void GMainWindow::OnCaptureScreenshot() { return; } - const u64 title_id = system->GetCurrentProcessProgramID(); + const u64 title_id = system->GetApplicationProcessProgramID(); const auto screenshot_path = QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::ScreenshotsDir)); const auto date = |