Skip to content

Commit

Permalink
Add a section for custom effect
Browse files Browse the repository at this point in the history
  • Loading branch information
tcfshcrw committed Jul 17, 2024
1 parent 2ebfb24 commit 4e3ba97
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 23 deletions.
123 changes: 103 additions & 20 deletions SimHubPlugin/SettingsControlDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
xmlns:styles="clr-namespace:SimHub.Plugins.Styles;assembly=SimHub.Plugins" mc:Ignorable="d"
xmlns:ui="clr-namespace:SimHub.Plugins.UI;assembly=SimHub.Plugins"
xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
Height="900" Width="1050">
Height="900" Width="1110">


<UserControl.Resources>
Expand All @@ -31,7 +31,7 @@
<Grid SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding BorderThickness}" RadiusX="0" RadiusY="0"/>
<Rectangle x:Name="DisabledVisualElement" Fill="{DynamicResource DisabledWhiteBrush}" IsHitTestVisible="false" Opacity="0"/>

</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsDragging" Value="True">
Expand Down Expand Up @@ -326,7 +326,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="175"/>
<ColumnDefinition Width="545"/>
<ColumnDefinition Width="300"/>
<ColumnDefinition Width="360"/>
<ColumnDefinition Width="440"/>

</Grid.ColumnDefinitions>
Expand Down Expand Up @@ -390,7 +390,7 @@



<Canvas x:Name="canvas_Header_Tab" Height="6" Width="725" Background="#00333333" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Left" Grid.Row="2" >
<Canvas x:Name="canvas_Header_Tab" Height="6" Width="725" Background="#00333333" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Left" Grid.Row="2" Grid.ColumnSpan="3" Margin="0,1,0,1" >
<Canvas.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1"/>
Expand Down Expand Up @@ -654,15 +654,15 @@


</Canvas>

<StackPanel Width="50" Height="230" Margin="10,-10,0,0">
<Label x:Name="Label_max_force" Width="50" Height="20" Foreground="White" RenderTransformOrigin="0.5,0.5" Canvas.Top="3" FontSize="8" FontFamily="Arial Black" Canvas.Left="5" HorizontalAlignment="Left" VerticalAlignment="Top" Content="Min" Padding="0,0,0,0" Margin="0,-5,0,0"/>
<controls:RangeSlider x:Name="Rangeslider_force_range" Style="{DynamicResource RangeSliderStyle}" MinRangeWidth="1" Grid.Column="2" Height="180" LowerValueChanged="Rangeslider_force_range_LowerValueChanged" UpperValueChanged="Rangeslider_force_range_UpperValueChanged" MinRange="1" SmallChange="1" IsSnapToTickEnabled="True" LowerValue="10" UpperValue="30" Width="20" Orientation="Vertical" Maximum="200" HorizontalAlignment="Left" LargeChange="10"/>
<Label x:Name="Label_min_force" Width="50" Height="20" Foreground="White" RenderTransformOrigin="0.5,0.5" Canvas.Top="3" FontSize="8" FontFamily="Arial Black" Canvas.Left="5" HorizontalAlignment="Left" VerticalAlignment="Top" Content="Min" Padding="0,0,0,0"/>
</StackPanel>
</StackPanel>


<StackPanel Width="430" Height="40" Orientation="Horizontal" Margin="0,-10,0,0">
<Label x:Name="Label_min_pos" Width="30" Height="40" Foreground="White" RenderTransformOrigin="0.5,0.5" Canvas.Top="3" FontSize="8" FontFamily="Arial Black" Canvas.Left="5" HorizontalAlignment="Left" VerticalAlignment="Top" Content="Min" Padding="0,0,0,0" HorizontalContentAlignment="Center"/>
<controls:RangeSlider x:Name="Rangeslider_travel_range" Style="{DynamicResource RangeSliderStyle}" MinRangeWidth="1" Grid.Column="2" Height="20" LowerValueChanged="Rangeslider_travel_range_LowerValueChanged" UpperValueChanged="Rangeslider_travel_range_UpperValueChanged" MinRange="1" SmallChange="1" IsSnapToTickEnabled="True" UpperValue="30" Width="370" VerticalAlignment="Top"/>
Expand Down Expand Up @@ -773,7 +773,7 @@

</TabControl>

