新增设置导航

This commit is contained in:
ZouJin 2023-10-12 00:08:04 +08:00
parent 4c551b9ada
commit 61c08cc6a0
5 changed files with 80 additions and 14 deletions

View File

@ -6,9 +6,9 @@
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"
Width="{ll:Dbe SettingWidth, DefValue=650}" Height="550" Closing="WindowX_Closing" FontSize="16"
Style="{DynamicResource BaseWindowXStyle}" Topmost="True" WindowStartupLocation="CenterScreen" mc:Ignorable="d">
xmlns:system="clr-namespace:System;assembly=mscorlib" Width="{ll:Dbe SettingWidth, DefValue=650}" Height="550"
Closing="WindowX_Closing" FontSize="16" Style="{DynamicResource BaseWindowXStyle}" Topmost="True"
WindowStartupLocation="CenterScreen" mc:Ignorable="d">
<!--<pu:WindowX.Resources>
<DataTemplate x:Key="DIYDataTemplate">
@ -16,9 +16,15 @@
</pu:WindowX.Resources>-->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition x:Name="SettingMenuWidth" Width="150" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ListBox x:Name="ListMenu" ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="3,3,6,3" BorderBrush="{DynamicResource Primary}"
pu:ListBoxHelper.CornerRadius="5" BorderThickness="2" Background="{DynamicResource SecondaryLighter}"
pu:ListBoxHelper.ItemsHoverBackground="{DynamicResource Primary}"
pu:ListBoxHelper.ItemsSelectedBackground="{DynamicResource SecondaryLight}" />
<GridSplitter Width="3" Background="{DynamicResource PrimaryDarker}" />
<TabControl x:Name="MainTab" Margin="5" pu:TabControlHelper.CanHeaderPanelScroll="True"
pu:TabControlHelper.ItemsCornerRadius="4" pu:TabControlHelper.ItemsHeight="NaN"
pu:TabControlHelper.ItemsHoverBackground="{DynamicResource PrimaryLight}"
@ -384,9 +390,14 @@
<Button Grid.Row="1" Grid.Column="2" Margin="4" Padding="1" pu:ButtonHelper.CornerRadius="4"
Background="{DynamicResource SecondaryLight}" Content="{ll:Str 重新开始}"
ToolTip="{ll:Str '重新开始新游戏,重置统计等信息\&#13;对于想要获得脱离超模从而获得成就非常有帮助'}" 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 '清理缓存的动画,声音文件'}" />
<Button x:Name="btn_cleancache" 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 '清理缓存的动画,声音文件'}" />
<TextBlock Margin="0,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"
Background="{x:Null}" TextWrapping="Wrap">
<Run FontSize="18" FontWeight="Bold" Text="{ll:Str 桌宠多开}" />
</TextBlock>
</StackPanel>
</ScrollViewer>
</TabItem>
@ -702,7 +713,7 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Margin="4" Padding="1" pu:ButtonHelper.CornerRadius="4"
<Button x:Name="btn_DIY" Margin="4" Padding="1" pu:ButtonHelper.CornerRadius="4"
Background="{DynamicResource SecondaryLight}" Click="DIY_ADD_Click"
Content="{ll:Str 添加新链接}" />
<Button Grid.Column="1" Margin="4" Padding="1" pu:ButtonHelper.CornerRadius="4"
@ -960,7 +971,7 @@
</Grid>
</TabItem>
</TabControl>
<Label x:Name="GameVerison" HorizontalAlignment="Left" VerticalAlignment="Bottom" Background="{x:Null}"
<Label x:Name="GameVerison" HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="{x:Null}"
Content="版本v1.0 (655366666)" FontSize="10" Foreground="Green" Grid.ColumnSpan="2" />
</Grid>
</pu:WindowX>

View File

