summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/configuration/config.cpp2
-rw-r--r--src/yuzu/configuration/configure_per_general.cpp18
-rw-r--r--src/yuzu/configuration/configure_per_general.h18
-rw-r--r--src/yuzu/game_list.cpp3
-rw-r--r--src/yuzu/game_list.h1
-rw-r--r--src/yuzu/game_list_worker.cpp2
-rw-r--r--src/yuzu/main.cpp29
-rw-r--r--src/yuzu/main.h1
-rw-r--r--src/yuzu_cmd/default_ini.h2
9 files changed, 54 insertions, 22 deletions
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index 4d4bd2a46..97a1633b0 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -669,7 +669,7 @@ void Config::SaveValues() {
669 int i = 0; 669 int i = 0;
670 for (const auto& elem : Settings::values.disabled_addons) { 670 for (const auto& elem : Settings::values.disabled_addons) {
671 qt_config->setArrayIndex(i); 671 qt_config->setArrayIndex(i);
672 qt_config->setValue("title_id", elem.first); 672 qt_config->setValue("title_id", QVariant::fromValue<u64>(elem.first));
673 qt_config->beginWriteArray("disabled"); 673 qt_config->beginWriteArray("disabled");
674 for (std::size_t j = 0; j < elem.second.size(); ++j) { 674 for (std::size_t j = 0; j < elem.second.size(); ++j) {
675 qt_config->setArrayIndex(j); 675 qt_config->setArrayIndex(j);
diff --git a/src/yuzu/configuration/configure_per_general.cpp b/src/yuzu/configuration/configure_per_general.cpp
index ed85f84a9..80109b434 100644
--- a/src/yuzu/configuration/configure_per_general.cpp
+++ b/src/yuzu/configuration/configure_per_general.cpp
@@ -5,24 +5,27 @@
5#include <algorithm> 5#include <algorithm>
6#include <memory> 6#include <memory>
7#include <utility> 7#include <utility>
8
9#include <QHeaderView>
8#include <QMenu> 10#include <QMenu>
9#include <QMessageBox> 11#include <QMessageBox>
10#include <QStandardItemModel> 12#include <QStandardItemModel>
11#include <QString> 13#include <QString>
12#include <QTimer> 14#include <QTimer>
13#include <QTreeView> 15#include <QTreeView>
14#include "common/param_package.h" 16
15#include "core/file_sys/control_metadata.h" 17#include "core/file_sys/control_metadata.h"
16#include "core/file_sys/patch_manager.h" 18#include "core/file_sys/patch_manager.h"
17#include "core/file_sys/xts_archive.h" 19#include "core/file_sys/xts_archive.h"
18#include "core/loader/loader.h" 20#include "core/loader/loader.h"
19#include "input_common/main.h" 21#include "ui_configure_per_general.h"
20#include "yuzu/configuration/config.h" 22#include "yuzu/configuration/config.h"
21#include "yuzu/configuration/configure_input.h" 23#include "yuzu/configuration/configure_input.h"
22#include "yuzu/configuration/configure_per_general.h" 24#include "yuzu/configuration/configure_per_general.h"
23#include "yuzu/ui_settings.h" 25#include "yuzu/ui_settings.h"
26#include "yuzu/util/util.h"
24 27
25ConfigurePerGameGeneral::ConfigurePerGameGeneral(u64 title_id, QWidget* parent) 28ConfigurePerGameGeneral::ConfigurePerGameGeneral(QWidget* parent, u64 title_id)
26 : QDialog(parent), ui(std::make_unique<Ui::ConfigurePerGameGeneral>()), title_id(title_id) { 29 : QDialog(parent), ui(std::make_unique<Ui::ConfigurePerGameGeneral>()), title_id(title_id) {
27 30
28 ui->setupUi(this); 31 ui->setupUi(this);
@@ -61,11 +64,13 @@ ConfigurePerGameGeneral::ConfigurePerGameGeneral(u64 title_id, QWidget* parent)
61 ui->icon_view->setScene(scene); 64 ui->icon_view->setScene(scene);
62 65
63 connect(item_model, &QStandardItemModel::itemChanged, 66 connect(item_model, &QStandardItemModel::itemChanged,
64 [&]() { UISettings::values.is_game_list_reload_pending.exchange(true); }); 67 [] { UISettings::values.is_game_list_reload_pending.exchange(true); });
65 68
66 this->loadConfiguration(); 69 this->loadConfiguration();
67} 70}
68 71
72ConfigurePerGameGeneral::~ConfigurePerGameGeneral() = default;
73
69void ConfigurePerGameGeneral::applyConfiguration() { 74void ConfigurePerGameGeneral::applyConfiguration() {
70 std::vector<std::string> disabled_addons; 75 std::vector<std::string> disabled_addons;
71 76
@@ -107,7 +112,7 @@ void ConfigurePerGameGeneral::loadConfiguration() {
107 if (loader->ReadDeveloper(developer) == Loader::ResultStatus::Success) 112 if (loader->ReadDeveloper(developer) == Loader::ResultStatus::Success)
108 ui->display_developer->setText(QString::fromStdString(developer)); 113 ui->display_developer->setText(QString::fromStdString(developer));
109 114
110 ui->display_version->setText("1.0.0"); 115 ui->display_version->setText(QStringLiteral("1.0.0"));
111 } 116 }
112 117
113 if (control.second != nullptr) { 118 if (control.second != nullptr) {
@@ -160,7 +165,6 @@ void ConfigurePerGameGeneral::loadConfiguration() {
160 ui->display_format->setText( 165 ui->display_format->setText(
161 QString::fromStdString(Loader::GetFileTypeString(loader->GetFileType()))); 166 QString::fromStdString(Loader::GetFileTypeString(loader->GetFileType())));
162 167
163 QLocale locale = this->locale(); 168 const auto valueText = ReadableByteSize(file->GetSize());
164 QString valueText = locale.formattedDataSize(file->GetSize());
165 ui->display_size->setText(valueText); 169 ui->display_size->setText(valueText);
166} 170}
diff --git a/src/yuzu/configuration/configure_per_general.h b/src/yuzu/configuration/configure_per_general.h
index 5f958bbba..a4494446c 100644
--- a/src/yuzu/configuration/configure_per_general.h
+++ b/src/yuzu/configuration/configure_per_general.h
@@ -4,21 +4,14 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <array>
8#include <functional>
9#include <memory> 7#include <memory>
10#include <string> 8#include <vector>
11#include <unordered_map> 9
12#include <QKeyEvent> 10#include <QKeyEvent>
13#include <QList> 11#include <QList>
14#include <QWidget> 12#include <QWidget>
15#include <boost/optional.hpp> 13
16#include "common/param_package.h" 14#include "core/file_sys/vfs_types.h"
17#include "core/file_sys/vfs.h"
18#include "core/settings.h"
19#include "input_common/main.h"
20#include "ui_configure_per_general.h"
21#include "yuzu/configuration/config.h"
22 15
23class QTreeView; 16class QTreeView;
24class QGraphicsScene; 17class QGraphicsScene;
@@ -33,7 +26,8 @@ class ConfigurePerGameGeneral : public QDialog {
33 Q_OBJECT 26 Q_OBJECT
34 27
35public: 28public:
36 explicit ConfigurePerGameGeneral(u64 title_id, QWidget* parent = nullptr); 29 explicit ConfigurePerGameGeneral(QWidget* parent, u64 title_id);
30 ~ConfigurePerGameGeneral() override;
37 31
38 /// Save all button configurations to settings file 32 /// Save all button configurations to settings file
39 void applyConfiguration(); 33 void applyConfiguration();
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index b52a50915..8e9524fd6 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -333,6 +333,8 @@ void GameList::PopupContextMenu(const QPoint& menu_location) {
333 QAction* dump_romfs = context_menu.addAction(tr("Dump RomFS")); 333 QAction* dump_romfs = context_menu.addAction(tr("Dump RomFS"));
334 QAction* copy_tid = context_menu.addAction(tr("Copy Title ID to Clipboard")); 334 QAction* copy_tid = context_menu.addAction(tr("Copy Title ID to Clipboard"));
335 QAction* navigate_to_gamedb_entry = context_menu.addAction(tr("Navigate to GameDB entry")); 335 QAction* navigate_to_gamedb_entry = context_menu.addAction(tr("Navigate to GameDB entry"));
336 context_menu.addSeparator();
337 QAction* properties = context_menu.addAction(tr("Properties"));
336 338
337 open_save_location->setEnabled(program_id != 0); 339 open_save_location->setEnabled(program_id != 0);
338 auto it = FindMatchingCompatibilityEntry(compatibility_list, program_id); 340 auto it = FindMatchingCompatibilityEntry(compatibility_list, program_id);
@@ -346,6 +348,7 @@ void GameList::PopupContextMenu(const QPoint& menu_location) {
346 connect(copy_tid, &QAction::triggered, [&]() { emit CopyTIDRequested(program_id); }); 348 connect(copy_tid, &QAction::triggered, [&]() { emit CopyTIDRequested(program_id); });
347 connect(navigate_to_gamedb_entry, &QAction::triggered, 349 connect(navigate_to_gamedb_entry, &QAction::triggered,
348 [&]() { emit NavigateToGamedbEntryRequested(program_id, compatibility_list); }); 350 [&]() { emit NavigateToGamedbEntryRequested(program_id, compatibility_list); });
351 connect(properties, &QAction::triggered, [&]() { emit OpenPerGameGeneralRequested(path); });
349 352
350 context_menu.exec(tree_view->viewport()->mapToGlobal(menu_location)); 353 context_menu.exec(tree_view->viewport()->mapToGlobal(menu_location));
351} 354}
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h
index 05e115e19..b317eb2fc 100644
--- a/src/yuzu/game_list.h
+++ b/src/yuzu/game_list.h
@@ -70,6 +70,7 @@ signals:
70 void CopyTIDRequested(u64 program_id); 70 void CopyTIDRequested(u64 program_id);
71 void NavigateToGamedbEntryRequested(u64 program_id, 71 void NavigateToGamedbEntryRequested(u64 program_id,
72 const CompatibilityList& compatibility_list); 72 const CompatibilityList& compatibility_list);
73 void OpenPerGameGeneralRequested(const std::string& file);
73 74
74private slots: 75private slots:
75 void onTextChanged(const QString& newText); 76 void onTextChanged(const QString& newText);
diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp
index 1edc60df7..553269269 100644
--- a/src/yuzu/game_list_worker.cpp
+++ b/src/yuzu/game_list_worker.cpp
@@ -62,7 +62,7 @@ QString FormatPatchNameVersions(const FileSys::PatchManager& patch_manager,
62 FileSys::VirtualFile update_raw; 62 FileSys::VirtualFile update_raw;
63 loader.ReadUpdateRaw(update_raw); 63 loader.ReadUpdateRaw(update_raw);
64 for (const auto& kv : patch_manager.GetPatchVersionNames(update_raw)) { 64 for (const auto& kv : patch_manager.GetPatchVersionNames(update_raw)) {
65 const bool is_update = kv.first == "Update"; 65 const bool is_update = kv.first == "Update" || kv.first == "[D] Update";
66 if (!updatable && is_update) { 66 if (!updatable && is_update) {
67 continue; 67 continue;
68 } 68 }
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 22c207a3a..90b212ba5 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -9,6 +9,7 @@
9 9
10// VFS includes must be before glad as they will conflict with Windows file api, which uses defines. 10// VFS includes must be before glad as they will conflict with Windows file api, which uses defines.
11#include "applets/software_keyboard.h" 11#include "applets/software_keyboard.h"
12#include "configuration/configure_per_general.h"
12#include "core/file_sys/vfs.h" 13#include "core/file_sys/vfs.h"
13#include "core/file_sys/vfs_real.h" 14#include "core/file_sys/vfs_real.h"
14#include "core/hle/service/acc/profile_manager.h" 15#include "core/hle/service/acc/profile_manager.h"
@@ -441,6 +442,8 @@ void GMainWindow::ConnectWidgetEvents() {
441 connect(game_list, &GameList::CopyTIDRequested, this, &GMainWindow::OnGameListCopyTID); 442 connect(game_list, &GameList::CopyTIDRequested, this, &GMainWindow::OnGameListCopyTID);
442 connect(game_list, &GameList::NavigateToGamedbEntryRequested, this, 443 connect(game_list, &GameList::NavigateToGamedbEntryRequested, this,
443 &GMainWindow::OnGameListNavigateToGamedbEntry); 444 &GMainWindow::OnGameListNavigateToGamedbEntry);
445 connect(game_list, &GameList::OpenPerGameGeneralRequested, this,
446 &GMainWindow::OnGameListOpenPerGameProperties);
444 447
445 connect(this, &GMainWindow::EmulationStarting, render_window, 448 connect(this, &GMainWindow::EmulationStarting, render_window,
446 &GRenderWindow::OnEmulationStarting); 449 &GRenderWindow::OnEmulationStarting);
@@ -988,6 +991,32 @@ void GMainWindow::OnGameListNavigateToGamedbEntry(u64 program_id,
988 QDesktopServices::openUrl(QUrl("https://yuzu-emu.org/game/" + directory)); 991 QDesktopServices::openUrl(QUrl("https://yuzu-emu.org/game/" + directory));
989} 992}
990 993
994void GMainWindow::OnGameListOpenPerGameProperties(const std::string& file) {
995 u64 title_id{};
996 const auto v_file = Core::GetGameFileFromPath(vfs, file);
997 const auto loader = Loader::GetLoader(v_file);
998 if (loader == nullptr || loader->ReadProgramId(title_id) != Loader::ResultStatus::Success) {
999 QMessageBox::information(this, tr("Properties"),
1000 tr("The game properties could not be loaded."));
1001 return;
1002 }
1003
1004 ConfigurePerGameGeneral dialog(this, title_id);
1005 dialog.loadFromFile(v_file);
1006 auto result = dialog.exec();
1007 if (result == QDialog::Accepted) {
1008 dialog.applyConfiguration();
1009
1010 const auto reload = UISettings::values.is_game_list_reload_pending.exchange(false);
1011 if (reload) {
1012 game_list->PopulateAsync(UISettings::values.gamedir,
1013 UISettings::values.gamedir_deepscan);
1014 }
1015
1016 config->Save();
1017 }
1018}
1019
991void GMainWindow::OnMenuLoadFile() { 1020void GMainWindow::OnMenuLoadFile() {
992 const QString extensions = 1021 const QString extensions =
993 QString("*.").append(GameList::supported_file_extensions.join(" *.")).append(" main"); 1022 QString("*.").append(GameList::supported_file_extensions.join(" *.")).append(" main");
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 674e73412..ca9c50367 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -168,6 +168,7 @@ private slots:
168 void OnGameListCopyTID(u64 program_id); 168 void OnGameListCopyTID(u64 program_id);
169 void OnGameListNavigateToGamedbEntry(u64 program_id, 169 void OnGameListNavigateToGamedbEntry(u64 program_id,
170 const CompatibilityList& compatibility_list); 170 const CompatibilityList& compatibility_list);
171 void OnGameListOpenPerGameProperties(const std::string& file);
171 void OnMenuLoadFile(); 172 void OnMenuLoadFile();
172 void OnMenuLoadFolder(); 173 void OnMenuLoadFolder();
173 void OnMenuInstallToNAND(); 174 void OnMenuInstallToNAND();
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h
index 25236d05d..0f3f8da50 100644
--- a/src/yuzu_cmd/default_ini.h
+++ b/src/yuzu_cmd/default_ini.h
@@ -225,7 +225,7 @@ yuzu_token =
225[AddOns] 225[AddOns]
226# Used to disable add-ons 226# Used to disable add-ons
227# List of title IDs of games that will have add-ons disabled (separated by '|'): 227# List of title IDs of games that will have add-ons disabled (separated by '|'):
228title_ids = 228title_ids =
229# For each title ID, have a key/value pair called `disabled_<title_id>` equal to the names of the add-ons to disable (sep. by '|') 229# For each title ID, have a key/value pair called `disabled_<title_id>` equal to the names of the add-ons to disable (sep. by '|')
230# e.x. disabled_0100000000010000 = Update|DLC <- disables Updates and DLC on Super Mario Odyssey 230# e.x. disabled_0100000000010000 = Update|DLC <- disables Updates and DLC on Super Mario Odyssey
231)"; 231)";