Jump to content
LaunchBox Community Forums

add movie rating images to custom theme


jkuch77

Recommended Posts

I've been using BigBox as my game frontend for some time now and love it.  After finding I can also use it for movies, I'm trying to get rid of Kodi and only use BigBox on my HTPC/Gaming rig.  I've successfully setup Movies platform and added a couple movies.  I found I can put custom fields for writer, director, etc., but how can I have rating images like the ESRB images for games show up only R, PG-13, etc. instead for movies?  I installed the visual studio and thought I could do this in a custom theme, but checked the code for where the rating image is displayed and it seems to be part of the launchbox or BigBox code and not part of the theme.  Can anyone point me in the right direction to get these movie rating images to show if I have my own .png images?  I know I can change the path in the code, but that is only for one image and I need different images to display based on rating.  Thank you for your help!

Link to comment
Share on other sites

So, after finding this video: 

I edited the GameDetailsView.xaml file as follows:

<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:wpf="clr-namespace:Unbroken.LaunchBox.Wpf;assembly=Unbroken.LaunchBox.Wpf"
             xmlns:controls="clr-namespace:Unbroken.LaunchBox.Wpf.Controls;assembly=Unbroken.LaunchBox.Wpf"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300"
             FocusVisualStyle="{x:Null}">
    <UserControl.Resources>
        <DataTemplate DataType="{x:Type ContentControl}" x:Key="ImageTemplate">
            <Image x:Name="Test" DockPanel.Dock="Left" Margin="0,0,5,0" RenderOptions.BitmapScalingMode="HighQuality" />
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Path=SelectedGame.Rating}" Value="PG-13">
                    <Setter TargetName="Test" Property="Source" Value="C:\LaunchBox\Themes\Custom\Images\PG-13.png" />
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
    </UserControl.Resources>
    <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="#00FFFFFF">
        <Grid.RowDefinitions>
            <RowDefinition Height="4*" />
            <RowDefinition Height="44*" />
            <RowDefinition Height="1*" />
            <RowDefinition Height="10*" />
            <RowDefinition Height="5*" />
            <RowDefinition Height="42*" />
            <RowDefinition Height="4*" />
        </Grid.RowDefinitions>
        <DockPanel Name="DetailsPanel"  Grid.Row="1">
            <TextBlock Name="Title" Text="{Binding Path=Title}" Visibility="{Binding TitleVisibility}" FontFamily="Calibri" FontWeight="Bold" Foreground="White" TextWrapping="Wrap" DockPanel.Dock="Top" />
            <Canvas x:Name="DetailsCanvas" Width="{Binding ElementName=DetailsPanel, Path=ActualWidth}" ClipToBounds="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="{Binding ScrollingDetailsVisibility}">
                <controls:ScrollableTextBlock Name="ScrollingDetails" Text="{Binding Path=Details}" FontFamily="Calibri" Foreground="White" TextWrapping="Wrap"
                Width="{Binding ElementName=DetailsCanvas, Path=ActualWidth}" ScrollBeginDelay="10" ScrollSpeed="3" ScrollAutoReverse="True"
                ScrollEndDelay="10" ReverseScrollSpeed="0.5" />
            </Canvas>
            <TextBlock Name="Details" Text="{Binding Path=Details}" FontFamily="Calibri" Foreground="White" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Visibility="{Binding DetailsVisibility}" />
        </DockPanel>
        <DockPanel DockPanel.Dock="Top" Grid.Row="3" HorizontalAlignment="Left">
            <ContentControl Content="Binding" ContentTemplate="{StaticResource ImageTemplate}" />
        </DockPanel>
        <Canvas x:Name="NotesCanvas" Grid.Row="5" ClipToBounds="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="{Binding ScrollingNotesVisibility}">
            <controls:ScrollableTextBlock Name="ScrollingNotes" Text="{Binding Path=Notes}" FontFamily="Calibri" Foreground="White" TextWrapping="Wrap"
                Width="{Binding ElementName=NotesCanvas, Path=ActualWidth}" ScrollBeginDelay="10" ScrollSpeed="3" ScrollAutoReverse="True"
                ScrollEndDelay="10" ReverseScrollSpeed="0.5" ScrollDirection="Up" />
        </Canvas>
        <TextBlock Name="Notes" Grid.Row="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Text="{Binding Path=Notes}" FontFamily="Calibri" Foreground="White" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Visibility="{Binding NotesVisibility}" />
    </Grid>
</UserControl>

Per the Documentation PDF, SelectedGame.Rating binding path should return the value of "PG-13", which is what I have as the game rating, but doesn't seem to be as the image is not displaying.  What would the correct binding path be to return the text value of the game rating?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...