Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GameList: Support adding custom titles and/or regions to files #9330

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

CookiePLMonster
Copy link
Contributor

@CookiePLMonster CookiePLMonster commented Jul 23, 2023

Description of Changes

This PR adds an ability to override game names and regions on the list, which can be useful when using romhacks. With this change, two previously "identical" entries can be given unique names and/or regions. These attributes are being saved into a new custom_properties.ini file, where each section name is a full path to a file.

image

A new "Restore" buttons have been added to the Game Summary which restore the original property. Deleting the custom Title restores the default one.

image

To-do and/or agree on:

  • Should this be only possible for titles or also serials and regions? It is titles and regions now.
  • Is an Edit button a good UX? Maybe those fields should just become editable as-is? It is Restore instead now.
  • Should the Game List sort again after quitting the summary? Right now it doesn't.
  • Should custom names be marked somehow on the Game List?

Rationale behind Changes

Less ambiguity when using romhacks or multiple versions of the same game in general.

Suggested Testing Steps

  1. Create multiple copies of the same game ISO, or use romhacks.
  2. Make them all listed on the Game List.
  3. Go to Game Properties -> Edit the title and region.
  4. Verify that a custom title shows as expected and persists across sessions.

@seta-san
Copy link
Contributor

I feel like this is supporting mods in a way. i always thought it would be better to have the actual box title for the games as official alternative. I think our japanese friends would appreciate it if they could see the game's title in their native language that many of them were made in.

@CookiePLMonster
Copy link
Contributor Author

Updated to make the title and regions editable out of the box, with new "Restore" buttons that reset a respective custom property.

@CookiePLMonster CookiePLMonster changed the title GameList: Support adding custom titles to files GameList: Support adding custom titles and/or regions to files Jul 25, 2023
@CookiePLMonster CookiePLMonster marked this pull request as ready for review July 26, 2023 12:39
@JordanTheToaster
Copy link
Contributor

Currently works as intended but it would be interesting to have the current game title in the top bar also change to reflect the currently assigned name.

@CookiePLMonster
Copy link
Contributor Author

Currently works as intended but it would be interesting to have the current game title in the top bar also change to reflect the currently assigned name.

image

Done.

@CookiePLMonster CookiePLMonster marked this pull request as draft July 26, 2023 17:03
@CookiePLMonster CookiePLMonster marked this pull request as ready for review July 26, 2023 18:54
@@ -51,7 +51,7 @@ class SettingsDialog final : public QDialog

public:
explicit SettingsDialog(QWidget* parent);
SettingsDialog(QWidget* parent, std::unique_ptr<SettingsInterface> sif, const GameList::Entry* game, std::string serial, u32 disc_crc);
SettingsDialog(QWidget* parent, std::unique_ptr<SettingsInterface> sif, const GameList::Entry* game, std::string serial, u32 disc_crc, QString filename = QString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const QString&

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm std::move-ing it in so it's intended, same as std::string serial.

@@ -79,6 +79,8 @@ class SettingsDialog final : public QDialog
void registerWidgetHelp(QObject* object, QString title, QString recommended_value, QString text);
bool eventFilter(QObject* object, QEvent* event) override;

void setWindowTitle(const QString& title);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might cause a shadowing warning (check the CI logs)

pcsx2/GameList.cpp Outdated Show resolved Hide resolved
pcsx2/GameList.cpp Outdated Show resolved Hide resolved
pcsx2/VMManager.cpp Show resolved Hide resolved
@kamfretoz
Copy link
Contributor

Causes crash on Linux upon opening the game properties dialog.

Crash Log:

*************** Unhandled SIGSEGV at 0x55f9014a4b00 ***************
0x0055f901805d77 CrashSignalHandler [/home/runner/work/pcsx2/pcsx2/common/CrashHandler.cpp:358]
0x0055f901821bf0 CallExistingSignalHandler [/home/runner/work/pcsx2/pcsx2/common/Linux/LnxHostSys.cpp:68]
0x0055f901821bf0 SysPageFaultSignalFilter [/home/runner/work/pcsx2/pcsx2/common/Linux/LnxHostSys.cpp:126]
0x007ff418e43a4f
0x0055f9014a4b00 _M_data [/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h:235]
0x0055f9014a4b00 data [/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h:2568]
0x0055f9014a4b00 operator basic_string_view [/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/basic_string.h:937]
0x0055f9014a4b00 openGamePropertiesDialog [/home/runner/work/pcsx2/pcsx2/pcsx2-qt/Settings/SettingsDialog.cpp:564]
0x0055f90139ae0e operator() [/home/runner/work/pcsx2/pcsx2/pcsx2-qt/MainWindow.cpp:1140]
0x0055f90139ae0e call [/home/runner/deps/include/QtCore/qobjectdefs_impl.h:127]
0x0055f90139ae0e call<QtPrivate::List<>, void> [/home/runner/deps/include/QtCore/qobjectdefs_impl.h:241]
0x0055f90139ae0e impl [/home/runner/deps/include/QtCore/qobjectdefs_impl.h:409]
0x007ff4197a56b8
0x007ff41a35d745
0x007ff41a3607ac
0x007ff41af5b584
0x007ff41af63542
0x007ff41ade04c7
0x007ff41ad87315
0x007ff41ad90dbf
0x007ff4197433a9
0x007ff41ad8f863
0x007ff41adf34aa
0x007ff41adf57d7
0x007ff41ad87315
0x007ff4197433a9
0x007ff419fa18bf
0x007ff419ffacbb
0x007ff414da0c3d
0x007ff4186b1d3a
0x007ff418707257
0x007ff4186af3e2
0x007ff419a0befd
0x007ff41974f7fa
0x007ff41af60ec9
0x007ff41af61013
0x0055f9013916e7 onGameListEntryContextMenuRequested [/home/runner/work/pcsx2/pcsx2/pcsx2-qt/MainWindow.cpp:1207]
0x007ff4197965ed
0x007ff41ad87315
0x007ff4197433a9
0x007ff419746a8f
0x007ff419a0c606
0x007ff4186b1d3a
0x007ff418707257
0x007ff4186af3e2
0x007ff419a0befd
0x007ff41974f7fa
0x007ff41974b935
0x0055f9013b6240 main [/home/runner/work/pcsx2/pcsx2/pcsx2-qt/QtHost.cpp:1877]
0x007ff418e27f8f
0x007ff418e28049
0x0055f900c4f0a4
0xffffffffffffffff
*******************************************************************
fish: Job 1, './PCSX2-linux-Qt-x64-pr[9330]-s…' terminated by signal SIGABRT (Abort)

@refractionpcsx2 refractionpcsx2 merged commit 0256c45 into PCSX2:master Aug 10, 2023
12 checks passed
@CookiePLMonster CookiePLMonster deleted the custom-names branch August 10, 2023 09:41
stenzek added a commit to stenzek/duckstation that referenced this pull request Jun 17, 2024
Largely inspired by PCSX2/pcsx2#9330, but almost
entirely rewritten.
stenzek added a commit to stenzek/duckstation that referenced this pull request Jun 17, 2024
Largely inspired by PCSX2/pcsx2#9330, but almost
entirely rewritten.
stenzek added a commit to stenzek/duckstation that referenced this pull request Jun 17, 2024
Largely inspired by PCSX2/pcsx2#9330, but almost
entirely rewritten.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants