WIn_RustTools/Views/SettingsPage.xaml
muqing 7735738c3d 简化和优化代码,添加新 JSON 文件
此次提交主要对代码进行了简化和优化,具体更改如下:

1. 在 `App.xaml` 中,将 `ConCernItem` 的 `DataTemplate` 从 `StackPanel` 改为 `Grid`,并添加了 `Grid.ColumnDefinitions` 和 `Grid.RowDefinitions`。
2. 在 `App.xaml.cs` 中,删除了创建和解压缩 `RustCode` 目录的代码,改为直接从 `Assets` 目录获取 `DataBaseManifest` 文件,并更新了异常处理逻辑。
3. 在 `RustTools.csproj` 中,添加了新的 `PackageReference`,更新了 `RestSharp` 的版本,并注释掉了 `squirrel.windows` 的引用。
4. 在 `PostRwmod.xaml.cs` 中,删除了 `SharpCompress.Common` 和 `TinyPinyin` 的引用。
5. 在 `CodeDataPage.xaml.cs` 中,更新了 `filePath` 的路径,从 `ApplicationData.Current.LocalFolder.Path` 改为 `AppContext.BaseDirectory`。
6. 在 `ConcernPage.xaml` 中,调整了 `StackPanelA` 的 `MinWidth` 属性,并删除了 `StackPanel` 的 `Background` 属性。
7. 在 `ConcernPage.xaml.cs` 中,更新了 `Getlist` 方法的逻辑,增加了对 `response` 的空值和错误码检查。
8. 在 `ModulePage.xaml.cs` 中,删除了 `SharpCompress.Common` 和 `WinRT.Interop` 的引用。
9. 在 `SettingsPage.xaml` 中,更新了 `PersonPicture` 的 `ToolTipService.ToolTip` 属性。
10. 在 `IniHelper.cs` 中,更新了 `Load` 方法的 `filePath` 路径,并添加了目录不存在时创建目录的逻辑。
11. 在 `wj.cs` 中,更新了 `CD` 的路径为 `AppContext.BaseDirectory`,并注释掉了废弃的路径。
12. 在 `config.ini` 中,添加了 `[Settings]` 节点和 `SystemBackdrop=Mica` 设置。

此外,添加了以下新 JSON 文件:
1. `DataBaseManifest.json`:包含数据集的基本信息和数据表的映射。
2. `game_version.json`:包含游戏版本数据。
3. `section.json`:包含铁锈助手节名数据。
4. `value_type.json`:定义了一个名为 "值类型表" 的数据结构,包含多个值类型及其详细信息。
2025-01-20 22:43:40 +08:00

125 lines
6.6 KiB
XML

