Skip to content

Commit 38088d4

Browse files
committed
feat: Implement Project selection/creation
1 parent 1ab59a6 commit 38088d4

File tree

7 files changed

+128
-1
lines changed

7 files changed

+128
-1
lines changed

build/Stride.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Avalonia", "Avalonia", "{C4
374374
EndProject
375375
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{BFF9AA54-F9DD-42BB-8163-6C03E7F51623}"
376376
EndProject
377+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stride.Core.Assets.Editor.Avalonia", "..\sources\editor\Stride.Core.Assets.Editor.Avalonia\Stride.Core.Assets.Editor.Avalonia.csproj", "{67142D11-FA16-47E3-9894-6EE071F4F3B2}"
378+
EndProject
377379
Global
378380
GlobalSection(SolutionConfigurationPlatforms) = preSolution
379381
Debug|Any CPU = Debug|Any CPU
@@ -1691,6 +1693,18 @@ Global
16911693
{6A4C8B36-8DBB-44D1-B9BB-4F19C9BB48F3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
16921694
{6A4C8B36-8DBB-44D1-B9BB-4F19C9BB48F3}.Release|Win32.ActiveCfg = Release|Any CPU
16931695
{6A4C8B36-8DBB-44D1-B9BB-4F19C9BB48F3}.Release|Win32.Build.0 = Release|Any CPU
1696+
{67142D11-FA16-47E3-9894-6EE071F4F3B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1697+
{67142D11-FA16-47E3-9894-6EE071F4F3B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
1698+
{67142D11-FA16-47E3-9894-6EE071F4F3B2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
1699+
{67142D11-FA16-47E3-9894-6EE071F4F3B2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
1700+
{67142D11-FA16-47E3-9894-6EE071F4F3B2}.Debug|Win32.ActiveCfg = Debug|Any CPU
1701+
{67142D11-FA16-47E3-9894-6EE071F4F3B2}.Debug|Win32.Build.0 = Debug|Any CPU
1702+
{67142D11-FA16-47E3-9894-6EE071F4F3B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
1703+
{67142D11-FA16-47E3-9894-6EE071F4F3B2}.Release|Any CPU.Build.0 = Release|Any CPU
1704+
{67142D11-FA16-47E3-9894-6EE071F4F3B2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
1705+
{67142D11-FA16-47E3-9894-6EE071F4F3B2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
1706+
{67142D11-FA16-47E3-9894-6EE071F4F3B2}.Release|Win32.ActiveCfg = Release|Any CPU
1707+
{67142D11-FA16-47E3-9894-6EE071F4F3B2}.Release|Win32.Build.0 = Release|Any CPU
16941708
EndGlobalSection
16951709
GlobalSection(SolutionProperties) = preSolution
16961710
HideSolutionNode = FALSE
@@ -1837,6 +1851,7 @@ Global
18371851
{9E965084-6022-469C-AA1B-C877FEB3FCEA} = {75A820AB-0F21-40F2-9448-5D7F495B97A0}
18381852
{C4E8D317-8A14-499B-97CB-4AFCA70C22C2} = {5D2D3BE8-9910-45CA-8E45-95660DA4C563}
18391853
{BFF9AA54-F9DD-42BB-8163-6C03E7F51623} = {C4E8D317-8A14-499B-97CB-4AFCA70C22C2}
1854+
{67142D11-FA16-47E3-9894-6EE071F4F3B2} = {C4E8D317-8A14-499B-97CB-4AFCA70C22C2}
18401855
EndGlobalSection
18411856
GlobalSection(ExtensibilityGlobals) = postSolution
18421857
SolutionGuid = {FF877973-604D-4EA7-B5F5-A129961F9EF2}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Stride.Core.Presentation.Commands;
2+
using Stride.Core.Presentation.ViewModels;
3+
4+
namespace Stride.Core.Assets.Editor.Avalonia;
5+
6+
public class NewOrOpenSessionTemplateCollectionViewModel
7+
{
8+
public NewOrOpenSessionTemplateCollectionViewModel(IViewModelServiceProvider serviceProvider)
9+
{
10+
11+
BrowseForExistingProjectCommand = new AnonymousTaskCommand(serviceProvider, BrowseForExistingProject);
12+
}
13+
public ICommandBase BrowseForExistingProjectCommand { get; }
14+
public bool AutoReloadSession { get; }
15+
16+
private Task BrowseForExistingProject()
17+
{
18+
return Task.CompletedTask;
19+
}
20+
21+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<Window xmlns="https://github.com/avaloniaui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:avalonia="clr-namespace:Stride.Core.Assets.Editor.Avalonia"
6+
xmlns:sd="http://schemas.stride3d.net/xaml/presentation"
7+
mc:Ignorable="d"
8+
Height="768" Width="1024" ShowInTaskbar="False"
9+
x:Class="Stride.Core.Assets.Editor.Avalonia.ProjectSelectionWindow"
10+
d:DataContext="{d:DesignInstance avalonia:NewOrOpenSessionTemplateCollectionViewModel}">
11+
<DockPanel>
12+
<Grid DockPanel.Dock="Bottom">
13+
<DockPanel>
14+
<DockPanel DockPanel.Dock="Bottom" Margin="20">
15+
<Button DockPanel.Dock="Left" Content="{sd:LocalizeString Browse for existing project, Context=Button}" Command="{Binding BrowseForExistingProjectCommand}" Padding="20,6"/>
16+
<CheckBox IsChecked="{Binding AutoReloadSession}" Content="{sd:LocalizeString Reload last session automatically at startup, Context=Button}"
17+
VerticalAlignment="Center" Margin="8"/>
18+
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
19+
<UniformGrid Rows="1">
20+
<Button Content="{sd:LocalizeString Select, Context=Button}" Padding="20,6" Margin="10,0,0,0"
21+
IsEnabled="{Binding SelectedTemplate, Converter={sd:ObjectToBool}}">
22+
</Button>
23+
<Button Content="{sd:LocalizeString Cancel, Context=Button}" Padding="20,6" Margin="10,0,0,0" IsCancel="True">
24+
</Button>
25+
</UniformGrid>
26+
</StackPanel>
27+
</DockPanel>
28+
<Grid ColumnDefinitions="Auto,2*,*" RowDefinitions="Auto,Auto,Auto,Auto">
29+
<TextBlock Grid.Row="0" Grid.Column="0" Text="{sd:LocalizeString Name:}" Margin="20,0" VerticalAlignment="Center"/>
30+
<TextBox Grid.Row="0" Grid.Column="1" Margin="2" Text="{Binding Name}"/>
31+
<TextBlock Grid.Row="1" Grid.Column="0" Text="{sd:LocalizeString Location:}" Margin="20,0" VerticalAlignment="Center"/>
32+
<DockPanel Grid.Row="1" Grid.Column="1">
33+
<Button DockPanel.Dock="Right" Command="{Binding BrowseDirectoryCommand}" CommandParameter="Location">
34+
</Button>
35+
<TextBox Margin="2" Text="{Binding Location}"/>
36+
</DockPanel>
37+
<TextBlock Grid.Row="2" Grid.Column="0" Text="{sd:LocalizeString Solution name:}" Margin="20,0" VerticalAlignment="Center"/>
38+
<TextBox Grid.Row="2" Grid.Column="1" Margin="2" Watermark="{sd:LocalizeString (Auto-generate solution name)}"
39+
Text="{Binding SolutionName}">
40+
</TextBox>
41+
<TextBlock Grid.Row="3" Grid.Column="0" Text="{sd:LocalizeString Solution location:}" Margin="20,0" VerticalAlignment="Center"/>
42+
<DockPanel Grid.Row="3" Grid.Column="1">
43+
<Button DockPanel.Dock="Right" Command="{Binding BrowseDirectoryCommand}" CommandParameter="SolutionLocation" />
44+
<TextBox Margin="2" Watermark="{sd:LocalizeString (Same location)}" Text="{Binding SolutionLocation}">
45+
</TextBox>
46+
</DockPanel>
47+
</Grid>
48+
</DockPanel>
49+
</Grid>
50+
</DockPanel>
51+
</Window>
52+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net)
2+
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
3+
4+
using Avalonia;
5+
using Avalonia.Controls;
6+
using Avalonia.Markup.Xaml;
7+
8+
namespace Stride.Core.Assets.Editor.Avalonia;
9+
10+
public partial class ProjectSelectionWindow : Window
11+
{
12+
public ProjectSelectionWindow()
13+
{
14+
InitializeComponent();
15+
}
16+
}
17+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project>
2+
<Import Project="..\..\targets\Stride.props" />
3+
4+
<PropertyGroup>
5+
<TargetFramework>$(StrideXplatEditorTargetFramework)</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Avalonia" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\..\presentation\Stride.Core.Presentation.Avalonia\Stride.Core.Presentation.Avalonia.csproj" />
16+
<ProjectReference Include="..\..\presentation\Stride.Core.Presentation\Stride.Core.Presentation.csproj" />
17+
</ItemGroup>
18+
19+
<Import Project="$(StrideSdkTargets)" />
20+
</Project>

sources/editor/Stride.GameStudio.Avalonia/App.axaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Avalonia.Controls.ApplicationLifetimes;
66
using Avalonia.Data.Core.Plugins;
77
using Avalonia.Markup.Xaml;
8+
using Stride.Core.Assets.Editor.Avalonia;
89
using Stride.Core.Assets.Editor.Services;
910
using Stride.Core.IO;
1011
using Stride.Core.Presentation.Avalonia.Services;
@@ -31,7 +32,7 @@ public override void OnFrameworkInitializationCompleted()
3132

3233
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
3334
{
34-
desktop.MainWindow = new MainWindow();
35+
desktop.MainWindow = new ProjectSelectionWindow();
3536
}
3637
else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform)
3738
{

sources/editor/Stride.GameStudio.Avalonia/Stride.GameStudio.Avalonia.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
</ItemGroup>
3838

3939
<ItemGroup>
40+
<ProjectReference Include="..\Stride.Core.Assets.Editor.Avalonia\Stride.Core.Assets.Editor.Avalonia.csproj" />
4041
<ProjectReference Include="..\Stride.Editor.Avalonia\Stride.Editor.Avalonia.csproj" />
4142
</ItemGroup>
4243

0 commit comments

Comments
 (0)