XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
返回提交历史

SpaceEngineersModDev/SpaceEngineersBlueprintEditorInWinUI

引用社区工具包完成设置界面的展开选项卡

5b46e20
XFE工作室室长 <mail@xfegzs.com>
提交于

代码差异

17 个文件 +188 -20
Deleted SpaceEngineersBlueprintEditor/Assets/Images/LockScreenLogo.scale-200.png +0 -0
二进制文件已变更,无法进行逐行预览。
Deleted SpaceEngineersBlueprintEditor/Assets/Images/SplashScreen.scale-200.png +0 -0
二进制文件已变更,无法进行逐行预览。
Deleted SpaceEngineersBlueprintEditor/Assets/Images/Square44x44Logo.targetsize-24_altform-unplated.png +0 -0
二进制文件已变更,无法进行逐行预览。
Deleted SpaceEngineersBlueprintEditor/Assets/Images/Wide310x150Logo.scale-200.png +0 -0
二进制文件已变更,无法进行逐行预览。
Modified SpaceEngineersBlueprintEditor/Package.appxmanifest +3 -2
@@ -39,14 +39,15 @@
39 39 BackgroundColor="transparent"
40 40 Square150x150Logo="Assets\Images\EditorIcon300x300.png"
41 41 Square44x44Logo="Assets\Images\EditorIcon88x88.png">
42 <uap:DefaultTile Wide310x150Logo="Assets\Images\Wide310x150Logo.png" Square310x310Logo="Assets\Images\EditorIcon.png" Square71x71Logo="Assets\Images\EditorIcon88x88.png">
42 <uap:DefaultTile Wide310x150Logo="Assets\Images\EditorIcon.png" Square310x310Logo="Assets\Images\EditorIcon.png" Square71x71Logo="Assets\Images\EditorIcon88x88.png">
43 43 <uap:ShowNameOnTiles>
44 44 <uap:ShowOn Tile="square150x150Logo"/>
45 45 <uap:ShowOn Tile="wide310x150Logo"/>
46 46 <uap:ShowOn Tile="square310x310Logo"/>
47 47 </uap:ShowNameOnTiles>
48 48 </uap:DefaultTile >
49 <uap:SplashScreen Image="Assets\Images\SplashScreen.png" />
49 <uap:SplashScreen Image="Assets\Images\EditorIcon.png" />
50 <uap:LockScreen BadgeLogo="Assets\Images\EditorIcon50x50.png" Notification="badgeAndTileText"/>
50 51 </uap:VisualElements>
51 52 </Application>
52 53 </Applications>
Added SpaceEngineersBlueprintEditor/Profiles/SystemProfile.cs +9 -0
@@ -0,0 +1,9 @@
1 using XFEExtension.NetCore.AutoConfig;
2
3 namespace SpaceEngineersBlueprintEditor.Profiles;
4
5 public partial class SystemProfile
6 {
7 [ProfileProperty]
8 private ElementTheme theme;
9 }
Modified SpaceEngineersBlueprintEditor/SpaceEngineersBlueprintEditor.csproj +3 -4
@@ -1,7 +1,7 @@
1 1 <Project Sdk="Microsoft.NET.Sdk">
2 2 <PropertyGroup>
3 3 <OutputType>WinExe</OutputType>
4 <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
4 <TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
5 5 <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
6 6 <RootNamespace>SpaceEngineersBlueprintEditor</RootNamespace>
7 7 <ApplicationManifest>app.manifest</ApplicationManifest>
@@ -15,6 +15,7 @@
15 15 <WindowsSdkPackageVersion>10.0.19041.39</WindowsSdkPackageVersion>
16 16 <!--<WindowsPackageType>None</WindowsPackageType>-->
17 17 <!--<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>-->
18 <WindowsSdkPackageVersion>10.0.22621.38</WindowsSdkPackageVersion>
18 19 </PropertyGroup>
19 20 <ItemGroup>
20 21 <None Remove="Assets\Icons\EditorIcon.ico" />
@@ -55,6 +56,7 @@
55 56 </ItemGroup>
56 57 <ItemGroup>
57 58 <PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
59 <PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.1.240916" />
58 60 <PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
59 61 <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240923002" />
60 62 <PackageReference Include="XFEExtension.NetCore" Version="3.1.4" />
@@ -62,9 +64,6 @@
62 64 <PackageReference Include="XFEExtension.NetCore.AutoPath" Version="1.0.1" />
63 65 <PackageReference Include="XFEExtension.NetCore.TodoHighLight" Version="1.0.0" />
64 66 </ItemGroup>
65 <ItemGroup>
66 <Folder Include="Profiles\" />
67 </ItemGroup>
68 67 <ItemGroup>
69 68 <Page Update="Views\BlueprintEditorPage.xaml">
70 69 <Generator>MSBuild:Compile</Generator>
Modified SpaceEngineersBlueprintEditor/Strings/en-us/Resources.resw +30 -3
@@ -117,9 +117,6 @@
117 117 <resheader name="writer">
118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119 119 </resheader>
120 <data name="AppTitle" xml:space="preserve">
121 <value>SpaceEngineersBlueprintEditor</value>
122 </data>
123 120 <data name="ShellItem_EditorPage.Content" xml:space="preserve">
124 121 <value>Edit Blueprint</value>
125 122 </data>
@@ -144,4 +141,34 @@
144 141 <data name="DragFileToEditorText" xml:space="preserve">
145 142 <value>Drag Blueprint Here</value>
146 143 </data>
144 <data name="AppInfo_Author.Header" xml:space="preserve">
145 <value>Author</value>
146 </data>
147 <data name="AppInfo_Contact.Header" xml:space="preserve">
148 <value>Contact Us</value>
149 </data>
150 <data name="AppInfo_Expander.Description" xml:space="preserve">
151 <value>CopyRight © 2024 XFEstudio. All rights reserved.</value>
152 </data>
153 <data name="AppInfo_Expander.Header" xml:space="preserve">
154 <value>SpaceEngineers Blueprint Editor</value>
155 </data>
156 <data name="AppInfo_GithubProject.Header" xml:space="preserve">
157 <value>Github Repo</value>
158 </data>
159 <data name="AppInfo_Contact_Bilibili.Content" xml:space="preserve">
160 <value>Bilibili</value>
161 </data>
162 <data name="AppInfo_Contact_Github.Content" xml:space="preserve">
163 <value>Github</value>
164 </data>
165 <data name="AppInfo_Contact_QQ.Content" xml:space="preserve">
166 <value>SpaceEnginners Group</value>
167 </data>
168 <data name="AppInfo_Contact_Twitter.Content" xml:space="preserve">
169 <value>Twitter(X)</value>
170 </data>
171 <data name="AppInfo_Contact_Youtube.Content" xml:space="preserve">
172 <value>Youtube</value>
173 </data>
147 174 </root>
Modified SpaceEngineersBlueprintEditor/Strings/zh-cn/Resources.resw +30 -3
@@ -117,9 +117,6 @@
117 117 <resheader name="writer">
118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119 119 </resheader>
120 <data name="AppTitle" xml:space="preserve">
121 <value>太空工程师蓝图修改器</value>
122 </data>
123 120 <data name="ShellItem_EditorPage.Content" xml:space="preserve">
124 121 <value>编辑蓝图</value>
125 122 </data>
@@ -144,4 +141,34 @@
144 141 <data name="DragFileToEditorText" xml:space="preserve">
145 142 <value>拖动蓝图文件至此处</value>
146 143 </data>
144 <data name="AppInfo_Expander.Header" xml:space="preserve">
145 <value>太空工程师蓝图修改器</value>
146 </data>
147 <data name="AppInfo_Author.Header" xml:space="preserve">
148 <value>作者</value>
149 </data>
150 <data name="AppInfo_Expander.Description" xml:space="preserve">
151 <value>版权所有 © 2024 XFEstudio. All rights reserved.</value>
152 </data>
153 <data name="AppInfo_GithubProject.Header" xml:space="preserve">
154 <value>Github仓库</value>
155 </data>
156 <data name="AppInfo_Contact.Header" xml:space="preserve">
157 <value>联系我们</value>
158 </data>
159 <data name="AppInfo_Contact_QQ.Content" xml:space="preserve">
160 <value>太空工程师交流群</value>
161 </data>
162 <data name="AppInfo_Contact_Youtube.Content" xml:space="preserve">
163 <value>油管</value>
164 </data>
165 <data name="AppInfo_Contact_Twitter.Content" xml:space="preserve">
166 <value>推特(X)</value>
167 </data>
168 <data name="AppInfo_Contact_Github.Content" xml:space="preserve">
169 <value>Github</value>
170 </data>
171 <data name="AppInfo_Contact_Bilibili.Content" xml:space="preserve">
172 <value>哔哩哔哩</value>
173 </data>
147 174 </root>
Added SpaceEngineersBlueprintEditor/Utilities/AppPath.cs +24 -0
@@ -0,0 +1,24 @@
1 using System.Reflection;
2 using XFEExtension.NetCore.AutoPath;
3
4 namespace SpaceEngineersBlueprintEditor.Utilities;
5
6 public partial class AppPath
7 {
8 [AutoPath]
9 private static readonly string appSynData = @$"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}\SpaceEngineersBlueprintsEditor";
10 [AutoPath]
11 private static readonly string appLocalData = @$"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\SpaceEngineersBlueprintsEditor\CrossVersion";
12 [AutoPath]
13 private static readonly string appLocalVersionData = @$"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\SpaceEngineersBlueprintsEditor\Versions\{(Assembly.GetExecutingAssembly()?.GetName()?.Version?.ToString() ?? "UnknownVersion")}";
14 [AutoPath]
15 private static readonly string appCache = @$"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\Temp\SpaceEngineersBlueprintsEditor";
16 [AutoPath]
17 private static readonly string localProfile = @$"{AppLocalData}\Profiles";
18 [AutoPath]
19 private static readonly string localVersionProfile = $@"{AppLocalVersionData}\Profiles";
20 [AutoPath]
21 private static readonly string synProfile = $@"{AppSynData}\Profiles";
22 [AutoPath]
23 private static readonly string cacheProfile = $@"{AppCache}\Profiles";
24 }
Added SpaceEngineersBlueprintEditor/Utilities/SpaceEngineersPath.cs +17 -0
@@ -0,0 +1,17 @@
1 using XFEExtension.NetCore.AutoPath;
2
3 namespace SpaceEngineersBlueprintEditor.Utilities;
4
5 public partial class SpaceEngineersPath
6 {
7 [AutoPath]
8 private static readonly string userGameDataRoot = $@"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}\SpaceEngineers";
9 [AutoPath]
10 private static readonly string blueprintsRoot = $@"{UserGameDataRoot}/Blueprints";
11 [AutoPath]
12 private static readonly string localBlueprints = $@"{BlueprintsRoot}/local";
13 [AutoPath]
14 private static readonly string cloudBlueprints = $@"{BlueprintsRoot}/cloud";
15 [AutoPath]
16 private static readonly string workshopBlueprints = $@"{BlueprintsRoot}/workshop/temp/Steam";
17 }
Added SpaceEngineersBlueprintEditor/ViewModels/SettingPageViewModel.cs +26 -0
@@ -0,0 +1,26 @@
1 using CommunityToolkit.Mvvm.ComponentModel;
2 using CommunityToolkit.Mvvm.Input;
3 using System;
4 using Windows.System;
5
6 namespace SpaceEngineersBlueprintEditor.ViewModels;
7
8 public partial class SettingPageViewModel : ViewModelBase
9 {
10 [ObservableProperty]
11 string currentVersion = "";
12
13 public SettingPageViewModel()
14 {
15 if (System.Reflection.Assembly.GetEntryAssembly()?.GetName().Version is Version version)
16 {
17 CurrentVersion = version.ToString();
18 }
19 }
20
21 [RelayCommand]
22 async Task LinkToGithubRepo()
23 {
24 await Launcher.LaunchUriAsync(new Uri("https://github.com/XFEstudio/SpaceEngineersBlueprintEditorInWinUI"));
25 }
26 }
Modified SpaceEngineersBlueprintEditor/Views/AppShellPage.xaml +3 -4
@@ -7,15 +7,14 @@
7 7 xmlns:viewmodel="using:SpaceEngineersBlueprintEditor.ViewModels"
8 8 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
9 9 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
10 mc:Ignorable="d"
11 d:DataContext="{d:DesignInstance viewmodel:AppShellPageViewModel}">
10 mc:Ignorable="d">
12 11
13 12 <Grid>
14 13 <Grid x:Name="appTitleBar" Canvas.ZIndex="1" Height="{Binding ElementName=navigationView, Path=CompactPaneLength}" IsHitTestVisible="True" VerticalAlignment="Top">
15 14 <Image Source="/Assets/Icons/EditorIcon.ico" HorizontalAlignment="Left" Width="16" Height="16"/>
16 <TextBlock x:Name="appTitleBarText" VerticalAlignment="Center" TextWrapping="NoWrap" Margin="28,0,0,0"/>
15 <TextBlock x:Name="appTitleBarText" x:Uid="AppTitle" VerticalAlignment="Center" TextWrapping="NoWrap" Margin="28,0,0,0"/>
17 16 </Grid>
18 <NavigationView x:Name="navigationView" IsBackButtonVisible="Visible" Canvas.ZIndex="0" IsBackEnabled="{Binding CanGoBack}" Header="{Binding Selected.Content}" IsSettingsVisible="False" DisplayModeChanged="NavigationView_DisplayModeChanged">
17 <NavigationView x:Name="navigationView" IsBackButtonVisible="Visible" Canvas.ZIndex="0" IsBackEnabled="{x:Bind ViewModel.CanGoBack, Mode=OneWay}" Header="{x:Bind ((ContentControl)ViewModel.Selected).Content, Mode=OneWay}" IsSettingsVisible="False" DisplayModeChanged="NavigationView_DisplayModeChanged">
19 18 <NavigationView.MenuItems>
20 19 <NavigationViewItem x:Uid="ShellItem_EditorPage" Tag="SpaceEngineersBlueprintEditor.Views.BlueprintEditorPage">
21 20 <NavigationViewItem.Icon>
Modified SpaceEngineersBlueprintEditor/Views/AppShellPage.xaml.cs +0 -1
@@ -16,7 +16,6 @@ public sealed partial class AppShellPage : Page
16 16 DataContext = ViewModel = new AppShellPageViewModel();
17 17 this.InitializeComponent();
18 18 App.MainWindow?.SetTitleBar(appTitleBar);
19 appTitleBarText.Text = "AppTitle".GetLocalized();
20 19 ViewModel.NavigationViewService.Initialize(navigationView, navigationFrame);
21 20 ViewModel.NavigationViewService.NavigateTo<BlueprintEditorPage>();
22 21 }
Modified SpaceEngineersBlueprintEditor/Views/BlueprintEditorPage.xaml +1 -1
@@ -10,6 +10,6 @@
10 10
11 11 <Grid ColumnDefinitions="*, *">
12 12 <Grid CanDrag="True" Background="AliceBlue" Width="200" Height="200"/>
13 <Grid Grid.Column="1" AllowDrop="True" DragOver="Grid_DragOver" Drop="Grid_Drop" Background="PaleVioletRed" Width="200" Height="200"/>
13 <Grid Grid.Column="1" AllowDrop="True" DragOver="Grid_DragOver" Drop="Grid_Drop" Background="PaleVioletRed" Width="200" Height="200"/>
14 14 </Grid>
15 15 </Page>
Modified SpaceEngineersBlueprintEditor/Views/SettingPage.xaml +38 -1
@@ -4,11 +4,48 @@
4 4 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
5 5 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
6 6 xmlns:local="using:SpaceEngineersBlueprintEditor.Views"
7 xmlns:viewmodel="using:SpaceEngineersBlueprintEditor.ViewModels"
8 xmlns:toolkit="using:CommunityToolkit.WinUI.Controls"
7 9 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
8 10 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9 11 mc:Ignorable="d">
10 12
11 13 <Grid>
12
14 <ScrollViewer>
15 <StackPanel Spacing="4">
16 <toolkit:SettingsCard Header="">
17 <ComboBox>
18 <ComboBoxItem Content="Light" Tag="Light"/>
19 <ComboBoxItem Content="Dark" Tag="Dark"/>
20 <ComboBoxItem Content="Default" Tag="Defalut"/>
21 </ComboBox>
22 </toolkit:SettingsCard>
23 <toolkit:SettingsExpander x:Uid="AppInfo_Expander">
24 <toolkit:SettingsExpander.HeaderIcon>
25 <ImageIcon Source="/Assets/Images/EditorIcon.png"/>
26 </toolkit:SettingsExpander.HeaderIcon>
27 <TextBlock Grid.Column="2" Grid.RowSpan="2" Text="{x:Bind ViewModel.CurrentVersion, Mode=OneWay}" Opacity="0.5"/>
28 <toolkit:SettingsExpander.Items>
29 <toolkit:SettingsCard x:Uid="AppInfo_Author">
30 <TextBlock Text="XFEstudio" Foreground="{ThemeResource TextFillColorSecondary}"/>
31 </toolkit:SettingsCard>
32 <toolkit:SettingsCard x:Uid="AppInfo_GithubProject" IsClickEnabled="True" Command="{x:Bind ViewModel.LinkToGithubRepoCommand}">
33 <toolkit:SettingsCard.ActionIcon>
34 <FontIcon Glyph="&#xE8A7;"/>
35 </toolkit:SettingsCard.ActionIcon>
36 </toolkit:SettingsCard>
37 <toolkit:SettingsCard x:Uid="AppInfo_Contact" HorizontalContentAlignment="Left" ContentAlignment="Vertical">
38 <StackPanel Margin="-12,0,0,0" Orientation="Vertical">
39 <HyperlinkButton x:Uid="AppInfo_Contact_QQ" NavigateUri="https://qm.qq.com/q/JAHAohawuW"/>
40 <HyperlinkButton x:Uid="AppInfo_Contact_Twitter" NavigateUri="https://x.com/smithtom228705"/>
41 <HyperlinkButton x:Uid="AppInfo_Contact_Github" NavigateUri="https://github.com/XFEstudio"/>
42 <HyperlinkButton x:Uid="AppInfo_Contact_Bilibili" NavigateUri="https://space.bilibili.com/200494622"/>
43 <HyperlinkButton x:Uid="AppInfo_Contact_Youtube" NavigateUri="https://www.youtube.com/@playerxfe7204"/>
44 </StackPanel>
45 </toolkit:SettingsCard>
46 </toolkit:SettingsExpander.Items>
47 </toolkit:SettingsExpander>
48 </StackPanel>
49 </ScrollViewer>
13 50 </Grid>
14 51 </Page>
Modified SpaceEngineersBlueprintEditor/Views/SettingPage.xaml.cs +4 -1