-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support per-project engine arguments.
- Loading branch information
Showing
8 changed files
with
144 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Reactive; | ||
using System.Windows.Input; | ||
using ReactiveUI; | ||
using Seed.Models; | ||
|
||
namespace Seed.ViewModels; | ||
|
||
public class CommandLineOptionsViewModel: ViewModelBase | ||
{ | ||
public ReactiveCommand<Unit, string> SaveCommand { get; set; } | ||
private string _arguments; | ||
|
||
public string Arguments | ||
{ | ||
get => _arguments; | ||
set => this.RaiseAndSetIfChanged(ref _arguments, value); | ||
} | ||
|
||
private string _title; | ||
|
||
public string Title | ||
{ | ||
get => _title; | ||
set => this.RaiseAndSetIfChanged(ref _title, value); | ||
} | ||
|
||
public CommandLineOptionsViewModel(Project project) | ||
{ | ||
Title = $"Editing arguments for {project.Name}"; | ||
Arguments = project.ProjectArguments ?? string.Empty; | ||
SaveCommand = ReactiveCommand.Create(() => Arguments); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<Window xmlns="https://github.com/avaloniaui" | ||
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:vm="using:Seed.ViewModels" | ||
mc:Ignorable="d" d:DesignWidth="400" d:DesignHeight="100" | ||
x:Class="Seed.Views.Dialogs.CommandLineOptionsDialog" | ||
x:DataType="vm:CommandLineOptionsViewModel" | ||
WindowStartupLocation="CenterOwner" | ||
Width="400" | ||
Height="100" | ||
Icon="/Assets/seed-logo-blue-64.png" | ||
Title="{Binding Title}"> | ||
<Border BorderThickness="5"> | ||
<DockPanel> | ||
<Button | ||
DockPanel.Dock="Bottom" | ||
HorizontalAlignment="Center" | ||
Command="{Binding SaveCommand}">Save</Button> | ||
<TextBlock DockPanel.Dock="Top"> | ||
See docs.flaxengine.com | ||
</TextBlock> | ||
<TextBox | ||
DockPanel.Dock="Top" | ||
Text="{Binding Arguments}"></TextBox> | ||
</DockPanel> | ||
</Border> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using Avalonia.Controls; | ||
using Seed.ViewModels; | ||
|
||
namespace Seed.Views.Dialogs; | ||
|
||
public partial class CommandLineOptionsDialog : Window | ||
{ | ||
public CommandLineOptionsDialog() | ||
{ | ||
InitializeComponent(); | ||
DataContextProperty.Changed.Subscribe(OnDataContextChanged); | ||
} | ||
|
||
private void OnDataContextChanged(object _) | ||
{ | ||
if (DataContext is CommandLineOptionsViewModel viewModel) | ||
{ | ||
viewModel.SaveCommand.Subscribe(Close); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters