- Added UID, Party Editing.

- Separated monster skills.
- Added NA support of "DELETE" monsters.
This commit is contained in:
sy2zhao 2017-09-10 16:33:19 -04:00
parent 3588806971
commit 9fbf4e9794
15 changed files with 275 additions and 72 deletions

View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.26430.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MHSEC-G", "MHSEC-G\MHSEC-G.csproj", "{80372081-2D34-424B-93E2-89D5815BF3E8}"
EndProject

View File

@ -32,7 +32,7 @@
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
@ -43,7 +43,7 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
@ -98,6 +98,9 @@
<DependentUpon>MonsterWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Offsets.cs" />
<Compile Include="PartyWindow.xaml.cs">
<DependentUpon>PartyWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\Annotations.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
@ -126,6 +129,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="PartyWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@ -151,7 +158,8 @@
<AppDesigner Include="Properties\" />
<None Include="Resources\egg_dummy_template.bin" />
<None Include="Resources\egg_null_template.bin" />
<None Include="Resources\monster_null_template.bin" />
<None Include="Resources\monster_null_template_JPN.bin" />
<None Include="Resources\monster_null_template_NA.bin" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\idmap.txt" />

View File

@ -137,8 +137,8 @@
</TabItem>
<TabItem Header="Monsters" Margin="0,0,0,0">
<Grid Background="#FFE5E5E5">
<DataGrid x:Name="monster_grid" HorizontalAlignment="Left" Margin="10,24,0,0" IsReadOnly="True"
VerticalAlignment="Top" Height="293" Width="414" CanUserAddRows="False"
<DataGrid x:Name="monster_grid" HorizontalAlignment="Left" Margin="10,36,0,0" IsReadOnly="True"
VerticalAlignment="Top" Height="286" Width="414" CanUserAddRows="False"
AutoGenerateColumns="False" SelectionMode="Single" ItemsSource="{Binding monsters}">
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}">
@ -147,20 +147,24 @@
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False"
Width="40" Binding="{Binding box}"
Width="30" Binding="{Binding box}"
Header="Box"/>
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False"
Width="40" Binding="{Binding slot}"
Width="30" Binding="{Binding slot}"
Header="Slot"/>
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False"
Width="250" Binding="{Binding name}"
Width="40" Binding="{Binding uid}"
Header="UID"/>
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False"
Width="200" Binding="{Binding name}"
Header="Name" />
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False"
Width="*" Binding="{Binding level}"
Header="Level" />
</DataGrid.Columns>
</DataGrid>
<Label x:Name="label_monster" Content="Double-click an entry to edit." HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.184,0.019"/>
<Label x:Name="label_monster" Content="Double-click an entry to edit." HorizontalAlignment="Left" Margin="10,5,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.184,0.019"/>
<Button x:Name="btn_monster_party" Content="Edit Current Party" HorizontalAlignment="Left" VerticalAlignment="Top" Width="112" Margin="312,8,0,0" Click="btn_monster_party_Click"/>
</Grid>
</TabItem>
<TabItem Header="Talismans" Margin="0,0,0,0">

View File

@ -30,10 +30,8 @@ namespace MHSEC_G
byte[] dummy = new byte[Offsets.SAVE_FILE_SIZE_JPN];
Array.Clear(dummy, 0, dummy.Length);
this.Title = "MHSEC-G Ver " + get_app_version();
Offsets.init(dummy);
init(dummy);
DataContext = this;
}
@ -234,5 +232,11 @@ namespace MHSEC_G
}
}
}
private void btn_monster_party_Click(object sender, RoutedEventArgs e)
{
PartyWindow partyWnd = new PartyWindow(_model);
partyWnd.Show();
}
}
}

View File

