VPet/VPet.Solution/Views/InteractiveSettingPage.xaml

401 lines
16 KiB
Plaintext
Raw Normal View History

2023-12-20 12:51:58 +00:00
<Page
2023-12-30 14:54:49 +00:00
x:Class="VPet.Solution.Views.InteractiveSettingPage"
2023-12-20 12:51:58 +00:00
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ll="clr-namespace:LinePutScript.Localization.WPF;assembly=LinePutScript.Localization.WPF"
xmlns:local="clr-namespace:VPet.Solution.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="https://opensource.panuon.com/wpf-ui"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:vm="clr-namespace:VPet.Solution.ViewModels"
Title="InteractiveSettingsPage"
2023-12-30 14:54:49 +00:00
d:DataContext="{d:DesignInstance Type=vm:InteractiveSettingPageVM}"
2023-12-20 12:51:58 +00:00
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Grid>
2023-12-24 16:31:22 +00:00
<ScrollViewer VerticalScrollBarVisibility="Auto">
2023-12-20 12:51:58 +00:00
<StackPanel>
2023-12-24 16:31:22 +00:00
<Label
Margin="5"
2023-12-20 12:51:58 +00:00
HorizontalAlignment="Left"
2023-12-24 16:31:22 +00:00
Content="{ll:Str 桌宠设置}"
FontSize="16"
FontWeight="Bold"
Style="{DynamicResource Label_BaseStyle}" />
<Grid MinHeight="40">
2023-12-20 12:51:58 +00:00
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
2023-12-24 16:31:22 +00:00
<Label Content="{ll:Str 桌宠名称}" Style="{DynamicResource Label_BaseStyle}" />
<TextBox
x:Name="TextBoxPetName"
Grid.Column="1"
2023-12-30 14:54:49 +00:00
Style="{DynamicResource StandardTextBoxStyle}"
Text="{Binding InteractiveSetting.PetName}" />
2023-12-24 16:31:22 +00:00
</Grid>
<Grid MinHeight="40">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Content="{ll:Str 桌宠状态}" Style="{DynamicResource Label_BaseStyle}" />
2023-12-20 12:51:58 +00:00
<pu:Switch
2023-12-24 16:31:22 +00:00
x:Name="Switch_EnablePetState"
Grid.Column="1"
Content="{ll:Str '启用桌宠状态'}"
2023-12-30 14:54:49 +00:00
IsChecked="{Binding InteractiveSetting.CalFunState}"
2023-12-24 16:31:22 +00:00
Style="{DynamicResource Switch_BaseStyle}"
2023-12-20 12:51:58 +00:00
ToolTip="{ll:Str '启用数据计算,桌宠会有状态变化,需要按时投喂等.\&#13;如果嫌麻烦可以关掉'}" />
2023-12-24 16:31:22 +00:00
<!-- TODO: ComboBox使用内部数据 -->
<ComboBox
2023-12-20 12:51:58 +00:00
Grid.Column="2"
2023-12-24 16:31:22 +00:00
pu:ComboBoxHelper.Watermark="{ll:Str '当关闭数据计算时\&#13;桌宠显示的状态'}"
IsEnabled="{Binding IsChecked, ElementName=Switch_EnablePetState, Converter={StaticResource BoolInverter}}"
SelectedIndex="0"
2023-12-30 14:54:49 +00:00
SelectedItem="{Binding InteractiveSetting.CalFunState}"
2023-12-24 16:31:22 +00:00
Style="{DynamicResource ComboBox_BaseStyle}"
ToolTip="{ll:Str '当关闭数据计算时\&#13;桌宠显示的状态'}">
<ComboBoxItem Content="Happy" />
<ComboBoxItem Content="Nomal" />
<ComboBoxItem Content="PoorCondition" />
<ComboBoxItem Content="Ill" />
</ComboBox>
</Grid>
<Grid MinHeight="40">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label Content="{ll:Str 长按间隔}" Style="{DynamicResource Label_BaseStyle}" />
<Slider
x:Name="PressLengthSlider"
Grid.Column="1"
VerticalAlignment="Center"
d:ValueChanged="PressLengthSlider_ValueChanged"
LargeChange="0.1"
Maximum="5"
Minimum="0.05"
SmallChange=".05"
Style="{DynamicResource Slider_BaseStyle}"
TickFrequency="0.01"
Value="0.5" />
<pu:NumberInput
Grid.Column="2"
Interval="0.1"
Maximum="5"
Minimum="0.05"
Style="{DynamicResource NumberInput_BaseStyle}"
Value="{Binding Value, ElementName=PressLengthSlider}" />
<TextBlock
Grid.Column="3"
Margin="0,5,10,5"
Style="{DynamicResource TextBlock_BaseStyle}"
Text="{ll:Str 秒}" />
</Grid>
<Grid MinHeight="40">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label Content="{ll:Str 计算间隔}" Style="{DynamicResource Label_BaseStyle}" />
<Slider
x:Name="Slider_Cal"
Grid.Column="1"
VerticalAlignment="Center"
d:ValueChanged="CalSlider_ValueChanged"
LargeChange="1"
Maximum="60"
Minimum="5"
SmallChange=".5"
Style="{DynamicResource Slider_BaseStyle}"
TickFrequency="0.1"
Value="15" />
<pu:NumberInput
Grid.Column="2"
Interval="0.5"
Maximum="60"
Minimum="5"
Style="{DynamicResource NumberInput_BaseStyle}"
Value="{Binding Value, ElementName=Slider_Cal}" />
<TextBlock
Grid.Column="3"
Margin="0,5,10,5"
Style="{DynamicResource TextBlock_BaseStyle}"
Text="{ll:Str 秒}" />
</Grid>
<Grid MinHeight="40" ToolTip="{ll:Str 互动周期决定在交互结束后大约经历多少计算间隔后再次进行自主行动}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Content="{ll:Str 互动周期}" Style="{DynamicResource Label_BaseStyle}" />
<Grid Grid.Column="1">
2023-12-20 12:51:58 +00:00
<Grid.ColumnDefinitions>
2023-12-24 16:31:22 +00:00
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
2023-12-20 12:51:58 +00:00
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
2023-12-24 16:31:22 +00:00
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
2023-12-20 12:51:58 +00:00
</Grid.RowDefinitions>
2023-12-24 16:31:22 +00:00
<Slider
x:Name="Slider_Interaction"
d:ValueChanged="Slider_Interaction_ValueChanged"
LargeChange="5"
Maximum="1000"
Minimum="30"
SmallChange="1"
Style="{DynamicResource Slider_BaseStyle}"
TickFrequency="1"
ToolTip="{ll:Str '数据计算和互动计算时间间隔,间隔越短需要互动的频率可能会增加.\&#13;间隔越大越不容易打扰到当前工作'}"
Value="200" />
<pu:NumberInput
2023-12-20 12:51:58 +00:00
Grid.Column="1"
2023-12-24 16:31:22 +00:00
Interval="1"
Maximum="1000"
Minimum="30"
Style="{DynamicResource NumberInput_BaseStyle}"
Value="{Binding ElementName=Slider_Interaction, Path=Value}" />
<TextBlock
Grid.Column="2"
Margin="0,5,10,5"
Style="{DynamicResource TextBlock_BaseStyle}"
Text="{ll:Str 秒}" />
2023-12-20 12:51:58 +00:00
<TextBlock
Grid.Row="1"
2023-12-24 16:31:22 +00:00
Grid.ColumnSpan="3"
HorizontalAlignment="Left"
Style="{DynamicResource TextBlock_BaseStyle}">
<Run Text="{ll:Str 每分钟计算}" /> <Run x:Name="rTimeMinute">4</Run> <Run Text="{ll:Str 次数值变化}" />
<Run Text="{ll:Str 大约}" /> <Run x:Name="RInter">4</Run> <Run Text="{ll:Str '分钟左右主动进行一次互动 (走路发呆爬墙等) '}" />
</TextBlock>
2023-12-20 12:51:58 +00:00
</Grid>
2023-12-24 16:31:22 +00:00
</Grid>
<Grid MinHeight="40" ToolTip="{ll:Str '当玩家在指定时间未对桌宠进行交互的时候,智能禁用移动功能\&#13;将在下次交互时解除'}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label Content="{ll:Str 桌宠移动}" Style="{DynamicResource Label_BaseStyle}" />
<pu:Switch
x:Name="Switch_PetMove"
Grid.Column="1"
d:Checked="Switch_PetMove_Checked"
d:Unchecked="Switch_PetMove_Checked"
Content="{ll:Str 启用桌宠移动}"
Style="{DynamicResource Switch_BaseStyle}"
ToolTip="{ll:Str '启用移动互动,桌宠会在屏幕上乱动,移动互动概率为普通互动的一半.\&#13;如果嫌麻烦可以关掉'}" />
<pu:Switch
x:Name="Switch_SmartPetMove"
Grid.Column="2"
d:Checked="SmartSwitch_PetMove_Checked"
d:Unchecked="SmartSwitch_PetMove_Checked"
Content="{ll:Str '智能移动'}"
IsEnabled="{Binding ElementName=Switch_PetMove, Path=IsChecked}"
Style="{DynamicResource Switch_BaseStyle}" />
<ComboBox
x:Name="CBSmartMove"
Grid.Column="3"
d:SelectionChanged="CBSmartMove_SelectionChanged"
IsEnabled="{Binding IsChecked, ElementName=Switch_SmartPetMove}"
SelectedIndex="5"
Style="{DynamicResource StandardComboBoxStyle}"
ToolTip="{ll:Str 智能移动判断时间间隔}">
<!--<ComboBoxItem Content="{ll:Str '30 秒'}">
<ComboBoxItem.Tag>
<sys:Int32>30</sys:Int32>
</ComboBoxItem.Tag>
</ComboBoxItem>
<ComboBoxItem Content="{ll:Str '1 分钟'}">
<ComboBoxItem.Tag>
<sys:Int32>60</sys:Int32>
</ComboBoxItem.Tag>
</ComboBoxItem>
<ComboBoxItem Content="{ll:Str '2 分钟'}">
<ComboBoxItem.Tag>
<sys:Int32>120</sys:Int32>
</ComboBoxItem.Tag>
</ComboBoxItem>
<ComboBoxItem Content="{ll:Str '5 分钟'}">
<ComboBoxItem.Tag>
<sys:Int32>300</sys:Int32>
</ComboBoxItem.Tag>
</ComboBoxItem>
<ComboBoxItem Content="{ll:Str '10 分钟'}">
<ComboBoxItem.Tag>
<sys:Int32>600</sys:Int32>
</ComboBoxItem.Tag>
</ComboBoxItem>
<ComboBoxItem Content="{ll:Str '20 分钟'}">
<ComboBoxItem.Tag>
<sys:Int32>1200</sys:Int32>
</ComboBoxItem.Tag>
</ComboBoxItem>
<ComboBoxItem Content="{ll:Str '30 分钟'}">
<ComboBoxItem.Tag>
<sys:Int32>1800</sys:Int32>
</ComboBoxItem.Tag>
</ComboBoxItem>
<ComboBoxItem Content="{ll:Str '40 分钟'}">
<ComboBoxItem.Tag>
<sys:Int32>2400</sys:Int32>
</ComboBoxItem.Tag>
</ComboBoxItem>
<ComboBoxItem Content="{ll:Str '50 分钟'}">
<ComboBoxItem.Tag>
<sys:Int32>3000</sys:Int32>
</ComboBoxItem.Tag>
</ComboBoxItem>
<ComboBoxItem Content="{ll:Str '60 分钟'}">
<ComboBoxItem.Tag>
<sys:Int32>3600</sys:Int32>
</ComboBoxItem.Tag>
</ComboBoxItem>-->
</ComboBox>
<TextBlock
Grid.Column="4"
Style="{DynamicResource TextBlock_BaseStyle}"
Text="{ll:Str 分钟}" />
</Grid>
<Grid MinHeight="40">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Content="{ll:Str 移动范围}" Style="{DynamicResource Label_BaseStyle}" />
<Grid Grid.Column="1">
2023-12-20 12:51:58 +00:00
<Grid.ColumnDefinitions>
2023-12-24 16:31:22 +00:00
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
2023-12-20 12:51:58 +00:00
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
2023-12-24 16:31:22 +00:00
<TextBlock HorizontalAlignment="Left" Style="{DynamicResource TextBlock_BaseStyle}">
<Run Text="{ll:Str '当前移动区域:'}" />
<Run Text="{ll:Str '主屏幕'}" />
</TextBlock>
2023-12-20 12:51:58 +00:00
<Button
x:Name="BtnSetMoveArea_Default"
Grid.Row="1"
d:Click="BtnSetMoveArea_Default_Click"
2023-12-24 16:31:22 +00:00
Content="{ll:Str 重置为主屏幕}"
Style="{DynamicResource Button_BaseStyle}"
2023-12-20 12:51:58 +00:00
ToolTip="{ll:Str '设置桌宠只在主屏幕进行移动'}" />
<Button
x:Name="BtnSetMoveArea_DetectScreen"
Grid.Row="1"
Grid.Column="1"
d:Click="BtnSetMoveArea_DetectScreen_Click"
Content="{ll:Str 设为当前屏幕}"
2023-12-24 16:31:22 +00:00
Style="{DynamicResource Button_BaseStyle}"
2023-12-20 12:51:58 +00:00
ToolTip="{ll:Str '设置桌宠只在当前桌宠所在的屏幕范围进行移动'}" />
<Button
x:Name="BtnSetMoveArea_Window"
Grid.Row="1"
Grid.Column="2"
d:Click="BtnSetMoveArea_Window_Click"
Content="{ll:Str 自定移动范围}"
2023-12-24 16:31:22 +00:00
Style="{DynamicResource Button_BaseStyle}"
2023-12-20 12:51:58 +00:00
ToolTip="{ll:Str '手动设置桌宠可移动范围'}" />
</Grid>
</Grid>
2023-12-24 16:31:22 +00:00
<Label
Margin="5"
2023-12-20 12:51:58 +00:00
HorizontalAlignment="Left"
2023-12-24 16:31:22 +00:00
Content="{ll:Str 音乐识别设置}"
FontSize="16"
FontWeight="Bold"
Style="{DynamicResource Label_BaseStyle}" />
<Grid MinHeight="40">
2023-12-20 12:51:58 +00:00
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
2023-12-24 16:31:22 +00:00
<Label
Content="{ll:Str 触发音量}"
Style="{DynamicResource Label_BaseStyle}"
2023-12-20 12:51:58 +00:00
ToolTip="{ll:Str 当实时播放音量达到该值时运行音乐动作}" />
<Slider
x:Name="VoiceCatchSilder"
2023-12-24 16:31:22 +00:00
Grid.Column="1"
2023-12-20 12:51:58 +00:00
d:ValueChanged="VoiceCatchSilder_ValueChanged"
2023-12-24 16:31:22 +00:00
LargeChange="5"
Maximum="100"
2023-12-20 12:51:58 +00:00
Minimum="0"
2023-12-24 16:31:22 +00:00
SmallChange="1"
Style="{DynamicResource Slider_BaseStyle}"
TickFrequency="1"
2023-12-20 12:51:58 +00:00
ToolTip="{ll:Str 当实时播放音量达到该值时运行音乐动作}"
2023-12-24 16:31:22 +00:00
Value="30" />
<pu:NumberInput
Grid.Column="2"
Interval="1"
Maximum="100"
Minimum="0"
Style="{DynamicResource NumberInput_BaseStyle}"
ToolTip="{ll:Str 当实时播放音量达到该值时运行特殊音乐动作}"
Value="{Binding Value, ElementName=VoiceCatchSilder}" />
2023-12-20 12:51:58 +00:00
<TextBlock
Grid.Column="3"
2023-12-24 16:31:22 +00:00
Margin="0,5,10,5"
Text="%" />
</Grid>
<Grid MinHeight="40">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label
Content="{ll:Str 高潮音量}"
Style="{DynamicResource Label_BaseStyle}"
ToolTip="{ll:Str 当实时播放音量达到该值时运行音乐动作}" />
2023-12-20 12:51:58 +00:00
<Slider
x:Name="VoiceMaxSilder"
2023-12-24 16:31:22 +00:00
Grid.Column="1"
2023-12-20 12:51:58 +00:00
d:ValueChanged="VoiceCatchSilder_ValueChanged"
2023-12-24 16:31:22 +00:00
LargeChange="1"
Maximum="100"
2023-12-20 12:51:58 +00:00
Minimum="{Binding ElementName=VoiceCatchSilder, Path=Value}"
2023-12-24 16:31:22 +00:00
SmallChange="1"
2023-12-20 12:51:58 +00:00
Style="{DynamicResource StandardSliderStyle}"
2023-12-24 16:31:22 +00:00
TickFrequency="1"
ToolTip="{ll:Str 当实时播放音量达到该值时运行特殊音乐动作}"
Value="75" />
<pu:NumberInput
Grid.Column="2"
Foreground="{DynamicResource DARKPrimaryDarker}"
Interval="1"
Maximum="100"
Minimum="{Binding ElementName=VoiceCatchSilder, Path=Value}"
Style="{DynamicResource NumberInput_BaseStyle}"
2023-12-20 12:51:58 +00:00
ToolTip="{ll:Str 当实时播放音量达到该值时运行特殊音乐动作}"
2023-12-24 16:31:22 +00:00
Value="{Binding Value, ElementName=VoiceMaxSilder}" />
2023-12-20 12:51:58 +00:00
<TextBlock
Grid.Column="3"
2023-12-24 16:31:22 +00:00
Margin="0,5,10,5"
Text="%" />
2023-12-20 12:51:58 +00:00
</Grid>
</StackPanel>
</ScrollViewer>
</Grid>
</Page>