Skip to content

Commit

Permalink
Add foundation for Kh2 Battle Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeeynamo authored and Rikux3 committed May 31, 2020
1 parent 9461cbd commit 87e5f95
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 0 deletions.
9 changes: 9 additions & 0 deletions OpenKh.Tools.Kh2BattleEditor/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="OpenKh.Tools.Kh2BattleEditor.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:OpenKh.Tools.Kh2BattleEditor"
StartupUri="Views/MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions OpenKh.Tools.Kh2BattleEditor/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace OpenKh.Tools.Kh2BattleEditor
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
28 changes: 28 additions & 0 deletions OpenKh.Tools.Kh2BattleEditor/OpenKh.Tools.Kh2BattleEditor.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="MSBuild.Sdk.Extras/1.6.65">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net472</TargetFramework>
<UseWPF>true</UseWPF>
<OutputPath>..\bin\$(Configuration)\</OutputPath>
<ExtrasEnableWpfProjectSetup>true</ExtrasEnableWpfProjectSetup>
<AssemblyTitle>KH2 Battle Editor</AssemblyTitle>
<Product>KH2 Battle Editor - OpenKh</Product>
</PropertyGroup>

<ItemGroup>
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\OpenKh.Common\OpenKh.Common.csproj" />
<ProjectReference Include="..\OpenKh.Kh2\OpenKh.Kh2.csproj" />
<ProjectReference Include="..\OpenKh.Tools.Common\OpenKh.Tools.Common.csproj" />
<ProjectReference Include="..\XeEngine.Tools.Public\Xe.Tools.Wpf\Xe.Tools.Wpf.csproj" />
<ProjectReference Include="..\XeEngine.Tools.Public\Xe.Tools\Xe.Tools.csproj" />
</ItemGroup>

</Project>
26 changes: 26 additions & 0 deletions OpenKh.Tools.Kh2BattleEditor/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.Linq;
using System.Windows;
using OpenKh.Tools.Common;
using Xe.Tools;

namespace OpenKh.Tools.Kh2BattleEditor.ViewModels
{
public class MainViewModel : BaseNotifyPropertyChanged
{
private static string ApplicationName = Utilities.GetApplicationName();
private Window Window => Application.Current.Windows.OfType<Window>().FirstOrDefault(x => x.IsActive);
private string _fileName;

public string Title => $"{FileName ?? "untitled"} | {ApplicationName}";

private string FileName
{
get => _fileName;
set
{
_fileName = value;
OnPropertyChanged(nameof(Title));
}
}
}
}
12 changes: 12 additions & 0 deletions OpenKh.Tools.Kh2BattleEditor/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Window x:Class="OpenKh.Tools.Kh2BattleEditor.Views.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:local="clr-namespace:OpenKh.Tools.Kh2BattleEditor.Views"
mc:Ignorable="d"
Title="{Binding Title}" Height="450" Width="800">
<Grid>

</Grid>
</Window>
17 changes: 17 additions & 0 deletions OpenKh.Tools.Kh2BattleEditor/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Windows;
using OpenKh.Tools.Kh2BattleEditor.ViewModels;

namespace OpenKh.Tools.Kh2BattleEditor.Views
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
DataContext = new MainViewModel();
}
}
}
19 changes: 19 additions & 0 deletions OpenKh.sln
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenKh.Command.Layout", "Op
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenKh.Command.Bar", "OpenKh.Command.Bar\OpenKh.Command.Bar.csproj", "{4AEB5DD5-A59E-49F8-8610-7DAA72C2081B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenKh.Tools.Kh2BattleEditor", "OpenKh.Tools.Kh2BattleEditor\OpenKh.Tools.Kh2BattleEditor.csproj", "{67810138-DACB-4A93-87FC-647BF73672AC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -643,6 +645,22 @@ Global
{4AEB5DD5-A59E-49F8-8610-7DAA72C2081B}.Release|x64.Build.0 = Release|Any CPU
{4AEB5DD5-A59E-49F8-8610-7DAA72C2081B}.Release|x86.ActiveCfg = Release|Any CPU
{4AEB5DD5-A59E-49F8-8610-7DAA72C2081B}.Release|x86.Build.0 = Release|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Debug|ARM.ActiveCfg = Debug|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Debug|ARM.Build.0 = Debug|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Debug|x64.ActiveCfg = Debug|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Debug|x64.Build.0 = Debug|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Debug|x86.ActiveCfg = Debug|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Debug|x86.Build.0 = Debug|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Release|Any CPU.Build.0 = Release|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Release|ARM.ActiveCfg = Release|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Release|ARM.Build.0 = Release|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Release|x64.ActiveCfg = Release|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Release|x64.Build.0 = Release|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Release|x86.ActiveCfg = Release|Any CPU
{67810138-DACB-4A93-87FC-647BF73672AC}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -682,6 +700,7 @@ Global
{CFD7082A-3556-4656-8AE3-7096ABC3979F} = {402B2669-D594-4DFA-965B-02A92626ADC6}
{50473DB5-C28D-4AB2-9E99-FDB24EA95F3D} = {9C52D787-9819-4B89-989B-EEA6FEB20731}
{4AEB5DD5-A59E-49F8-8610-7DAA72C2081B} = {9C52D787-9819-4B89-989B-EEA6FEB20731}
{67810138-DACB-4A93-87FC-647BF73672AC} = {402B2669-D594-4DFA-965B-02A92626ADC6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1DF3960B-4FE5-4E56-92D4-2FC0A912E823}
Expand Down

0 comments on commit 87e5f95

Please sign in to comment.