-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Wip: Initial work on running game from the new editor #2796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: xplat-editor
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial review. I'll have a second look at it later. I'm busy this weekend.
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" PrivateAssets="all" /> | ||
</ItemGroup> | ||
</Project> | ||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah those things where made automatically by vs I didn't touch that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be done by VS unless you have some non-standard config that overrides the .editorconfig
that we have at the root of the repo. It has this line which forces each file to have a blank line at the end:
Lines 6 to 8 in f99bde2
[*] | |
end_of_line = crlf | |
insert_final_newline = true |
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Avalonia" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not wrong but it's not needed as it is implied by the other package references. I tend to keep the smallest list of dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was added on it's own I thought I was already there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's this one that is not necessary.
using Avalonia; | ||
using Avalonia.Controls.ApplicationLifetimes; | ||
using Avalonia.Data.Core.Plugins; | ||
using Avalonia.Input; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i forgot about that but should port the input checking function to this file
|
||
|
||
|
||
private async void RunCurrentProject() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use async void
, always return a Task
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok will look into that
OpenCommand = new AnonymousTaskCommand<UFile?>(serviceProvider, OnOpen); | ||
OpenDebugWindowCommand = new AnonymousTaskCommand(serviceProvider, OnOpenDebugWindow, () => DialogService.HasMainWindow); | ||
OpenWebPageCommand = new AnonymousTaskCommand<string>(serviceProvider, OnOpenWebPage); | ||
RunCurrentProjectCommand = new AnonymousCommand(serviceProvider, RunCurrentProject); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use AnonymousTaskCommand for async methods.
process.Start(); | ||
process.BeginOutputReadLine(); | ||
process.BeginErrorReadLine(); | ||
process.WaitForExit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to use the async version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sources/editor/Stride.GameStudio.Avalonia/Views/MainWindow.axaml.cs
Outdated
Show resolved
Hide resolved
…nto xplat-editor
i reopened this one sorry for the other one I don't work with github a lot so I forget sometimes |
<AvaloniaBehaviorVersion>11.2.7.3</AvaloniaBehaviorVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be removed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i did that i keeped this one now and the other has been removed in past commit but it's still there idk why
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Avalonia" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's this one that is not necessary.
</DrawingImage> | ||
|
||
<DrawingImage x:Key="ImageStart"> | ||
<DrawingImage.Drawing> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 spaces instead of tabs for indentation in XAML files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to still be a mix of spaces and tabs.
If you are using Visual Studio, you can use Ctrl+E,D
to format the current document. Or In Visual Studio code Ctrl+Shift+i
.
@ourabigdev I have fixed the conflicts and pushed a little cleanup. I also changed the PR to a draft since it might not be complete yet. I will do some testing and I might push new commits later. Thanks for the contribution in any case. |
Thanks for that yeah it's better for it to become a draft since I will not be able to work on it this month so I will be back at the start of July, I did make the run in editor on windows work with shortcut key and the run button but the run button is just put there randomly I still need to learn about the new editor layout and also more about avalonia so that I can make a similar design and positioning like the wpf editor, when I come back to coding in July I will try my best to finish the pr if I find the time |
PR Details
This PR adds the ability to build the game project from within the new Avalonia-based editor. While the editor UI doesn't yet include a button for this feature, the F5 shortcut can be used to trigger the build.
Currently, this functionality only works on Windows due to the limitations of the Stride AssetCompiler, which is platform-specific. I have started laying the groundwork for supporting other platforms in the future, but I am currently unable to test this feature on my Linux machine.
Related Issue
Fixes or relates to issue: #2742
Types of changes
Checklist