From 1a21507ca207bad6c578928a1079ae5b5a2d843f Mon Sep 17 00:00:00 2001 From: ZouJin <zoujin.dev@exlb.org> Date: Sun, 24 Sep 2023 14:27:32 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=BD=93=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E5=8A=A8=E7=94=BB=E6=97=B6=E8=B7=B3=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Display/MainDisplay.cs | 4 +- .../WinDesign/winGameSetting.xaml | 191 ++++++++++++------ 2 files changed, 130 insertions(+), 65 deletions(-) diff --git a/VPet-Simulator.Core/Display/MainDisplay.cs b/VPet-Simulator.Core/Display/MainDisplay.cs index b07a708..08f3251 100644 --- a/VPet-Simulator.Core/Display/MainDisplay.cs +++ b/VPet-Simulator.Core/Display/MainDisplay.cs @@ -449,7 +449,7 @@ namespace VPet_Simulator.Core public void Display(string name, AnimatType animat, GraphType Type, Action<string> EndAction = null) { var list = Core.Graph.FindGraphs(name, animat, Core.Save.Mode)?.FindAll(x => x.GraphInfo.Type == Type); - if (list != null && list.Count > 0) + if ((list?.Count ?? -1) > 0) Display(list[Function.Rnd.Next(list.Count)], () => EndAction(name)); else Display(Type, animat, EndAction); @@ -464,7 +464,7 @@ namespace VPet_Simulator.Core public void Display(string name, AnimatType animat, GraphType Type, Action EndAction = null) { var list = Core.Graph.FindGraphs(name, animat, Core.Save.Mode)?.FindAll(x => x.GraphInfo.Type == Type); - if (list.Count > 0) + if ((list?.Count ?? -1) > 0) Display(list[Function.Rnd.Next(list.Count)], EndAction); else Display(Type, animat, EndAction); diff --git a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml index 6f4fec0..49f15c1 100644 --- a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml +++ b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml @@ -6,8 +6,8 @@ xmlns:local="clr-namespace:VPet_Simulator.Windows" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" - xmlns:system="clr-namespace:System;assembly=mscorlib" Title="{ll:Str 设置}" Width="{ll:Dbe SettingWidth, - DefValue=500}" Height="550" Closing="WindowX_Closing" FontSize="16" + xmlns:system="clr-namespace:System;assembly=mscorlib" Title="{ll:Str 设置}" + Width="{ll:Dbe SettingWidth, DefValue=500}" Height="550" Closing="WindowX_Closing" FontSize="16" Style="{DynamicResource BaseWindowXStyle}" Topmost="True" WindowStartupLocation="CenterScreen" mc:Ignorable="d"> <!--<pu:WindowX.Resources> <DataTemplate x:Key="DIYDataTemplate"> @@ -53,6 +53,7 @@ <RowDefinition Height="35" /> <RowDefinition Height="35" /> <RowDefinition Height="35" /> + <RowDefinition Height="35" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <TextBlock Grid.Row="1" VerticalAlignment="Center" Text="{ll:Str 快速切换}" /> @@ -214,6 +215,16 @@ <ComboBox x:Name="PetBox" Grid.Row="11" Grid.Column="2" Margin="0,3,0,2" FontSize="16" SelectionChanged="PetBox_SelectionChanged" Style="{DynamicResource StandardComboBoxStyle}" ToolTip="{ll:Str '加载的宠物动画,重启后生效'}" /> + <TextBlock Grid.Row="13" VerticalAlignment="Center" Text="{ll:Str 隐藏窗口}" /> + <pu:Switch x:Name="SwitchHideFromTaskControl" Grid.Row="13" Grid.Column="2" + Background="Transparent" BorderBrush="{DynamicResource PrimaryDark}" BoxHeight="18" + BoxWidth="35" Checked="SwitchHideFromTaskControl_OnChecked" + CheckedBackground="{DynamicResource Primary}" + CheckedBorderBrush="{DynamicResource Primary}" + CheckedToggleBrush="{DynamicResource DARKPrimaryText}" + Content="{ll:Str '在任务切换器中隐藏窗口'}" ToggleBrush="{DynamicResource PrimaryDark}" + ToggleShadowColor="{x:Null}" ToggleSize="14" ToolTip="{ll:Str '在Alt+Tab中隐藏'}" + Unchecked="SwitchHideFromTaskControl_OnChecked" /> </Grid> </ScrollViewer> <Button x:Name="ButtonRestartGraph" VerticalAlignment="Bottom" @@ -239,6 +250,11 @@ <system:Int32>-1</system:Int32> </ComboBoxItem.Tag> </ComboBoxItem> + <ComboBoxItem Content="{ll:Str 每2分钟一次}"> + <ComboBoxItem.Tag> + <system:Int32>2</system:Int32> + </ComboBoxItem.Tag> + </ComboBoxItem> <ComboBoxItem Content="{ll:Str 每5分钟一次}"> <ComboBoxItem.Tag> <system:Int32>5</system:Int32> @@ -297,7 +313,7 @@ <TextBlock Margin="0,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{x:Null}" TextWrapping="Wrap"> <Run FontSize="18" FontWeight="Bold" Text="{ll:Str 聊天设置}" /><LineBreak /> - <Run Text="{ll:Str 使用ChatGPT进行聊天等相关设置}" /> + <Run Text="{ll:Str 聊天框等相关设置}" /> </TextBlock> <Grid> <Grid.ColumnDefinitions> @@ -309,7 +325,7 @@ <RowDefinition Height="Auto" /> <RowDefinition Height="35" /> </Grid.RowDefinitions> - <TextBlock Grid.Row="0" VerticalAlignment="Center" Text="{ll:Str 使用模式}" /> + <TextBlock x:Name="tbMode" Grid.Row="0" VerticalAlignment="Center" Text="{ll:Str 使用模式}" /> <TextBlock Grid.Row="1" VerticalAlignment="Center" Text="{ll:Str 相关功能}" /> <Grid Grid.Column="2"> <Grid.ColumnDefinitions> @@ -320,20 +336,35 @@ <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> - <RadioButton x:Name="RBCGPTUseAPI" Grid.Column="1" Checked="CGPType_Checked" + <!--<RadioButton x:Name="RBCGPTUseAPI" Grid.Column="1" Checked="CGPType_Checked" Content="{ll:Str '使用从ChatGPT\ 申请的的API'}" GroupName="cgpttype" Style="{DynamicResource StandardRadioButtonStyle}" - ToolTip="{ll:Str 需要去OpenAI官网申请}" /> + ToolTip="{ll:Str 需要去OpenAI官网申请}" />--> <RadioButton x:Name="RBCGPTUseLB" Checked="CGPType_Checked" Content="{ll:Str '使用桌宠选项式\ 聊天功能'}" GroupName="cgpttype" IsChecked="True" Style="{DynamicResource StandardRadioButtonStyle}" ToolTip="{ll:Str 支持MOD与创意工坊添加聊天内容}" /> - <RadioButton x:Name="RBCGPTClose" Grid.Row="1" Checked="CGPType_Checked" + <RadioButton x:Name="RBCGPTClose" Grid.Column="1" Checked="CGPType_Checked" Content="{ll:Str '关闭聊天框'}" GroupName="cgpttype" Style="{DynamicResource StandardRadioButtonStyle}" /> - <RadioButton x:Name="RBCGPTDIY" Grid.Row="1" Grid.Column="1" Checked="CGPType_Checked" - Content="{ll:Str '自定义聊天接口'}" GroupName="cgpttype" IsEnabled="False" - Style="{DynamicResource StandardRadioButtonStyle}" /> + <RadioButton x:Name="RBCGPTDIY" Grid.Row="1" Checked="CGPType_Checked" + GroupName="cgpttype" Style="{DynamicResource StandardRadioButtonStyle}" + Grid.ColumnSpan="2"> + <Grid Width="{Binding ActualWidth,ElementName=RBCGPTDIY}"> + <Grid.RowDefinitions> + <RowDefinition /> + <RowDefinition /> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition /> + <ColumnDefinition Width="40" /> + </Grid.ColumnDefinitions> + <Label Content="{ll:Str '自定义聊天接口'}" Background="{x:Null}" /> + <ComboBox x:Name="cbChatAPISelect" + Style="{DynamicResource StandardComboBoxStyle}" Grid.Column="0" + Grid.Row="1" SelectionChanged="cbChatAPISelect_SelectionChanged" /> + </Grid> + </RadioButton> </Grid> <Button x:Name="BtnCGPTReSet" Grid.Row="1" Grid.Column="2" Margin="4" Padding="1" pu:ButtonHelper.CornerRadius="4" Background="{DynamicResource SecondaryLight}" @@ -347,8 +378,8 @@ Background="{DynamicResource SecondaryLight}" Click="save_click" Content="{ll:Str 保存游戏}" ToolTip="{ll:Str '手动保存桌宠存档,就算不手动保存,桌宠也会在退出的时候自动保存'}" /> <Button Grid.Row="1" Grid.Column="2" Margin="4" Padding="1" pu:ButtonHelper.CornerRadius="4" - Background="{DynamicResource SecondaryLight}" - Content="{ll:Str 重新开始}" ToolTip="{ll:Str '重新开始新游戏,重置统计等信息\ 对于想要获得脱离超模从而获得成就非常有帮助'}" Click="restart_click" /> + Background="{DynamicResource SecondaryLight}" Content="{ll:Str 重新开始}" + ToolTip="{ll:Str '重新开始新游戏,重置统计等信息\ 对于想要获得脱离超模从而获得成就非常有帮助'}" Click="restart_click" /> <Button Grid.Row="1" Grid.Column="2" Margin="4" Padding="1" pu:ButtonHelper.CornerRadius="4" Background="{DynamicResource SecondaryLight}" Click="cleancache_click" Content="{ll:Str 清理缓存}" ToolTip="{ll:Str '清理缓存的动画,声音文件'}" /> @@ -377,6 +408,7 @@ <RowDefinition Height="35" /> <RowDefinition Height="35" /> <RowDefinition Height="35" /> + <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <pu:Switch x:Name="CalFunctionBox" Grid.Column="2" Background="Transparent" BorderBrush="{DynamicResource PrimaryDark}" BoxHeight="18" BoxWidth="35" @@ -404,7 +436,7 @@ <ComboBoxItem Content="Ill" /> </ComboBox> </Grid> - <Grid Grid.Row="5" Grid.RowSpan="2" Grid.Column="2"> + <Grid Grid.Row="5" Grid.RowSpan="4" Grid.Column="2"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> @@ -491,7 +523,37 @@ </ComboBoxItem> </ComboBox> </Grid> + <Grid Grid.Row="7" Grid.Column="3"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <WrapPanel Grid.ColumnSpan="3"> + <TextBlock Text="{ll:Str '当前移动区域:'}" /> + <TextBlock x:Name="textMoveArea" Text="{ll:Str '主屏幕'}" /> + </WrapPanel> + <Button x:Name="BtnSetMoveArea_Default" Grid.Row="1" Grid.Column="0" Margin="5,5,5,5" + Padding="1" pu:ButtonHelper.CornerRadius="4" + Background="{DynamicResource SecondaryLight}" + Click="BtnSetMoveArea_Default_Click" Content="{ll:Str 重置为主屏}" + ToolTip="{ll:Str '设置桌宠只在主屏幕进行移动'}" /> + <Button x:Name="BtnSetMoveArea_DetectScreen" Grid.Row="1" Grid.Column="1" + Margin="5,5,5,5" Padding="1" pu:ButtonHelper.CornerRadius="4" + Background="{DynamicResource SecondaryLight}" + Click="BtnSetMoveArea_DetectScreen_Click" Content="{ll:Str 设为当前屏幕}" + ToolTip="{ll:Str '设置桌宠只在当前桌宠所在的屏幕范围进行移动'}" /> + <Button x:Name="BtnSetMoveArea_Window" Grid.Row="1" Grid.Column="2" Margin="5,5,5,5" + Padding="1" pu:ButtonHelper.CornerRadius="4" + Background="{DynamicResource SecondaryLight}" + Click="BtnSetMoveArea_Window_Click" Content="{ll:Str 自定移动范围}" + ToolTip="{ll:Str '手动设置桌宠可移动范围'}" /> + </Grid> <TextBlock Grid.Row="0" VerticalAlignment="Center" Text="{ll:Str 数据计算}" /> <TextBlock Grid.Row="1" VerticalAlignment="Center" Text="{ll:Str 显示状态}" /> <TextBlock Grid.Row="5" VerticalAlignment="Center" Text="{ll:Str 桌宠移动}" /> @@ -650,56 +712,59 @@ </TabItem> <TabItem BorderBrush="{DynamicResource PrimaryDarker}" Header="{ll:Str 诊断}"> - <StackPanel> - <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Background="{x:Null}" - TextWrapping="Wrap"> - <Run FontSize="18" FontWeight="Bold" Text="{ll:Str 自动超模MOD优化}" /><LineBreak /> - <Run Text="{ll:Str '对于超模内容,游戏会自动计算合理价格\ 如果未使用任何超模数据,数据菜单栏将会显示图标方便您进行炫耀数据'}" /> - </TextBlock> - <pu:Switch x:Name="swAutoCal" Grid.Column="2" Background="Transparent" BorderBrush="{DynamicResource PrimaryDark}" - BoxHeight="18" BoxWidth="35" - CheckedBackground="{DynamicResource Primary}" CheckedBorderBrush="{DynamicResource Primary}" - CheckedToggleBrush="{DynamicResource DARKPrimaryText}" Content="{ll:Str '自动计算合理价格'}" - ToggleBrush="{DynamicResource PrimaryDark}" ToggleShadowColor="{x:Null}" ToggleSize="14" - ToolTip="{ll:Str '该选项重启后生效'}" HorizontalAlignment="Left" - Margin="20,0,0,0" - Checked="swAutoCal_Checked" Unchecked="swAutoCal_Checked" /> - <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Background="{x:Null}" FontSize="13" - TextWrapping="Wrap" Margin="0,20,0,0"> - <Run FontSize="18" FontWeight="Bold" Text="{ll:Str 诊断与反馈}" /> <LineBreak /> - <Run Text="{ll:Str '选择要发送给 LBGame 的诊断数据,诊断数据用于保护和及时更新 虚拟桌宠模拟器, 解决问题并改进产品.'}" /><LineBreak /> - <Run Text="{ll:Str '无论选择哪个选项,游戏都可以安全正常地运行.'}" /> <Hyperlink Click="hyper_moreInfo"> - <Run Text="{ll:Str 获取有关这些设置的更多信息}" /> - </Hyperlink> - <LineBreak /> <Run FontWeight="Bold" Text="{ll:Str '当前存档Hash验证信息'}" /> - :<Run x:Name="RHashCheck" FontWeight="Bold" Text="通过" /> - </TextBlock> - <RadioButton x:Name="RBDiagnosisYES" Margin="10,10,10,0" HorizontalAlignment="Left" - VerticalAlignment="Top" Checked="RBDiagnosisYES_Checked" - Content="{ll:Str '发送诊断数据: 发送游戏存档, 包括饱腹,状态等各种游戏内\ 数据. 可能会包括该游戏内存和CPU使用情况'}" - GroupName="diagnosis" Style="{DynamicResource StandardRadioButtonStyle}" /> - <RadioButton x:Name="RBDiagnosisNO" Margin="10,10,10,0" HorizontalAlignment="Left" - VerticalAlignment="Top" Checked="RBDiagnosisNO_Checked" - Content="{ll:Str '不发送诊断数据: 适用于启用修改器,修改过游戏数据等不\ 符合分析数据条件. 或不希望提供游戏数据的玩家'}" - GroupName="diagnosis" IsChecked="True" Style="{DynamicResource StandardRadioButtonStyle}" /> - <TextBlock Margin="0,15,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" - Background="{x:Null}" TextWrapping="Wrap"> - <Run FontWeight="Bold" Text="{ll:Str 反馈频率}" /><LineBreak /> - <Run Text="{ll:Str 'VOS 应寻求我反馈按以下频率'}" /> - </TextBlock> - <ComboBox x:Name="CBDiagnosis" Width="200" Margin="10,5,0,0" HorizontalAlignment="Left" - VerticalAlignment="Top" IsEnabled="False" SelectedIndex="1" - SelectionChanged="CBDiagnosis_SelectionChanged" - Style="{DynamicResource StandardComboBoxStyle}"> - <ComboBoxItem Content="{ll:Str '每 两百 周期一次'}" /> - <ComboBoxItem Content="{ll:Str '每 五百 周期一次'}" /> - <ComboBoxItem Content="{ll:Str '每 一千 周期一次'}" /> - <ComboBoxItem Content="{ll:Str '每 两千 周期一次'}" /> - <ComboBoxItem Content="{ll:Str '每 五千 周期一次'}" /> - <ComboBoxItem Content="{ll:Str '每 一万 周期一次'}" /> - <ComboBoxItem Content="{ll:Str '每 两万 周期一次'}" /> - </ComboBox> - </StackPanel> + <ScrollViewer> + <StackPanel> + <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Background="{x:Null}" + TextWrapping="Wrap"> + <Run FontSize="18" FontWeight="Bold" Text="{ll:Str 自动超模MOD优化}" /><LineBreak /> + <Run Text="{ll:Str '对于超模内容,游戏会自动计算合理价格\ 如果未使用任何超模数据,数据菜单栏将会显示图标方便您进行炫耀数据'}" /> + </TextBlock> + <pu:Switch x:Name="swAutoCal" Grid.Column="2" Background="Transparent" + BorderBrush="{DynamicResource PrimaryDark}" BoxHeight="18" BoxWidth="35" + CheckedBackground="{DynamicResource Primary}" + CheckedBorderBrush="{DynamicResource Primary}" + CheckedToggleBrush="{DynamicResource DARKPrimaryText}" Content="{ll:Str '自动计算合理价格'}" + ToggleBrush="{DynamicResource PrimaryDark}" ToggleShadowColor="{x:Null}" ToggleSize="14" + ToolTip="{ll:Str '该选项重启后生效'}" HorizontalAlignment="Left" Margin="20,0,0,0" + Checked="swAutoCal_Checked" Unchecked="swAutoCal_Checked" /> + <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Background="{x:Null}" + FontSize="13" TextWrapping="Wrap" Margin="0,20,0,0"> + <Run FontSize="18" FontWeight="Bold" Text="{ll:Str 诊断与反馈}" /> <LineBreak /> + <Run Text="{ll:Str '选择要发送给 LBGame 的诊断数据,诊断数据用于保护和及时更新 虚拟桌宠模拟器, 解决问题并改进产品.'}" /><LineBreak /> + <Run Text="{ll:Str '无论选择哪个选项,游戏都可以安全正常地运行.'}" /> <Hyperlink Click="hyper_moreInfo"> + <Run Text="{ll:Str 获取有关这些设置的更多信息}" /> + </Hyperlink> + <LineBreak /> <Run FontWeight="Bold" Text="{ll:Str '当前存档Hash验证信息'}" /> + :<Run x:Name="RHashCheck" FontWeight="Bold" Text="通过" /> + </TextBlock> + <RadioButton x:Name="RBDiagnosisYES" Margin="10,10,10,0" HorizontalAlignment="Left" + VerticalAlignment="Top" Checked="RBDiagnosisYES_Checked" + Content="{ll:Str '发送诊断数据: 发送游戏存档, 包括饱腹,状态等各种游戏内\ 数据. 可能会包括该游戏内存和CPU使用情况'}" + GroupName="diagnosis" Style="{DynamicResource StandardRadioButtonStyle}" /> + <RadioButton x:Name="RBDiagnosisNO" Margin="10,10,10,0" HorizontalAlignment="Left" + VerticalAlignment="Top" Checked="RBDiagnosisNO_Checked" + Content="{ll:Str '不发送诊断数据: 适用于启用修改器,修改过游戏数据等不\ 符合分析数据条件. 或不希望提供游戏数据的玩家'}" + GroupName="diagnosis" IsChecked="True" + Style="{DynamicResource StandardRadioButtonStyle}" /> + <TextBlock Margin="0,15,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" + Background="{x:Null}" TextWrapping="Wrap"> + <Run FontWeight="Bold" Text="{ll:Str 反馈频率}" /><LineBreak /> + <Run Text="{ll:Str 'VOS 应寻求我反馈按以下频率'}" /> + </TextBlock> + <ComboBox x:Name="CBDiagnosis" Width="200" Margin="10,5,0,0" HorizontalAlignment="Left" + VerticalAlignment="Top" IsEnabled="False" SelectedIndex="1" + SelectionChanged="CBDiagnosis_SelectionChanged" + Style="{DynamicResource StandardComboBoxStyle}"> + <ComboBoxItem Content="{ll:Str '每 两百 周期一次'}" /> + <ComboBoxItem Content="{ll:Str '每 五百 周期一次'}" /> + <ComboBoxItem Content="{ll:Str '每 一千 周期一次'}" /> + <ComboBoxItem Content="{ll:Str '每 两千 周期一次'}" /> + <ComboBoxItem Content="{ll:Str '每 五千 周期一次'}" /> + <ComboBoxItem Content="{ll:Str '每 一万 周期一次'}" /> + <ComboBoxItem Content="{ll:Str '每 两万 周期一次'}" /> + </ComboBox> + </StackPanel> + </ScrollViewer> </TabItem> <TabItem BorderBrush="{DynamicResource PrimaryDarker}" Header="{ll:Str MOD管理}"> <Grid> From c82155f3d5754c4e475194ceaaf02291d3febf4b Mon Sep 17 00:00:00 2001 From: ZouJin <zoujin.dev@exlb.org> Date: Sun, 24 Sep 2023 21:17:48 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=85=A8=E6=96=B0=E5=AD=98=E6=A1=A3/?= =?UTF-8?q?=E5=A4=87=E4=BB=BD=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/MainWindow.cs | 14 +++++----- VPet-Simulator.Windows/MainWindow.xaml.cs | 26 ++++++++++++------- .../WinDesign/winGameSetting.xaml.cs | 13 ++++------ 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index 78e9d84..c50e3af 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -188,12 +188,12 @@ namespace VPet_Simulator.Windows Set.StartRecordLastPoint = new Point(Dispatcher.Invoke(() => Left), Dispatcher.Invoke(() => Top)); File.WriteAllText(ExtensionValue.BaseDirectory + @"\Setting.lps", Set.ToString()); - if (!Directory.Exists(ExtensionValue.BaseDirectory + @"\BackUP")) - Directory.CreateDirectory(ExtensionValue.BaseDirectory + @"\BackUP"); + if (!Directory.Exists(ExtensionValue.BaseDirectory + @"\Saves")) + Directory.CreateDirectory(ExtensionValue.BaseDirectory + @"\Saves"); if (Core != null && Core.Save != null) { - var ds = new List<string>(Directory.GetFiles(ExtensionValue.BaseDirectory + @"\BackUP", "*.lps")).FindAll(x => x.Contains('_')).OrderBy(x => + var ds = new List<string>(Directory.GetFiles(ExtensionValue.BaseDirectory + @"\Saves", "*.lps")).FindAll(x => x.Contains('_')).OrderBy(x => { if (int.TryParse(x.Split('_')[1].Split('.')[0], out int i)) return i; @@ -204,13 +204,13 @@ namespace VPet_Simulator.Windows File.Delete(ds[0]); ds.RemoveAt(0); } - if (File.Exists(ExtensionValue.BaseDirectory + $"\\BackUP\\Save_{st}.lps")) - File.Delete(ExtensionValue.BaseDirectory + $"\\BackUP\\Save_{st}.lps"); + if (File.Exists(ExtensionValue.BaseDirectory + $"\\Saves\\Save_{st}.lps")) + File.Delete(ExtensionValue.BaseDirectory + $"\\Saves\\Save_{st}.lps"); if (File.Exists(ExtensionValue.BaseDirectory + @"\Save.lps")) - File.Move(ExtensionValue.BaseDirectory + @"\Save.lps", ExtensionValue.BaseDirectory + $"\\BackUP\\Save_{st}.lps"); + File.Move(ExtensionValue.BaseDirectory + @"\Save.lps", ExtensionValue.BaseDirectory + @"\Save.bkp"); - File.WriteAllText(ExtensionValue.BaseDirectory + @"\Save.lps", GameSavesData.ToLPS().ToString()); + File.WriteAllText(ExtensionValue.BaseDirectory + $"\\Saves\\Save_{st}.lps", GameSavesData.ToLPS().ToString()); } } } diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index bb8d68c..8c70396 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -108,8 +108,8 @@ namespace VPet_Simulator.Windows var point = Set.StartRecordLastPoint; if (point.X != 0 || point.Y != 0) { - L= point.X; - T = point.Y; + L = point.X; + T = point.Y; } } else @@ -155,6 +155,17 @@ namespace VPet_Simulator.Windows } Closed += ForceClose; + //更新存档系统 + if (!Directory.Exists(ExtensionValue.BaseDirectory + @"\Saves")) + { + if (Directory.Exists(ExtensionValue.BaseDirectory + @"\BackUP")) + { + Directory.Move(ExtensionValue.BaseDirectory + @"\BackUP", ExtensionValue.BaseDirectory + @"\Saves"); + } + else + Directory.CreateDirectory(ExtensionValue.BaseDirectory + @"\Saves"); + } + Task.Run(GameLoad); } catch (Exception e) @@ -258,9 +269,9 @@ namespace VPet_Simulator.Windows public void LoadLatestSave(string petname) { - if (Directory.Exists(ExtensionValue.BaseDirectory + @"\BackUP")) + if (Directory.Exists(ExtensionValue.BaseDirectory + @"\Saves")) { - var ds = new List<string>(Directory.GetFiles(ExtensionValue.BaseDirectory + @"\BackUP", "*.lps")).FindAll(x => x.Contains('_')).OrderBy(x => + var ds = new List<string>(Directory.GetFiles(ExtensionValue.BaseDirectory + @"\Saves", "*.lps")).FindAll(x => x.Contains('_')).OrderBy(x => { if (int.TryParse(x.Split('_')[1].Split('.')[0], out int i)) return i; @@ -383,11 +394,6 @@ namespace VPet_Simulator.Windows else//新玩家,默认设置为 Set["CGPT"][(gstr)"type"] = "LB"; - if (Directory.Exists(ExtensionValue.BaseDirectory + @"\UserData") && !Directory.Exists(ExtensionValue.BaseDirectory + @"\BackUP")) - { - Directory.Move(ExtensionValue.BaseDirectory + @"\UserData", ExtensionValue.BaseDirectory + @"\BackUP"); - } - //加载数据合理化:食物 if (!Set["gameconfig"].GetBool("noAutoCal")) { @@ -410,7 +416,7 @@ namespace VPet_Simulator.Windows await Dispatcher.InvokeAsync(new Action(() => LoadingText.Content = "尝试加载游戏存档".Translate())); //加载存档 - if (File.Exists(ExtensionValue.BaseDirectory + @"\Save.lps")) + if (File.Exists(ExtensionValue.BaseDirectory + @"\Save.lps")) //有老的旧存档,优先旧存档 try { if (!GameLoad(new LpsDocument(File.ReadAllText(ExtensionValue.BaseDirectory + @"\Save.lps")))) diff --git a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs index ae6cf68..7696b71 100644 --- a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs @@ -1103,15 +1103,12 @@ namespace VPet_Simulator.Windows reloadid = mw.Set.SaveTimes; CBSaveReLoad.SelectedItem = null; CBSaveReLoad.Items.Clear(); - if (Directory.Exists(ExtensionValue.BaseDirectory + @"\BackUP")) + if (Directory.Exists(ExtensionValue.BaseDirectory + @"\Saves")) { - foreach (var file in new DirectoryInfo(ExtensionValue.BaseDirectory + @"\BackUP") - .GetFiles().OrderByDescending(x => x.LastWriteTime)) + foreach (var file in new DirectoryInfo(ExtensionValue.BaseDirectory + @"\Saves") + .GetFiles("Save*.lps").OrderByDescending(x => x.LastWriteTime)) { - if (file.Extension.ToLower() == ".lps") - { - CBSaveReLoad.Items.Add(file.Name.Split('.').First()); - } + CBSaveReLoad.Items.Add(file.Name.Split('.').First()); } CBSaveReLoad.SelectedIndex = 0; } @@ -1123,7 +1120,7 @@ namespace VPet_Simulator.Windows if (CBSaveReLoad.SelectedItem != null) { string txt = (string)CBSaveReLoad.SelectedItem; - string path = ExtensionValue.BaseDirectory + @"\BackUP\" + txt + ".lps"; + string path = ExtensionValue.BaseDirectory + @"\Saves\" + txt + ".lps"; if (File.Exists(path)) { try From b162309c58313dea515c25dc5138256740df5783 Mon Sep 17 00:00:00 2001 From: ZouJin <zoujin.dev@exlb.org> Date: Sun, 24 Sep 2023 23:35:49 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=B8=BA=E6=96=B0=E6=88=90=E5=B0=B1?= =?UTF-8?q?=E5=87=86=E5=A4=87=E7=9A=84=E6=96=B0=E7=BB=9F=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Display/WorkTimer.xaml.cs | 43 +++++++++++++++++-- VPet-Simulator.Windows/MainWindow.cs | 5 +++ VPet-Simulator.Windows/MainWindow.xaml.cs | 12 ++++++ .../WinDesign/TalkSelect.xaml.cs | 28 +++++++++++- 4 files changed, 82 insertions(+), 6 deletions(-) diff --git a/VPet-Simulator.Core/Display/WorkTimer.xaml.cs b/VPet-Simulator.Core/Display/WorkTimer.xaml.cs index bf3b8d3..61b2a64 100644 --- a/VPet-Simulator.Core/Display/WorkTimer.xaml.cs +++ b/VPet-Simulator.Core/Display/WorkTimer.xaml.cs @@ -41,6 +41,39 @@ namespace VPet_Simulator.Core /// </summary> public DateTime StartTime; /// <summary> + /// 任务完成时调用该参数 + /// </summary> + public event Action<FinishWorkInfo> E_FinishWork; + /// <summary> + /// 完成工作信息 + /// </summary> + public struct FinishWorkInfo + { + /// <summary> + /// 当前完成工作 + /// </summary> + public Work work; + /// <summary> + /// 当前完成工作收入 + /// </summary> + public double count; + /// <summary> + /// 当前完成工作花费时间 + /// </summary> + public double spendtime; + /// <summary> + /// 完成工作信息 + /// </summary> + /// <param name="work">当前工作</param> + /// <param name="count">当前盈利(自动计算附加)</param> + public FinishWorkInfo(Work work, double count) + { + this.work = work; + this.count = count * (1 + work.FinishBonus); + this.spendtime = work.Time; + } + } + /// <summary> /// UI相关显示 /// </summary> /// <param name="m"></param> @@ -55,17 +88,19 @@ namespace VPet_Simulator.Core //ts = TimeSpan.FromMinutes(MaxTime); //tleft = TimeSpan.Zero; //PBLeft.Value = MaxTime; + var fwi = new FinishWorkInfo(nowWork, GetCount); + E_FinishWork?.Invoke(fwi); if (nowWork.Type == Work.WorkType.Work) { m.Core.Save.Money += GetCount * nowWork.FinishBonus; - Stop(() => m.SayRnd(LocalizeCore.Translate("{2}完成啦, 累计赚了 {0:f2} 金钱\n共计花费了{1}分钟", GetCount * (1 + nowWork.FinishBonus), - nowWork.Time, nowWork.NameTrans), true)); + Stop(() => m.SayRnd(LocalizeCore.Translate("{2}完成啦, 累计赚了 {0:f2} 金钱\n共计花费了{1}分钟", fwi.count, + fwi.spendtime, fwi.work.NameTrans), true)); } else { m.Core.Save.Exp += GetCount * nowWork.FinishBonus; - Stop(() => m.SayRnd(LocalizeCore.Translate("{2}完成啦, 累计获得 {0:f2} 经验\n共计花费了{1}分钟", GetCount * (1 + nowWork.FinishBonus), - nowWork.Time, nowWork.NameTrans), true)); + Stop(() => m.SayRnd(LocalizeCore.Translate("{2}完成啦, 累计获得 {0:f2} 经验\n共计花费了{1}分钟", fwi.count, + fwi.spendtime, fwi.work.NameTrans), true)); } return; } diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index c50e3af..8e03731 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -459,6 +459,7 @@ namespace VPet_Simulator.Windows Core.Save.Money -= item.Price; //统计 + GameSavesData.Statistics[(gint)"stat_buytimes"]++; GameSavesData.Statistics[(gint)("buy_" + item.Name)]++; GameSavesData.Statistics[(gdbe)"stat_betterbuy"] += item.Price; switch (item.Type) @@ -471,6 +472,7 @@ namespace VPet_Simulator.Windows break; case Food.FoodType.Drug: GameSavesData.Statistics[(gdbe)"stat_bb_drug"] += item.Price; + GameSavesData.Statistics[(gdbe)"stat_bb_drug_exp"] += item.Exp; break; case Food.FoodType.Snack: GameSavesData.Statistics[(gdbe)"stat_bb_snack"] += item.Price; @@ -483,6 +485,7 @@ namespace VPet_Simulator.Windows break; case Food.FoodType.Gift: GameSavesData.Statistics[(gdbe)"stat_bb_gift"] += item.Price; + GameSavesData.Statistics[(gdbe)"stat_bb_gift_like"] += item.Likability; break; } } @@ -714,6 +717,8 @@ namespace VPet_Simulator.Windows if (CurrMusicType != null && Main.IsIdel) {//识别通过,开始跑跳舞动画 + //先统计下 + GameSavesData.Statistics[(gint)"stat_music"]++; Main.Display(Core.Graph.FindGraph("music", AnimatType.A_Start, Core.Save.Mode), Display_Music); } else diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index 8c70396..3e47ae9 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -545,6 +545,7 @@ namespace VPet_Simulator.Windows winSetting.Show(); }; Main.FunctionSpendHandle += lowStrength; + Main.WorkTimer.E_FinishWork += WorkTimer_E_FinishWork; Main.ToolBar.MenuMODConfig.Items.Add(m); try { @@ -802,6 +803,17 @@ namespace VPet_Simulator.Windows } + private void WorkTimer_E_FinishWork(WorkTimer.FinishWorkInfo obj) + { + if (obj.work.Type == GraphHelper.Work.WorkType.Work) + { + GameSavesData.Statistics[(gint)"stat_single_profit_money"] = (int)obj.count; + } + else + { + GameSavesData.Statistics[(gint)"stat_single_profit_exp"] = (int)obj.count; + } + } private void Main_Event_TouchBody() { diff --git a/VPet-Simulator.Windows/WinDesign/TalkSelect.xaml.cs b/VPet-Simulator.Windows/WinDesign/TalkSelect.xaml.cs index b6e1dbe..9878ab7 100644 --- a/VPet-Simulator.Windows/WinDesign/TalkSelect.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/TalkSelect.xaml.cs @@ -1,4 +1,5 @@ -using LinePutScript.Localization.WPF; +using LinePutScript; +using LinePutScript.Localization.WPF; using System; using System.Collections.Generic; using System.Linq; @@ -115,6 +116,29 @@ namespace VPet_Simulator.Windows var say = textList[tbTalk.SelectedIndex]; textList.RemoveAt(tbTalk.SelectedIndex); //聊天效果 + if (say.Exp != 0) + { + if (say.Exp > 0) + { + mw.GameSavesData.Statistics[(gint)"stat_say_exp_p"]++; + } + else + mw.GameSavesData.Statistics[(gint)"stat_say_exp_d"]++; + } + if (say.Likability != 0) + { + if (say.Likability > 0) + mw.GameSavesData.Statistics[(gint)"stat_say_like_p"]++; + else + mw.GameSavesData.Statistics[(gint)"stat_say_like_d"]++; + } + if(say.Money != 0) + { + if (say.Money > 0) + mw.GameSavesData.Statistics[(gint)"stat_say_money_p"]++; + else + mw.GameSavesData.Statistics[(gint)"stat_say_money_d"]++; + } mw.Main.Core.Save.EatFood(say); mw.Main.Core.Save.Money += say.Money; @@ -136,7 +160,7 @@ namespace VPet_Simulator.Windows break; } } - } + } RelsSelect(); } } From 2dd4393b9e5e0baae42def67846fcd656c7f69e1 Mon Sep 17 00:00:00 2001 From: ZouJin <zoujin.dev@exlb.org> Date: Mon, 25 Sep 2023 15:50:41 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=B8=BA=E6=96=B0=E6=88=90=E5=B0=B1?= =?UTF-8?q?=E5=87=86=E5=A4=87=E7=9A=84=E6=96=B0=E7=BB=9F=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E6=8D=AE2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/MainWindow.cs | 3 +++ VPet-Simulator.Windows/MainWindow.xaml.cs | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index 8e03731..a67bc43 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -308,6 +308,7 @@ namespace VPet_Simulator.Windows var item = food[Function.Rnd.Next(food.Count)]; Core.Save.Money -= item.Price * 0.2; TakeItem(item); + GameSavesData.Statistics[(gint)"stat_autobuy"]++; Main.Display(item.GetGraph(), item.ImageSource, Main.DisplayToNomal); } else if (Core.Save.StrengthDrink < 75) @@ -318,6 +319,7 @@ namespace VPet_Simulator.Windows var item = food[Function.Rnd.Next(food.Count)]; Core.Save.Money -= item.Price * 0.2; TakeItem(item); + GameSavesData.Statistics[(gint)"stat_autobuy"]++; Main.Display(item.GetGraph(), item.ImageSource, Main.DisplayToNomal); } else if (Set.AutoGift && Core.Save.Feeling < 50) @@ -328,6 +330,7 @@ namespace VPet_Simulator.Windows var item = food[Function.Rnd.Next(food.Count)]; Core.Save.Money -= item.Price * 0.2; TakeItem(item); + GameSavesData.Statistics[(gint)"stat_autogift"]++; Main.Display(item.GetGraph(), item.ImageSource, Main.DisplayToNomal); } } diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index 3e47ae9..61dcbc3 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -676,6 +676,7 @@ namespace VPet_Simulator.Windows m_menu = new ContextMenu(); + m_menu.Popup += (x, y) => { GameSavesData.Statistics[(gint)"stat_menu_pop"]++; }; m_menu.MenuItems.Add(new MenuItem("鼠标穿透".Translate(), (x, y) => { SetTransparentHitThrough(); }) { }); m_menu.MenuItems.Add(new MenuItem("操作教程".Translate(), (x, y) => { @@ -803,6 +804,11 @@ namespace VPet_Simulator.Windows } + private void M_menu_Popup(object sender, EventArgs e) + { + throw new NotImplementedException(); + } + private void WorkTimer_E_FinishWork(WorkTimer.FinishWorkInfo obj) { if (obj.work.Type == GraphHelper.Work.WorkType.Work) From b3c34106a05ecbf3e7cfdb0f27c340fb89df25c6 Mon Sep 17 00:00:00 2001 From: ZouJin <zoujin.dev@exlb.org> Date: Mon, 25 Sep 2023 16:52:20 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=B8=B0=E5=AF=8C?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/MainWindow.cs | 26 ++++++++++++++++++- VPet-Simulator.Windows/MainWindow.xaml.cs | 9 +++++++ VPet-Simulator.Windows/RichPresence.vdf | 24 ++++++++--------- .../mod/0000_core/lang/en/Base2309.lps | 5 +++- .../mod/0000_core/lang/zh-Hans/Base2309.lps | 5 +++- .../mod/0000_core/lang/zh-Hant/Base2309.lps | 3 +++ 6 files changed, 57 insertions(+), 15 deletions(-) diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index a67bc43..b1c623c 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -209,7 +209,7 @@ namespace VPet_Simulator.Windows if (File.Exists(ExtensionValue.BaseDirectory + @"\Save.lps")) File.Move(ExtensionValue.BaseDirectory + @"\Save.lps", ExtensionValue.BaseDirectory + @"\Save.bkp"); - + File.WriteAllText(ExtensionValue.BaseDirectory + $"\\Saves\\Save_{st}.lps", GameSavesData.ToLPS().ToString()); } } @@ -633,6 +633,14 @@ namespace VPet_Simulator.Windows } private void Handle_Steam(Main obj) { + if (HashCheck) + { + SteamFriends.SetRichPresence("lv", $" (lv{GameSavesData.GameSave.Level})"); + } + else + { + SteamFriends.SetRichPresence("lv", ""); + } if (Core.Save.Mode == GameSave.ModeType.Ill) { SteamFriends.SetRichPresence("steam_display", "#Status_Ill"); @@ -653,7 +661,23 @@ namespace VPet_Simulator.Windows if (obj.DisplayType.Name == "music") SteamFriends.SetRichPresence("steam_display", "#Status_Music"); else + { + switch (obj.DisplayType.Type) + { + case GraphType.Move: + SteamFriends.SetRichPresence("idel", "乱爬".Translate()); + break; + case GraphType.Idel: + case GraphType.StateONE: + case GraphType.StateTWO: + SteamFriends.SetRichPresence("idel", "发呆".Translate()); + break; + default: + SteamFriends.SetRichPresence("idel", "闲逛".Translate()); + break; + } SteamFriends.SetRichPresence("steam_display", "#Status_IDLE"); + } break; } } diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index 61dcbc3..d3c2d3c 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -477,6 +477,15 @@ namespace VPet_Simulator.Windows SteamFriends.SetRichPresence("username", Core.Save.Name); SteamFriends.SetRichPresence("mode", (Core.Save.Mode.ToString() + "ly").Translate()); SteamFriends.SetRichPresence("steam_display", "#Status_IDLE"); + SteamFriends.SetRichPresence("idel", "闲逛".Translate()); + if (HashCheck) + { + SteamFriends.SetRichPresence("lv", $" (lv{GameSavesData.GameSave.Level})"); + } + else + { + SteamFriends.SetRichPresence("lv", ""); + } } else { diff --git a/VPet-Simulator.Windows/RichPresence.vdf b/VPet-Simulator.Windows/RichPresence.vdf index babe22d..d433d9f 100644 --- a/VPet-Simulator.Windows/RichPresence.vdf +++ b/VPet-Simulator.Windows/RichPresence.vdf @@ -4,10 +4,10 @@ { "tokens" { - "#Status_IDLE" "%username%在%mode%闲逛" - "#Status_Music" "%username%在%mode%跳舞" - "#Status_Sleep" "%username%在%mode%睡大觉" - "#Status_Work" "%username%在%mode%%work%" + "#Status_IDLE" "%username%在%mode%%idel%%lv%" + "#Status_Music" "%username%在%mode%跳舞%lv%" + "#Status_Sleep" "%username%在%mode%睡大觉%lv%" + "#Status_Work" "%username%在%mode%%work%%lv%" "#Status_DIY" "%DIY%" "#Status_Ill" "%username% 生病了" } @@ -16,10 +16,10 @@ { "tokens" { - "#Status_IDLE" "%username%在%mode%閒逛" - "#Status_Music" "%username%在%mode%跳舞" - "#Status_Sleep" "%username%在%mode%睡大覺" - "#Status_Work" "%username%在%mode%%work%" + "#Status_IDLE" "%username%在%mode%%idel%%lv%" + "#Status_Music" "%username%在%mode%跳舞%lv%" + "#Status_Sleep" "%username%在%mode%睡大覺%lv%" + "#Status_Work" "%username%在%mode%%work%%lv%" "#Status_DIY" "%DIY%" "#Status_Ill" "%username% 生病了" } @@ -28,10 +28,10 @@ { "tokens" { - "#Status_IDLE" "%username% is %mode% idle" - "#Status_Music" "%username% dancing %mode%" - "#Status_Sleep" "%username% Sleep %mode%" - "#Status_Work" "%username% %work% %mode%" + "#Status_IDLE" "%username% is %mode% %idel%%lv%" + "#Status_Music" "%username% dancing %mode%%lv%" + "#Status_Sleep" "%username% Sleep %mode%%lv%" + "#Status_Work" "%username% %work% %mode%%lv%" "#Status_DIY" "%DIY%" "#Status_Ill" "%username% is sick" } diff --git a/VPet-Simulator.Windows/mod/0000_core/lang/en/Base2309.lps b/VPet-Simulator.Windows/mod/0000_core/lang/en/Base2309.lps index cb1a887..7310a07 100644 --- a/VPet-Simulator.Windows/mod/0000_core/lang/en/Base2309.lps +++ b/VPet-Simulator.Windows/mod/0000_core/lang/en/Base2309.lps @@ -35,4 +35,7 @@ EXP#EXP:| 在任务切换器中隐藏窗口#Hide window from task switcher:| 在Alt+Tab中隐藏#Hide from Alt+Tab:| 音频播放失败,已尝试自动切换到备用播放器. 如果问题持续,请检查是否已安装WindowsMediaPlayer#Audio playback failed, attempted automatic switch to backup player. If the issue persists, please check if Windows Media Player is installed.:| -音频错误#audio error:| \ No newline at end of file +音频错误#audio error:| +闲逛#Idle:| +乱爬#Climb:| +发呆#Stare:| \ No newline at end of file diff --git a/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hans/Base2309.lps b/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hans/Base2309.lps index 9501805..f7de0ec 100644 --- a/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hans/Base2309.lps +++ b/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hans/Base2309.lps @@ -35,4 +35,7 @@ EXP#EXP:| 在任务切换器中隐藏窗口#在任务切换器中隐藏窗口:| 在Alt+Tab中隐藏#在Alt+Tab中隐藏:| 音频播放失败,已尝试自动切换到备用播放器. 如果问题持续,请检查是否已安装WindowsMediaPlayer#音频播放失败,已尝试自动切换到备用播放器. 如果问题持续,请检查是否已安装WindowsMediaPlayer:| -音频错误#音频错误:| \ No newline at end of file +音频错误#音频错误:| +闲逛#闲逛:| +乱爬#乱爬:| +发呆#发呆:| \ No newline at end of file diff --git a/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hant/Base2309.lps b/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hant/Base2309.lps index 0bc167b..5562539 100644 --- a/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hant/Base2309.lps +++ b/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hant/Base2309.lps @@ -36,3 +36,6 @@ EXP#EXP:| 在Alt+Tab中隐藏#在Alt+Tab選單中隱藏視窗:| 音频播放失败,已尝试自动切换到备用播放器. 如果问题持续,请检查是否已安装WindowsMediaPlayer#無法播放音訊,已嘗試自動切換到備用播放器。如果問題仍然出現,請檢查是否已安裝WindowsMediaPlayer:| 音频错误#音訊錯誤:| +闲逛#閒逛:| +乱爬#亂爬:| +发呆#發呆:| \ No newline at end of file From 8abef6bd075e5446c880177b854895bbe1814b2a Mon Sep 17 00:00:00 2001 From: ZouJin <zoujin.dev@exlb.org> Date: Mon, 25 Sep 2023 17:44:02 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steam居然会自动云同步的时候创建个文件夹,太逊了 --- VPet-Simulator.Windows/MainWindow.xaml.cs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index d3c2d3c..c6234dd 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -156,14 +156,21 @@ namespace VPet_Simulator.Windows Closed += ForceClose; //更新存档系统 + if (Directory.Exists(ExtensionValue.BaseDirectory + @"\BackUP")) + { + if (!Directory.Exists(ExtensionValue.BaseDirectory + @"\Saves")) + Directory.Move(ExtensionValue.BaseDirectory + @"\BackUP", ExtensionValue.BaseDirectory + @"\Saves"); + else + { + foreach (var file in new DirectoryInfo(ExtensionValue.BaseDirectory + @"\BackUP").GetFiles()) + if (!File.Exists(ExtensionValue.BaseDirectory + @"\Saves\" + file.Name)) + file.MoveTo(ExtensionValue.BaseDirectory + @"\Saves\" + file.Name); + Directory.Delete(ExtensionValue.BaseDirectory + @"\BackUP"); + } + } if (!Directory.Exists(ExtensionValue.BaseDirectory + @"\Saves")) { - if (Directory.Exists(ExtensionValue.BaseDirectory + @"\BackUP")) - { - Directory.Move(ExtensionValue.BaseDirectory + @"\BackUP", ExtensionValue.BaseDirectory + @"\Saves"); - } - else - Directory.CreateDirectory(ExtensionValue.BaseDirectory + @"\Saves"); + Directory.CreateDirectory(ExtensionValue.BaseDirectory + @"\Saves"); } Task.Run(GameLoad); @@ -484,7 +491,7 @@ namespace VPet_Simulator.Windows } else { - SteamFriends.SetRichPresence("lv", ""); + SteamFriends.SetRichPresence("lv", " "); } } else From 22a32beb3a760ebfb5baece78a026d2918754cb6 Mon Sep 17 00:00:00 2001 From: ZouJin <zoujin.dev@exlb.org> Date: Mon, 25 Sep 2023 17:44:21 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=B8=B0=E5=AF=8C=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/MainWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index b1c623c..4f92d94 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -639,7 +639,7 @@ namespace VPet_Simulator.Windows } else { - SteamFriends.SetRichPresence("lv", ""); + SteamFriends.SetRichPresence("lv", " "); } if (Core.Save.Mode == GameSave.ModeType.Ill) { From f278442c71d843a9c9130a6cafb46dd46c10e61c Mon Sep 17 00:00:00 2001 From: ZouJin <zoujin.dev@exlb.org> Date: Mon, 25 Sep 2023 19:07:22 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=BC=80?= =?UTF-8?q?=E8=AF=BB=E5=A4=87=E4=BB=BD=E6=97=B6=E5=B7=A5=E4=BD=9C=E6=9C=AA?= =?UTF-8?q?=E5=81=9C=E6=AD=A2=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Display/WorkTimer.xaml.cs | 2 +- VPet-Simulator.Windows/MainWindow.xaml.cs | 2 ++ .../WinDesign/winGameSetting.xaml.cs | 12 +++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/VPet-Simulator.Core/Display/WorkTimer.xaml.cs b/VPet-Simulator.Core/Display/WorkTimer.xaml.cs index 61b2a64..909b23b 100644 --- a/VPet-Simulator.Core/Display/WorkTimer.xaml.cs +++ b/VPet-Simulator.Core/Display/WorkTimer.xaml.cs @@ -88,7 +88,7 @@ namespace VPet_Simulator.Core //ts = TimeSpan.FromMinutes(MaxTime); //tleft = TimeSpan.Zero; //PBLeft.Value = MaxTime; - var fwi = new FinishWorkInfo(nowWork, GetCount); + FinishWorkInfo fwi = new FinishWorkInfo(nowWork, GetCount); E_FinishWork?.Invoke(fwi); if (nowWork.Type == Work.WorkType.Work) { diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index c6234dd..8ed9fed 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -165,6 +165,8 @@ namespace VPet_Simulator.Windows foreach (var file in new DirectoryInfo(ExtensionValue.BaseDirectory + @"\BackUP").GetFiles()) if (!File.Exists(ExtensionValue.BaseDirectory + @"\Saves\" + file.Name)) file.MoveTo(ExtensionValue.BaseDirectory + @"\Saves\" + file.Name); + else + file.Delete(); Directory.Delete(ExtensionValue.BaseDirectory + @"\BackUP"); } } diff --git a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs index 7696b71..6342ded 100644 --- a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs @@ -1075,6 +1075,11 @@ namespace VPet_Simulator.Windows { mw.Set.EnableFunction = false; combCalFunState.IsEnabled = true; + if (mw.Main.State != Main.WorkingState.Nomal) + { + mw.Main.WorkTimer.Visibility = Visibility.Collapsed; + mw.Main.State = Main.WorkingState.Nomal; + } } } @@ -1132,8 +1137,13 @@ namespace VPet_Simulator.Windows { try { + if (mw.Main.State != Main.WorkingState.Nomal) + { + mw.Main.WorkTimer.Visibility = Visibility.Collapsed; + mw.Main.State = Main.WorkingState.Nomal; + } if (!mw.GameLoad(l)) - MessageBoxX.Show("存档损毁,无法加载该存档\n可能是上次储存出错或Steam云同步导致的\n请在设置中加载备份还原存档", "存档损毁".Translate()); + MessageBoxX.Show("存档损毁,无法加载该存档\n可能是上次储存出错或Steam云同步导致的\n请在设置中加载备份还原存档", "存档损毁".Translate()); } catch (Exception ex) {