summaryrefslogtreecommitdiffstats
path: root/src/yuzu/main.cpp
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2022-12-04 19:38:01 +0100
committerGitHub <noreply@github.com>2022-12-04 19:38:01 +0100
commit522e7c5663bcb61a760c412d655295de11c38077 (patch)
treee76cacbb42a31d87eb014783a10597377a9898a4 /src/yuzu/main.cpp
parentMerge pull request #9372 from liamwhite/vk12 (diff)
parentconfigure_input_player: Fix profile saving when using handheld controller type (diff)
downloadyuzu-522e7c5663bcb61a760c412d655295de11c38077.tar
yuzu-522e7c5663bcb61a760c412d655295de11c38077.tar.gz
yuzu-522e7c5663bcb61a760c412d655295de11c38077.tar.bz2
yuzu-522e7c5663bcb61a760c412d655295de11c38077.tar.lz
yuzu-522e7c5663bcb61a760c412d655295de11c38077.tar.xz
yuzu-522e7c5663bcb61a760c412d655295de11c38077.tar.zst
yuzu-522e7c5663bcb61a760c412d655295de11c38077.zip
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r--src/yuzu/main.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index e06ee7570..c0afb2e5f 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -126,6 +126,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
#include "yuzu/compatibility_list.h"
#include "yuzu/configuration/config.h"
#include "yuzu/configuration/configure_dialog.h"
+#include "yuzu/configuration/configure_input_per_game.h"
#include "yuzu/debugger/console.h"
#include "yuzu/debugger/controller.h"
#include "yuzu/debugger/profiler.h"
@@ -1658,6 +1659,11 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
LOG_INFO(Frontend, "yuzu starting...");
StoreRecentFile(filename); // Put the filename on top of the list
+ // Save configurations
+ UpdateUISettings();
+ game_list->SaveInterfaceLayout();
+ config->Save();
+
u64 title_id{0};
last_filename_booted = filename;
@@ -1674,14 +1680,10 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
? Common::FS::PathToUTF8String(file_path.filename())
: fmt::format("{:016X}", title_id);
Config per_game_config(config_file_name, Config::ConfigType::PerGameConfig);
+ system->HIDCore().ReloadInputDevices();
system->ApplySettings();
}
- // Save configurations
- UpdateUISettings();
- game_list->SaveInterfaceLayout();
- config->Save();
-
Settings::LogSettings();
if (UISettings::values.select_user_on_boot) {
@@ -2802,6 +2804,7 @@ void GMainWindow::OnStopGame() {
ShutdownGame();
Settings::RestoreGlobalState(system->IsPoweredOn());
+ system->HIDCore().ReloadInputDevices();
UpdateStatusButtons();
}
@@ -3281,6 +3284,7 @@ void GMainWindow::OpenPerGameConfiguration(u64 title_id, const std::string& file
// Do not cause the global config to write local settings into the config file
const bool is_powered_on = system->IsPoweredOn();
Settings::RestoreGlobalState(is_powered_on);
+ system->HIDCore().ReloadInputDevices();
UISettings::values.configuration_applied = false;
@@ -3764,6 +3768,7 @@ void GMainWindow::OnCoreError(Core::SystemResultStatus result, std::string detai
ShutdownGame();
Settings::RestoreGlobalState(system->IsPoweredOn());
+ system->HIDCore().ReloadInputDevices();
UpdateStatusButtons();
}
} else {
@@ -3915,18 +3920,19 @@ void GMainWindow::closeEvent(QCloseEvent* event) {
// Unload controllers early
controller_dialog->UnloadController();
game_list->UnloadController();
- system->HIDCore().UnloadInputDevices();
// Shutdown session if the emu thread is active...
if (emu_thread != nullptr) {
ShutdownGame();
Settings::RestoreGlobalState(system->IsPoweredOn());
+ system->HIDCore().ReloadInputDevices();
UpdateStatusButtons();
}
render_window->close();
multiplayer_state->Close();
+ system->HIDCore().UnloadInputDevices();
system->GetRoomNetwork().Shutdown();
QWidget::closeEvent(event);