summaryrefslogtreecommitdiff
path: root/src/yuzu
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu')
-rw-r--r--src/yuzu/applets/qt_amiibo_settings.cpp4
-rw-r--r--src/yuzu/applets/qt_amiibo_settings.h2
-rw-r--r--src/yuzu/applets/qt_controller.cpp8
-rw-r--r--src/yuzu/applets/qt_software_keyboard.cpp2
-rw-r--r--src/yuzu/bootmanager.h2
-rw-r--r--src/yuzu/configuration/configure_input_player.cpp34
-rw-r--r--src/yuzu/configuration/configure_input_player_widget.cpp26
-rw-r--r--src/yuzu/configuration/configure_profile_manager.cpp4
-rw-r--r--src/yuzu/configuration/configure_system.cpp2
-rw-r--r--src/yuzu/configuration/input_profiles.cpp3
-rw-r--r--src/yuzu/configuration/qt_config.cpp7
-rw-r--r--src/yuzu/configuration/shared_widget.cpp4
-rw-r--r--src/yuzu/main.cpp10
-rw-r--r--src/yuzu/multiplayer/chat_room.cpp2
-rw-r--r--src/yuzu/util/controller_navigation.cpp4
15 files changed, 69 insertions, 45 deletions
diff --git a/src/yuzu/applets/qt_amiibo_settings.cpp b/src/yuzu/applets/qt_amiibo_settings.cpp
index b457a736a..b91796dde 100644
--- a/src/yuzu/applets/qt_amiibo_settings.cpp
+++ b/src/yuzu/applets/qt_amiibo_settings.cpp
@@ -36,7 +36,7 @@ QtAmiiboSettingsDialog::QtAmiiboSettingsDialog(QWidget* parent,
QtAmiiboSettingsDialog::~QtAmiiboSettingsDialog() = default;
int QtAmiiboSettingsDialog::exec() {
- if (!is_initalized) {
+ if (!is_initialized) {
return QDialog::Rejected;
}
return QDialog::exec();
@@ -66,7 +66,7 @@ void QtAmiiboSettingsDialog::LoadInfo() {
QString::fromStdString(input_subsystem->GetVirtualAmiibo()->GetLastFilePath()));
SetSettingsDescription();
- is_initalized = true;
+ is_initialized = true;
}
void QtAmiiboSettingsDialog::LoadAmiiboInfo() {
diff --git a/src/yuzu/applets/qt_amiibo_settings.h b/src/yuzu/applets/qt_amiibo_settings.h
index ee66a0255..3833cf6f2 100644
--- a/src/yuzu/applets/qt_amiibo_settings.h
+++ b/src/yuzu/applets/qt_amiibo_settings.h
@@ -58,7 +58,7 @@ private:
Core::Frontend::CabinetParameters parameters;
// If false amiibo settings failed to load
- bool is_initalized{};
+ bool is_initialized{};
};
class QtAmiiboSettings final : public QObject, public Core::Frontend::CabinetApplet {
diff --git a/src/yuzu/applets/qt_controller.cpp b/src/yuzu/applets/qt_controller.cpp
index 8b340ee6c..48ce860ad 100644
--- a/src/yuzu/applets/qt_controller.cpp
+++ b/src/yuzu/applets/qt_controller.cpp
@@ -41,7 +41,7 @@ void UpdateController(Core::HID::EmulatedController* controller,
bool IsControllerCompatible(Core::HID::NpadStyleIndex controller_type,
Core::Frontend::ControllerParameters parameters) {
switch (controller_type) {
- case Core::HID::NpadStyleIndex::ProController:
+ case Core::HID::NpadStyleIndex::Fullkey:
return parameters.allow_pro_controller;
case Core::HID::NpadStyleIndex::JoyconDual:
return parameters.allow_dual_joycons;
@@ -462,7 +462,7 @@ void QtControllerSelectorDialog::SetEmulatedControllers(std::size_t player_index
};
if (npad_style_set.fullkey == 1) {
- add_item(Core::HID::NpadStyleIndex::ProController, tr("Pro Controller"));
+ add_item(Core::HID::NpadStyleIndex::Fullkey, tr("Pro Controller"));
}
if (npad_style_set.joycon_dual == 1) {
@@ -519,7 +519,7 @@ Core::HID::NpadStyleIndex QtControllerSelectorDialog::GetControllerTypeFromIndex
[index](const auto& pair) { return pair.first == index; });
if (it == pairs.end()) {
- return Core::HID::NpadStyleIndex::ProController;
+ return Core::HID::NpadStyleIndex::Fullkey;
}
return it->second;
@@ -549,7 +549,7 @@ void QtControllerSelectorDialog::UpdateControllerIcon(std::size_t player_index)
const QString stylesheet = [this, player_index] {
switch (GetControllerTypeFromIndex(emulated_controllers[player_index]->currentIndex(),
player_index)) {
- case Core::HID::NpadStyleIndex::ProController:
+ case Core::HID::NpadStyleIndex::Fullkey:
case Core::HID::NpadStyleIndex::GameCube:
return QStringLiteral("image: url(:/controller/applet_pro_controller%0); ");
case Core::HID::NpadStyleIndex::JoyconDual:
diff --git a/src/yuzu/applets/qt_software_keyboard.cpp b/src/yuzu/applets/qt_software_keyboard.cpp
index bbe17c35e..ac81ace9e 100644
--- a/src/yuzu/applets/qt_software_keyboard.cpp
+++ b/src/yuzu/applets/qt_software_keyboard.cpp
@@ -832,7 +832,7 @@ void QtSoftwareKeyboardDialog::SetControllerImage() {
}();
switch (controller_type) {
- case Core::HID::NpadStyleIndex::ProController:
+ case Core::HID::NpadStyleIndex::Fullkey:
case Core::HID::NpadStyleIndex::GameCube:
ui->icon_controller->setStyleSheet(
QStringLiteral("image: url(:/overlay/controller_pro%1.png);").arg(theme));
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h
index 60edd464c..ae12b3481 100644
--- a/src/yuzu/bootmanager.h
+++ b/src/yuzu/bootmanager.h
@@ -170,7 +170,7 @@ public:
void resizeEvent(QResizeEvent* event) override;
- /// Converts a Qt keybard key into NativeKeyboard key
+ /// Converts a Qt keyboard key into NativeKeyboard key
static int QtKeyToSwitchKey(Qt::Key qt_keys);
/// Converts a Qt modifier keys into NativeKeyboard modifier keys
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp
index f3552191a..400917f9d 100644
--- a/src/yuzu/configuration/configure_input_player.cpp
+++ b/src/yuzu/configuration/configure_input_player.cpp
@@ -1094,7 +1094,7 @@ void ConfigureInputPlayer::SetConnectableControllers() {
};
if (npad_style_set.fullkey == 1) {
- add_item(Core::HID::NpadStyleIndex::ProController, tr("Pro Controller"));
+ add_item(Core::HID::NpadStyleIndex::Fullkey, tr("Pro Controller"));
}
if (npad_style_set.joycon_dual == 1) {
@@ -1149,7 +1149,7 @@ Core::HID::NpadStyleIndex ConfigureInputPlayer::GetControllerTypeFromIndex(int i
[index](const auto& pair) { return pair.first == index; });
if (it == index_controller_type_pairs.end()) {
- return Core::HID::NpadStyleIndex::ProController;
+ return Core::HID::NpadStyleIndex::Fullkey;
}
return it->second;
@@ -1178,7 +1178,7 @@ void ConfigureInputPlayer::UpdateInputDevices() {
void ConfigureInputPlayer::UpdateControllerAvailableButtons() {
auto layout = GetControllerTypeFromIndex(ui->comboControllerType->currentIndex());
if (debug) {
- layout = Core::HID::NpadStyleIndex::ProController;
+ layout = Core::HID::NpadStyleIndex::Fullkey;
}
// List of all the widgets that will be hidden by any of the following layouts that need
@@ -1206,7 +1206,7 @@ void ConfigureInputPlayer::UpdateControllerAvailableButtons() {
std::vector<QWidget*> layout_hidden;
switch (layout) {
- case Core::HID::NpadStyleIndex::ProController:
+ case Core::HID::NpadStyleIndex::Fullkey:
case Core::HID::NpadStyleIndex::Handheld:
layout_hidden = {
ui->buttonShoulderButtonsSLSRLeft,
@@ -1254,7 +1254,7 @@ void ConfigureInputPlayer::UpdateControllerAvailableButtons() {
void ConfigureInputPlayer::UpdateControllerEnabledButtons() {
auto layout = GetControllerTypeFromIndex(ui->comboControllerType->currentIndex());
if (debug) {
- layout = Core::HID::NpadStyleIndex::ProController;
+ layout = Core::HID::NpadStyleIndex::Fullkey;
}
// List of all the widgets that will be disabled by any of the following layouts that need
@@ -1271,7 +1271,7 @@ void ConfigureInputPlayer::UpdateControllerEnabledButtons() {
std::vector<QWidget*> layout_disable;
switch (layout) {
- case Core::HID::NpadStyleIndex::ProController:
+ case Core::HID::NpadStyleIndex::Fullkey:
case Core::HID::NpadStyleIndex::JoyconDual:
case Core::HID::NpadStyleIndex::Handheld:
case Core::HID::NpadStyleIndex::JoyconLeft:
@@ -1304,7 +1304,7 @@ void ConfigureInputPlayer::UpdateMotionButtons() {
// Show/hide the "Motion 1/2" groupboxes depending on the currently selected controller.
switch (GetControllerTypeFromIndex(ui->comboControllerType->currentIndex())) {
- case Core::HID::NpadStyleIndex::ProController:
+ case Core::HID::NpadStyleIndex::Fullkey:
case Core::HID::NpadStyleIndex::JoyconLeft:
case Core::HID::NpadStyleIndex::Handheld:
// Show "Motion 1" and hide "Motion 2".
@@ -1333,11 +1333,11 @@ void ConfigureInputPlayer::UpdateMotionButtons() {
void ConfigureInputPlayer::UpdateControllerButtonNames() {
auto layout = GetControllerTypeFromIndex(ui->comboControllerType->currentIndex());
if (debug) {
- layout = Core::HID::NpadStyleIndex::ProController;
+ layout = Core::HID::NpadStyleIndex::Fullkey;
}
switch (layout) {
- case Core::HID::NpadStyleIndex::ProController:
+ case Core::HID::NpadStyleIndex::Fullkey:
case Core::HID::NpadStyleIndex::JoyconDual:
case Core::HID::NpadStyleIndex::Handheld:
case Core::HID::NpadStyleIndex::JoyconLeft:
@@ -1650,9 +1650,21 @@ void ConfigureInputPlayer::SaveProfile() {
void ConfigureInputPlayer::UpdateInputProfiles() {
ui->comboProfiles->clear();
- for (const auto& profile_name : profiles->GetInputProfileNames()) {
+ // Set current profile as empty by default
+ int profile_index = -1;
+
+ // Add every available profile and search the player profile to set it as current one
+ auto& current_profile = Settings::values.players.GetValue()[player_index].profile_name;
+ std::vector<std::string> profile_names = profiles->GetInputProfileNames();
+ std::string profile_name;
+ for (size_t i = 0; i < profile_names.size(); i++) {
+ profile_name = profile_names[i];
ui->comboProfiles->addItem(QString::fromStdString(profile_name));
+ if (current_profile == profile_name) {
+ profile_index = (int)i;
+ }
}
- ui->comboProfiles->setCurrentIndex(-1);
+ LOG_DEBUG(Frontend, "Setting the current input profile to index {}", profile_index);
+ ui->comboProfiles->setCurrentIndex(profile_index);
}
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp
index 19fdca7d3..b3d9d8006 100644
--- a/src/yuzu/configuration/configure_input_player_widget.cpp
+++ b/src/yuzu/configuration/configure_input_player_widget.cpp
@@ -244,7 +244,7 @@ void PlayerControlPreview::paintEvent(QPaintEvent* event) {
case Core::HID::NpadStyleIndex::GameCube:
DrawGCController(p, center);
break;
- case Core::HID::NpadStyleIndex::ProController:
+ case Core::HID::NpadStyleIndex::Fullkey:
default:
DrawProController(p, center);
break;
@@ -845,12 +845,12 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center)
DrawSymbol(p, face_center + QPoint(-face_distance, 1), Symbol::Y, text_size);
// D-pad buttons
- const QPointF dpad_postion = center + QPoint(-61, 0);
- DrawArrowButton(p, dpad_postion, Direction::Up, button_values[DUp]);
- DrawArrowButton(p, dpad_postion, Direction::Left, button_values[DLeft]);
- DrawArrowButton(p, dpad_postion, Direction::Right, button_values[DRight]);
- DrawArrowButton(p, dpad_postion, Direction::Down, button_values[DDown]);
- DrawArrowButtonOutline(p, dpad_postion);
+ const QPointF dpad_position = center + QPoint(-61, 0);
+ DrawArrowButton(p, dpad_position, Direction::Up, button_values[DUp]);
+ DrawArrowButton(p, dpad_position, Direction::Left, button_values[DLeft]);
+ DrawArrowButton(p, dpad_position, Direction::Right, button_values[DRight]);
+ DrawArrowButton(p, dpad_position, Direction::Down, button_values[DDown]);
+ DrawArrowButtonOutline(p, dpad_position);
// ZL and ZR buttons
p.setPen(colors.outline);
@@ -935,13 +935,13 @@ void PlayerControlPreview::DrawGCController(QPainter& p, const QPointF center) {
DrawSymbol(p, center + QPoint(100, -83), Symbol::Y, text_size);
// D-pad buttons
- const QPointF dpad_postion = center + QPoint(-61, 37);
+ const QPointF dpad_position = center + QPoint(-61, 37);
const float dpad_size = 0.8f;
- DrawArrowButton(p, dpad_postion, Direction::Up, button_values[DUp], dpad_size);
- DrawArrowButton(p, dpad_postion, Direction::Left, button_values[DLeft], dpad_size);
- DrawArrowButton(p, dpad_postion, Direction::Right, button_values[DRight], dpad_size);
- DrawArrowButton(p, dpad_postion, Direction::Down, button_values[DDown], dpad_size);
- DrawArrowButtonOutline(p, dpad_postion, dpad_size);
+ DrawArrowButton(p, dpad_position, Direction::Up, button_values[DUp], dpad_size);
+ DrawArrowButton(p, dpad_position, Direction::Left, button_values[DLeft], dpad_size);
+ DrawArrowButton(p, dpad_position, Direction::Right, button_values[DRight], dpad_size);
+ DrawArrowButton(p, dpad_position, Direction::Down, button_values[DDown], dpad_size);
+ DrawArrowButtonOutline(p, dpad_position, dpad_size);
// Minus and Plus buttons
p.setPen(colors.outline);
diff --git a/src/yuzu/configuration/configure_profile_manager.cpp b/src/yuzu/configuration/configure_profile_manager.cpp
index fa5f383d6..12a04b9a0 100644
--- a/src/yuzu/configuration/configure_profile_manager.cpp
+++ b/src/yuzu/configuration/configure_profile_manager.cpp
@@ -205,6 +205,7 @@ void ConfigureProfileManager::AddUser() {
const auto uuid = Common::UUID::MakeRandom();
profile_manager.CreateNewUser(uuid, username.toStdString());
+ profile_manager.WriteUserSaveFile();
item_model->appendRow(new QStandardItem{GetIcon(uuid), FormatUserEntryText(username, uuid)});
}
@@ -228,6 +229,7 @@ void ConfigureProfileManager::RenameUser() {
std::copy(username_std.begin(), username_std.end(), profile.username.begin());
profile_manager.SetProfileBase(*uuid, profile);
+ profile_manager.WriteUserSaveFile();
item_model->setItem(
user, 0,
@@ -256,6 +258,8 @@ void ConfigureProfileManager::DeleteUser(const Common::UUID& uuid) {
return;
}
+ profile_manager.WriteUserSaveFile();
+
item_model->removeRows(tree_view->currentIndex().row(), 1);
tree_view->clearSelection();
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp
index 7cbf43775..b0b84f967 100644
--- a/src/yuzu/configuration/configure_system.cpp
+++ b/src/yuzu/configuration/configure_system.cpp
@@ -121,7 +121,7 @@ void ConfigureSystem::Setup(const ConfigurationShared::Builder& builder) {
}
if (setting->Id() == Settings::values.region_index.Id()) {
- // Keep track of the region_index (and langauge_index) combobox to validate the selected
+ // Keep track of the region_index (and language_index) combobox to validate the selected
// settings
combo_region = widget->combobox;
} else if (setting->Id() == Settings::values.language_index.Id()) {
diff --git a/src/yuzu/configuration/input_profiles.cpp b/src/yuzu/configuration/input_profiles.cpp
index 716efbccd..ebebadc94 100644
--- a/src/yuzu/configuration/input_profiles.cpp
+++ b/src/yuzu/configuration/input_profiles.cpp
@@ -5,6 +5,7 @@
#include "common/fs/fs.h"
#include "common/fs/path_util.h"
+#include "common/logging/log.h"
#include "frontend_common/config.h"
#include "yuzu/configuration/input_profiles.h"
@@ -113,6 +114,8 @@ bool InputProfiles::LoadProfile(const std::string& profile_name, std::size_t pla
return false;
}
+ LOG_INFO(Config, "Loading input profile `{}`", profile_name);
+
map_profiles[profile_name]->ReadQtControlPlayerValues(player_index);
return true;
}
diff --git a/src/yuzu/configuration/qt_config.cpp b/src/yuzu/configuration/qt_config.cpp
index 6aca71d7c..1051031f2 100644
--- a/src/yuzu/configuration/qt_config.cpp
+++ b/src/yuzu/configuration/qt_config.cpp
@@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
+#include "common/logging/log.h"
#include "input_common/main.h"
#include "qt_config.h"
#include "uisettings.h"
@@ -65,7 +66,7 @@ void QtConfig::ReloadAllValues() {
}
void QtConfig::SaveAllValues() {
- Save();
+ SaveValues();
SaveQtValues();
}
@@ -327,7 +328,10 @@ void QtConfig::ReadMultiplayerValues() {
void QtConfig::SaveQtValues() {
if (global) {
+ LOG_DEBUG(Config, "Saving global Qt configuration values");
SaveUIValues();
+ } else {
+ LOG_DEBUG(Config, "Saving Qt configuration values");
}
SaveQtControlValues();
@@ -545,6 +549,7 @@ void QtConfig::ReadQtControlPlayerValues(std::size_t player_index) {
void QtConfig::SaveQtControlPlayerValues(std::size_t player_index) {
BeginGroup(Settings::TranslateCategory(Settings::Category::Controls));
+ LOG_DEBUG(Config, "Saving players control configuration values");
SavePlayerValues(player_index);
SaveQtPlayerValues(player_index);
diff --git a/src/yuzu/configuration/shared_widget.cpp b/src/yuzu/configuration/shared_widget.cpp
index 941683a43..85f4f7655 100644
--- a/src/yuzu/configuration/shared_widget.cpp
+++ b/src/yuzu/configuration/shared_widget.cpp
@@ -750,12 +750,12 @@ Widget::Widget(Settings::BasicSetting* setting_, const TranslationMap& translati
}
apply_funcs.push_back([load_func, setting_](bool powered_on) {
- if (setting_->RuntimeModfiable() || !powered_on) {
+ if (setting_->RuntimeModifiable() || !powered_on) {
load_func();
}
});
- bool enable = runtime_lock || setting.RuntimeModfiable();
+ bool enable = runtime_lock || setting.RuntimeModifiable();
if (setting.Switchable() && Settings::IsConfiguringGlobal() && !runtime_lock) {
enable &= setting.UsingGlobal();
}
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 4f4c75f5c..33756febf 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -2292,14 +2292,14 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
ASSERT(user_id);
const auto user_save_data_path = FileSys::SaveDataFactory::GetFullPath(
- *system, vfs_nand_dir, FileSys::SaveDataSpaceId::NandUser,
+ {}, vfs_nand_dir, FileSys::SaveDataSpaceId::NandUser,
FileSys::SaveDataType::SaveData, program_id, user_id->AsU128(), 0);
path = Common::FS::ConcatPathSafe(nand_dir, user_save_data_path);
} else {
// Device save data
const auto device_save_data_path = FileSys::SaveDataFactory::GetFullPath(
- *system, vfs_nand_dir, FileSys::SaveDataSpaceId::NandUser,
+ {}, vfs_nand_dir, FileSys::SaveDataSpaceId::NandUser,
FileSys::SaveDataType::SaveData, program_id, {}, 0);
path = Common::FS::ConcatPathSafe(nand_dir, device_save_data_path);
@@ -2662,8 +2662,8 @@ void GMainWindow::RemoveCacheStorage(u64 program_id) {
vfs->OpenDirectory(Common::FS::PathToUTF8String(nand_dir), FileSys::Mode::Read);
const auto cache_storage_path = FileSys::SaveDataFactory::GetFullPath(
- *system, vfs_nand_dir, FileSys::SaveDataSpaceId::NandUser,
- FileSys::SaveDataType::CacheStorage, 0 /* program_id */, {}, 0);
+ {}, vfs_nand_dir, FileSys::SaveDataSpaceId::NandUser, FileSys::SaveDataType::CacheStorage,
+ 0 /* program_id */, {}, 0);
const auto path = Common::FS::ConcatPathSafe(nand_dir, cache_storage_path);
@@ -3988,7 +3988,7 @@ void GMainWindow::OnToggleDockedMode() {
tr("Handheld controller can't be used on docked mode. Pro "
"controller will be selected."));
handheld->Disconnect();
- player_1->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController);
+ player_1->SetNpadStyleIndex(Core::HID::NpadStyleIndex::Fullkey);
player_1->Connect();
controller_dialog->refreshConfiguration();
}
diff --git a/src/yuzu/multiplayer/chat_room.cpp b/src/yuzu/multiplayer/chat_room.cpp
index dec9696c1..4463616b4 100644
--- a/src/yuzu/multiplayer/chat_room.cpp
+++ b/src/yuzu/multiplayer/chat_room.cpp
@@ -206,7 +206,7 @@ void ChatRoom::Initialize(Network::RoomNetwork* room_network_) {
room_network = room_network_;
// setup the callbacks for network updates
if (auto member = room_network->GetRoomMember().lock()) {
- member->BindOnChatMessageRecieved(
+ member->BindOnChatMessageReceived(
[this](const Network::ChatEntry& chat) { emit ChatReceived(chat); });
member->BindOnStatusMessageReceived(
[this](const Network::StatusMessageEntry& status_message) {
diff --git a/src/yuzu/util/controller_navigation.cpp b/src/yuzu/util/controller_navigation.cpp
index 2690b075d..0dbfca243 100644
--- a/src/yuzu/util/controller_navigation.cpp
+++ b/src/yuzu/util/controller_navigation.cpp
@@ -66,7 +66,7 @@ void ControllerNavigation::ControllerUpdateButton() {
}
switch (controller_type) {
- case Core::HID::NpadStyleIndex::ProController:
+ case Core::HID::NpadStyleIndex::Fullkey:
case Core::HID::NpadStyleIndex::JoyconDual:
case Core::HID::NpadStyleIndex::Handheld:
case Core::HID::NpadStyleIndex::GameCube:
@@ -116,7 +116,7 @@ void ControllerNavigation::ControllerUpdateStick() {
}
switch (controller_type) {
- case Core::HID::NpadStyleIndex::ProController:
+ case Core::HID::NpadStyleIndex::Fullkey:
case Core::HID::NpadStyleIndex::JoyconDual:
case Core::HID::NpadStyleIndex::Handheld:
case Core::HID::NpadStyleIndex::GameCube: