darklinkpower / Stardust

Theme inspired by GOG Galaxy 2.0 for Playnite Desktop Mode.
MIT License
69 stars 7 forks source link

How to change the new "game library banner" image? #25

Closed profucius closed 2 years ago

profucius commented 2 years ago

Feature Description

Hi there, love your theme so much! I also really like the new feature you just added recently, that shows a game banner above the box art in grid view. You call it "game library banner".

I have a question, I have many games manually added to my Playnite library which are not synced from an integration. I have my own organization to separate the sources of these manually installed games (VR, Emulators, etc) as separate Source and Platform.

Anyway, I cant seem to find a way to change the banner for these manually added games. It seems that all manually added games are given the same banner, orange with a playnite logo on the left. All the games added via an Integration do in fact have their own image and banner color.

Is there any way to change the banner image for manually added games? I would love to be able to change it based on either Source, or Platform.

If this is outside the scope of your addon, but there is another way to handle this with another addon or directly in Playnite, please let me know if you know how. Thanks!

PS- I dont mind manually editing xml/yaml files, and adding my own images to the Images/Banners folder (within your skin subfolder).

Screenshots

image

darklinkpower commented 2 years ago

I'm afraid that adding support to Sources, Platforms or any other field is a no go from me. It needs to be done using a field that all games always have and can't be changed, like the PluginId in my implementation.

I've seen that other themes do it but with all respect, the solutions are very hacky and have numerous issues that I'm not okay with adding for my themes:

I implemented banners in a different way to how it's been done before in other themes and doesn't carries these issues but has the limitation of only be able to use PluginIds. I think I'd be a cool feature but for those reasons unfortunately I can't add support for that. This will have to wait until there's native support in Playnite or if someone makes an extension for that.

darklinkpower commented 2 years ago

To change existing banners, you can replace the images in the .\Images\Banners directory https://github.com/darklinkpower/Stardust/tree/master/source/Images/Banners

Only banners for plugins are supported and are references by the Plugin Guid. Here's an example of how to add new ones https://github.com/darklinkpower/Stardust/commit/1fd1579accd3d7e77a4ec30de1c57a29a628f246

darklinkpower commented 2 years ago

The reason why the games you mention use the orange/Generic Playnite banner is because they are handled by Playnite and not by a library plugin. All manually added games will use this banner.

profucius commented 2 years ago

I see, ok this makes sense the way you've explained it. It's unfortunate that it's this complicated to implement.

So in other words, if a library integration addon (like Steam, Humble, Ichio, etc) imports a game, that game has a Plugin ID associated to it, which your theme uses to reference to show the respective banner. But games added manually do not have a Plugin ID, or they all use the same generic one, which is why they have their own banner.

With this limitation being the case, if I wanted to have specific banners for different types of locally/manually installed games, e.g. manually added Android games, for keeping track of them in Playnite, I (or someone) would need to make a library integration addon, which serves to assign Plugin IDs to specifically chosen games. I'm not sure in the slightest how possible this would be, but following the logic of how other integration addons work, this seems to be the case. I wish this were easier to do on the fly.

One more question that just popped into my head as I typed this out: Let's say the above was possible, creating our own integration plugin to manage manually installed games / non-games, would it be fairly easy to create our own banners within your theme, associate them to the Plugin ID (somehow), and effectively make our own banners?

If you can tell, I am grasping at straws trying to think of any way this might be possible, before I give up on the idea.

darklinkpower commented 2 years ago

But games added manually do not have a Plugin ID, or they all use the same generic one, which is why they have their own banner.

All games have a pluginId. Games handled by Playnite (Including manually added games) have an empty Guid, which is what the theme uses https://github.com/darklinkpower/Stardust/blob/5eb176e81720d7bc4db7bd21c16519a202a02825/source/DerivedStyles/GridViewItemTemplate.xaml#L190

One more question that just popped into my head as I typed this out: Let's say the above was possible, creating our own integration plugin to manage manually installed games / non-games, would it be fairly easy to create our own banners within your theme, associate them to the Plugin ID (somehow), and effectively make our own banners?

In that case, you would need to implement what Playnite does to handle those games again in the plugin, including game handling and it would not be compatible with emulates games, unless you also implement all emulation stuff again. You also would need to implement how to assign pluginIds to specific games, etc. I also don't like the idea of using workarounds/hacks to implement this functionality and I think any additional effort like that should be directed towards either making an extension that handles this in a clean and proper way or to implement it in Playnite itself.

darklinkpower commented 2 years ago

I investigated and found a way to add platform banners in a clean way.

https://user-images.githubusercontent.com/1389286/165879907-a3ed5c44-53c8-4fb9-9cd5-6c888fd18d27.mp4

I need help to get the images, rename them and possibly make new ones but being honest it's not something I want to do myself. If you are interested to help please contact me in the Playnite discord.

profucius commented 2 years ago

Sounds good, I messaged in the Themes Devel room