From 24e7f47921e14f1c893157f3f7c14b1bad6bfd7b Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Thu, 4 Feb 2021 21:32:13 +0100 Subject: [PATCH] early-access version 1413 --- README.md | 2 +- src/core/crypto/key_manager.cpp | 5 +++++ src/yuzu/debugger/controller.cpp | 16 ++++++++++------ src/yuzu/debugger/controller.h | 3 +++ src/yuzu/main.cpp | 7 ++++--- src/yuzu/main.h | 2 +- 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 20ce7b010..8454ee0a4 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 1412. +This is the source code for early-access 1413. ## Legal Notice diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index cebe2ce37..ad116dcc0 100755 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp @@ -568,6 +568,11 @@ KeyManager::KeyManager() { // Initialize keys const std::string hactool_keys_dir = Common::FS::GetHactoolConfigurationPath(); const std::string yuzu_keys_dir = Common::FS::GetUserPath(Common::FS::UserPath::KeysDir); + + if (!Common::FS::Exists(yuzu_keys_dir)) { + Common::FS::CreateDir(yuzu_keys_dir); + } + if (Settings::values.use_dev_keys) { dev_mode = true; AttemptLoadKeyFile(yuzu_keys_dir, hactool_keys_dir, "dev.keys", false); diff --git a/src/yuzu/debugger/controller.cpp b/src/yuzu/debugger/controller.cpp index 23834f063..33c953933 100755 --- a/src/yuzu/debugger/controller.cpp +++ b/src/yuzu/debugger/controller.cpp @@ -18,12 +18,8 @@ ControllerDialog::ControllerDialog(QWidget* parent) : QWidget(parent, Qt::Dialog setWindowFlags((windowFlags() & ~Qt::WindowContextHelpButtonHint) | Qt::WindowMaximizeButtonHint); - PlayerControlPreview* widget = new PlayerControlPreview(this); - const auto& players = Settings::values.players.GetValue(); - constexpr std::size_t player = 0; - widget->SetPlayerInputRaw(player, players[player].buttons, players[player].analogs); - widget->SetConnectedStatus(players[player].connected); - widget->SetControllerType(players[player].controller_type); + widget = new PlayerControlPreview(this); + RefreshConfiguration(); QLayout* layout = new QVBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(widget); @@ -36,6 +32,14 @@ ControllerDialog::ControllerDialog(QWidget* parent) : QWidget(parent, Qt::Dialog widget->setFocus(); } +void ControllerDialog::RefreshConfiguration() { + const auto& players = Settings::values.players.GetValue(); + constexpr std::size_t player = 0; + widget->SetPlayerInputRaw(player, players[player].buttons, players[player].analogs); + widget->SetConnectedStatus(players[player].connected); + widget->SetControllerType(players[player].controller_type); +} + QAction* ControllerDialog::toggleViewAction() { if (toggle_view_action == nullptr) { toggle_view_action = new QAction(windowTitle(), this); diff --git a/src/yuzu/debugger/controller.h b/src/yuzu/debugger/controller.h index da389b6a2..c07753c69 100755 --- a/src/yuzu/debugger/controller.h +++ b/src/yuzu/debugger/controller.h @@ -9,6 +9,7 @@ class QAction; class QHideEvent; class QShowEvent; +class PlayerControlPreview; class ControllerDialog : public QWidget { Q_OBJECT @@ -18,6 +19,7 @@ public: /// Returns a QAction that can be used to toggle visibility of this dialog. QAction* toggleViewAction(); + void RefreshConfiguration(); protected: void showEvent(QShowEvent* ev) override; @@ -25,4 +27,5 @@ protected: private: QAction* toggle_view_action = nullptr; + PlayerControlPreview* widget; }; diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 3629de221..123139c1e 100755 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -690,9 +690,9 @@ void GMainWindow::InitializeDebugWidgets() { waitTreeWidget->hide(); debug_menu->addAction(waitTreeWidget->toggleViewAction()); - controllerDialog = new ControllerDialog(this); - controllerDialog->hide(); - debug_menu->addAction(controllerDialog->toggleViewAction()); + controller_dialog = new ControllerDialog(this); + controller_dialog->hide(); + debug_menu->addAction(controller_dialog->toggleViewAction()); connect(this, &GMainWindow::EmulationStarting, waitTreeWidget, &WaitTreeWidget::OnEmulationStarting); @@ -2352,6 +2352,7 @@ void GMainWindow::OnConfigure() { } configure_dialog.ApplyConfiguration(); + controller_dialog->RefreshConfiguration(); InitializeHotkeys(); if (UISettings::values.theme != old_theme) { UpdateUITheme(); diff --git a/src/yuzu/main.h b/src/yuzu/main.h index f4a71ea11..04d37d4ae 100755 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -314,7 +314,7 @@ private: ProfilerWidget* profilerWidget; MicroProfileDialog* microProfileDialog; WaitTreeWidget* waitTreeWidget; - ControllerDialog* controllerDialog; + ControllerDialog* controller_dialog; QAction* actions_recent_files[max_recent_files_item];