-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGentlemanDriverPluginSettingsControl.xaml
125 lines (111 loc) · 10.2 KB
/
GentlemanDriverPluginSettingsControl.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<UserControl x:Class="sjdawson.GentlemanDriverPlugin.GentlemanDriverPluginSettingsControl"
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:styles="clr-namespace:SimHub.Plugins.Styles;assembly=SimHub.Plugins"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
d:DesignHeight="850" d:DesignWidth="800" Loaded="UserControl_Loaded">
<styles:SHTabControl x:Name="GentlemanDriverPluginSettingsTabs">
<styles:SHTabItem Header="General">
<ScrollViewer>
<StackPanel>
<styles:SHSection Title="Optimal tyre temperature defaults (°C)">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="36*" />
<RowDefinition Height="36*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="Non-game specific" Grid.Row="0" />
<mah:NumericUpDown x:Name="OptimalTyreTemperature" HasDecimals="False" Margin="5" ValueChanged="OptimalTyreTemperatureChanged" Grid.Row="0"
ToolTip="The value at which your tyres are at their optimal temperature by default"
Width="300" HorizontalAlignment="Left"
Grid.Column="1" Minimum="0" Maximum="200"/>
<TextBlock x:Name="OptimalTyreTemperatureCurrentGameLabel" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="Current game: {Game}" Grid.Row="1" />
<mah:NumericUpDown x:Name="OptimalTyreTemperatureCurrentGame" HasDecimals="False" Margin="5" ValueChanged="OptimalTyreTemperatureChangedCurrentGame" Grid.Row="1"
ToolTip="The value at which your tyres are at their optimal temperature by default"
Width="300" HorizontalAlignment="Left"
Grid.Column="1" Minimum="0" Maximum="200"/>
</Grid>
</styles:SHSection>
</StackPanel>
</ScrollViewer>
</styles:SHTabItem>
<styles:SHTabItem Header="WLED">
<ScrollViewer>
<StackPanel>
<Border CornerRadius="1" BorderBrush="#FFFF8000" BorderThickness="5" Margin="5">
<TextBlock Background="#FFFF8000" Foreground="{DynamicResource ControlBackgroundBrush}" Padding="20, 2" TextAlignment="Center" FontWeight="Bold" FontSize="14">
Note: This functionality is currently experimental. Report any bugs via a <Hyperlink RequestNavigate="Hyperlink_RequestNavigate" Foreground="{DynamicResource ControlBackgroundBrush}" NavigateUri="https://github.com/sjdawson/GentlemanDriverPlugin/issues/new?assignees=sjdawson&labels=Bug&template=bug.md&title=BUG%3A+">GitHub issue</Hyperlink>. Thanks.
</TextBlock>
</Border>
<styles:SHSection Title="Settings" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="36" />
<RowDefinition Height="36" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="IP Address" Grid.Row="0" />
<TextBox x:Name="WledIp" TextChanged="WledIpChanged" Grid.Row="0" Grid.Column="1" Margin="5" mah:TextBoxHelper.Watermark="Ex. 192.168.0.5" FontFamily="Consolas" />
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="Enable" Grid.Row="1" />
<CheckBox x:Name="WledControlEnabled" Click="WledControlEnabled_Click" Grid.Row="1" Grid.Column="1" Margin="5" />
<TextBlock x:Name="WledControlPanelLinkContainer" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1" Margin="40, 5" Visibility="Hidden">
<Hyperlink x:Name="WledControlPanelLink" Foreground="{DynamicResource AccentBaseColorBrush}" FontWeight="Bold" RequestNavigate="Hyperlink_RequestNavigate" NavigateUri="http://www.nothing.com">Open WLED</Hyperlink>
</TextBlock>
<TextBlock x:Name="WledStatusMessage" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="10,0,10,0" Text="Enable to check status…" Grid.Row="1" Grid.Column="1" Foreground="{DynamicResource GrayBrush5}" />
</Grid>
</styles:SHSection>
<styles:SHSection Title="Colours">
<Grid>
<Grid.RowDefinitions>
<RowDefinition MinHeight="36"/>
<RowDefinition Height="36"/>
<RowDefinition Height="36"/>
<RowDefinition Height="36"/>
<RowDefinition Height="36"/>
<RowDefinition Height="36"/>
<RowDefinition Height="36"/>
<RowDefinition Height="36"/>
<RowDefinition Height="36"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Grid.ColumnSpan="2" HorizontalAlignment="Left" Margin="10" TextWrapping="WrapWithOverflow">
To account for the variances in different LED strips, you can configure the colour of each flag that is sent to WLED.
</TextBlock>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="Black Flag" Grid.Row="1" />
<xctk:ColorPicker x:Name="BlackFlagRgb" SelectedColorChanged="FlagRgb_SelectedColorChanged" Grid.Row="1" Grid.Column="1" Margin="5" Width="100" HorizontalAlignment="Left" UsingAlphaChannel="False"/>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="Blue Flag" Grid.Row="2" />
<xctk:ColorPicker x:Name="BlueFlagRgb" SelectedColorChanged="FlagRgb_SelectedColorChanged" Grid.Row="2" Grid.Column="1" Margin="5" Width="100" HorizontalAlignment="Left" UsingAlphaChannel="False"/>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="Checkered Flag" Grid.Row="3" />
<xctk:ColorPicker x:Name="CheckeredFlagRgb" SelectedColorChanged="FlagRgb_SelectedColorChanged" Grid.Row="3" Grid.Column="1" Margin="5" Width="100" HorizontalAlignment="Left" UsingAlphaChannel="False"/>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="Green Flag" Grid.Row="4" />
<xctk:ColorPicker x:Name="GreenFlagRgb" SelectedColorChanged="FlagRgb_SelectedColorChanged" Grid.Row="4" Grid.Column="1" Margin="5" Width="100" HorizontalAlignment="Left" UsingAlphaChannel="False"/>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="Orange Flag" Grid.Row="5" />
<xctk:ColorPicker x:Name="OrangeFlagRgb" SelectedColorChanged="FlagRgb_SelectedColorChanged" Grid.Row="5" Grid.Column="1" Margin="5" Width="100" HorizontalAlignment="Left" UsingAlphaChannel="False"/>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="White Flag" Grid.Row="6" />
<xctk:ColorPicker x:Name="WhiteFlagRgb" SelectedColorChanged="FlagRgb_SelectedColorChanged" Grid.Row="6" Grid.Column="1" Margin="5" Width="100" HorizontalAlignment="Left" UsingAlphaChannel="False"/>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="Yellow Flag" Grid.Row="7" />
<xctk:ColorPicker x:Name="YellowFlagRgb" SelectedColorChanged="FlagRgb_SelectedColorChanged" Grid.Row="7" Grid.Column="1" Margin="5" Width="100" HorizontalAlignment="Left" UsingAlphaChannel="False"/>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="No Flag" Grid.Row="8" />
<xctk:ColorPicker x:Name="NoFlagRgb" SelectedColorChanged="FlagRgb_SelectedColorChanged" Grid.Row="8" Grid.Column="1" Margin="5" Width="100" HorizontalAlignment="Left" UsingAlphaChannel="False"/>
<TextBlock HorizontalAlignment="Left" Foreground="{DynamicResource GrayBrush5}" VerticalAlignment="Center" Margin="120,0,0,0" Text="When no flags are active, this colour will be sent to WLED, if you want to maintain an ambient light." Grid.Row="8" Grid.Column="1" />
</Grid>
</styles:SHSection>
</StackPanel>
</ScrollViewer>
</styles:SHTabItem>
</styles:SHTabControl>
</UserControl>