Skip to content

Instantly share code, notes, and snippets.

@jlhawn
Created January 16, 2024 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlhawn/6b6250196140695effc6598cb44bb7eb to your computer and use it in GitHub Desktop.
Save jlhawn/6b6250196140695effc6598cb44bb7eb to your computer and use it in GitHub Desktop.
BG3 Books as Scrolls
<ResourceDictionary 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:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions"
xmlns:ls="clr-namespace:ls;assembly=SharedGUI"
xmlns:System="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d">
<!-- GnomishAparratusOfLessSquinting
Place custom fonts into .\Baldurs Gate 3\Data\Public\Game\GUI\Assets\Fonts\Replacers\
#Black Gohan = Black Gohan.otf, #Aller = Aller.ttf etc.
If a Mod uses a custom DefaultFont use this to restore it to vanilla (or delete Keyboard.Fonts.xaml):
pack://application:,,,/GustavNoesisGUI;component/Assets/Fonts/QuadraatOffcPro/#Quadraat Offc Pro
Mods like Easier Text use Alegreya Sans as DefaultFont you can set it here with this string:
pack://application:,,,/GustavNoesisGUI;component/Assets/Fonts/AlegreyaSans/#Alegreya Sans
-->
<!-- SETTING CUSTOM FONTS: !IF FONTS DONT EXIST OR TYPO & YOU ENABLED THESE YOULL GET BLANK PAGES! -->
<!--
<FontFamily x:Key="BookPageStyleFont">/Assets/Fonts/Replacers/#BookinsanityRemakeRegular</FontFamily>
<FontFamily x:Key="PaperSheetBookPageFont">/Assets/Fonts/Replacers/#BookinsanityRemakeItalic</FontFamily>
<FontFamily x:Key="TabletBookPageFont">/Assets/Fonts/Replacers/#ScalySansRemakeRegular</FontFamily>
<FontFamily x:Key="GithDiscBookFont">/Assets/Fonts/Replacers/#ScalySansRemakeRegular</FontFamily>
-->
<!-- /GnomishAparratusOfLessSquinting -->
<!-- <BitmapImage x:Key="DefaultBookBackground" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/Book_BG_B1.png" /> -->
<BitmapImage x:Key="DefaultBookBackground" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/paper_Sheet.png" />
<BitmapImage x:Key="PaperSheetBackground" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/paper_Sheet.png" />
<BitmapImage x:Key="PaperStackBackground" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/paper_Stack.png" />
<BitmapImage x:Key="ScrollABackground" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/scroll_A_bg.png" />
<BitmapImage x:Key="ScrollBBackground" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/scroll_B_bg.png" />
<BitmapImage x:Key="TabletABackground" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/tablet_A_bg.png" />
<BitmapImage x:Key="TabletBBackground" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/tablet_B_bg.png" />
<BitmapImage x:Key="TabletCBackground" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/tablet_C_bg.png" />
<BitmapImage x:Key="GithDiscBackground" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/gith_disc_bg.png" />
<!-- <BitmapImage x:Key="PageTabBackground" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/Book_BG_tab.png" /> -->
<BitmapImage x:Key="MainPaneVignette" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Shared/mainpane_vignette.png" />
<BitmapImage x:Key="FakeTextImage" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/Gazette_faux_text.png"/>
<BitmapImage x:Key="DarkScrollButtonHighlighted" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Scrollbars/scroll_btn_dark_h.png"/>
<BitmapImage x:Key="DarkScrollButtonDefault" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Scrollbars/scroll_btn_dark_d.png"/>
<System:Double x:Key="FakeTextLineHeight">20</System:Double>
<System:String x:Key="IllustrationPath">Assets/Book/GazetteIllustrations/</System:String>
<Storyboard x:Key="OpenBookViewerAnim" >
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="BookViewerHolder" >
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1">
<EasingDoubleKeyFrame.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="BookContentHolder" >
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1">
<EasingDoubleKeyFrame.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimation
Storyboard.TargetName="BookContentTransform"
Storyboard.TargetProperty="(ScaleTransform.ScaleX)"
From="0.3"
To="1"
Duration="0:0:0.1">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation
Storyboard.TargetName="BookContentTransform"
Storyboard.TargetProperty="(ScaleTransform.ScaleY)"
From="0.3"
To="1"
Duration="0:0:0.1">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
<Style x:Key="BookPageStyle" TargetType="ls:LSBookPage" >
<Setter Property="Width" Value="200"/>
<Setter Property="Foreground" Value="{StaticResource LS_tint00}"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="TextAlignment" Value="Justify"/>
<!-- <Setter Property="FontFamily" Value="Comic Sans MS"/> -->
<Setter Property="FontSize" Value="{StaticResource ScaledDefaultFontSize}"/>
<Setter Property="LineHeight" Value="{StaticResource ScaledDefaultFontSizeLineHeight}"/>
<Setter Property="FontWeight" Value="Regular"/>
<!-- <Setter Property="LineStackingStrategy" Value="MaxHeight"/> -->
<Setter Property="IsHitTestVisible" Value="False"/>
</Style>
<Style x:Key="PaperSheetBookPageStyle" TargetType="ls:LSBookPage" BasedOn="{StaticResource BookPageStyle}">
<Setter Property="Width" Value="980"/>
<!-- <Setter Property="FontFamily" Value="{StaticResource PaperSheetBookPageFont}"/> -->
<!-- <Setter Property="FontSize" Value="{StaticResource ScaledLargeFontSize}"/> -->
<Setter Property="FontSize" Value="{StaticResource ScaledDefaultFontSize}"/>
<Setter Property="LineHeight" Value="{StaticResource ScaledLargeFontSizeLineHeight}"/>
<Setter Property="FontWeight" Value="Regular"/>
</Style>
<Style x:Key="TabletBookPageStyle" TargetType="ls:LSBookPage" BasedOn="{StaticResource BookPageStyle}">
<Setter Property="Width" Value="980"/>
<Setter Property="FontFamily" Value="{StaticResource TabletBookPageFont}"/>
<Setter Property="FontSize" Value="{StaticResource ScaledLargeFontSize}"/>
<Setter Property="LineHeight" Value="{StaticResource ScaledLargeFontSizeLineHeight}"/>
<Setter Property="FontWeight" Value="Regular"/>
</Style>
<Style x:Key="GithDiscBookPageStyle" TargetType="ls:LSBookPage" BasedOn="{StaticResource BookPageStyle}">
<Setter Property="Width" Value="920"/>
<Setter Property="Foreground" Value="{StaticResource LS_tint100}"/>
<Setter Property="FontFamily" Value="{StaticResource GithDiscBookFont}"/>
<Setter Property="FontSize" Value="{StaticResource ScaledLargeFontSize}"/>
<Setter Property="LineHeight" Value="{StaticResource ScaledLargeFontSizeLineHeight}"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Regular"/>
</Style>
<Style x:Key="ScrollViewerBookStyle" TargetType="ScrollViewer" BasedOn="{StaticResource {x:Type ScrollViewer}}">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Top"/>
</Style>
<Style x:Key="LSScrollViewerBookStyle" TargetType="ls:LSScrollViewer" BasedOn="{StaticResource {x:Type ScrollViewer}}">
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
</Style>
<Style x:Key="PageScrollBarDownButtonVertical" TargetType="{x:Type ls:LSRepeatButton}" BasedOn="{StaticResource BaseScrollBarDownButtonVertical}">
<Style.Resources>
<ImageSource x:Key="DownButton" >pack://application:,,,/GustavNoesisGUI;component/Assets/Scrollbars/scroll_dark_down_d.png</ImageSource>
<ImageSource x:Key="HoverDownButton" >pack://application:,,,/GustavNoesisGUI;component/Assets/Scrollbars/scroll_dark_down_h.png</ImageSource>
<ImageSource x:Key="PressedDownButton" >pack://application:,,,/GustavNoesisGUI;component/Assets/Scrollbars/scroll_dark_down_h.png</ImageSource>
<ImageSource x:Key="DisabledDownButton" >pack://application:,,,/GustavNoesisGUI;component/Assets/Scrollbars/scroll_dark_down_d.png</ImageSource>
</Style.Resources>
</Style>
<Style x:Key="PageScrollBarUpButtonVertical" TargetType="{x:Type ls:LSRepeatButton}" BasedOn="{StaticResource BaseScrollBarUpButtonVertical}">
<Style.Resources>
<ImageSource x:Key="UpButton" >pack://application:,,,/GustavNoesisGUI;component/Assets/Scrollbars/scroll_dark_up_d.png</ImageSource>
<ImageSource x:Key="HoverUpButton" >pack://application:,,,/GustavNoesisGUI;component/Assets/Scrollbars/scroll_dark_up_h.png</ImageSource>
<ImageSource x:Key="PressedUpButton" >pack://application:,,,/GustavNoesisGUI;component/Assets/Scrollbars/scroll_dark_up_h.png</ImageSource>
<ImageSource x:Key="DisabledUpButton">pack://application:,,,/GustavNoesisGUI;component/Assets/Scrollbars/scroll_dark_up_d.png</ImageSource>
</Style.Resources>
</Style>
<Style x:Key="PageScrollThumb" TargetType="ls:LSThumb" BasedOn="{StaticResource GoldScrollThumb}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ls:LSThumb">
<ls:LSNineSliceImage x:Name="Thumb" ImageSource="{StaticResource DarkScrollButtonDefault}" Slices="10,6,10,6" Width="20" Height="{TemplateBinding Height}" MinHeight="{TemplateBinding MinHeight}"/>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Thumb" Property="ImageSource" Value="{StaticResource DarkScrollButtonHighlighted}"/>
</Trigger>
<Trigger Property="IsDragging" Value="True">
<Setter TargetName="Thumb" Property="ImageSource" Value="{StaticResource DarkScrollButtonHighlighted}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DarkScrollBar" TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource GoldScrollBar}">
<Style.Triggers>
<Trigger Property="Orientation" Value="Vertical">
<Setter Property="MinWidth" Value="28"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Grid.RowSpan="3" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"/>
<ls:LSRepeatButton Grid.Row="0" Style="{StaticResource PageScrollBarUpButtonVertical}" Command="ScrollBar.LineUpCommand"/>
<Track Grid.Row="1" x:Name="PART_Track" ViewportSize="{TemplateBinding ViewportSize}" IsDirectionReversed="True" IsEnabled="{TemplateBinding IsMouseOver}" Margin="0,4,0,4">
<Track.DecreaseRepeatButton>
<ls:LSRepeatButton x:Name="DecreaseBtn" Command="ScrollBar.PageUpCommand" Style="{StaticResource ScrollBarPageButton}"/>
</Track.DecreaseRepeatButton>
<Track.Thumb>
<ls:LSThumb x:Name="Thumb" VerticalAlignment="Top" Style="{StaticResource PageScrollThumb}">
<ls:LSThumb.Height>
<MultiBinding Converter="{StaticResource AddMultipleConverter}">
<Binding Path="ActualHeight" ElementName="PART_Track"/>
<Binding Path="ActualHeight" ElementName="DecreaseBtn" Converter="{StaticResource MultiplierConverter}" ConverterParameter="-1"/>
<Binding Path="ActualHeight" ElementName="IncreaseBtn" Converter="{StaticResource MultiplierConverter}" ConverterParameter="-1"/>
</MultiBinding>
</ls:LSThumb.Height>
</ls:LSThumb>
</Track.Thumb>
<Track.IncreaseRepeatButton>
<ls:LSRepeatButton x:Name="IncreaseBtn" Command="ScrollBar.PageDownCommand" Style="{StaticResource ScrollBarPageButton}"/>
</Track.IncreaseRepeatButton>
</Track>
<ls:LSRepeatButton Grid.Row="2" Style="{StaticResource PageScrollBarDownButtonVertical}" Command="ScrollBar.LineDownCommand"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<ControlTemplate x:Key="BookScrollViewerTemplate" TargetType="{x:Type ls:LSScrollViewer}">
<Grid Background="Transparent">
<ScrollBar Name="PART_VerticalScrollBar" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0"
ViewportSize="{TemplateBinding ViewportHeight}" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" HorizontalAlignment="Right"
BorderBrush="Transparent" Margin="{TemplateBinding Padding}"/>
<ScrollContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
CanContentScroll="{TemplateBinding CanContentScroll}"/>
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="PaperSheetBookTemplate" TargetType="ls:LSBook">
<Grid>
<Grid.Resources>
<Style TargetType="ls:LSScrollViewer" BasedOn="{StaticResource LSScrollViewerBookStyle}">
<Setter Property="Height" Value="1200"/>
<Setter Property="MinHeight" Value="1200"/>
</Style>
<Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource DarkScrollBar}"/>
</Grid.Resources>
<ls:LSScrollViewer x:Name="PART_LeftScroller">
<ls:LSBookPage x:Name="PART_LeftPage" Style="{StaticResource PaperSheetBookPageStyle}"/>
</ls:LSScrollViewer>
<ls:LSScrollViewer x:Name="PART_RightScroller" HorizontalAlignment="Center" Template="{StaticResource BookScrollViewerTemplate}" BoundScrollUpEvent="UIScrollUp" BoundScrollDownEvent="UIScrollDown">
<Border BorderThickness="1" BorderBrush="Transparent" Margin="0,0,80,0" HorizontalAlignment="Center">
<ls:LSBookPage x:Name="PART_RightPage" Style="{StaticResource PaperSheetBookPageStyle}"/>
</Border>
</ls:LSScrollViewer>
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="ScrollBookTemplate" TargetType="ls:LSBook">
<Grid>
<Grid.Resources>
<Style TargetType="ls:LSScrollViewer" BasedOn="{StaticResource LSScrollViewerBookStyle}">
<Setter Property="Height" Value="1100"/>
<Setter Property="MinHeight" Value="1100"/>
</Style>
<Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource DarkScrollBar}"/>
</Grid.Resources>
<ls:LSScrollViewer x:Name="PART_LeftScroller">
<ls:LSBookPage x:Name="PART_LeftPage" Style="{StaticResource PaperSheetBookPageStyle}"/>
</ls:LSScrollViewer>
<ls:LSScrollViewer x:Name="PART_RightScroller" Margin="0,180" HorizontalAlignment="Center" Template="{StaticResource BookScrollViewerTemplate}" BoundScrollUpEvent="UIScrollUp" BoundScrollDownEvent="UIScrollDown">
<Border BorderThickness="1" BorderBrush="Transparent" Margin="0,0,80,0" HorizontalAlignment="Center">
<ls:LSBookPage x:Name="PART_RightPage" Style="{StaticResource PaperSheetBookPageStyle}"/>
</Border>
</ls:LSScrollViewer>
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="TabletBookTemplate" TargetType="ls:LSBook">
<Grid>
<Grid.Resources>
<Style TargetType="ls:LSScrollViewer" BasedOn="{StaticResource LSScrollViewerBookStyle}">
<Setter Property="Height" Value="1000"/>
<Setter Property="MinHeight" Value="1000"/>
</Style>
<Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource DarkScrollBar}"/>
</Grid.Resources>
<ls:LSScrollViewer x:Name="PART_LeftScroller">
<ls:LSBookPage x:Name="PART_LeftPage" Style="{StaticResource TabletBookPageStyle}"/>
</ls:LSScrollViewer>
<ls:LSScrollViewer x:Name="PART_RightScroller" Margin="0,180" HorizontalAlignment="Center" Template="{StaticResource BookScrollViewerTemplate}" BoundScrollUpEvent="UIScrollUp" BoundScrollDownEvent="UIScrollDown">
<Border BorderThickness="1" BorderBrush="Transparent" Margin="50,0,100,0" HorizontalAlignment="Left">
<ls:LSBookPage x:Name="PART_RightPage" Style="{StaticResource TabletBookPageStyle}"/>
</Border>
</ls:LSScrollViewer>
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="GithDiscBookTemplate" TargetType="ls:LSBook">
<Grid Height="1200" Width="1200" Margin="0,-120,0,140">
<Grid.Resources>
<Style TargetType="ls:LSScrollViewer" BasedOn="{StaticResource LSScrollViewerBookStyle}">
<Setter Property="MaxHeight" Value="750"/>
<Setter Property="MinHeight" Value="750"/>
</Style>
</Grid.Resources>
<ls:LSScrollViewer x:Name="PART_LeftScroller" HorizontalAlignment="Center" VerticalAlignment="Center">
<ls:LSBookPage x:Name="PART_LeftPage" Style="{StaticResource GithDiscBookPageStyle}"/>
</ls:LSScrollViewer>
<ls:LSScrollViewer x:Name="PART_RightScroller" Margin="50,0,0,140" HorizontalAlignment="Center" VerticalAlignment="Center" Template="{StaticResource BookScrollViewerTemplate}"
BoundScrollUpEvent="UIScrollUp" BoundScrollDownEvent="UIScrollDown" Padding="0,50,0,50">
<Border BorderThickness="1" BorderBrush="Transparent" Margin="0,0,50,0" HorizontalAlignment="Left">
<ls:LSBookPage x:Name="PART_RightPage" Style="{StaticResource GithDiscBookPageStyle}" Margin="0,50">
<ls:LSBookPage.Effect>
<DropShadowEffect BlurRadius="8" ShadowDepth="5" Opacity="1" Color="{StaticResource barMagicColor}"/>
</ls:LSBookPage.Effect>
</ls:LSBookPage>
</Border>
<ls:LSScrollViewer.OpacityMask>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#00FFFFFF" Offset="0"/>
<GradientStop Color="#FFFFFFFF" Offset="0.1"/>
<GradientStop Color="#FFFFFFFF" Offset="0.9"/>
<GradientStop Color="#00FFFFFF" Offset="1"/>
</LinearGradientBrush>
</ls:LSScrollViewer.OpacityMask>
</ls:LSScrollViewer>
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding Data.UIInputMethod}" Value="Controller">
<Setter TargetName="PART_RightScroller" Property="Padding" Value="0,150,0,50"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!-- <ControlTemplate x:Key="DefaultBookTemplate" TargetType="ls:LSBook">
<Grid>
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="{StaticResource ScaledLargeFontSize}"/>
<Setter Property="LineHeight" Value="{StaticResource ScaledLargeFontSizeLineHeight}"/>
<Setter Property="Foreground" Value="{StaticResource LS_tint00}"/>
<Setter Property="IsHitTestVisible" Value="False"/>
</Style>
<Style TargetType="ls:LSBookPage" BasedOn="{StaticResource BookPageStyle}">
<Setter Property="Width" Value="850"/>
<Setter Property="TextAlignment" Value="Left"/>
<Setter Property="FontSize" Value="{StaticResource ScaledLargeFontSize}"/>
<Setter Property="LineHeight" Value="{StaticResource ScaledLargeFontSizeLineHeight}"/>
</Style>
<Style TargetType="ScrollViewer" BasedOn="{StaticResource ScrollViewerBookStyle}">
<Setter Property="Height" Value="1060"/>
<Setter Property="IsHitTestVisible" Value="False"/>
</Style>
<Style TargetType="ls:LSButton" BasedOn="{StaticResource {x:Type ls:LSButton}}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Style.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
</Trigger>
</Style.Triggers>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ScrollViewer Grid.Column="0" x:Name="PART_LeftScroller" Margin="0,52,0,0" VerticalScrollBarVisibility="Hidden">
<ls:LSBookPage x:Name="PART_LeftPage"/>
</ScrollViewer>
<ScrollViewer Grid.Column="1" x:Name="PART_RightScroller" Margin="0,52,0,0" VerticalScrollBarVisibility="Hidden">
<ls:LSBookPage x:Name="PART_RightPage"/>
</ScrollViewer>
<TextBlock Grid.Column="0" x:Name="LeftPageNumber" Text="{Binding LeftNumber, RelativeSource={RelativeSource AncestorType={x:Type ls:LSBook}}}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="95,0,0,30"/>
<TextBlock Grid.Column="1" x:Name="RighPageNumber" Text="{Binding RightNumber, RelativeSource={RelativeSource AncestorType={x:Type ls:LSBook}}}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,90,30"/>
<ls:LSButton Grid.Column="0" Command="ls:LSBook.PrevPageCommand" BoundEvent="{Binding IEventID}" DataContext="{Binding CurrentPlayer.UIData.InputEvents, Converter={StaticResource FindInputEventConverter}, ConverterParameter='UILeft'}" IsEnabled="{Binding HasPrevPage, RelativeSource={RelativeSource AncestorType={x:Type ls:LSBook}}}"/>
<ls:LSButton Grid.Column="1" Command="ls:LSBook.NextPageCommand" BoundEvent="{Binding IEventID}" DataContext="{Binding CurrentPlayer.UIData.InputEvents, Converter={StaticResource FindInputEventConverter}, ConverterParameter='UIRight'}" IsEnabled="{Binding HasNextPage, RelativeSource={RelativeSource AncestorType={x:Type ls:LSBook}}}"/>
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding DataContext.Data.UIInputMethod, RelativeSource={RelativeSource AncestorType={x:Type ls:UIWidget}}}" Value="Controller">
<Setter TargetName="PART_LeftScroller" Property="Margin" Value="0,24,50,0"/>
<Setter TargetName="PART_RightScroller" Property="Margin" Value="0,24,20,0"/>
<Setter TargetName="LeftPageNumber" Property="Margin" Value="75,0,0,52"/>
<Setter TargetName="RighPageNumber" Property="Margin" Value="0,0,70,52"/>
<Setter TargetName="PART_LeftPage" Property="FontSize" Value="{StaticResource ScaledMiniFontSize}"/>
<Setter TargetName="PART_RightPage" Property="FontSize" Value="{StaticResource ScaledMiniFontSize}"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate> -->
<ControlTemplate x:Key="DefaultBookTemplate" TargetType="ls:LSBook">
<Grid>
<Grid.Resources>
<Style TargetType="ls:LSScrollViewer" BasedOn="{StaticResource LSScrollViewerBookStyle}">
<Setter Property="Height" Value="1400"/>
<Setter Property="MinHeight" Value="1400"/>
</Style>
<Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource DarkScrollBar}"/>
</Grid.Resources>
<ls:LSScrollViewer x:Name="PART_LeftScroller">
<ls:LSBookPage x:Name="PART_LeftPage" Style="{StaticResource PaperSheetBookPageStyle}"/>
</ls:LSScrollViewer>
<ls:LSScrollViewer x:Name="PART_RightScroller" HorizontalAlignment="Center" Template="{StaticResource BookScrollViewerTemplate}" BoundScrollUpEvent="UIScrollUp" BoundScrollDownEvent="UIScrollDown">
<Border BorderThickness="1" BorderBrush="Transparent" Margin="0,0,80,0" HorizontalAlignment="Center">
<ls:LSBookPage x:Name="PART_RightPage" Style="{StaticResource PaperSheetBookPageStyle}"/>
</Border>
</ls:LSScrollViewer>
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="GazetteTemplate">
<Grid x:Name="Gazette">
<Image x:Name="Background" Source="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/gazette_bg1_v2.png" Stretch="None" />
<Grid Width="1554" Height="{Binding ActualHeight, ElementName=Background}" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="360"/>
<RowDefinition Height="306"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="410"/>
<RowDefinition Height="160"/>
</Grid.RowDefinitions>
<ls:LSButton Grid.Row="0" Grid.Column="3" x:Name="GazetteCloseBtn" HorizontalAlignment="Right" VerticalAlignment="Top" Template="{StaticResource IconButtonTemplate}" Command="{Binding CustomEvent}" CommandParameter="CloseWidget" SoundID="UI_HUD_Options_Close" Margin="0,18,-18,0" >
<ls:LSButton.Resources>
<BitmapImage x:Key="ButtonNormal" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Buttons/btn_hudNav_d.png"/>
<BitmapImage x:Key="ButtonHighlight" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Buttons/btn_hudNav_h.png" />
<BitmapImage x:Key="ButtonPressed" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Buttons/btn_hudNav_p.png" />
<BitmapImage x:Key="ButtonDisabled" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Buttons/btn_hudNav_disabled.png" />
<BitmapImage x:Key="IconNormal" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Buttons/ico_btn_cross_d.png" />
<BitmapImage x:Key="IconHighlight" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Buttons/ico_btn_cross_h.png" />
<BitmapImage x:Key="IconPressed" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Buttons/ico_btn_cross_d.png" />
<BitmapImage x:Key="IconDisabled" UriSource="pack://application:,,,/GustavNoesisGUI;component/Assets/Buttons/ico_btn_cross_d.png" />
<System:Double x:Key="IconDisabledOpacity">0.7</System:Double>
<System:Double x:Key="IconWidth">64</System:Double>
<System:Double x:Key="IconHeight">64</System:Double>
</ls:LSButton.Resources>
</ls:LSButton>
<!-- Row 0 -->
<TextBlock x:Name="Edition" Text="{Binding Edition, StringFormat={}#{0}}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" Style="{DynamicResource BaseTextStyle}" FontSize="{StaticResource SmallFontSize}" Margin="130,0,0,10"/>
<TextBlock x:Name="Price" Text="2" Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Style="{DynamicResource BaseTextStyle}" FontSize="{StaticResource SmallFontSize}" Margin="0,0,10,10"/>
<!-- Row1 -->
<Image x:Name="Image1" Grid.Row="1" Grid.Column="0" Source="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/gazette_img_top_01.png" Stretch="None" Width="472" Height="272" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="18,20,0,0"/>
<Grid x:Name="Article1Container" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition x:Name="TestRow" Height="*"/>
</Grid.RowDefinitions>
<TextBlock x:Name="Arcticle1Title" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" ls:TextBlockFormatter.SourceText="{Binding Entries[2].Text}" Style="{DynamicResource ArticleStyle}"/>
<Border x:Name="FakeText1Border" Grid.Row="1" Grid.Column="0">
<Image x:Name="FakeText1" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Top">
<b:Interaction.Behaviors>
<ls:RandomizedImageCropBehavior AvailableHeight="{Binding ActualHeight, ElementName=FakeText1Border}" ImageSource="{StaticResource FakeTextImage}" LineStep="{StaticResource FakeTextLineHeight}">
<ls:RandomizedImageCropBehavior.Seed>
<MultiBinding Converter="{StaticResource MultiplierMultiConverter}">
<Binding Path="Edition"/>
<Binding Source="123"/>
</MultiBinding>
</ls:RandomizedImageCropBehavior.Seed>
</ls:RandomizedImageCropBehavior>
</b:Interaction.Behaviors>
</Image>
</Border>
<Border x:Name="FakeText2Border" Grid.Row="1" Grid.Column="1">
<Image x:Name="FakeText2" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Top" >
<b:Interaction.Behaviors>
<ls:RandomizedImageCropBehavior AvailableHeight="{Binding ActualHeight, ElementName=FakeText2Border}" ImageSource="{StaticResource FakeTextImage}" LineStep="{StaticResource FakeTextLineHeight}">
<ls:RandomizedImageCropBehavior.Seed>
<MultiBinding Converter="{StaticResource MultiplierMultiConverter}">
<Binding Path="Edition"/>
<Binding Source="234"/>
</MultiBinding>
</ls:RandomizedImageCropBehavior.Seed>
</ls:RandomizedImageCropBehavior>
</b:Interaction.Behaviors>
</Image>
</Border>
</Grid>
<!-- Row 2 -->
<TextBlock x:Name="MainArticle" ls:TextBlockFormatter.SourceText="{Binding Entries[0].Text}" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Center"
VerticalAlignment="Center" Margin="0,50,0,0" Style="{DynamicResource BaseTextStyle}" FontSize="{StaticResource HumongousFontSize}" TextAlignment="Center"
LineHeight="{StaticResource HumongousFontSizeLineHeight}" LineStackingStrategy="BlockLineHeight"/>
<!-- Row 3 -->
<Image x:Name="Separator" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" Source="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/gazette_pagebreak.png" Stretch="None" Margin="0,0,0,10"/>
<!-- Row 4 -->
<Grid x:Name="Article2Container" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock x:Name="Arcticle2Title" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" ls:TextBlockFormatter.SourceText="{Binding Entries[3].Text}" Style="{DynamicResource ArticleStyle}"/>
<Border x:Name="FakeText3Border" Grid.Row="1" Grid.Column="0">
<Image x:Name="FakeText3" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Top">
<b:Interaction.Behaviors>
<ls:RandomizedImageCropBehavior AvailableHeight="{Binding ActualHeight, ElementName=FakeText3Border}" ImageSource="{StaticResource FakeTextImage}" LineStep="{StaticResource FakeTextLineHeight}">
<ls:RandomizedImageCropBehavior.Seed>
<MultiBinding Converter="{StaticResource MultiplierMultiConverter}">
<Binding Path="Edition"/>
<Binding Source="345"/>
</MultiBinding>
</ls:RandomizedImageCropBehavior.Seed>
</ls:RandomizedImageCropBehavior>
</b:Interaction.Behaviors>
</Image>
</Border>
<Border x:Name="FakeText4Border" Grid.Row="1" Grid.Column="1">
<Image x:Name="FakeText4" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Top">
<b:Interaction.Behaviors>
<ls:RandomizedImageCropBehavior AvailableHeight="{Binding ActualHeight, ElementName=FakeText4Border}" ImageSource="{StaticResource FakeTextImage}" LineStep="{StaticResource FakeTextLineHeight}">
<ls:RandomizedImageCropBehavior.Seed>
<MultiBinding Converter="{StaticResource MultiplierMultiConverter}">
<Binding Path="Edition"/>
<Binding Source="456"/>
</MultiBinding>
</ls:RandomizedImageCropBehavior.Seed>
</ls:RandomizedImageCropBehavior>
</b:Interaction.Behaviors>
</Image>
</Border>
</Grid>
<Grid x:Name="Article3Container" Grid.Row="4" Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock x:Name="SmallArticle3" Grid.Row="0" ls:TextBlockFormatter.SourceText="{Binding Entries[4].Text}" Style="{DynamicResource ArticleStyle}"/>
<Border x:Name="FakeText5Border" Grid.Row="1">
<Image x:Name="FakeText5" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Top">
<b:Interaction.Behaviors>
<ls:RandomizedImageCropBehavior AvailableHeight="{Binding ActualHeight, ElementName=FakeText5Border}" ImageSource="{StaticResource FakeTextImage}" LineStep="{StaticResource FakeTextLineHeight}">
<ls:RandomizedImageCropBehavior.Seed>
<MultiBinding Converter="{StaticResource MultiplierMultiConverter}">
<Binding Path="Edition"/>
<Binding Source="567"/>
</MultiBinding>
</ls:RandomizedImageCropBehavior.Seed>
</ls:RandomizedImageCropBehavior>
</b:Interaction.Behaviors>
</Image>
</Border>
</Grid>
<!-- Row 5 -->
<Grid x:Name="Article4Container" Grid.Row="5" Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock x:Name="SmallArticle4" Grid.Row="0" ls:TextBlockFormatter.SourceText="{Binding Entries[5].Text}" Style="{DynamicResource ArticleStyle}"/>
<Border x:Name="FakeText6Border" Grid.Row="1">
<Image x:Name="FakeText6" Grid.Row="1" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Top">
<b:Interaction.Behaviors>
<ls:RandomizedImageCropBehavior AvailableHeight="{Binding ActualHeight, ElementName=FakeText6Border}" ImageSource="{StaticResource FakeTextImage}" LineStep="{StaticResource FakeTextLineHeight}">
<ls:RandomizedImageCropBehavior.Seed>
<MultiBinding Converter="{StaticResource MultiplierMultiConverter}">
<Binding Path="Edition"/>
<Binding Source="678"/>
</MultiBinding>
</ls:RandomizedImageCropBehavior.Seed>
</ls:RandomizedImageCropBehavior>
</b:Interaction.Behaviors>
</Image>
</Border>
</Grid>
<Image x:Name="Image2" Grid.Row="5" Grid.Column="1" Source="pack://application:,,,/GustavNoesisGUI;component/Assets/Book/gazette_img_bottom_01.png" Stretch="None" Width="484" Height="370" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,10,0,10"/>
<Grid x:Name="Article5Container" Grid.Row="5" Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock x:Name="SmallArticle5" Grid.Row="0" ls:TextBlockFormatter.SourceText="{Binding Entries[6].Text}" Style="{DynamicResource ArticleStyle}"/>
<Border x:Name="FakeText7Border" Grid.Row="1">
<Image x:Name="FakeText7" Grid.Row="1" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Top">
<b:Interaction.Behaviors>
<ls:RandomizedImageCropBehavior AvailableHeight="{Binding ActualHeight, ElementName=FakeText7Border}" ImageSource="{StaticResource FakeTextImage}" LineStep="{StaticResource FakeTextLineHeight}">
<ls:RandomizedImageCropBehavior.Seed>
<MultiBinding Converter="{StaticResource MultiplierMultiConverter}">
<Binding Path="Edition"/>
<Binding Source="789"/>
</MultiBinding>
</ls:RandomizedImageCropBehavior.Seed>
</ls:RandomizedImageCropBehavior>
</b:Interaction.Behaviors>
</Image>
</Border>
</Grid>
<!-- Row 6 -->
<TextBlock x:Name="Footer" ls:TextBlockFormatter.SourceText="{Binding Entries[1].Text}" Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Center" VerticalAlignment="Center"
Style="{DynamicResource BaseTextStyle}" Margin="0,0,0,26" TextAlignment="Center" LineStackingStrategy="BlockLineHeight" LineHeight="{StaticResource ScaledDefaultFontSizeLineHeight}"/>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding Data.UIInputMethod}" Value="Controller">
<Setter TargetName="GazetteCloseBtn" Property="Visibility" Value="Collapsed"/>
<Setter TargetName="MainArticle" Property="FontSize" Value="{StaticResource MassiveFontSize}"/>
<Setter TargetName="MainArticle" Property="LineHeight" Value="{StaticResource TitleFontSizeLineHeight}"/>
<Setter TargetName="Footer" Property="FontSize" Value="{StaticResource DefaultFontSize}"/>
<Setter TargetName="Footer" Property="LineHeight" Value="{StaticResource DefaultFontSizeLineHeight}"/>
</DataTrigger>
<DataTrigger Binding="{Binding IllustrationNames.Count, Converter={StaticResource GreaterThanConverter}, ConverterParameter=0}" Value="True">
<Setter TargetName="Image1" Property="Source">
<Setter.Value>
<MultiBinding Converter="{StaticResource IconIdToSourceConverter}" ConverterParameter="Assets/Book/gazette_img_top_01.png">
<Binding Source="{StaticResource IllustrationPath}"/>
<Binding Path="IllustrationNames[0].Line"/>
</MultiBinding>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IllustrationNames.Count, Converter={StaticResource GreaterThanConverter}, ConverterParameter=1}" Value="True">
<Setter TargetName="Image2" Property="Source">
<Setter.Value>
<MultiBinding Converter="{StaticResource IconIdToSourceConverter}" ConverterParameter="Assets/Book/gazette_img_bottom_01.png">
<Binding Source="{StaticResource IllustrationPath}"/>
<Binding Path="IllustrationNames[1].Line"/>
</MultiBinding>
</Setter.Value>
</Setter>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ResourceDictionary>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment