Skip to content

Addition in a custom theme (Playnite 8)

Lacro59 edited this page Sep 3, 2021 · 1 revision

In full screen application only the differents resources are available.

Differents resources disponible with DynamicResource

Name Type Default Description
Ga_HasData bool false if have session data
Ga_HasDataLog bool false if have log session data
Ga_LastDateSession string string.Empty date last game session
Ga_LastDateTimeSession string string.Empty datetime last game session
Ga_LastPlaytimeSession string string.Empty playtime last game session
Ga_IntegrationShowGraphic bool true value from settings
Ga_IntegrationShowGraphicLog bool true value from settings

Code integration example with options "Custom theme integration"

Show a element if there is data

<StackPanel Tag="{DynamicResource Ga_HasData}">
    <StackPanel.Style>
        <Style>
            <Setter Property="Control.Visibility" Value="Visible" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="False">
                    <Setter Property="Control.Visibility" Value="Collapsed" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </StackPanel.Style>

    <here your custom code or a element predefined with extension>
</StackPanel>

Show a element if the plugin is actived

<StackPanel Tag="{DynamicResource Ga_HasData}">
    <StackPanel.Style>
        <Style>
            <Setter Property="Control.Visibility" Value="Visible" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="{x:Null}">
                    <Setter Property="Control.Visibility" Value="Collapsed" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </StackPanel.Style>

    <here your custom code or a element predefined with extension>
</StackPanel>

Show a element if there is data and the plugin is actived

<StackPanel Tag="{DynamicResource Ga_HasData}">
    <StackPanel.Style>
        <Style>
            <Setter Property="Control.Visibility" Value="Visible" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="{x:Null}">
                    <Setter Property="Control.Visibility" Value="Collapsed" />
                </DataTrigger>
                <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="False">
                    <Setter Property="Control.Visibility" Value="Collapsed" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </StackPanel.Style>

    <here your custom code or a element predefined with extension>
</StackPanel>

Show a button that open plugin view

<StackPanel Name="PART_GaButtonWithJustIcon" With="optional" Height="optional" />

<StackPanel Name="PART_GaButtonWithTitle" With="optional" Height="optional" />

<StackPanel Name="PART_GaButtonWithTitleAndDetails" With="optional" Height="optional" />

Create a custom button what open plugin view

<Button Name="PART_GaCustomButton">your custom template here</Button>

Show graphic with time session

<StackPanel Name="PART_GameActivity_Graphic" With="optional" Height="optional" />

Show graphic with last log session

<StackPanel Name="PART_GameActivity_GraphicLog" With="optional" Height="optional" />