-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add HowLongToBeat progress #4
base: main
Are you sure you want to change the base?
Conversation
It also appears to be causing the drag and drop behavior to slow down significantly. Perhaps I may need to disable property updates during dragging |
I don't know what |
Sorry, typo while shortening the sample code. It's Would you consider an API in the future to allow plugin views or Windows to do this in a supported way? Something like |
open issue |
To be honest I don't remember why that plugin list is exposed there, that should definitely not be done the way it is (exposing the "raw" plugin classes). I'm going to remove it in P9. |
@bburky Basically, giving a |
Closes #2
This is a kind of hacky implementation, but does work. The normal
<ContentControl x:Name="HowLongToBeat_PluginProgressBar"/>
way doesn't work because Playnite only provides custom control integration in library views.Instead, it's possible to manually access a different extension and call it's
GetGameViewControl()
methods to instantiate the custom controls it provides. This control can be loaded into a ContentControl and it's GameContext manually bound.The code is roughly this plus some additional error checking:
It mostly works well. This change introduced a short lag when first loading my Playlist sidebar view. Also when each HowLongToBeat progress bar shows up it takes a second to "pop in", it shows up unstyled and then resizes and loads. I'm not sure if that's avoidable?
@Lacro59 Are you okay with me using your plugin like this? Will anything break if I load lots of controls like this (it seems to work fine though). The button even works too. It gets loaded basically the same way as the library views use it. Is there any thing I should be doing to reduce the loading time for each control?
@JosefNemec I looked at
ControlTemplateTools.InitializePluginControls()
and it doesn't look like it could be easily extended to support sidebar views like I'm trying to do. Is loading another extension's control like I'm doing here a good idea, or should I expect this to break horribly?