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

SteamGridDB: Implement GUI for getSteamGridDBArtwork command #1007

Merged
merged 11 commits into from
Jan 12, 2024

Conversation

sonic2kk
Copy link
Owner

@sonic2kk sonic2kk commented Jan 10, 2024

Implements #933.

Overview

This PR adds a GUI dialog frontend for the commandlineGetSteamGridDBArtwork SteamGridDB command, fully implementing the work for #933 and completing the SteamGridDB Overhaul. It allows a user to enter information on the frontend instead of manually entering it all on the commandline, which is a small Quality of Life enhancement.

The options on this dialog are essentially a form for taking input for the SteamGridDB Command.

image

Implementation

Not much to add to this since the bulk of the implementation detail is for commandlineGetSteamGridDBArtwork.

Usage: steamtinkerlaunch sgdb <appid>

This works by the user running the sgdb command and give it an AppID, and then a dialog appears, allowing them to enter information to download artwork from SteamGridDB for that specific game. They can search for artwork using a Steam AppID (it doesn't have to be the AppID of the current game, i.e. they can get artwork for a version of a game on Steam that they don't own if it has better artwork), the SteamGridDB Game ID, or they can attempt to get artwork from a fuzzy Game Name search. SteamGridDB has an endpoint for fetching artwork by Game Name. This is all implemented on the commandlineGetSteamGridDBArtwork function, we just massage some of the entered data to make it easier to pass to the command.

Managing Game Type Search

We use a variable to denote if we pass --steam or --nonsteam to the commandlineGetSteamGridDBArtwork command, and we set this variable based on whether the user

If the user enters a Steam AppID, it will take priority and we will assume we're searching for artwork for a Steam game. Otherwise, we will search based on the SteamGridDB Game ID and assume we're using its game endpoint.

Since the command takes the AppID of a specific Steam game, we can force the filename AppID to this file, as we have the context of what AppID the user wants to set the SteamGridDB game artwork for. Therefore we should be able to search for artwork for a Non-Steam Game using a Steam AppID (for example, if using the GOG release of Oblivion, the user could still use the Steam AppID to fetch the game artwork, since the grids will use the --filename-appid).

Some Specified Defaults

For selecting how to handle existing grids, we have a combobox, and this defaults to the option selected on the Global Menu just like the command does, except we select it visually as the default option on the GUI.

We also default to having the "Apply" option enabled, as it is probably sensible to have this on by default for the GUI portion of this work. A user can toggle it off and it is more likely that from the GUI a user will want the default behaviour to be that grids are set on Steam.

Remaining Work

This still needs a lot of testing, it's not ready for merging yet. There are also some other UI changes I want to make, such as changing the dialog size, and adding the notifier. I have noted the remaining work in a checklist under the "TODO" section at the bottom of this PR.


TODO:

  • Testing
  • Adjust dialog sizing
  • Add notifier
  • Update helpscreen
  • Code cleanup
  • Update langfiles
  • Update wiki

@sonic2kk sonic2kk linked an issue Jan 10, 2024 that may be closed by this pull request
11 tasks
@sonic2kk
Copy link
Owner Author

Updated the description to be a bit more informative, updated the heading to display the Game Name and AppID to add visual clarity for the current game, and added the showPic for further visual clarity. If the showPic is not found, the "Game Name (AppID)" in the title should help make it clearer what the current game is, this way the user should be less likely to forget what the game they're downloading artwork for is.

image

@sonic2kk
Copy link
Owner Author

Can't figure out how to change the window dimensions, maybe this is some Wayland weirdness with Yad so I'll leave it be.

@sonic2kk
Copy link
Owner Author

Had to make a couple of fixes, but as of 1ea5a89, this is working in initial testing!

Tested with Persona 4 Golden (Steam) and the artwork downloaded and applied perfectly. Did not test the SteamGridDB Game ID yet, or Game Name, or Non-Steam Games. I also need to test the Apply checkbox to make sure it works, as well as the override for how to manage existing grids.

@sonic2kk
Copy link
Owner Author

Removed some comments and unneeded logging, and as of 4e8d0dd, ShellCheck is green on this. I will do a final check before merging (not ready to merge yet) but good progress is being made at a surprising rate.

@sonic2kk
Copy link
Owner Author

Helpscreen has been updated. Remaining work:

  • Add Notifier
  • Test SteamGridDB Game ID, SteamGridDB Game Name
  • Test dropdown options for how to handle existing grids
  • Test Apply checkbox
  • Final pass on phrasing before updating langfiles

@sonic2kk
Copy link
Owner Author

sonic2kk commented Jan 12, 2024

Tested SteamGridDB Game Name, works as expected for Steam and Non-Steam Games.

@sonic2kk
Copy link
Owner Author

sonic2kk commented Jan 12, 2024

Added notifier and some extra echo output for downloading SteamGridDB artwork, and a notifier on error when no Steam AppID, SteamGridDB Game ID, or Game Name is provided.

@sonic2kk
Copy link
Owner Author

Non-Steam Games are not displaying their titles because of a bug with getTitleFromID which will be fixed with #1011.

@sonic2kk
Copy link
Owner Author

Tested toggling the "Apply" checkbox and it works as expected.

@sonic2kk
Copy link
Owner Author

Tested SteamGridDB Game ID, works as expected.

@sonic2kk
Copy link
Owner Author

Tested the "Existing grids" dropdown, works as expected as well!

@sonic2kk
Copy link
Owner Author

The notifier is going to need changed, as my idea of displaying when a game is "Steam" and "Non-Steam" does not work. It is using --nonsteam when using SteamGridDB Game ID or Game Name, even for a Steam Game, which is correct behaviour but incorrect for the notifier. For example, using SteamGridDB Game ID 5259688 for PowerWash Simulator would display in the notifier that it was a Non-Steam Game, even though it isn't. Likewise, using a Steam Store AppID 22330 to fetch artwork for "The Elder Scrolls IV: Oblivion Game of the Year Edition" even if the AppID is for a Non-Steam Game (such as the GOG release), it would incorrectly display that it was downloading artwork for a Steam game.

I will push a fix soon.

@sonic2kk
Copy link
Owner Author

Notifier is fixed in 7cdc7d5.

@sonic2kk
Copy link
Owner Author

Testing for this PR is now complete. The remaining work is some last minute code checks, then some phrasing checks + langfile update, and finally a wiki update and a merge.

@sonic2kk
Copy link
Owner Author

Langfiles updated, phrasing looks ok.

@sonic2kk
Copy link
Owner Author

Testing is good on this, code is ready, langfiles updated, version bumped, ShellCheck is green.

I will write the wiki update and then this will be ready to merge!

@sonic2kk
Copy link
Owner Author

Wiki update is ready, this can be merged!

@sonic2kk sonic2kk merged commit ba9c1ff into master Jan 12, 2024
@sonic2kk sonic2kk deleted the sgdb-artwork-gui branch January 27, 2024 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Overhaul SteamGridDB Integration
1 participant