Skip to content

Addition in a custom theme

Lacro59 edited this page Sep 3, 2021 · 11 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 CheckLocalizations

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.
EnableIntegrationListLanguages bool false Settings to display or not the list of supported languages.
EnableIntegrationFlags bool false Settings to display or not the list of available language flags.

Plugin data for game selected

CustomOption Type Default Description
HasData bool false Indicates if the game has data.
HasNativeSupport bool false Indicates if the game support the native language.
ListNativeSupport 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="CheckLocalizations_PluginViewItem" />

Button (supporting the different options in the plugin settings)

<ContentControl x:Name="CheckLocalizations_PluginButton" />

List of available language flags (supporting the different options in the plugin settings)

<ContentControl x:Name="CheckLocalizations_PluginFlags" />

List of supported languages (supporting the different options in the plugin settings)

<ContentControl x:Name="CheckLocalizations_CheckLocListLanguages" />

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

Custom elements with plugin data

Button (example)

<Button Name="PART_CustomCheckLocButton">
    <ContentControl x:Name="CheckLocalizations_PluginViewItem" />
</Button>

Custom list of supported languages (example)

<ListBox ItemsSource="{PluginSettings Plugin=CheckLocalizations, Path=ListNativeSupport}">
    <ListBox.ItemTemplate>
        <DataTemplate>
            <Grid Margin="0,2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="50" />
                    <ColumnDefinition Width="50" />
                    <ColumnDefinition Width="50" />
                    <ColumnDefinition Width="2*" />
                </Grid.ColumnDefinitions>
                
                <TextBlock Grid.Column="0" Text="{Binding DisplayName}" />
                <Image Grid.Column="1" HorizontalAlignment="Center" Height="24" VerticalAlignment="Center" Width="24" Source="{Binding UiIcon}"/>
                <Image Grid.Column="2" HorizontalAlignment="Center" Height="24" VerticalAlignment="Center" Width="24" Source="{Binding AudioIcon}"/>
                <Image Grid.Column="3" HorizontalAlignment="Center" Height="24" VerticalAlignment="Center" Width="24" Source="{Binding SubIcon}"/>
                <TextBlock Grid.Column="4" Text="{Binding Notes}" />
            </Grid>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>