<StackPanel HorizontalAlignment="Center" Height="580" Grid.Row="3" VerticalAlignment="Top" Width="168" Grid.RowSpan="5">
<StackPanel HorizontalAlignment="Center" Height="580" Grid.Row="3" VerticalAlignment="Top" Width="168" Grid.RowSpan="3">

<Border Background="#7F4E4E4E" Height="391" CornerRadius="5,5,5,5" BorderThickness="0,0,0,0" Width="168" HorizontalAlignment="Center" >
<StackPanel HorizontalAlignment="Center" Height="381" VerticalAlignment="Top" Width="160" Margin="0,5,0,0">
Expand Down Expand Up @@ -830,7 +830,7 @@
</StackPanel>
</Border>
</StackPanel>
<Border x:Name="debug_border" Background="#7F4E4E4E" Height="268" CornerRadius="5,5,5,5" BorderThickness="0,0,0,0" Width="168" HorizontalAlignment="Center" Margin="0,5,0,0" Grid.Row="5" Grid.RowSpan="3" VerticalAlignment="Top" >
<Border x:Name="debug_border" Background="#7F4E4E4E" Height="268" CornerRadius="5,5,5,5" BorderThickness="0,0,0,0" Width="168" HorizontalAlignment="Center" Grid.Row="5" VerticalAlignment="Center" >
<StackPanel HorizontalAlignment="Left" Height="268" Grid.Row="4" VerticalAlignment="Top" Width="168" Grid.RowSpan="3">
<Label x:Name="debug_label_text" Content="Advanced Area" Height="20" Width="150" Padding="0,0,0,0" VerticalContentAlignment="Center" FontFamily="Arial Black" HorizontalAlignment="Left" FontSize="10" Margin="5,0,0,0"/>
<StackPanel x:Name="text_debug_flag" Height="20" Width="150" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
Expand Down Expand Up @@ -938,7 +938,7 @@
</StackPanel>

</StackPanel>

<StackPanel Width="400" Height="40">
<StackPanel Width="400" Height="20" Orientation="Horizontal">
<Label x:Name="label_ABS_AMP" Width="150" Foreground="White" RenderTransformOrigin="0.5,0.5" Canvas.Top="3" FontSize="8" FontFamily="Arial Black" Canvas.Left="5" HorizontalAlignment="Left" VerticalAlignment="Top" Content="ABS/TC Amplitude:" Height="10" Padding="0,0,0,0"/>
Expand Down Expand Up @@ -979,8 +979,8 @@


</StackPanel>


<StackPanel Width="400" Height="40">
<StackPanel Width="400" Height="20" Orientation="Horizontal">
<Label x:Name="label_RPM_AMP" Width="150" Foreground="White" RenderTransformOrigin="0.5,0.5" Canvas.Top="3" FontSize="8" FontFamily="Arial Black" Canvas.Left="5" HorizontalAlignment="Left" VerticalAlignment="Top" Content="Effect Amplitude:" Height="10" Padding="0,0,0,0"/>
Expand Down Expand Up @@ -1017,7 +1017,7 @@
<Polyline x:Name="Polyline_plot_BP" Height="50" Width="400" Points="0,25 80,25 160,25 240,25 320,25 400,25" Stroke="{DynamicResource AccentColorBrush}" Opacity="0.7" HorizontalAlignment="Left" VerticalAlignment="Center" StrokeThickness="2" />

</Canvas>

<StackPanel Width="400" Height="40">
<StackPanel Width="400" Height="20" Orientation="Horizontal">
<Label x:Name="label_BP_AMP" Width="150" Foreground="White" RenderTransformOrigin="0.5,0.5" Canvas.Top="3" FontSize="8" FontFamily="Arial Black" Canvas.Left="5" HorizontalAlignment="Left" VerticalAlignment="Top" Content="Bite Point Amplitude:" Height="10" Padding="0,0,0,0"/>
Expand Down Expand Up @@ -1130,7 +1130,7 @@
<styles:SHButtonPrimary x:Name="Bind_Impacteffect" Click="Bind_Impacteffect_Click" Width="30" Content="Bind" Height="20" Margin="0,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="0,0,0,0" VerticalContentAlignment="Center" FontFamily="Arial" FontSize="10" MinHeight="20" />
<styles:SHButtonPrimary x:Name="Clear_Impacteffect" Click="Clear_Impacteffect_Click" Width="30" Content="Clear" Height="20" Margin="2,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="0,0,0,0" VerticalContentAlignment="Center" FontFamily="Arial" FontSize="10" MinHeight="20" />
</StackPanel>

