Skip to content

Commit

Permalink
Merge pull request #6 from seionmoya/main
Browse files Browse the repository at this point in the history
Move from Avalonia to WPF
  • Loading branch information
seionmoya authored Aug 26, 2024
2 parents 0c16f82 + 39163df commit 16b0c3c
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
test:
runs-on: ubuntu-latest
runs-on: windows-latest

env:
DOTNET_NOLOGO: true
Expand Down
8 changes: 0 additions & 8 deletions Fuyu.Launcher/App.axaml

This file was deleted.

47 changes: 0 additions & 47 deletions Fuyu.Launcher/App.axaml.cs

This file was deleted.

9 changes: 9 additions & 0 deletions Fuyu.Launcher/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="Fuyu.Launcher.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Fuyu.Launcher"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
10 changes: 10 additions & 0 deletions Fuyu.Launcher/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Configuration;
using System.Data;
using System.Windows;

namespace Fuyu.Launcher
{
public partial class App : Application
{
}
}
10 changes: 10 additions & 0 deletions Fuyu.Launcher/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Windows;

[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
29 changes: 12 additions & 17 deletions Fuyu.Launcher/Fuyu.Launcher.csproj
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<UseWPF>true</UseWPF>
</PropertyGroup>

<PropertyGroup>
<OutputType>WinExe</OutputType>
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>

<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.1.0" />
<PackageReference Include="Avalonia.Desktop" Version="11.1.0" />
<PackageReference Include="BlazorWebView.Avalonia" Version="11.0.0.1" />
<PackageReference Include="WebView.Avalonia.Desktop" Version="11.0.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<PackageReference Include="Avalonia.Diagnostics" Version="11.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Wpf" Version="8.0.80" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../Fuyu.Platform.Launcher/Fuyu.Platform.Launcher.csproj" />
</ItemGroup>

<ItemGroup>
<Content Update="wwwroot\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>
11 changes: 0 additions & 11 deletions Fuyu.Launcher/MainWindow.axaml

This file was deleted.

14 changes: 0 additions & 14 deletions Fuyu.Launcher/MainWindow.axaml.cs

This file was deleted.

17 changes: 17 additions & 0 deletions Fuyu.Launcher/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Window x:Class="Fuyu.Launcher.MainWindow"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:blazor="clr-namespace:Microsoft.AspNetCore.Components.WebView.Wpf;assembly=Microsoft.AspNetCore.Components.WebView.Wpf"
xmlns:local="clr-namespace:Fuyu.Launcher"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<blazor:BlazorWebView HostPage="wwwroot\index.html" Services="{DynamicResource services}">
<blazor:BlazorWebView.RootComponents>
<blazor:RootComponent Selector="#app" ComponentType="{x:Type local:Routes}" />
</blazor:BlazorWebView.RootComponents>
</blazor:BlazorWebView>
</Grid>
</Window>
20 changes: 20 additions & 0 deletions Fuyu.Launcher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Windows;
using Microsoft.Extensions.DependencyInjection;

namespace Fuyu.Launcher
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();

ServiceCollection serviceCollection = new ServiceCollection();
serviceCollection.AddWpfBlazorWebView();
#if DEBUG
serviceCollection.AddBlazorWebViewDeveloperTools();
#endif
Resources.Add("services", serviceCollection.BuildServiceProvider());
}
}
}
19 changes: 0 additions & 19 deletions Fuyu.Launcher/Program.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@namespace Fuyu.Platform.Launcher
@namespace Fuyu.Launcher

@using Fuyu.Platform.Launcher.Layout
@using Microsoft.AspNetCore.Components.Routing
@using Fuyu.Platform.Launcher.Layout

<Router AppAssembly="typeof(Layout.MainLayout).Assembly">
<Router AppAssembly="typeof(MainLayout).Assembly">
<Found Context="routeData">
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" />
<RouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)" />
<FocusOnNavigate RouteData="routeData" Selector="h1" />
</Found>
</Router>
18 changes: 0 additions & 18 deletions Fuyu.Launcher/app.manifest

This file was deleted.

6 changes: 0 additions & 6 deletions Fuyu.Platform.Launcher/Fuyu.Platform.Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,4 @@
<PackageReference Include="Microsoft.AspNetCore.Components.WebView" Version="8.0.8" />
</ItemGroup>

<ItemGroup>
<Content Update="wwwroot\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>
4 changes: 3 additions & 1 deletion Fuyu.Platform.Launcher/Layout/MainLayout.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@inherits LayoutComponentBase
@namespace Fuyu.Platform.Launcher.Layout

@inherits LayoutComponentBase

<div class="page">
<main>
Expand Down
12 changes: 6 additions & 6 deletions Fuyu.Platform.Launcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
The actual launcher pages and functionality.
Can be used as a starting point if you want to make your own launcher.

## Fuyu.Launcher.Services
## Fuyu.Platform.Launcher.Services

### EftProcess
### ProcessService

`EftProcess` is a quick way to get a new EFT instance up and running. There are
a couple of things you need to provide:
`ProcessService` is a quick way to get a new EFT instance up and running. There
are a couple of things you need to provide:

- `cwd`: Current working directory. This is also where `EscapeFromTarkov.exe`
must be located.
Expand All @@ -17,7 +17,7 @@ a couple of things you need to provide:

```cs
using System;
using Fuyu.Platform.Launcher.Services;
using Fuyu.Platform.Launcher;

public class Program
{
Expand All @@ -27,7 +27,7 @@ public class Program
var accountId = 480892;
var address = "http://localhost:8000";

using (var process = EftProcess.Get(cwd, accountId, address))
using (var process = ProcessService.StartEft(cwd, accountId, address))
{
process.Start();
}
Expand Down
12 changes: 2 additions & 10 deletions Fuyu.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,8 @@
},
"program": "OVERWRITTEN_BY_OS_SPECIFIC",
"windows": {
"program": "${workspaceFolder}/Fuyu.Launcher/bin/Debug/net8.0/win-x64/Fuyu.Launcher.dll",
"cwd": "${workspaceFolder}/Fuyu.Launcher/bin/Debug/net8.0/win-x64/",
},
"linux": {
"program": "${workspaceFolder}/Fuyu.Launcher/bin/Debug/net8.0/linux-x64/Fuyu.Launcher.dll",
"cwd": "${workspaceFolder}/Fuyu.Launcher/bin/Debug/net8.0/linux-x64/",
},
"osx": {
"program": "${workspaceFolder}/Fuyu.Launcher/bin/Debug/net8.0/osx-x64/Fuyu.Launcher.dll",
"cwd": "${workspaceFolder}/Fuyu.Launcher/bin/Debug/net8.0/osx-x64/",
"program": "${workspaceFolder}/Fuyu.Launcher/bin/Debug/net8.0-windows/win-x64/Fuyu.Launcher.dll",
"cwd": "${workspaceFolder}/Fuyu.Launcher/bin/Debug/net8.0-windows/win-x64/",
}
}
]
Expand Down

0 comments on commit 16b0c3c

Please sign in to comment.