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
Sc_HasData bool false if have achievement data
Sc_Is100Percent bool false
Sc_Total int 0 total achievement
Sc_TotalDouble double 0 total achievement
Sc_TotalString string "0" total achievement
Sc_Unlocked int 0 count achievement unlocked
Sc_UnlockedDouble double 0 count achievement unlocked
Sc_UnlockedString String "0" count achievement unlocked
Sc_Locked int 0 count achievement locked
Sc_LockedDouble double 0 count achievement locked
Sc_LockedString String "0" count achievement locked
Sc_PercentageUnlocked int 0 percentage achievement unlocked
Sc_PercentageUnlockedDouble double 0 percentage achievement unlocked
Sc_PercentageUnlockedString String "0" percentage achievement unlocked
Sc_ListAchievements List achievements List.Empty details
Sc_EnableIntegrationInCustomTheme bool false value from settings
Sc_IntegrationShowGraphic bool true value from settings
Sc_IntegrationShowAchievements bool true value from settings
Sc_IntegrationShowProgressBar bool true value from settings
Sc_IntegrationShowAchievementsCompactLocked bool true value from settings
Sc_IntegrationShowAchievementsCompactUnlocked bool true value from settings

Code integration example with options "Custom theme integration"

Show a element if there is data

<StackPanel Tag="{DynamicResource Sc_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 Sc_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 Sc_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_ScButtonWithJustIcon" With="optional" Height="optional" />

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

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

Create a custom button what open plugin view

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

Show graphic datetime unlock achievement

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

Show list with all achievements

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

Show compact list with all achievements

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

Show compact list vertical with all achievements

<StackPanel Name="PART_Achievements_ListComptactVertical" Height="mandatory" />

Show progressbar

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

Show list compact unlocked

<StackPanel Name="PART_Achievements_ListCompactUnlocked" />

Show list compact locked

<StackPanel Name="PART_Achievements_ListCompactLocked" />

Show list vertical compact unlocked

<StackPanel Name="PART_Achievements_ListCompactVerticalUnlocked" Height="mandatory" />

Show list vertical compact locked

<StackPanel Name="PART_Achievements_ListCompactVerticalLocked" Height="mandatory" />

Show list with user stats

<StackPanel Name="PART_ScUserStats" />