Skip to content

Addition in a custom theme

Lacro59 edited this page Sep 3, 2021 · 8 revisions

You can see a example with https://github.com/Lacro59/playnite-defaultextend-theme.

Differents resources disponible with PluginSettings

The SourceName for the plugin is ScreenshotsVisualizer

Plugin settings

CustomOption Type Default Description
EnableIntegrationButton bool false Parameters to display or not the plugin button.
EnableIntegrationButtonDetails bool false Parameters to display or not more infos in the plugin button.
EnableIntegrationViewItem bool false Parameters to display or not a simple item games list.
EnableIntegrationShowSinglePicture bool false Parameters to display or not a control with a single screenshoot.
EnableIntegrationShowPictures bool false Settings to display or not a control with the list of screenshots.
EnableIntegrationShowPicturesVertical bool false Settings to display or not a control with the list of vertical screenshots.

Plugin data for game selected

CustomOption Type Default Description
HasData bool false Indicates if the game has data.
ListScreenshots List List empty details

Integration of plugin elements with ContentControl

Visibility

Visibility according to the presence of the plugin

<StackPanel Visibility="{PluginStatus Plugin=<PluginId>, Status=Installed}">
</StackPanel>

Visibility depending the element visibility parameter in plugin settings

If the item is not enabled in the plugin settings, it is collapsed.

Visibility according to the visibility of the element

<StackPanel Visibility="{Binding ElementName=<SourceName>_<ElementName>, Path=Visibility}">
</StackPanel>

Plugin elements

ViewItem (supporting the different options in the plugin settings)

<ContentControl x:Name="ScreenshotsVisualizer_PluginViewItem" />

Button (supporting the different options in the plugin settings)

<ContentControl x:Name="ScreenshotsVisualizer_PluginButton" />

Single screenshot (supporting the different options in the plugin settings)

<ContentControl x:Name="ScreenshotsVisualizer_PluginSinglePicture" />

Height is managed in plugin settings but you can defined a MinHeight and MaxHeight.

List screenshots (supporting the different options in the plugin settings)

<ContentControl x:Name="ScreenshotsVisualizer_PluginListScreenshots" />

Height is managed in plugin settings but you can defined a MinHeight and MaxHeight.

List screenshots vertical (supporting the different options in the plugin settings)

<ContentControl x:Name="ScreenshotsVisualizer_PluginListScreenshotsVertical" />

Custom elements with plugin data

Button (example)

<Button Name="PART_CustomSsvButton">
    <ContentControl x:Name="ScreenshotsVisualizer_PluginViewItem" />
</Button>

Custom list of screenshots (example)

<ListBox ItemsSource="{PluginSettings Plugin=ScreenshotsVisualizer, Path=ListScreenshots}">
    <ListBox.ItemTemplate>
        <DataTemplate>
            <Grid Margin="0,2">
                <Image HorizontalAlignment="Center" Height="100" VerticalAlignment="Center" Source="{Binding FileName}"/>
            </Grid>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>