Skip to content

Commit

Permalink
Began working on an enemy item drop editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sage-of-Mirrors committed Sep 27, 2020
1 parent 821e95e commit 1627d44
Show file tree
Hide file tree
Showing 4 changed files with 229 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Editor/Editor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@
<Compile Include="Editor\Events\VectorValueEditorViewModel.cs" />
<Compile Include="Editor\Managers\EventDataManager.cs" />
<Compile Include="Editor\Entities\TriggerRegion.cs" />
<Compile Include="Editor\Minitors\EnemyDropMinitor.cs" />
<Compile Include="Editor\Minitors\EnemyDropMinitor\EnemyDropMinitorWindow.xaml.cs">
<DependentUpon>EnemyDropMinitorWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Editor\Minitors\IMinitor.cs" />
<Compile Include="Editor\Minitors\InputMinitor\InputMinitorWindow.xaml.cs">
<DependentUpon>InputMinitorWindow.xaml</DependentUpon>
Expand Down Expand Up @@ -857,6 +861,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Editor\Minitors\EnemyDropMinitor\EnemyDropMinitorWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Editor\Minitors\InputMinitor\InputMinitorWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
113 changes: 113 additions & 0 deletions Editor/Editor/Minitors/EnemyDropMinitor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using WindEditor.ViewModel;
using WindEditor.Minitors.EnemyDrop;

namespace WindEditor.Minitors
{
public class EnemyDropMinitor : IMinitor, INotifyPropertyChanged
{
#region IMinitor Interface
public MenuItem GetMenuItem()
{
return new MenuItem()
{
Header = "Enemy Drop Editor",
ToolTip = "Editor for the items that enemies can drop upon defeat.",
Command = OpenMinitorCommand,
};
}

public void InitModule(WDetailsViewViewModel details_view_model)
{

}

public bool RequestCloseModule()
{
if (!m_IsDataDirty)
return true;

MessageBoxResult result = MessageBox.Show("You have unsaved changes to the enemy item drop data. Save them?", "Unsaved Enemy Drop Changes", MessageBoxButton.YesNoCancel);

switch (result)
{
case MessageBoxResult.Yes:
//OnRequestSaveMessageData();
return true;
case MessageBoxResult.No:
return true;
case MessageBoxResult.Cancel:
return false;
default:
return true;
}
}
#endregion

#region INotifyPropertyChanged Interface
public event PropertyChangedEventHandler PropertyChanged;

protected void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
#endregion

public ICommand OpenMinitorCommand
{
get { return new RelayCommand(x => OnRequestOpenEnemyDropEditor(), x => !string.IsNullOrEmpty(WSettingsManager.GetSettings().RootDirectoryPath)); }
}

public string WindowTitle
{
get { return m_IsDataDirty ? m_WindowTitle + "*" : m_WindowTitle; }
set
{
if (value != m_WindowTitle)
{
m_WindowTitle = value;
OnPropertyChanged("WindowTitle");
}
}
}

private EnemyDropMinitorWindow m_MinitorWindow;

private string m_WindowTitle;
private bool m_IsDataDirty;

private void OnRequestOpenEnemyDropEditor()
{
if (m_MinitorWindow != null)
{
m_MinitorWindow.Show();
m_MinitorWindow.Focus();
return;
}

WindowTitle = "Enemy Item Drop Editor - " + Path.Combine(WSettingsManager.GetSettings().RootDirectoryPath, "files", "res", "ActorDat", "ActorDat.bin");

m_MinitorWindow = new EnemyDropMinitorWindow();
m_MinitorWindow.DataContext = this;
m_MinitorWindow.Closing += M_MinitorWindow_Closing;

m_MinitorWindow.Show();
}
private void M_MinitorWindow_Closing(object sender, CancelEventArgs e)
{
e.Cancel = true;
m_MinitorWindow.Hide();
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<Window x:Class="WindEditor.Minitors.EnemyDrop.EnemyDropMinitorWindow"
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:WindEditor.Minitors.EnemyDrop"
xmlns:sc="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
mc:Ignorable="d"
Title="{Binding WindowTitle}" Height="271" Width="898" ResizeMode="NoResize">
<Window.InputBindings>
<KeyBinding Command="{Binding Path=SaveFileCommand}" Key="S" Modifiers="Ctrl"/>
<KeyBinding Command="{Binding Path=SaveAsFileCommand}" Key="S" Modifiers="Ctrl+Shift"/>
</Window.InputBindings>
<Grid>
<DockPanel VerticalAlignment="Top" Height="20" Grid.ColumnSpan="3">
<Menu DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem InputGestureText="Ctrl + S" Header="_Save" Command="{Binding SaveFileCommand}"/>
<MenuItem InputGestureText="Ctrl + Shift + S" Header="Save _As..." Command="{Binding SaveAsFileCommand}"/>
</MenuItem>
<MenuItem Header="Help">
<MenuItem Header="Tutorial" Command="{Binding OpenTutorialCommand}"/>
</MenuItem>
</Menu>
</DockPanel>
<Label Content="Actor:" Margin="10,29,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
<ComboBox Margin="51,32,0,0" Height="23" VerticalAlignment="Top" HorizontalAlignment="Left" Width="164"/>
<Label Content="Arg:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="228,29,0,0" Height="28"/>
<sc:IntegerUpDown Width="175" VerticalAlignment="Top" Height="23" HorizontalAlignment="Left" Margin="260,32,0,0"/>
<DockPanel Margin="10,60,0,0" Height="169" VerticalAlignment="Top" HorizontalAlignment="Left" Width="882">
<GroupBox Header="Individual Items" Width="425" Height="165" VerticalAlignment="Top">
<StackPanel Margin="10,10,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="398" Height="135">
<StackPanel Width="408" Height="23" Orientation="Horizontal" Margin="0,0,0,10">
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90"/>
</StackPanel>
<StackPanel Width="408" Height="23" Orientation="Horizontal" Margin="0,0,0,10">
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90"/>
</StackPanel>
<StackPanel Width="408" Height="23" Orientation="Horizontal" Margin="0,0,0,10">
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90"/>
</StackPanel>
<StackPanel Width="408" Height="23" Orientation="Horizontal">
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90"/>
</StackPanel>
</StackPanel>
</GroupBox>
<GroupBox Header="Item Ball Settings" Width="424" Height="165" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="11,0,0,0">
<DockPanel Margin="10,0,-2,0">
<Grid HorizontalAlignment="Left" VerticalAlignment="Top" Height="142" Width="398">
<Label Content="% Chance of Spawn:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="-5,0,0,0"/>
<sc:IntegerUpDown Width="278" VerticalAlignment="Top" Height="25" HorizontalAlignment="Left" Margin="112,1,0,0"/>
<StackPanel Orientation="Horizontal" Margin="0,42,0,0" Height="24" VerticalAlignment="Top">
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,76,0,0" Height="24" VerticalAlignment="Top">
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90" Margin="0,0,10,0"/>
<ComboBox Width="90"/>
</StackPanel>
</Grid>
</DockPanel>
</GroupBox>
</DockPanel>
</Grid>
</Window>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WindEditor.Minitors.EnemyDrop
{
/// <summary>
/// Interaction logic for EnemyDropMinitorWindow.xaml
/// </summary>
public partial class EnemyDropMinitorWindow : Window
{
public EnemyDropMinitorWindow()
{
InitializeComponent();
}
}
}

0 comments on commit 1627d44

Please sign in to comment.