@ -6,6 +6,7 @@ using Steamworks.Ugc;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.IO;
using System.Linq;
using System.Threading;
@ -41,7 +42,7 @@ namespace VPet_Simulator.Windows
//Console.WriteLine(DateTime.Now.ToString("mm:ss.fff"));
Title = "设置".Translate() + ' ' + mw.PrefixSave;
SettingMenuWidth.Width = new GridLength(LocalizeCore.GetDouble("SettingMenuWidth", 150));
TopMostBox.IsChecked = mw.Set.TopMost;
if (mw.Set.IsBiggerScreen)
{
@ -218,8 +219,57 @@ namespace VPet_Simulator.Windows
AllowChange = true;
UpdateMoveAreaText();
//为侧边添加目录
ListMenu.Items.Add(listmenuswith("置于顶层", 0, TopMostBox));
ListMenu.Items.Add(listmenuswith("开机启动", 0, StartUpBox));
ListMenu.Items.Add(listmenuswith("宠物动画", 0, PetBox));
ListMenu.Items.Add(listmenuswith("隐藏窗口", 0, SwitchHideFromTaskControl));
ListMenu.Items.Add(listmenuswith("自动保存频率", 1, CBAutoSave));
ListMenu.Items.Add(listmenuswith("从备份中还原", 1, numBackupSaveMaxNum));
ListMenu.Items.Add(listmenuswith("聊天设置", 1, RBCGPTUseLB));
ListMenu.Items.Add(listmenuswith("游戏操作", 1, btn_cleancache));
ListMenu.Items.Add(listmenuswith("互动设置", 2, CalFunctionBox));
ListMenu.Items.Add(listmenuswith("计算间隔", 2, CalSlider));
ListMenu.Items.Add(listmenuswith("桌宠移动", 2, MoveEventBox));
ListMenu.Items.Add(listmenuswith("操作设置", 2, PressLengthSlider));
ListMenu.Items.Add(listmenuswith("桌宠名字", 2, TextBoxPetName));
ListMenu.Items.Add(listmenuswith("音乐识别设置", 2, VoiceMaxSilder));
ListMenu.Items.Add(listmenuswith("自定义链接", 3, btn_DIY));
ListMenu.Items.Add(listmenuswith("自动超模MOD优化", 4, swAutoCal));
ListMenu.Items.Add(listmenuswith("诊断与反馈", 4, RBDiagnosisYES));
ListMenu.Items.Add(listmenuswith("MOD管理", 5, ButtonOpenModFolder));
ListMenu.Items.Add(listmenuswith("关于", 6, ImageWHY));
}
private ListBoxItem listmenuswith(string content, int page, FrameworkElement element)
{
var lbi = new ListBoxItem() { Content = content.Translate() };
lbi.PreviewMouseLeftButtonDown += (_, _) =>
{
if (page >= 0 && page <= 6)
MainTab.SelectedIndex = page;
if (page == 2)
{
voicetimer.Start();
}
Task.Run(() =>
{
Thread.Sleep(100);
Dispatcher.Invoke(element.BringIntoView);
});
};
return lbi;
}
private void Voicetimer_Tick(object sender, EventArgs e)
{
var v = mw.AudioPlayingVolume();
@ -1146,7 +1196,7 @@ namespace VPet_Simulator.Windows
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)
{

View File

@ -449,5 +449,7 @@ come on baby~#come on baby~:|
没钱也能吃,可以用来拯救存档(饥饿/口渴不足), 没事别吃这个#Need no money to eat, it used to save game (hunger/thirst). Don't eat this if you have nothing to do:|
分钟#Min:|
钱#$:|
未翻译文档提交#Untranslated Documents Submission:|
{0:f1} 秒#{0:f1} Sec:|
SettingWidth#700:|
SettingWidth#850:|
SettingMenuWidth#200:|

View File

@ -452,4 +452,6 @@ come on baby~#come on baby~:|
分钟#分钟:|
钱#金钱:|
{0:f1} 秒#{0:f1} 秒:|
SettingWidth#500:|
SettingWidth#650:|
SettingMenuWidth#150:|
未翻译文档提交#未翻译文档提交:|

View File

@ -452,5 +452,6 @@ come on baby~#come on baby~:|
分钟#分鐘:|
钱#財產:|
{0:f1} 秒#{0:f1} 秒:|
SettingWidth#500:|
SettingWidth#650:|
SettingMenuWidth#150:|
未翻译文档提交#提交未翻譯字串:|