@ -36,6 +36,26 @@ namespace MHSEC_G
}
}
public string uid
{
get => Helper.byte_to_uint16_le(_data, _obj_offset + Offsets.OFFSETR_MONSTER_UID).ToString("X4");
set
{
uint parsed;
if (Helper.parse_hex_string(value, out parsed) && parsed <= 0xFFFF)
{
Helper.write_uint16_le(_data, _obj_offset + Offsets.OFFSETR_MONSTER_UID, parsed);
}
else
{
MessageBox.Show("UID must be at most 0xFFFF", "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(uid));
}
}
public uint atk
{
get => Helper.byte_to_uint16_le(_data, _obj_offset + Offsets.OFFSETR_MONSTER_ATK);
@ -250,23 +270,43 @@ namespace MHSEC_G
}
}
public string skill
public string skill1
{
get => Helper.byte_to_uint16_le(_data, _obj_offset + Offsets.OFFSETR_MONSTER_SKILL).ToString("X4");
get => Helper.byte_to_uint(_data[_obj_offset + Offsets.OFFSETR_MONSTER_SKILL]).ToString("X2");
set
{
uint parsed;
if (Helper.parse_hex_string(value, out parsed))
if (Helper.parse_hex_string(value, out parsed) && parsed <= 0xFF)
{
Helper.write_uint16_le(_data, _obj_offset + Offsets.OFFSETR_MONSTER_SKILL, parsed);
_data[_obj_offset + Offsets.OFFSETR_MONSTER_SKILL] = (byte) (parsed & 0xFF);
}
else
{
MessageBox.Show("Malformed skill value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK,
MessageBox.Show("Malformed skill value - must be <= 0xFF.", "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(skill));
OnPropertyChanged(nameof(skill1));
}
}
public string skill2
{
get => Helper.byte_to_uint(_data[_obj_offset + Offsets.OFFSETR_MONSTER_SKILL + 1]).ToString("X2");
set
{
uint parsed;
if (Helper.parse_hex_string(value, out parsed) && parsed <= 0xFF)
{
_data[_obj_offset + Offsets.OFFSETR_MONSTER_SKILL + 1] = (byte)(parsed & 0xFF);
}
else
{
MessageBox.Show("Malformed skill value - must be <= 0xFF.", "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(skill2));
}
}

View File

@ -5,87 +5,89 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MHSEC_G"
mc:Ignorable="d"
Title="Monster Editor" Height="328" Width="337.449" ResizeMode="NoResize">
<Grid>
<Grid Background="#FFE5E5E5" Margin="0,0,0.5,-0.5">
<Label x:Name="label_mhp" Content="HP" HorizontalAlignment="Left" Margin="30,39,0,0"
Title="Monster Editor" Height="313.238" Width="339.947" ResizeMode="NoResize">
<Grid Background="#FFE5E5E5">
<Label x:Name="label_mhp" Content="HP" HorizontalAlignment="Left" Margin="26,39,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mat" Content="Atk" HorizontalAlignment="Left" Margin="27,68,0,0"
<Label x:Name="label_mat" Content="Atk" HorizontalAlignment="Left" Margin="23,68,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mdf" Content="Def" HorizontalAlignment="Left" Margin="26,97,0,0"
<Label x:Name="label_mdf" Content="Def" HorizontalAlignment="Left" Margin="22,97,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mhiv" Content="IV-HP" HorizontalAlignment="Left" Margin="15,125,0,0"
<Label x:Name="label_mhiv" Content="IV-HP" HorizontalAlignment="Left" Margin="11,125,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mdiv" Content="IV-Atk" HorizontalAlignment="Left" Margin="12,154,0,0"
<Label x:Name="label_mdiv" Content="IV-Atk" HorizontalAlignment="Left" Margin="8,154,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_maiv" Content="IV-Def" HorizontalAlignment="Left" Margin="11,182,0,0"
<Label x:Name="label_maiv" Content="IV-Def" HorizontalAlignment="Left" Margin="7,182,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mhpu" Content="PowerUp-HP" HorizontalAlignment="Left" Margin="157,123,0,0"
<Label x:Name="label_mhpu" Content="PowerUp-HP" HorizontalAlignment="Left" Margin="157,123,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mapu" Content="PowerUp-Atk" HorizontalAlignment="Left" Margin="154,151,0,0"
<Label x:Name="label_mapu" Content="PowerUp-Atk" HorizontalAlignment="Left" Margin="154,151,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mdpu" Content="PowerUp-Def" HorizontalAlignment="Left" Margin="154,179,0,0"
<Label x:Name="label_mdpu" Content="PowerUp-Def" HorizontalAlignment="Left" Margin="154,179,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<TextBox x:Name="textbox_mhp" HorizontalAlignment="Left" Height="23" Margin="60,39,0,0"
<TextBox x:Name="textbox_mhp" HorizontalAlignment="Left" Height="23" Margin="56,39,0,0"
TextWrapping="Wrap" Text="{Binding monster.hp}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mat" HorizontalAlignment="Left" Height="23" Margin="60,69,0,0"
<TextBox x:Name="textbox_mat" HorizontalAlignment="Left" Height="23" Margin="56,69,0,0"
TextWrapping="Wrap" Text="{Binding monster.atk}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mdf" HorizontalAlignment="Left" Height="23" Margin="60,97,0,0"
<TextBox x:Name="textbox_mdf" HorizontalAlignment="Left" Height="23" Margin="56,97,0,0"
TextWrapping="Wrap" Text="{Binding monster.def}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mhiv" HorizontalAlignment="Left" Height="23" Margin="60,126,0,0"
<TextBox x:Name="textbox_mhiv" HorizontalAlignment="Left" Height="23" Margin="56,126,0,0"
TextWrapping="Wrap" Text="{Binding monster.hiv}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_maiv" HorizontalAlignment="Left" Height="23" Margin="60,154,0,0"
<TextBox x:Name="textbox_maiv" HorizontalAlignment="Left" Height="23" Margin="56,154,0,0"
TextWrapping="Wrap" Text="{Binding monster.aiv}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mdiv" HorizontalAlignment="Left" Height="23" Margin="60,182,0,0"
<TextBox x:Name="textbox_mdiv" HorizontalAlignment="Left" Height="23" Margin="56,182,0,0"
TextWrapping="Wrap" Text="{Binding monster.div}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mhpu" HorizontalAlignment="Left" Height="23" Margin="240,126,0,0"
<TextBox x:Name="textbox_mhpu" HorizontalAlignment="Left" Height="23" Margin="240,126,0,0"
TextWrapping="Wrap" Text="{Binding monster.hpu}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mapu" HorizontalAlignment="Left" Height="23" Margin="240,154,0,0"
<TextBox x:Name="textbox_mapu" HorizontalAlignment="Left" Height="23" Margin="240,154,0,0"
TextWrapping="Wrap" Text="{Binding monster.apu}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mdpu" HorizontalAlignment="Left" Height="23" Margin="240,182,0,0"
<TextBox x:Name="textbox_mdpu" HorizontalAlignment="Left" Height="23" Margin="240,182,0,0"
TextWrapping="Wrap" Text="{Binding monster.dpu}" VerticalAlignment="Top"
Width="75" />
<Label x:Name="label_mlv" Content="Level" HorizontalAlignment="Left" Margin="198,36,0,0"
<Label x:Name="label_mlv" Content="Level" HorizontalAlignment="Left" Margin="198,36,0,0"
VerticalAlignment="Top" RenderTransformOrigin="-0.263,0.135" />
<Label x:Name="label_mex" Content="Exp" HorizontalAlignment="Left" Margin="172,69,0,0"
<Label x:Name="label_mex" Content="Exp" HorizontalAlignment="Left" Margin="172,69,0,0"
VerticalAlignment="Top" RenderTransformOrigin="-0.263,0.135" />
<Label x:Name="label_spe" Content="Species (Hex)" Margin="156,97,94,0"
<Label x:Name="label_spe" Content="Species (Hex)" Margin="156,97,94,0"
VerticalAlignment="Top" RenderTransformOrigin="-0.263,0.135" />
<TextBox x:Name="textbox_mlv" HorizontalAlignment="Left" Height="24" Margin="240,39,0,0"
<TextBox x:Name="textbox_mlv" HorizontalAlignment="Left" Height="24" Margin="240,38,0,0"
TextWrapping="Wrap" Text="{Binding monster.level}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mex" HorizontalAlignment="Left" Height="24" Margin="240,68,0,0"
<TextBox x:Name="textbox_mex" HorizontalAlignment="Left" Height="24" Margin="240,68,0,0"
TextWrapping="Wrap" Text="{Binding monster.exp}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_spe" HorizontalAlignment="Left" Height="24" Margin="240,97,0,0"
<TextBox x:Name="textbox_spe" HorizontalAlignment="Left" Height="24" Margin="240,97,0,0"
TextWrapping="Wrap" Text="{Binding monster.spe, StringFormat=\{0:X2\}}" VerticalAlignment="Top"
Width="75"/>
<Label x:Name="label_mname" Content="Name" HorizontalAlignment="Left" Margin="14,10,0,0"
<Label x:Name="label_mname" Content="Name" HorizontalAlignment="Left" Margin="10,10,0,0"
VerticalAlignment="Top" />
<TextBox x:Name="textbox_mname" HorizontalAlignment="Left" Height="22" Margin="60,12,0,0"
<TextBox x:Name="textbox_mname" HorizontalAlignment="Left" Height="22" Margin="56,12,0,0"
TextWrapping="Wrap" Text="{Binding monster.name}" VerticalAlignment="Top"
Width="118" />
<Label x:Name="label_m_warn" Content="Warning: The sum of PowerUps should be at most 10."
HorizontalAlignment="Left" Margin="11,210,0,0" VerticalAlignment="Top" />
<Button x:Name="button_mexp" Content="Max" HorizontalAlignment="Left" Margin="200,72,0,0"
<Button x:Name="button_mexp" Content="Max" HorizontalAlignment="Left" Margin="200,72,0,0"
VerticalAlignment="Top" Width="35" Click="button_mexp_Click" />
<Button x:Name="button_mdel" Content="Export" HorizontalAlignment="Left" Margin="73,270,0,0" VerticalAlignment="Top" Width="76" Click="button_mdel_Click"/>
<Label x:Name="label_mon_skill" Content="Skill (X)" HorizontalAlignment="Left" Margin="186,10,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="textbox_mon_skill" HorizontalAlignment="Left" Height="24" Margin="240,10,0,0"
TextWrapping="Wrap" Text="{Binding monster.skill}" VerticalAlignment="Top"
<Button x:Name="button_mdel" Content="Export" HorizontalAlignment="Left" Margin="7,251,0,0" VerticalAlignment="Top" Width="76" Click="button_mdel_Click" Height="24"/>
<Label x:Name="label_mon_skill" Content="Skill 1" HorizontalAlignment="Left" Margin="10,211,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="textbox_mon_skill" HorizontalAlignment="Left" Height="24" Margin="56,211,0,0"
TextWrapping="Wrap" Text="{Binding monster.skill1}" VerticalAlignment="Top"
Width="75" />
<Button x:Name="button_mdel_import" Content="Import" HorizontalAlignment="Left" Margin="157,270,0,0" VerticalAlignment="Top" Width="76" Click="button_mimport_Click" RenderTransformOrigin="0.167,-0.328"/>
<Button x:Name="button_mdel_delete" Content="Delete" HorizontalAlignment="Left" Margin="239,270,0,0" VerticalAlignment="Top" Width="76" Click="button_mdelete_Click" Height="20"/>
<Button x:Name="button_mdel_genes" Content="Edit Genes" HorizontalAlignment="Left" Margin="239,241,0,0" VerticalAlignment="Top" Width="75" Click="button_mdel_genes_Click"/>
</Grid>
<Button x:Name="button_mdel_import" Content="Import" HorizontalAlignment="Left" Margin="88,251,0,0" VerticalAlignment="Top" Width="76" Click="button_mimport_Click" RenderTransformOrigin="0.167,-0.328" Height="24"/>
<Button x:Name="button_mdel_delete" Content="Delete" HorizontalAlignment="Left" Margin="169,251,0,0" VerticalAlignment="Top" Width="76" Click="button_mdelete_Click" Height="24" RenderTransformOrigin="-0.095,0.426"/>
<Button x:Name="button_mdel_genes" Content="Edit Genes" HorizontalAlignment="Left" Margin="250,251,0,0" VerticalAlignment="Top" Width="75" Click="button_mdel_genes_Click" Height="24" RenderTransformOrigin="0.415,0.563"/>
<Label x:Name="label_mon_uid" Content="UID (Hex)" HorizontalAlignment="Left" Margin="176,10,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<TextBox HorizontalAlignment="Left" Height="23" Margin="240,10,0,0" TextWrapping="Wrap" Text="{Binding monster.uid}" VerticalAlignment="Top" Width="75"/>
<Label x:Name="lab" Content="Skill 2" HorizontalAlignment="Left" Margin="195,211,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="textbox_mon_skill_Copy" HorizontalAlignment="Left" Height="24" Margin="240,211,0,0"
TextWrapping="Wrap" Text="{Binding monster.skill2}" VerticalAlignment="Top"
Width="75" />
</Grid>
</Window>

View File

@ -52,7 +52,7 @@ namespace MHSEC_G
MessageBoxResult confirm = MessageBox.Show("Are you sure you want to delete the monster?", "MHSEC-G", MessageBoxButton.YesNo);
if (confirm == MessageBoxResult.Yes)
{
_monster.setByteArray(Properties.Resources.monster_null_template);
_monster.setByteArray(Offsets.MONSTER_NULL_TEMPLATE);
}
}

View File

@ -178,6 +178,15 @@ namespace MHSEC_G
//
// Monsters
//
private static byte[] _MONSTER_NULL_TEMPLATE;
public static byte[] MONSTER_NULL_TEMPLATE => _MONSTER_NULL_TEMPLATE;
private static uint _OFFSETA_MONSTER_PARTY;
public static uint OFFSETA_MONSTER_PARTY => _OFFSETA_MONSTER_PARTY;
private static uint _OFFSETR_MONSTER_UID;
public static uint OFFSETR_MONSTER_UID => _OFFSETR_MONSTER_UID ;
private static uint _LIMIT_MONSTER_EXP;
public static uint LIMIT_MONSTER_EXP => _LIMIT_MONSTER_EXP;
@ -368,6 +377,10 @@ namespace MHSEC_G
//
//Monsters
//
_OFFSETR_MONSTER_UID = 0x28;
_OFFSETA_MONSTER_PARTY = 0x47870;
_MONSTER_NULL_TEMPLATE = Properties.Resources.monster_null_template_JPN;
_LIMIT_MONSTER_EXP = 0xFFFFFF;
_SIZE_MONSTER = 0x478;
_OFFSETA_MONSTER = 0xA150;
@ -483,6 +496,10 @@ namespace MHSEC_G
//
// Monsters ok
//
_MONSTER_NULL_TEMPLATE = Properties.Resources.monster_null_template_NA;
_OFFSETA_MONSTER_PARTY = 0x49B7C;
_OFFSETR_MONSTER_UID = 0x50;
_LIMIT_MONSTER_EXP = 0xFFFFFF;
_SIZE_MONSTER = 0x4A0;
_OFFSETA_MONSTER = 0xA1FC;

View File

@ -0,0 +1,23 @@
<Window x:Class="MHSEC_G.PartyWindow"
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:MHSEC_G"
mc:Ignorable="d"
Title="Party Editor" Height="229.308" Width="245.569">
<Grid Background="#FFE5E5E5">
<Label Content="Monster 1 UID" HorizontalAlignment="Left" Margin="10,9,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.053,-0.272"/>
<Label Content="Monster 2 UID" HorizontalAlignment="Left" Margin="10,39,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.507,-1.719"/>
<Label Content="Monster 3 UID" HorizontalAlignment="Left" Margin="10,69,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1.158,-2.912"/>
<Label Content="Monster 4 UID" HorizontalAlignment="Left" Margin="10,99,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1.158,-2.912"/>
<Label Content="Monster 5 UID" HorizontalAlignment="Left" Margin="10,129,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1.158,-2.912"/>
<Label Content="Monster 6 UID" HorizontalAlignment="Left" Margin="10,159,0,0" VerticalAlignment="Top" RenderTransformOrigin="-1.158,-2.912"/>
<TextBox HorizontalAlignment="Left" Height="23" Margin="102,9,0,0" TextWrapping="Wrap" Text="{Binding mon1}" VerticalAlignment="Top" Width="120"/>
<TextBox HorizontalAlignment="Left" Height="23" Margin="102,39,0,0" TextWrapping="Wrap" Text="{Binding mon2}" VerticalAlignment="Top" Width="120"/>
<TextBox HorizontalAlignment="Left" Height="23" Margin="102,69,0,0" TextWrapping="Wrap" Text="{Binding mon3}" VerticalAlignment="Top" Width="120"/>
<TextBox HorizontalAlignment="Left" Height="23" Margin="102,99,0,0" TextWrapping="Wrap" Text="{Binding mon4}" VerticalAlignment="Top" Width="120" RenderTransformOrigin="0.666,4.642"/>
<TextBox HorizontalAlignment="Left" Height="23" Margin="102,129,0,0" TextWrapping="Wrap" Text="{Binding mon5}" VerticalAlignment="Top" Width="120"/>
<TextBox HorizontalAlignment="Left" Height="23" Margin="102,159,0,0" TextWrapping="Wrap" Text="{Binding mon6}" VerticalAlignment="Top" Width="120"/>
</Grid>
</Window>

View File

@ -0,0 +1,93 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
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;
using MHSEC_G.Annotations;
namespace MHSEC_G
{
public partial class PartyWindow : Window, INotifyPropertyChanged
{
private readonly byte[] _model;
public PartyWindow(byte[] model)
{
_model = model;
InitializeComponent();
DataContext = this;
}
private void set_mon_by_id(string value, uint id)
{
uint parsed;
if (Helper.parse_hex_string(value, out parsed) && parsed <= 0xFFFF)
{
Helper.write_uint16_le(_model, Offsets.OFFSETA_MONSTER_PARTY + id * 4, parsed);
OnPropertyChanged(null);
}
else
{
MessageBox.Show("UID must be at most 0xFFFF", "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
}
private string get_mon_by_id(uint id)
{
return Helper.byte_to_uint16_le(_model, Offsets.OFFSETA_MONSTER_PARTY + id * 4).ToString("X4");
}
public string mon1
{
get => get_mon_by_id(0);
set { set_mon_by_id(value, 0); }
}
public string mon2
{
get => get_mon_by_id(1);
set { set_mon_by_id(value, 1); }
}
public string mon3
{
get => get_mon_by_id(2);
set { set_mon_by_id(value, 2); }
}
public string mon4
{
get => get_mon_by_id(3);
set { set_mon_by_id(value, 3); }
}
public string mon5
{
get => get_mon_by_id(4);
set { set_mon_by_id(value, 4); }
}
public string mon6
{
get => get_mon_by_id(5);
set { set_mon_by_id(value, 5); }
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

View File

@ -51,5 +51,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]

View File

@ -82,7 +82,7 @@ namespace MHSEC_G.Properties {
/// <summary>
/// Looks up a localized string similar to 0001 Empty Slot
///0002 No Slot
///0002 Locked Slot
///0003 アプトノス遺伝子
///0004 ポポ遺伝子
///0005 アプケロス遺伝子
@ -118,8 +118,7 @@ namespace MHSEC_G.Properties {
///0023 岩竜遺伝子
///0024 桃岩竜遺伝子
///0025 鎧竜遺伝子
///0026 黒鎧竜遺伝子
///0 [rest of string was truncated]&quot;;.
///0026 黒鎧竜遺伝 [rest of string was truncated]&quot;;.
/// </summary>
internal static string gene {
get {
@ -187,9 +186,19 @@ namespace MHSEC_G.Properties {
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] monster_null_template {
internal static byte[] monster_null_template_JPN {
get {
object obj = ResourceManager.GetObject("monster_null_template", resourceCulture);
object obj = ResourceManager.GetObject("monster_null_template_JPN", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] monster_null_template_NA {
get {
object obj = ResourceManager.GetObject("monster_null_template_NA", resourceCulture);
return ((byte[])(obj));
}
}

View File

@ -124,9 +124,6 @@
<data name="MainIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\MainIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="monster_null_template" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\monster_null_template.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="gene" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\gene.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
@ -136,4 +133,10 @@
<data name="egg_null_template" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\egg_null_template.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="monster_null_template_JPN" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\monster_null_template_JPN.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="monster_null_template_NA" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\monster_null_template_NA.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

Binary file not shown.