<Page
x:Class="RustTools.Views.SettingsPage"
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:helpers="using:RustTools.Helpers"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:xaml="using:Microsoft.UI.Xaml"
mc:Ignorable="d">
<Page.Resources>
<helpers:EnumToBooleanConverter x:Key="EnumToBooleanConverter" />
</Page.Resources>
<ScrollView HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<Grid>
<StackPanel x:Name="ContentArea">
<TextBlock x:Uid="Settings_Personalization" Style="{ThemeResource SubtitleTextBlockStyle}" />
<StackPanel Margin="{StaticResource SmallTopBottomMargin}">
<TextBlock x:Uid="Settings_Theme" />
<StackPanel Margin="{StaticResource XSmallTopMargin}" Orientation="Horizontal">
<RadioButton
x:Uid="Settings_Theme_Light"
Command="{x:Bind ViewModel.SwitchThemeCommand}"
FontSize="15"
GroupName="AppTheme"
IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Light, Mode=OneWay}">
<RadioButton.CommandParameter>
<xaml:ElementTheme>Light</xaml:ElementTheme>
</RadioButton.CommandParameter>
</RadioButton>
<RadioButton
x:Uid="Settings_Theme_Dark"
Command="{x:Bind ViewModel.SwitchThemeCommand}"
FontSize="15"
GroupName="AppTheme"
IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Dark, Mode=OneWay}">
<RadioButton.CommandParameter>
<xaml:ElementTheme>Dark</xaml:ElementTheme>
</RadioButton.CommandParameter>
</RadioButton>
<RadioButton
x:Uid="Settings_Theme_Default"
Command="{x:Bind ViewModel.SwitchThemeCommand}"
FontSize="15"
GroupName="AppTheme"
IsChecked="{x:Bind ViewModel.ElementTheme, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Default, Mode=OneWay}">
<RadioButton.CommandParameter>
<xaml:ElementTheme>Default</xaml:ElementTheme>
</RadioButton.CommandParameter>
</RadioButton>
</StackPanel>
<RadioButtons
x:Name="BackgroundRadioButtons"
Margin="{StaticResource XSmallTopMargin}"
Header="窗口背景材质"
MaxColumns="4">
<x:String>None</x:String>
<x:String>Blur</x:String>
<x:String>AcrylicBlur</x:String>
<x:String>Mica</x:String>
</RadioButtons>
</StackPanel>
<TextBlock
Margin="{StaticResource XSmallTopMargin}"
Style="{ThemeResource SubtitleTextBlockStyle}"
Text="基础配只因" />
<StackPanel Margin="{StaticResource SmallTopBottomMargin}">
<TextBlock Text="模组路径" />
<AutoSuggestBox
Name="ModFileUrlText"
Margin="{StaticResource XSmallTopMargin}"
LostFocus="ModFileUrlText_LostFocus"
PlaceholderText="输入或者搜索路径(取消焦点保存)"
QueryIcon="Find"
QuerySubmitted="AutoSuggestBox_Url" />
<TextBlock Margin="0,9,0,0" Text="地图路径" />
<AutoSuggestBox
Name="MapsFileUrlText"
Margin="{StaticResource XSmallTopMargin}"
LostFocus="ModFileUrlText_LostFocus"
PlaceholderText="输入或者搜索路径(取消焦点保存)"
QueryIcon="Find"
QuerySubmitted="AutoSuggestBox_Url" />
</StackPanel>
<TextBlock x:Uid="Settings_About" Style="{ThemeResource SubtitleTextBlockStyle}" />
<StackPanel Margin="{StaticResource XSmallTopMargin}">
<TextBlock Style="{ThemeResource BodyTextBlockStyle}" Text="{x:Bind ViewModel.VersionDescription, Mode=OneWay}" />
<TextBlock
x:Uid="Settings_AboutDescription"
Margin="{StaticResource XSmallTopMargin}"
Style="{ThemeResource BodyTextBlockStyle}" />
<StackPanel Orientation="Horizontal">
<HyperlinkButton
Margin="{StaticResource SettingsPageHyperlinkButtonMargin}"
Content="开源地址"
NavigateUri="https://git.coldmint.top/muqing" />
<HyperlinkButton x:Uid="SettingsPage_PrivacyTermsLink" Margin="{StaticResource SettingsPageHyperlinkButtonMargin}" />
<HyperlinkButton
Margin="{StaticResource SettingsPageHyperlinkButtonMargin}"
Content="创建快捷方式"
NavigateUri="https://blog.csdn.net/Tisfy/article/details/132254567" />
</StackPanel>
</StackPanel>
<TextBlock Style="{ThemeResource SubtitleTextBlockStyle}" Text="特别鸣谢" />
<StackPanel Margin="{StaticResource XSmallTopMargin}" Orientation="Horizontal">
<PersonPicture
Width="56"
Height="56"
Margin="6"
ProfilePicture="http://q.qlogo.cn/headimg_dl?dst_uin=2923268971&amp;spec=640&amp;img_type=jpg"
ToolTipService.ToolTip="感谢薄荷对本软件后端的帮助" />
</StackPanel>
</StackPanel>
</Grid>
</ScrollView>
</Page>