Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

added filepicker to load rust engine. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion XiEditor/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,29 @@ public MainWindow()
{
InitializeComponent();

var filename = @"C:\Users\Clayton\Source\xi-editor\rust\target\debug\xicore.exe";

string filename = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\xieditor\", "path", null);
if (String.IsNullOrWhiteSpace(filename) )
{

OpenFileDialog xiEnginePicker = new OpenFileDialog();

xiEnginePicker.InitialDirectory = "c:\\";
xiEnginePicker.Filter = "xi-editor core (*.exe)|*.exe|All files (*.*)|*.*";
xiEnginePicker.Title = "Please select the xi-editor.exe in your rust > target directory.";

if (xiEnginePicker.ShowDialog() == true )
{
filename = xiEnginePicker.FileName;
Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\xieditor\", "path", filename );
} else
{
System.Windows.MessageBox.Show("You must select a xi-editor core engine.");
Environment.Exit(1);
}
}

// filename = @"C:\Users\Clayton\Source\xi-editor\rust\target\debug\xicore.exe";
coreConnection = new CoreConnection(filename, delegate (object data) {
handleCoreCmd(data);
});
Expand Down
3 changes: 3 additions & 0 deletions XiEditor/XiEditor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down