<StackPanel Width="400" Height="40">
<StackPanel Width="400" Height="20" Orientation="Horizontal">
<Label x:Name="label_impact_multi" Width="150" Foreground="White" RenderTransformOrigin="0.5,0.5" Canvas.Top="3" FontSize="8" FontFamily="Arial Black" Canvas.Left="5" HorizontalAlignment="Left" VerticalAlignment="Top" Content="Impact Multiplier:" Height="10" Padding="0,0,0,0"/>
Expand All @@ -1152,7 +1152,7 @@


</TabControl>
<TabControl Grid.Column="1" HorizontalAlignment="Left" Height="222" Grid.Row="4" VerticalAlignment="Top" Width="540" Padding="0,0,0,0" BorderThickness="0,0,0,0" Background="#00252525" Foreground="Transparent" Margin="0,2,0,0" Grid.RowSpan="2">
<TabControl Grid.Column="1" HorizontalAlignment="Left" Height="222" Grid.Row="4" VerticalAlignment="Center" Width="540" Padding="0,0,0,0" BorderThickness="0,0,0,0" Background="#00252525" Foreground="Transparent">
<TabControl.Resources>
<Style TargetType="TabItem">
<Setter Property="Template">
Expand Down Expand Up @@ -1230,7 +1230,7 @@
</StackPanel>
<Slider x:Name="Slider_damping" Style="{DynamicResource SliderStyle_single_H}" HorizontalAlignment="Left" Grid.Row="1" VerticalAlignment="Top" Width="400" Height="10" Maximum="255" ValueChanged="Slider_damping_ValueChanged" IsSnapToTickEnabled="True" Value="0" SmallChange="1"/>
</StackPanel>



<StackPanel Height="40" Width="540" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Horizontal">
Expand Down Expand Up @@ -1526,17 +1526,100 @@
</TabControl>


<Border x:Name="Border_serial_monitor" Background="#7F4E4E4E" CornerRadius="5,5,5,5" Height="811" BorderThickness="0,0,0,0" Grid.Row="3" Grid.Column="2" Width="300" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.RowSpan="4" >
<StackPanel HorizontalAlignment="Center" Height="807" VerticalAlignment="Top" Width="296">
<StackPanel HorizontalAlignment="Center" Height="25" VerticalAlignment="Top" Width="296" Orientation="Horizontal">
<Border x:Name="Border_serial_monitor" Background="#7F4E4E4E" CornerRadius="5,5,5,5" Height="534" BorderThickness="0,0,0,0" Grid.Row="3" Grid.Column="2" Width="360" HorizontalAlignment="Center" VerticalAlignment="Top" Grid.RowSpan="2" >
<StackPanel HorizontalAlignment="Center" Height="530" VerticalAlignment="Top" Width="356">
<StackPanel HorizontalAlignment="Center" Height="25" VerticalAlignment="Top" Width="356" Orientation="Horizontal">
<Label x:Name="text_serial" Content="Serial Monitor" FontFamily="Arial Black" FontSize="12" Height="25" Width="100" Padding="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" VerticalContentAlignment="Center" Margin="5,0,0,0" />
<styles:SHButtonPrimary x:Name="btn_serial_clear" Click="btn_serial_clear_Click" Width="30" Content="Clear" Height="20" Margin="0,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="0,0,0,0" VerticalContentAlignment="Center" FontFamily="Arial" FontSize="10" MinHeight="20" />

</StackPanel>
<TextBox x:Name="TextBox_serialMonitor" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible" HorizontalAlignment="Left" Grid.Column="2" Grid.Row="2" Grid.RowSpan="4" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="296" Height="782" AutomationProperties.Name="TextBox3" Background="#00252525" BorderBrush="#00CCCCCC" BorderThickness="0,0,0,0" />
<TextBox x:Name="TextBox_serialMonitor" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible" HorizontalAlignment="Left" Grid.Column="2" Grid.Row="2" Grid.RowSpan="4" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="356" Height="505" AutomationProperties.Name="TextBox3" Background="#00252525" BorderBrush="#00CCCCCC" BorderThickness="0,0,0,0" />

