设置支持搜索功能

This commit is contained in:
ZouJin 2023-10-13 21:38:05 +08:00
parent 3e673083b6
commit 54dd8fb1bd
5 changed files with 62 additions and 35 deletions

View File

@ -19,8 +19,11 @@
<ColumnDefinition x:Name="SettingMenuWidth" Width="150" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBox x:Name="tb_seach_menu" FontSize="16" pu:TextBoxHelper.Watermark="{ll:Str 搜索设置}"
Style="{DynamicResource StandardTextBoxStyle}" VerticalAlignment="Top" Margin="3,6,6,0" TextChanged="tb_seach_menu_textchange" />
<ListBox x:Name="ListMenu" ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="3,3,6,3" BorderBrush="{DynamicResource Primary}"
ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="3,40,6,3"
BorderBrush="{DynamicResource Primary}"
pu:ListBoxHelper.CornerRadius="5" BorderThickness="2" Background="{DynamicResource SecondaryLighter}"
pu:ListBoxHelper.ItemsHoverBackground="{DynamicResource Primary}"
pu:ListBoxHelper.ItemsSelectedBackground="{DynamicResource SecondaryLight}" />

View File

@ -225,39 +225,58 @@ namespace VPet_Simulator.Windows
};
voicetimer.Tick += Voicetimer_Tick;
//为侧边添加目录
ListMenuItems.Add(listmenuswith("置于顶层", 0, TopMostBox));
ListMenuItems.Add(listmenuswith("开机启动", 0, StartUpBox));
ListMenuItems.Add(listmenuswith("宠物动画", 0, PetBox));
ListMenuItems.Add(listmenuswith("隐藏窗口", 0, SwitchHideFromTaskControl));
ListMenuItems.Add(listmenuswith("自动保存频率", 1, CBAutoSave));
ListMenuItems.Add(listmenuswith("从备份中还原", 1, numBackupSaveMaxNum));
ListMenuItems.Add(listmenuswith("聊天设置", 1, RBCGPTUseLB));
ListMenuItems.Add(listmenuswith("游戏操作", 1, btn_cleancache));
ListMenuItems.Add(listmenuswith("桌宠多开", 1, btn_mutidel));
ListMenuItems.Add(listmenuswith("互动设置", 2, CalFunctionBox));
ListMenuItems.Add(listmenuswith("计算间隔", 2, CalSlider));
ListMenuItems.Add(listmenuswith("桌宠移动", 2, MoveEventBox));
ListMenuItems.Add(listmenuswith("操作设置", 2, PressLengthSlider));
ListMenuItems.Add(listmenuswith("桌宠名字", 2, TextBoxPetName));
ListMenuItems.Add(listmenuswith("音乐识别设置", 2, VoiceMaxSilder));
ListMenuItems.Add(listmenuswith("自定义链接", 3, btn_DIY));
ListMenuItems.Add(listmenuswith("自动超模MOD优化", 4, swAutoCal));
ListMenuItems.Add(listmenuswith("诊断与反馈", 4, RBDiagnosisYES));
ListMenuItems.Add(listmenuswith("MOD管理", 5, ButtonOpenModFolder));
ListMenuItems.Add(listmenuswith("关于", 6, ImageWHY));
foreach (var v in ListMenuItems)
ListMenu.Items.Add(v);
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("桌宠多开", 1, btn_mutidel));
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));
}
public List<ListBoxItem> ListMenuItems = new List<ListBoxItem>();
private void tb_seach_menu_textchange(object sender, TextChangedEventArgs e)
{
if (!AllowChange)
return;
ListMenu.Items.Clear();
if (string.IsNullOrEmpty(tb_seach_menu.Text))
{
foreach (var v in ListMenuItems)
ListMenu.Items.Add(v);
return;
}
foreach (var v in ListMenuItems)
{
if (((string)v.Content).Contains(tb_seach_menu.Text))
ListMenu.Items.Add(v);
}
}
private ListBoxItem listmenuswith(string content, int page, FrameworkElement element)
@ -1361,7 +1380,7 @@ namespace VPet_Simulator.Windows
mw.Core.Save = mw.GameSavesData.GameSave;
if (oldsave.HashCheck) // 对于重开无作弊的玩家保留统计
mw.GameSavesData.Statistics = oldsave.Statistics;
mw.HashCheck = true;
mw.HashCheck = true;
MessageBoxX.Show("重置成功".Translate());
}
}
@ -1416,6 +1435,8 @@ namespace VPet_Simulator.Windows
new MainWindow(savename).Show();
}
private void SwitchHideFromTaskControl_OnChecked(object sender, RoutedEventArgs e)
{
if (!AllowChange)

View File

@ -18,4 +18,5 @@ selecttext#Options Chat Text:|
存档名不能包括特殊符号#Archive name cannot include special symbols:|
存档名重复#Duplicate archive name:|
当前多开已经加载#Currently loaded:|
导致的\n如有可能请发送 错误信息截图和引发错误之前的操作给相应MOD作者\n感谢您对MOD开发的支持\n#Caused. \nIf possible, please send the error message screenshot and the operation before the error to the corresponding MOD author\nThank you for your support for MOD development\n:|
导致的\n如有可能请发送 错误信息截图和引发错误之前的操作给相应MOD作者\n感谢您对MOD开发的支持\n#Caused. \nIf possible, please send the error message screenshot and the operation before the error to the corresponding MOD author\nThank you for your support for MOD development\n:|
搜索设置#Search settings:|

View File

@ -18,4 +18,5 @@ selecttext#选项聊天文本:|
存档名不能包括特殊符号#存档名不能包括特殊符号:|
存档名重复#存档名重复:|
当前多开已经加载#当前多开已经加载:|
导致的\n如有可能请发送 错误信息截图和引发错误之前的操作给相应MOD作者\n感谢您对MOD开发的支持\n#导致的\n如有可能请发送 错误信息截图和引发错误之前的操作给相应MOD作者\n感谢您对MOD开发的支持\n:|
导致的\n如有可能请发送 错误信息截图和引发错误之前的操作给相应MOD作者\n感谢您对MOD开发的支持\n#导致的\n如有可能请发送 错误信息截图和引发错误之前的操作给相应MOD作者\n感谢您对MOD开发的支持\n:|
搜索设置#搜索设置:|

View File

@ -18,4 +18,5 @@ selecttext#選項聊天文字:|
存档名不能包括特殊符号#存檔名不能包括特殊符號:|
存档名重复#存檔名重複:|
当前多开已经加载#當前多開已經加載:|
导致的\n如有可能请发送 错误信息截图和引发错误之前的操作给相应MOD作者\n感谢您对MOD开发的支持\n#導致的\n如有可能請發送 錯誤信息截圖和引發錯誤之前的操作給相應MOD作者\n感謝您對MOD開發的\n:|
导致的\n如有可能请发送 错误信息截图和引发错误之前的操作给相应MOD作者\n感谢您对MOD开发的支持\n#導致的\n如有可能請發送 錯誤信息截圖和引發錯誤之前的操作給相應MOD作者\n感謝您對MOD開發的\n:|
搜索设置#搜索設定:|