Skip to content

GameList: Add ability to favourite games#14216

Open
Vishrut2403 wants to merge 10 commits intoPCSX2:masterfrom
Vishrut2403:feature/favorites-gamelist
Open

GameList: Add ability to favourite games#14216
Vishrut2403 wants to merge 10 commits intoPCSX2:masterfrom
Vishrut2403:feature/favorites-gamelist

Conversation

@Vishrut2403
Copy link
Copy Markdown

Description of Changes

Adds the ability to favourite games in the game list. Favourited games are persisted to a favourites.ini file in the settings directory and sorted to the top of the game list regardless of the active sort column.

  • Added is_favourite field to GameList::Entry
  • Added GetFavouritesFile(), IsGameFavourited() and SetGameFavourite() functions to GameList
  • Favourites are loaded efficiently once per refresh, following the same pattern as custom_attributes_ini
  • Added "Add to Favourites" / "Remove from Favourites" to the right-click context menu
  • Favourited games sort to the top in GameListModel::lessThan()

#14107

Rationale behind Changes

Searching for a specific game manually takes time, especially with large libraries. Favouriting allows users to pin frequently played games to the top of the list without scrolling or searching.

The implementation is kept flexible so it can be extended to a full groups system in the future (#11666), with "Favourites" acting as a special case of a group.

Suggested Testing Steps

  1. Right-click any game in the list -> select "Add to Favourites"
  2. Verify the game sorts to the top of the list immediately
  3. Close and reopen PCSX2 to verify the favourite persists
  4. Right-click the favourited game -> verify it shows "Remove from Favourites"
  5. Remove the favourite and verify the game returns to its normal sort position

Did you use AI to help find, test, or implement this issue or feature?

Yes. I did use Claude to understand the codebase and existing patterns such as how custom_attributes_iniand PlayedTimeMap are structured, and to guide the implementation. All code was reviewed and tested manually.

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for submitting a contribution to PCSX2

As this is your first pull request, please be aware of the contributing guidelines.

Additionally, as per recent changes in GitHub Actions, your pull request will need to be approved by a maintainer before GitHub Actions can run against it. You can find more information about this change here.

Please be patient until this happens. In the meantime if you'd like to confirm the builds are passing, you have the option of opening a PR on your own fork, just make sure your fork's master branch is up to date!

@TellowKrinkle
Copy link
Copy Markdown
Member

Any reason for a separate ini instead of adding it to the custom attributes one?

@Vishrut2403
Copy link
Copy Markdown
Author

Vishrut2403 commented Mar 27, 2026

Any reason for a separate ini instead of adding it to the custom attributes one?

I kept favourites in a separate .ini because they represent user-specific state, whereas custom_attributes_ini is used for per-game metadata.

custom_attributes_ini is treated as static metadata, so introducing favourites there would mix it with changing user preferences.

@dezraj
Copy link
Copy Markdown

dezraj commented Mar 27, 2026

Hello! Is there a standard English spelling for files and folders in PCSX2? I ask because you suggested creating a "favourites.ini" file, not "favorites.ini". I'm not sure if the spelling variations can be mixed up in the graphical interface either. Anyway, just a small detail I noticed! Thank you for your contribution!

@Vishrut2403 Vishrut2403 force-pushed the feature/favorites-gamelist branch from cced973 to 289587d Compare March 28, 2026 00:16
@Vishrut2403
Copy link
Copy Markdown
Author

Vishrut2403 commented Mar 28, 2026

Hello! Is there a standard English spelling for files and folders in PCSX2? I ask because you suggested creating a "favourites.ini" file, not "favorites.ini". I'm not sure if the spelling variations can be mixed up in the graphical interface either. Anyway, just a small detail I noticed! Thank you for your contribution!

I think I should stick to American English, updated all spellings to "favorite" throughout and pushed the changes.
Also I don't think "favorite" or "favourite" has been used in any file.

@TellowKrinkle
Copy link
Copy Markdown
Member

custom_attributes_ini is treated as static metadata, so introducing favourites there would mix it with changing user preferences.

static metadata such as custom titles and regions?

@Vishrut2403
Copy link
Copy Markdown
Author

custom_attributes_ini is treated as static metadata, so introducing favourites there would mix it with changing user preferences.

static metadata such as custom titles and regions?

Yes, and also now I figured that custom titles and regions are also user preferences, I'm happy to move favorites into custom_attributes_ini if that is the preferred approach.

@kamfretoz
Copy link
Copy Markdown
Contributor

That is indeed the preferred approach, yes.

@Vishrut2403
Copy link
Copy Markdown
Author

That is indeed the preferred approach, yes.

Thanks, I'll make the changes now.

@Vishrut2403
Copy link
Copy Markdown
Author

Done, moved favorites into custom_attributes_ini and pushed the changes.

Copy link
Copy Markdown
Contributor

@kamfretoz kamfretoz left a comment

Choose a reason for hiding this comment

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

Looks good but i suggest that there should be some sort of "favorited game" indicator, something like a star on the bottom right side of the cover (in the case of cover view) or one of the column (in the case of list view)

Image

@Vishrut2403
Copy link
Copy Markdown
Author

Looks good but i suggest that there should be some sort of "favorited game" indicator, something like a star on the bottom right side of the cover (in the case of cover view) or one of the column (in the case of list view)

Image

Thanks for the suggestion,Should I add both, the star/badge overlay on cover art in grid view and a dedicated column/icon in list view, or just one of them to start?

@kamfretoz
Copy link
Copy Markdown
Contributor

Thanks for the suggestion,Should I add both, the star/badge overlay on cover art in grid view and a dedicated column/icon in list view, or just one of them to start?

I'd say both for consistency

@Vishrut2403
Copy link
Copy Markdown
Author

Thanks for the suggestion,Should I add both, the star/badge overlay on cover art in grid view and a dedicated column/icon in list view, or just one of them to start?

I'd say both for consistency

Sounds good, I'll implement both

@Vishrut2403
Copy link
Copy Markdown
Author

Vishrut2403 commented Mar 28, 2026

Added a star indicator for favorited games in both views.
List view: New "Favorite" column showing a star icon for favorite games. The column can be toggled via the right-click header menu like any other column.
You may have to drag the title menu to the left because the favorite menu is on the far right
Grid view: Star overlay on the bottom-right corner of the cover art for favorite games.
Both use the same star-fill.svg icon added to bin/resources/icons/.
List
Grid

@Vishrut2403 Vishrut2403 force-pushed the feature/favorites-gamelist branch from fec3d7f to 4f65a68 Compare March 29, 2026 06:51
@Vishrut2403 Vishrut2403 force-pushed the feature/favorites-gamelist branch 2 times, most recently from e908fbe to b3e1bb7 Compare April 1, 2026 11:40
Copy link
Copy Markdown
Member

@chaoticgd chaoticgd left a comment

Choose a reason for hiding this comment

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

Found some issues.

A thought on the design: If all the favorites are going to sort to the top anyway, is a whole new (visible) column even necessary? Could you get away with adding a unicode star to the title column instead?

Maybe someone else could weigh in on what they think would be best.

@Pesa
Copy link
Copy Markdown
Contributor

Pesa commented Apr 2, 2026

A thought on the design: If all the favorites are going to sort to the top anyway, is a whole new (visible) column even necessary? Could you get away with adding a unicode star to the title column instead?

As a user, this suggestion makes a lot of sense to me. Implementation-wise, it may be possible to just return the "star" icon as the DecorationRole for Column_Title. The only issue with this approach is that the star won't be visible if the user has hidden the Title column.

@Vishrut2403
Copy link
Copy Markdown
Author

As a user, this suggestion makes a lot of sense to me. Implementation-wise, it may be possible to just return the "star" icon as the DecorationRole for Column_Title. The only issue with this approach is that the star won't be visible if the user has hidden the Title column.

Using a star in the title column does simplify the UI and avoids introducing an extra visible column.

From an implementation perspective, returning a star via DecorationRole for Column_Title should work cleanly.

This ends up being a tradeoff between a cleaner UI and ensuring the favorite state is always visible.

I’m fine going with the star approach if we’re okay with that behavior, otherwise, the separate column guarantees persistent visibility.

@chaoticgd
Copy link
Copy Markdown
Member

chaoticgd commented Apr 2, 2026

The only practical scenario I see where the Title column isn't visible is if the File Title column is being used instead. So you could also display the favorite state there.

@Vishrut2403
Copy link
Copy Markdown
Author

I only practical scenario I see where the Title column isn't visible is if the File Title column is being used instead. So you could also display the favorite state there.

Going with the star-in-title approach for now.

I’ll surface the favorite state via DecorationRole on the Title column, and also in the File Title column so the indicator remains visible.

@Vishrut2403 Vishrut2403 force-pushed the feature/favorites-gamelist branch from b3e1bb7 to 194352a Compare April 2, 2026 18:28
@dezraj
Copy link
Copy Markdown

dezraj commented Apr 3, 2026

If all the favorites are going to sort to the top anyway

Will that be the final approach in this feature? I'd rather have the option to star my favorite games and keep them where they are in the list. But I understand if that may add more complexity to the current implementation...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants