Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Pd233 committed Dec 26, 2023
1 parent 07c6aef commit 2787d3f
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 13 deletions.
5 changes: 1 addition & 4 deletions src/LipUI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LipNETWrapperTest", "LipNET
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LipWebApi", "LipWebApi\LipWebApi.csproj", "{17569CD2-D4D2-4E10-927C-BECEAECF7786}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LipUI", "LipUI\LipUI.csproj", "{ADF26F0A-8BCE-4F01-ACA8-042B9EC35064}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LipUI", "LipUI\LipUI.csproj", "{ADF26F0A-8BCE-4F01-ACA8-042B9EC35064}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -36,7 +36,6 @@ Global
{A274FAC9-3169-4EAB-A659-4090F8D6E568}.Release|ARM64.ActiveCfg = Release|Any CPU
{A274FAC9-3169-4EAB-A659-4090F8D6E568}.Release|ARM64.Build.0 = Release|Any CPU
{A274FAC9-3169-4EAB-A659-4090F8D6E568}.Release|x64.ActiveCfg = Release|Any CPU
{A274FAC9-3169-4EAB-A659-4090F8D6E568}.Release|x64.Build.0 = Release|Any CPU
{A274FAC9-3169-4EAB-A659-4090F8D6E568}.Release|x86.ActiveCfg = Release|Any CPU
{A274FAC9-3169-4EAB-A659-4090F8D6E568}.Release|x86.Build.0 = Release|Any CPU
{2245E398-21FD-4F05-87A8-C6E8E29A4685}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -52,7 +51,6 @@ Global
{2245E398-21FD-4F05-87A8-C6E8E29A4685}.Release|ARM64.ActiveCfg = Release|Any CPU
{2245E398-21FD-4F05-87A8-C6E8E29A4685}.Release|ARM64.Build.0 = Release|Any CPU
{2245E398-21FD-4F05-87A8-C6E8E29A4685}.Release|x64.ActiveCfg = Release|Any CPU
{2245E398-21FD-4F05-87A8-C6E8E29A4685}.Release|x64.Build.0 = Release|Any CPU
{2245E398-21FD-4F05-87A8-C6E8E29A4685}.Release|x86.ActiveCfg = Release|Any CPU
{2245E398-21FD-4F05-87A8-C6E8E29A4685}.Release|x86.Build.0 = Release|Any CPU
{17569CD2-D4D2-4E10-927C-BECEAECF7786}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -68,7 +66,6 @@ Global
{17569CD2-D4D2-4E10-927C-BECEAECF7786}.Release|ARM64.ActiveCfg = Release|Any CPU
{17569CD2-D4D2-4E10-927C-BECEAECF7786}.Release|ARM64.Build.0 = Release|Any CPU
{17569CD2-D4D2-4E10-927C-BECEAECF7786}.Release|x64.ActiveCfg = Release|Any CPU
{17569CD2-D4D2-4E10-927C-BECEAECF7786}.Release|x64.Build.0 = Release|Any CPU
{17569CD2-D4D2-4E10-927C-BECEAECF7786}.Release|x86.ActiveCfg = Release|Any CPU
{17569CD2-D4D2-4E10-927C-BECEAECF7786}.Release|x86.Build.0 = Release|Any CPU
{ADF26F0A-8BCE-4F01-ACA8-042B9EC35064}.Debug|Any CPU.ActiveCfg = Debug|x64
Expand Down
13 changes: 13 additions & 0 deletions src/LipUI/LipUI.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>

<WindowsPackageType>None</WindowsPackageType>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>

<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
Expand All @@ -12,6 +16,15 @@
<EnableMsixTooling>true</EnableMsixTooling>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<PackageCertificateThumbprint>41F2155140B5369541BFDEEAC7B71FFB18F9E6DF</PackageCertificateThumbprint>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundle>Never</AppxBundle>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
</PropertyGroup>
<ItemGroup>
<Content Remove="Assets\applicationIcon-1024.png" />
Expand Down
Binary file added src/LipUI/LipUI_TemporaryKey.pfx
Binary file not shown.
4 changes: 2 additions & 2 deletions src/LipUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ bool TrySetSystemBackdrop()

// Create the policy object.
m_configurationSource = new SystemBackdropConfiguration();
Activated += WindowActivated;
//Activated += WindowActivated;
Closed += WindowClosed;
((FrameworkElement)Content).ActualThemeChanged += WindowThemeChanged;

Expand Down Expand Up @@ -184,7 +184,7 @@ private void WindowClosed(object sender, WindowEventArgs args)
m_backdropController.Dispose();
m_backdropController = null;
}
Activated -= WindowActivated;
//Activated -= WindowActivated;
m_configurationSource = null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/LipUI/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<Identity
Name="b34acd6e-13d6-4570-985a-e8e9c0461b27"
Publisher="CN=minec"
Publisher="CN=lippkg"
Version="1.0.0.0" />

<mp:PhoneIdentity PhoneProductId="b34acd6e-13d6-4570-985a-e8e9c0461b27" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
Expand Down
3 changes: 2 additions & 1 deletion src/LipUI/Pages/HomePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
<Button
x:Name="StartServerButton"
Width="192"
Height="40">
Height="40"
Click="StartServerButton_Click">
<TextBlock Text="i18n.startServer"/>
</Button>

Expand Down
24 changes: 23 additions & 1 deletion src/LipUI/Pages/HomePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using System;
using System.Diagnostics;
using System.IO;

// To learn more about WinUI, the WinUI project structure,
Expand Down Expand Up @@ -37,7 +38,7 @@ private void Page_Loaded(object sender, RoutedEventArgs e)

private void ShowLipInstallerPageIfNotExist()
{
if (File.Exists(Main.Config.Settings.LipPath))
if (File.Exists(Main.Config.Settings.LipPath))
{
return;
}
Expand All @@ -53,4 +54,25 @@ private void ShowLipInstallerPageIfNotExist()
await dialog.ShowAsync();
});
}

private void StartServerButton_Click(object sender, RoutedEventArgs e)
{
if (Main.Config.SelectedServer is null)
return;

var dir = Main.Config.SelectedServer.WorkingDirectory;
var path = Path.Combine(dir, "bedrock_server_mod.exe");

if (File.Exists(path))
{
Process.Start(path);
return;
}

path = Path.Combine(dir, "bedrock_server.exe");
if(File.Exists(path))
{
Process.Start(path);
}
}
}
5 changes: 1 addition & 4 deletions src/LipUI/Pages/LocalPackagePage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using LipUI.Language;
using LipUI.Models;
using LipUI.Models.Lip;
using LipUI.Protocol;
Expand All @@ -7,9 +6,7 @@
using Microsoft.UI.Xaml.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;

// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
Expand All @@ -23,7 +20,7 @@ public sealed partial class LocalPackagePage : Page
{
public LocalPackagePage()
{
this.InitializeComponent();
InitializeComponent();
}

private void ReloadPackage()
Expand Down
17 changes: 17 additions & 0 deletions src/LipUI/VIews/ServerInstanceEditView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media.Imaging;
using System;
using System.IO;
using System.Threading.Tasks;
using Windows.Storage.Pickers;
using WinRT.Interop;
Expand Down Expand Up @@ -70,6 +71,22 @@ public void CommitServerProperies()
Server.Description = DescriptionInput.Text;
Server.Version = VersionInput.Text;
Server.WorkingDirectory = WorkingDirectoryInput.Text;

if (iconPath is not null)
{
var dir = Path.Combine(Server.WorkingDirectory, DefaultSettings.DataDirectory);

if (Directory.Exists(dir) is false)
Directory.CreateDirectory(dir);

var dest = Path.Combine(dir, $"icon{new FileInfo(iconPath).Extension}");

File.Copy(iconPath, dest);

Server.Icon = dest;
return;
}

Server.Icon = iconPath;
}
}

0 comments on commit 2787d3f

Please sign in to comment.