</StackPanel>
</Border>
</Grid>
<TabControl x:Name="CustomEffectTab" Grid.Column="2" HorizontalAlignment="Left" Height="272" Grid.Row="5" VerticalAlignment="Center" Width="360" Padding="0,0,0,0" BorderThickness="0,0,0,0" Background="#00252525" Foreground="Transparent">
<TabControl.Resources>
<Style TargetType="TabItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<!--The four values of CornerRadius represent the four corners of the TabItem.-->
<Border Name="Border" BorderThickness="0,0,0,0" BorderBrush="Gainsboro" CornerRadius="5,5,5,5" Margin="0,0,2,0">
<ContentPresenter x:Name="ContentSite"
VerticalAlignment="Center"
HorizontalAlignment="Left"
ContentSource="Header"
Margin="0,0"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="#7F4E4E4E" />
<Setter Property="TextElement.Foreground" Value="#FFFFFFFF" />
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter TargetName="Border" Property="Background" Value="#334E4E4E" />
<Setter Property="TextElement.Foreground" Value="#7FFFFFFF" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" SourceName="Border" Value="True"/>
<Condition Property="IsSelected" Value="False"/>
</MultiTrigger.Conditions>
<Setter TargetName="Border" Property="Background" Value="#4C4E4E4E" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</TabControl.Resources>


<TabItem Width="90" Height="30" Padding="0,0,0,0">
<TabItem.Header>
<Border Width="90" Height="30" Margin="0,0,0,0" >
<Label Content="Custom-1" FontFamily="Arial Black" FontSize="12" Height="30" Width="90" Padding="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" ToolTip="Parameter of the ABS/TC effect " />
</Border>
</TabItem.Header>
<Border Background="#7F4E4E4E" CornerRadius="5,5,5,5" Height="240" BorderThickness="0,2,0,0" >
<StackPanel HorizontalAlignment="Left" Height="240" VerticalAlignment="Top" Width="540">
</StackPanel>
</Border>
</TabItem>
<TabItem Width="90" Height="30" Padding="0,0,0,0">
<TabItem.Header>
<Border Width="90" Height="30" Margin="0,0,0,0" >
<Label Content="Custom-2" FontFamily="Arial Black" FontSize="12" Height="30" Width="90" Padding="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" ToolTip="Parameter of the ABS/TC effect " />
</Border>
</TabItem.Header>
<Border Background="#7F4E4E4E" CornerRadius="5,5,5,5" Height="240" BorderThickness="0,2,0,0" >
<StackPanel HorizontalAlignment="Left" Height="240" VerticalAlignment="Top" Width="540">
</StackPanel>
</Border>
</TabItem>
<TabItem Width="90" Height="30" Padding="0,0,0,0">
<TabItem.Header>
<Border Width="90" Height="30" Margin="0,0,0,0" >
<Label Content="Custom-3" FontFamily="Arial Black" FontSize="12" Height="30" Width="90" Padding="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" ToolTip="Parameter of the ABS/TC effect " />
</Border>
</TabItem.Header>
<Border Background="#7F4E4E4E" CornerRadius="5,5,5,5" Height="240" BorderThickness="0,2,0,0" >
<StackPanel HorizontalAlignment="Left" Height="240" VerticalAlignment="Top" Width="540">
</StackPanel>
</Border>
</TabItem>
<TabItem Width="90" Height="30" Padding="0,0,0,0">
<TabItem.Header>
<Border Width="90" Height="30" Margin="0,0,0,0" >
<Label Content="Custom-4" FontFamily="Arial Black" FontSize="12" Height="30" Width="90" Padding="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" ToolTip="Parameter of the ABS/TC effect " />
</Border>
</TabItem.Header>
<Border Background="#7F4E4E4E" CornerRadius="5,5,5,5" Height="240" BorderThickness="0,2,0,0" >
<StackPanel HorizontalAlignment="Left" Height="240" VerticalAlignment="Top" Width="540">
</StackPanel>
</Border>
</TabItem>
</TabControl>
</Grid>
</ScrollViewer>
</UserControl>
Loading

0 comments on commit 4e3ba97

Please sign in to comment.