0. Added app ICON

1. Corrected the ID list and re-added
2. Changed to key-item display and values to hex values.
4. Allow user to sort item list
5. + Delete monsters
6. Fixed hex string negative sign validation
7. Added monster egg fragments: Oroshi kirin, Molten tigrex, Puzzle dragon (fire zinogre), white monoblos
8. Move resource files to resource.
This commit is contained in:
secXsQuared1995 2016-10-20 21:02:40 -04:00
parent a684fea1af
commit a9e982a0fd
15 changed files with 776 additions and 192 deletions

View File

@ -22,8 +22,7 @@ namespace MHSEC_G
// Faciltiy Item
ITEM_NO_CORRESPONDENCE = 0x21,
ITEM_MAPPING_CORRUPTED = 0x22,
ITEM_MAPPING_DNE = 0x23,
ITEM_MAPPING_CORRUPTED = 0x22
}
public static void bug_check(ErrorCode error_code, string error_message)

View File

@ -27,12 +27,13 @@ namespace MHSEC_G
{
get { return _offset; }
}
private readonly Model _model;
public string name
{
get {
string name = "Unknown";
string name = _offset >= OFFSETA_FIRST_KEY_ITEM ? "Key Item [" + id.ToString("X4") + "]" : "Unknown";
if (OFFSET_NAME_MAPPING.ContainsKey(_offset))
{
name = OFFSET_NAME_MAPPING[_offset];
@ -76,9 +77,7 @@ namespace MHSEC_G
List<Item> ret = new List<Item>();
for (uint offset = OFFSETA_ITEM_BOX; offset < OFFSETA_ITEM_BOX_END; offset += SIZE_ITEM)
{
string name = "Unknown";
uint item_id = Model.byte_to_uint16_le(buffer, offset + OFFSETR_ITEM_ID);
if (item_id == 0)
{
// if not obtained yet
@ -88,7 +87,8 @@ namespace MHSEC_G
// continue
continue;
}
// if we know the id to the offset, just set it
Model.write_uint16_le(model.save_file, offset + OFFSETR_ITEM_ID, OFFSET_ID_MAPPING[offset]);
}
else
{
@ -99,7 +99,8 @@ namespace MHSEC_G
if (item_id != OFFSET_ID_MAPPING[offset])
{
// correct to the correct id
// BugCheck.bug_check(BugCheck.ErrorCode.ITEM_NO_CORRESPONDENCE, "Item offset " + offset.ToString("X") + " and item ID " + item_id.ToString("X") + " do not correspond.");
// don't bug_check since too many people's files are broken
// TODO: BugCheck.bug_check(BugCheck.ErrorCode.ITEM_NO_CORRESPONDENCE, "Item offset " + offset.ToString("X") + " and item ID " + item_id.ToString("X") + " do not correspond.");
Model.write_uint16_le(model.save_file, offset + OFFSETR_ITEM_ID, OFFSET_ID_MAPPING[offset]);
}
}
@ -113,15 +114,8 @@ namespace MHSEC_G
public static void read_item_mappings()
{
string line;
System.IO.StreamReader file = null;
StringReader file = new StringReader(Properties.Resources.idmap);
if (!File.Exists(ID_MAPPING_FILE_NAME))
{
BugCheck.bug_check(BugCheck.ErrorCode.ITEM_MAPPING_DNE,
"Cannot find mapping file " + ID_MAPPING_FILE_NAME);
}
file = new System.IO.StreamReader(ID_MAPPING_FILE_NAME);
while ((line = file.ReadLine()) != null)
{
if (line.Length == 0)
@ -130,11 +124,12 @@ namespace MHSEC_G
string[] eachline = line.Split('\t');
if (eachline.Length != 3)
{
BugCheck.bug_check(BugCheck.ErrorCode.ITEM_MAPPING_CORRUPTED, "Invalid mapping file line:\n" + line);
}
OFFSET_ID_MAPPING.Add(UInt32.Parse(eachline[0], System.Globalization.NumberStyles.HexNumber), UInt32.Parse(eachline[1], System.Globalization.NumberStyles.HexNumber));
OFFSET_NAME_MAPPING.Add(UInt32.Parse(eachline[0], System.Globalization.NumberStyles.HexNumber), eachline[2]);
OFFSET_ID_MAPPING.Add(uint.Parse(eachline[0], System.Globalization.NumberStyles.HexNumber), uint.Parse(eachline[1], System.Globalization.NumberStyles.HexNumber));
OFFSET_NAME_MAPPING.Add(uint.Parse(eachline[0], System.Globalization.NumberStyles.HexNumber), eachline[2]);
}
file.Close();

View File

@ -51,9 +51,13 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\MainIcon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
@ -79,6 +83,12 @@
<Compile Include="Model.cs" />
<Compile Include="Monster.cs" />
<Compile Include="Properties\Annotations.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Talisman.cs" />
<Compile Include="ViewModel.cs" />
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
@ -97,11 +107,6 @@
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
@ -109,18 +114,21 @@
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="app.config" />
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
<None Include="Resources\monster_null_template.bin" />
</ItemGroup>
<ItemGroup>
<Resource Include="idmap.txt" />
<Resource Include="Resources\idmap.txt" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
@ -139,6 +147,9 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\MainIcon.ico" />
</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.

View File

@ -5,130 +5,266 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MHSEC_G"
mc:Ignorable="d"
Title="" Height="447.855" Width="761.218" ResizeMode="NoResize">
Title="" Height="447.855" Width="761.218" ResizeMode="NoResize" Icon="Resources/MainIcon.ico">
<Grid HorizontalAlignment="Left" Width="756" Margin="0,0,0,0">
<TabControl x:Name="tabControl" HorizontalAlignment="Left" Height="344" Margin="10,51,0,0" VerticalAlignment="Top" Width="726">
<TabControl x:Name="tabControl" HorizontalAlignment="Left" Height="344" Margin="10,51,0,0"
VerticalAlignment="Top" Width="726">
<TabItem Header="Character">
<Grid Background="#FFE5E5E5" Margin="0,0,0,0">
<Label x:Name="label_name" Content="Name" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top"/>
<Label x:Name="label_money" Content="Money" HorizontalAlignment="Left" Margin="10,40,0,0" VerticalAlignment="Top"/>
<Label x:Name="label_leve" Content="Level" HorizontalAlignment="Left" Margin="10,70,0,0" VerticalAlignment="Top"/>
<Label x:Name="label_exp" Content="Exp" HorizontalAlignment="Left" Margin="10,100,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="textbox_name" HorizontalAlignment="Left" Height="22" Margin="61,14,0,0" TextWrapping="NoWrap" VerticalAlignment="Top" Width="120" Text="{Binding character.name}"/>
<TextBox x:Name="textbox_money" HorizontalAlignment="Left" Height="22" Margin="61,44,0,0" TextWrapping="NoWrap" VerticalAlignment="Top" Width="120" Text="{Binding character.money}"/>
<TextBox x:Name="textbox_level" HorizontalAlignment="Left" Height="22" Margin="61,74,0,0" TextWrapping="NoWrap" VerticalAlignment="Top" Width="120" Text="{Binding character.level}"/>
<TextBox x:Name="textbox_exp" HorizontalAlignment="Left" Height="22" Margin="61,104,0,0" TextWrapping="NoWrap" VerticalAlignment="Top" Width="120" Text="{Binding character.exp}"/>
<Button x:Name="button_char_money" Content="Max Money" HorizontalAlignment="Left" Margin="200,44,0,0" VerticalAlignment="Top" Width="88" RenderTransformOrigin="0.065,-0.953" Height="22" Click="button_char_money_Click"/>
<Button x:Name="button_char_exp" Content="Max Exp" HorizontalAlignment="Left" Margin="200,104,0,0" VerticalAlignment="Top" Width="88" RenderTransformOrigin="0.065,-0.953" Height="22" Click="button_char_exp_Click"/>
<Label x:Name="label_name" Content="Name" HorizontalAlignment="Left" Margin="10,10,0,0"
VerticalAlignment="Top" />
<Label x:Name="label_money" Content="Money" HorizontalAlignment="Left" Margin="10,40,0,0"
VerticalAlignment="Top" />
<Label x:Name="label_leve" Content="Level" HorizontalAlignment="Left" Margin="10,70,0,0"
VerticalAlignment="Top" />
<Label x:Name="label_exp" Content="Exp" HorizontalAlignment="Left" Margin="10,100,0,0"
VerticalAlignment="Top" />
<TextBox x:Name="textbox_name" HorizontalAlignment="Left" Height="22" Margin="61,14,0,0"
TextWrapping="NoWrap" VerticalAlignment="Top" Width="120" Text="{Binding character.name}" />
<TextBox x:Name="textbox_money" HorizontalAlignment="Left" Height="22" Margin="61,44,0,0"
TextWrapping="NoWrap" VerticalAlignment="Top" Width="120" Text="{Binding character.money}" />
<TextBox x:Name="textbox_level" HorizontalAlignment="Left" Height="22" Margin="61,74,0,0"
TextWrapping="NoWrap" VerticalAlignment="Top" Width="120" Text="{Binding character.level}" />
<TextBox x:Name="textbox_exp" HorizontalAlignment="Left" Height="22" Margin="61,104,0,0"
TextWrapping="NoWrap" VerticalAlignment="Top" Width="120" Text="{Binding character.exp}" />
<Button x:Name="button_char_money" Content="Max Money" HorizontalAlignment="Left"
Margin="200,44,0,0" VerticalAlignment="Top" Width="88" RenderTransformOrigin="0.065,-0.953"
Height="22" Click="button_char_money_Click" />
<Button x:Name="button_char_exp" Content="Max Exp" HorizontalAlignment="Left" Margin="200,104,0,0"
VerticalAlignment="Top" Width="88" RenderTransformOrigin="0.065,-0.953" Height="22"
Click="button_char_exp_Click" />
</Grid>
</TabItem>
<TabItem Header="Egg Fragments">
<Grid Background="#FFE5E5E5">
<DataGrid x:Name="egg_frag_grid" HorizontalAlignment="Left" Margin="10,35,0,0" VerticalAlignment="Top" Height="271" Width="556" CanUserAddRows="False" AutoGenerateColumns="False" ItemsSource="{Binding Path=egg_fragments}">
<DataGrid x:Name="egg_frag_grid" HorizontalAlignment="Left" Margin="10,35,0,0"
VerticalAlignment="Top" Height="271" Width="556" CanUserAddRows="False"
AutoGenerateColumns="False" ItemsSource="{Binding Path=egg_fragments}">
<DataGrid.Columns>
<DataGridTextColumn CanUserReorder ="False" CanUserResize="False" CanUserSort="False" Width ="60" Binding="{Binding spe}"
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False"
Width="60" Binding="{Binding spe}"
Header="Species" />
<DataGridTextColumn CanUserReorder ="False" CanUserResize="False" CanUserSort="False" Width ="60" Binding="{Binding pos}"
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False"
Width="60" Binding="{Binding pos}"
Header="Position" />
<DataGridTextColumn CanUserReorder ="False" CanUserResize="False" CanUserSort="False" Width ="60" Binding="{Binding new_flag}"
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False"
Width="60" Binding="{Binding new_flag}"
Header="New?" />
<DataGridTextColumn CanUserReorder ="False" CanUserResize="False" CanUserSort="False" Width ="60" Binding="{Binding rarity}"
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False"
Width="60" Binding="{Binding rarity}"
Header="Rarity" />
<DataGridTextColumn CanUserReorder ="False" CanUserResize="False" CanUserSort="False" Width ="60" Binding="{Binding color}"
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False"
Width="60" Binding="{Binding color}"
Header="Color" />
<DataGridTextColumn CanUserReorder ="False" CanUserResize="False" CanUserSort="False" Width ="60" Binding="{Binding dlc}"
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False"
Width="60" Binding="{Binding dlc}"
Header="DLC" />
<DataGridTextColumn CanUserReorder ="False" CanUserResize="False" CanUserSort="False" Width ="60" Binding="{Binding unknown_7h}"
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False"
Width="60" Binding="{Binding unknown_7h}"
Header="0x6" />
<DataGridTextColumn CanUserReorder ="False" CanUserResize="False" CanUserSort="False" Width ="*" Binding="{Binding unknown_6h}"
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="False"
Width="*" Binding="{Binding unknown_6h}"
Header="0x7" />
</DataGrid.Columns>
</DataGrid>
<Button x:Name="button_give_dino" Content="Give Dinovaldo" HorizontalAlignment="Left" Margin="584,195,0,0" VerticalAlignment="Top" Width="110" Height="30" Click="button_give_dino_Click"/>
<Button x:Name="button_give_epony" Content="Give Epony" HorizontalAlignment="Left" Margin="584,35,0,0" VerticalAlignment="Top" Width="110" Height="30" Click="button_give_epony_Click"/>
<Button x:Name="button_give_bear" Content="Give Mascot" HorizontalAlignment="Left" Margin="584,75,0,0" VerticalAlignment="Top" Width="110" Height="30" Click="button_give_bear_Click"/>
<Button x:Name="button_give_mtiggy" IsEnabled="False" Content="Give Molten Tigrex" HorizontalAlignment="Left" Margin="584,115,0,0" VerticalAlignment="Top" Width="110" Height="30" Click="button_give_mtiggy_Click"/>
<Button x:Name="button_give_okirin" IsEnabled="False" Content="Give Oroshi Kirin" HorizontalAlignment="Left" Margin="584,155,0,0" VerticalAlignment="Top" Width="110" Height="30" Click="button_give_okirin_Click"/>
<TextBlock x:Name="textblock_egg_frag" HorizontalAlignment="Left" Margin="575,241,0,0" TextWrapping="Wrap" Text="Note: You can only give yourself one DLC monster at a time." VerticalAlignment="Top" RenderTransformOrigin="-0.182,-0.531" Width="125"/>
<TextBlock x:Name="textblock_egg_frag_n" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="If interested, try giving yourself DLC eggs and modify each shard's DLC byte to 0x4 and up. You can get other DLC monsters!" VerticalAlignment="Top"/>
<Button x:Name="button_give_dino" Content="Give Dinovaldo" HorizontalAlignment="Left"
Margin="584,195,0,0" VerticalAlignment="Top" Width="110" Height="30"
Click="button_give_dino_Click" />
<Button x:Name="button_give_epony" Content="Give Epony" HorizontalAlignment="Left"
Margin="584,35,0,0" VerticalAlignment="Top" Width="110" Height="30"
Click="button_give_epony_Click" />
<Button x:Name="button_give_bear" Content="Give Mascot" HorizontalAlignment="Left"
Margin="584,75,0,0" VerticalAlignment="Top" Width="110" Height="30"
Click="button_give_bear_Click" />
<Button x:Name="button_give_mtiggy" Content="Give Molten Tigrex" HorizontalAlignment="Left"
Margin="584,115,0,0" VerticalAlignment="Top" Width="110" Height="30"
Click="button_give_mtiggy_Click" />
<Button x:Name="button_give_okirin" Content="Give Oroshi Kirin" HorizontalAlignment="Left"
Margin="584,155,0,0" VerticalAlignment="Top" Width="110" Height="30"
Click="button_give_okirin_Click" />
<TextBlock x:Name="textblock_egg_frag_n" HorizontalAlignment="Left" Margin="10,10,0,0"
TextWrapping="Wrap"
Text="If interested, try giving yourself DLC eggs and modify each shard's DLC byte to 0x4 and up. You can get other DLC monsters!"
VerticalAlignment="Top" />
<Button x:Name="button_give_pd" Content="Give Puzzle Dragon" HorizontalAlignment="Left"
Margin="584,235,0,0" VerticalAlignment="Top" Width="110" Height="30"
Click="button_give_pd_Click" />
<Button x:Name="button_give_wm" Content="Give W. Monoblos" HorizontalAlignment="Left"
Margin="584,275,0,0" VerticalAlignment="Top" Width="110" Height="30"
Click="button_give_wm_Click" />
</Grid>
</TabItem>
<TabItem Header="Items">
<Grid Background="#FFE5E5E5" Margin="0,0,0,0">
<DataGrid x:Name="item_table" ItemsSource="{Binding items}" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top" Height="276" Width="550" CanUserAddRows="False" AutoGenerateColumns="False" >
<DataGrid x:Name="item_table" ItemsSource="{Binding items}" HorizontalAlignment="Left"
Margin="10,30,0,0" VerticalAlignment="Top" Height="276" Width="550"
CanUserAddRows="False" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn CanUserReorder ="False" CanUserResize="False" CanUserSort="False" Width ="100" Foreground="Gray" IsReadOnly="True" Binding="{Binding id}"
Header="ID" />
<DataGridTextColumn CanUserReorder ="False" CanUserResize="False" CanUserSort="False" Width ="100" Foreground="Gray" IsReadOnly="True" Binding="{Binding name}"
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="True"
Width="100" Foreground="Gray" IsReadOnly="True" Binding="{Binding offset , StringFormat={}{0:X4}}"
Header="Offset (Hex)" />
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="True"
Width="100" Foreground="Gray" IsReadOnly="True" Binding="{Binding id , StringFormat={}{0:X4}}"
Header="ID (Hex)" />
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="True"
Width="125" Foreground="Gray" IsReadOnly="True"
Binding="{Binding name}"
Header="Name" />
<DataGridTextColumn CanUserReorder ="False" CanUserResize="False" CanUserSort="False" Width ="*" Binding="{Binding count, Mode=TwoWay}"
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" CanUserSort="True"
Width="*" Binding="{Binding count, Mode=TwoWay}"
Header="Count" />
</DataGrid.Columns>
</DataGrid>
<Button x:Name="button_item_all" Content="All 986x" HorizontalAlignment="Left" Margin="586,30,0,0" VerticalAlignment="Top" Width="108" RenderTransformOrigin="0.065,-0.953" Height="45" Click="button_item_all_Click"/>
<Button x:Name="button_item_existing" Content="Existing 999x" HorizontalAlignment="Left" Margin="586,94,0,0" VerticalAlignment="Top" Width="108" RenderTransformOrigin="0.065,-0.953" Height="45" Click="button_item_existing_Click"/>
<Button x:Name="button_item_all" Content="All 986x" HorizontalAlignment="Left" Margin="586,30,0,0"
VerticalAlignment="Top" Width="108" RenderTransformOrigin="0.065,-0.953" Height="45"
Click="button_item_all_Click" />
<Button x:Name="button_item_existing" Content="Existing 999x" HorizontalAlignment="Left"
Margin="586,94,0,0" VerticalAlignment="Top" Width="108"
RenderTransformOrigin="0.065,-0.953" Height="45" Click="button_item_existing_Click" />
</Grid>
</TabItem>
<TabItem Header="Monsters" Margin="0,0,0,0">
<Grid Background="#FFE5E5E5">
<Label x:Name="label_mhp" Content="HP" HorizontalAlignment="Left" Margin="10,85,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072"/>
<Label x:Name="label_mat" Content="Atk" HorizontalAlignment="Left" Margin="10,115,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072"/>
<Label x:Name="label_mdf" Content="Def" HorizontalAlignment="Left" Margin="10,145,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072"/>
<Label x:Name="label_mhiv" Content="IV-HP" HorizontalAlignment="Left" Margin="10,175,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072"/>
<Label x:Name="label_mdiv" Content="IV-Atk" HorizontalAlignment="Left" Margin="10,205,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072"/>
<Label x:Name="label_maiv" Content="IV-Def" HorizontalAlignment="Left" Margin="10,235,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072"/>
<Label x:Name="label_mhpu" Content="PowerUp-HP" HorizontalAlignment="Left" Margin="150,175,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072"/>
<Label x:Name="label_mapu" Content="PowerUp-Atk" HorizontalAlignment="Left" Margin="150,205,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072"/>
<Label x:Name="label_mdpu" Content="PowerUp-Def" HorizontalAlignment="Left" Margin="150,235,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072"/>
<Label x:Name="label_mgen1" Content="Gene1 (Hex)" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="385,85,0,0"/>
<Label x:Name="label_mgen2" Content="Gene2 (Hex)" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="505,85,0,0"/>
<Label x:Name="label_mgen3" Content="Gene3 (Hex)" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="625,85,0,0" RenderTransformOrigin="0.537,0.19"/>
<Label x:Name="label_mgen4" Content="Gene4 (Hex)" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="385,155,0,0"/>
<Label x:Name="label_mgen5" Content="Gene5 (Hex)" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="505,155,0,0" RenderTransformOrigin="0.524,0.439"/>
<Label x:Name="label_mgen6" Content="Gene6 (Hex)" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="625,155,0,0"/>
<Label x:Name="label_mgen7" Content="Gene7 (Hex)" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="385,225,0,0"/>
<Label x:Name="label_mgen8" Content="Gene8 (Hex)" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="505,225,0,0"/>
<Label x:Name="label_mgen9" Content="Gene9 (Hex)" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="625,225,0,0"/>
<TextBox x:Name="textbox_mhp" HorizontalAlignment="Left" Height="23" Margin="60,87,0,0" TextWrapping="Wrap" Text="{Binding Path=cur_monster.hp}" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="textbox_mat" HorizontalAlignment="Left" Height="23" Margin="60,117,0,0" TextWrapping="Wrap" Text="{Binding Path=cur_monster.atk}" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="textbox_mdf" HorizontalAlignment="Left" Height="23" Margin="60,147,0,0" TextWrapping="Wrap" Text="{Binding Path=cur_monster.def}" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="textbox_mhiv" HorizontalAlignment="Left" Height="23" Margin="60,177,0,0" TextWrapping="Wrap" Text="{Binding Path=cur_monster.hiv}" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="textbox_maiv" HorizontalAlignment="Left" Height="23" Margin="60,207,0,0" TextWrapping="Wrap" Text="{Binding Path=cur_monster.aiv}" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="textbox_mdiv" HorizontalAlignment="Left" Height="23" Margin="60,237,0,0" TextWrapping="Wrap" Text="{Binding Path=cur_monster.div}" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="textbox_mhpu" HorizontalAlignment="Left" Height="23" Margin="240,177,0,0" TextWrapping="Wrap" Text="{Binding Path=cur_monster.hpu}" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="textbox_mapu" HorizontalAlignment="Left" Height="23" Margin="240,207,0,0" TextWrapping="Wrap" Text="{Binding Path=cur_monster.apu}" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="textbox_mdpu" HorizontalAlignment="Left" Height="23" Margin="240,237,0,0" TextWrapping="Wrap" Text="{Binding Path=cur_monster.dpu}" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="textbox_gene1" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" Text="{Binding Path=cur_monster.gene1}" VerticalAlignment="Top" Width="80" Margin="385,120,0,0"/>
<TextBox x:Name="textbox_gene2" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" Text="{Binding Path=cur_monster.gene2}" VerticalAlignment="Top" Width="80" Margin="505,120,0,0"/>
<TextBox x:Name="textbox_gene3" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" Text="{Binding Path=cur_monster.gene3}" VerticalAlignment="Top" Width="80" Margin="625,120,0,0"/>
<TextBox x:Name="textbox_gene4" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" Text="{Binding Path=cur_monster.gene4}" VerticalAlignment="Top" Width="80" Margin="385,190,0,0"/>
<TextBox x:Name="textbox_gene5" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" Text="{Binding Path=cur_monster.gene5}" VerticalAlignment="Top" Width="80" Margin="505,190,0,0"/>
<TextBox x:Name="textbox_gene6" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" Text="{Binding Path=cur_monster.gene6}" VerticalAlignment="Top" Width="80" Margin="625,190,0,0"/>
<TextBox x:Name="textbox_gene7" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" Text="{Binding Path=cur_monster.gene7}" VerticalAlignment="Top" Width="80" Margin="385,260,0,0"/>
<TextBox x:Name="textbox_gene8" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" Text="{Binding Path=cur_monster.gene8}" VerticalAlignment="Top" Width="80" Margin="505,260,0,0"/>
<TextBox x:Name="textbox_gene9" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" Text="{Binding Path=cur_monster.gene9}" VerticalAlignment="Top" Width="80" Margin="625,260,0,0"/>
<Label x:Name="label_mlv" Content="Level" HorizontalAlignment="Left" Margin="150,85,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.263,0.135"/>
<Label x:Name="label_mex" Content="Exp" HorizontalAlignment="Left" Margin="150,115,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.263,0.135"/>
<Label x:Name="label_spe" Content="Species (Hex)" HorizontalAlignment="Left" Margin="150,145,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.263,0.135"/>
<TextBox x:Name="textbox_mlv" HorizontalAlignment="Left" Height="24" Margin="240,87,0,0" TextWrapping="Wrap" Text="{Binding Path=cur_monster.level}" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="textbox_mex" HorizontalAlignment="Left" Height="24" Margin="240,117,0,0" TextWrapping="Wrap" Text="{Binding Path=cur_monster.exp}" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="textbox_spe" HorizontalAlignment="Left" Height="24" Margin="240,147,0,0" TextWrapping="Wrap" Text="{Binding Path=cur_monster.spe}" VerticalAlignment="Top" Width="75"/>
<Label x:Name="label_mname" Content="Name" HorizontalAlignment="Left" Margin="10,54,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="textbox_mname" HorizontalAlignment="Left" Height="22" Margin="60,58,0,0" TextWrapping="Wrap" Text="{Binding Path=cur_monster.name}" VerticalAlignment="Top" Width="255"/>
<Label x:Name="label_slct" Content="Monster" HorizontalAlignment="Left" Margin="2,10,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.466,0.596"/>
<ComboBox x:Name="combobox_slct" HorizontalAlignment="Left" Margin="60,10,0,0" VerticalAlignment="Top" Width="255" ItemsSource="{Binding Path=monsters}" DisplayMemberPath="full_name" IsReadOnly="True" SelectedValue="{Binding Path=cur_monster}"/>
<Label x:Name="label_m_warn" Content="Warning: The sum of PowerUps should be at most 10." HorizontalAlignment="Left" Margin="12,265,0,0" VerticalAlignment="Top"/>
<Label x:Name="label_m_warn2" Content="The exact IV algorithm is unknown. Edit wisely." HorizontalAlignment="Left" Margin="62,285,0,0" VerticalAlignment="Top"/>
<TextBlock x:Name="textblock_gene101" HorizontalAlignment="Left" Margin="385,16,0,0" TextWrapping="Wrap" Text="MHST Gene 101:&#x0a;0x0001 = Empty Slot&#x0a;0x0002 = No Slot&#x0a;For other genes codes, refer to the gene code mapping." VerticalAlignment="Top"/>
<Button x:Name="button_mexp" Content="Max" HorizontalAlignment="Left" Margin="193,119,0,0" VerticalAlignment="Top" Width="35" Click="button_mexp_Click"/>
<Label x:Name="label_mhp" Content="HP" HorizontalAlignment="Left" Margin="10,85,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mat" Content="Atk" HorizontalAlignment="Left" Margin="10,115,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mdf" Content="Def" HorizontalAlignment="Left" Margin="10,145,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mhiv" Content="IV-HP" HorizontalAlignment="Left" Margin="10,175,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mdiv" Content="IV-Atk" HorizontalAlignment="Left" Margin="10,205,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_maiv" Content="IV-Def" HorizontalAlignment="Left" Margin="10,235,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mhpu" Content="PowerUp-HP" HorizontalAlignment="Left" Margin="150,175,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mapu" Content="PowerUp-Atk" HorizontalAlignment="Left" Margin="150,205,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mdpu" Content="PowerUp-Def" HorizontalAlignment="Left" Margin="150,235,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.564,2.072" />
<Label x:Name="label_mgen1" Content="Gene 1 (Hex)" HorizontalAlignment="Left"
VerticalAlignment="Top" Margin="385,85,0,0" />
<Label x:Name="label_mgen2" Content="Gene 2 (Hex)" HorizontalAlignment="Left"
VerticalAlignment="Top" Margin="505,85,0,0" />
<Label x:Name="label_mgen3" Content="Gene 3 (Hex)" HorizontalAlignment="Left"
VerticalAlignment="Top" Margin="625,85,0,0" RenderTransformOrigin="0.537,0.19" />
<Label x:Name="label_mgen4" Content="Gene 4 (Hex)" HorizontalAlignment="Left"
VerticalAlignment="Top" Margin="385,155,0,0" />
<Label x:Name="label_mgen5" Content="Gene 5 (Hex)" HorizontalAlignment="Left"
VerticalAlignment="Top" Margin="505,155,0,0" RenderTransformOrigin="0.524,0.439" />
<Label x:Name="label_mgen6" Content="Gene 6 (Hex)" HorizontalAlignment="Left"
VerticalAlignment="Top" Margin="625,155,0,0" />
<Label x:Name="label_mgen7" Content="Gene 7 (Hex)" HorizontalAlignment="Left"
VerticalAlignment="Top" Margin="385,225,0,0" />
<Label x:Name="label_mgen8" Content="Gene 8 (Hex)" HorizontalAlignment="Left"
VerticalAlignment="Top" Margin="505,225,0,0" />
<Label x:Name="label_mgen9" Content="Gene 9 (Hex)" HorizontalAlignment="Left"
VerticalAlignment="Top" Margin="625,225,0,0" />
<TextBox x:Name="textbox_mhp" HorizontalAlignment="Left" Height="23" Margin="60,87,0,0"
TextWrapping="Wrap" Text="{Binding Path=cur_monster.hp}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mat" HorizontalAlignment="Left" Height="23" Margin="60,117,0,0"
TextWrapping="Wrap" Text="{Binding Path=cur_monster.atk}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mdf" HorizontalAlignment="Left" Height="23" Margin="60,147,0,0"
TextWrapping="Wrap" Text="{Binding Path=cur_monster.def}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mhiv" HorizontalAlignment="Left" Height="23" Margin="60,177,0,0"
TextWrapping="Wrap" Text="{Binding Path=cur_monster.hiv}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_maiv" HorizontalAlignment="Left" Height="23" Margin="60,207,0,0"
TextWrapping="Wrap" Text="{Binding Path=cur_monster.aiv}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mdiv" HorizontalAlignment="Left" Height="23" Margin="60,237,0,0"
TextWrapping="Wrap" Text="{Binding Path=cur_monster.div}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mhpu" HorizontalAlignment="Left" Height="23" Margin="240,177,0,0"
TextWrapping="Wrap" Text="{Binding Path=cur_monster.hpu}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mapu" HorizontalAlignment="Left" Height="23" Margin="240,207,0,0"
TextWrapping="Wrap" Text="{Binding Path=cur_monster.apu}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mdpu" HorizontalAlignment="Left" Height="23" Margin="240,237,0,0"
TextWrapping="Wrap" Text="{Binding Path=cur_monster.dpu}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_gene1" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap"
Text="{Binding Path=cur_monster.gene1}" VerticalAlignment="Top" Width="80"
Margin="385,120,0,0" />
<TextBox x:Name="textbox_gene2" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap"
Text="{Binding Path=cur_monster.gene2}" VerticalAlignment="Top" Width="80"
Margin="505,120,0,0" />
<TextBox x:Name="textbox_gene3" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap"
Text="{Binding Path=cur_monster.gene3}" VerticalAlignment="Top" Width="80"
Margin="625,120,0,0" />
<TextBox x:Name="textbox_gene4" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap"
Text="{Binding Path=cur_monster.gene4}" VerticalAlignment="Top" Width="80"
Margin="385,190,0,0" />
<TextBox x:Name="textbox_gene5" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap"
Text="{Binding Path=cur_monster.gene5}" VerticalAlignment="Top" Width="80"
Margin="505,190,0,0" />
<TextBox x:Name="textbox_gene6" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap"
Text="{Binding Path=cur_monster.gene6}" VerticalAlignment="Top" Width="80"
Margin="625,190,0,0" />
<TextBox x:Name="textbox_gene7" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap"
Text="{Binding Path=cur_monster.gene7}" VerticalAlignment="Top" Width="80"
Margin="385,260,0,0" />
<TextBox x:Name="textbox_gene8" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap"
Text="{Binding Path=cur_monster.gene8}" VerticalAlignment="Top" Width="80"
Margin="505,260,0,0" />
<TextBox x:Name="textbox_gene9" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap"
Text="{Binding Path=cur_monster.gene9}" VerticalAlignment="Top" Width="80"
Margin="625,260,0,0" />
<Label x:Name="label_mlv" Content="Level" HorizontalAlignment="Left" Margin="150,85,0,0"
VerticalAlignment="Top" RenderTransformOrigin="-0.263,0.135" />
<Label x:Name="label_mex" Content="Exp" HorizontalAlignment="Left" Margin="150,115,0,0"
VerticalAlignment="Top" RenderTransformOrigin="-0.263,0.135" />
<Label x:Name="label_spe" Content="Species (Hex)" HorizontalAlignment="Left" Margin="150,145,0,0"
VerticalAlignment="Top" RenderTransformOrigin="-0.263,0.135" />
<TextBox x:Name="textbox_mlv" HorizontalAlignment="Left" Height="24" Margin="240,87,0,0"
TextWrapping="Wrap" Text="{Binding Path=cur_monster.level}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_mex" HorizontalAlignment="Left" Height="24" Margin="240,117,0,0"
TextWrapping="Wrap" Text="{Binding Path=cur_monster.exp}" VerticalAlignment="Top"
Width="75" />
<TextBox x:Name="textbox_spe" HorizontalAlignment="Left" Height="24" Margin="240,147,0,0"
TextWrapping="Wrap" Text="{Binding Path=cur_monster.spe, StringFormat={}{0:X2}}" VerticalAlignment="Top"
Width="75"/>
<Label x:Name="label_mname" Content="Name" HorizontalAlignment="Left" Margin="10,54,0,0"
VerticalAlignment="Top" />
<TextBox x:Name="textbox_mname" HorizontalAlignment="Left" Height="22" Margin="60,58,0,0"
TextWrapping="Wrap" Text="{Binding Path=cur_monster.name}" VerticalAlignment="Top"
Width="255" />
<Label x:Name="label_slct" Content="Monster" HorizontalAlignment="Left" Margin="2,10,0,0"
VerticalAlignment="Top" RenderTransformOrigin="0.466,0.596" />
<ComboBox x:Name="combobox_slct" HorizontalAlignment="Left" Margin="60,10,0,0"
VerticalAlignment="Top" Width="168" ItemsSource="{Binding Path=monsters}"
DisplayMemberPath="full_name" IsReadOnly="True"
SelectedValue="{Binding Path=cur_monster}" />
<Label x:Name="label_m_warn" Content="Warning: The sum of PowerUps should be at most 10."
HorizontalAlignment="Left" Margin="12,265,0,0" VerticalAlignment="Top" />
<Label x:Name="label_m_warn2" Content="The exact IV algorithm is unknown. Edit wisely."
HorizontalAlignment="Left" Margin="62,285,0,0" VerticalAlignment="Top" />
<TextBlock x:Name="textblock_gene101" HorizontalAlignment="Left" Margin="385,16,0,0"
TextWrapping="Wrap"
Text="MHST Gene 101:&#x0a;0x0001 = Empty Slot&#x0a;0x0002 = No Slot&#x0a;For other gene codes, refer to the gene code mapping."
VerticalAlignment="Top" />
<Button x:Name="button_mexp" Content="Max" HorizontalAlignment="Left" Margin="193,119,0,0"
VerticalAlignment="Top" Width="35" Click="button_mexp_Click" />
<Button x:Name="button_mdel" Content="Delete" HorizontalAlignment="Left" Margin="239,10,0,0" VerticalAlignment="Top" Width="76" Click="button_mdel_Click"/>
<Label x:Name="label" Content="Don't delete monsters currently in your party." HorizontalAlignment="Left" Margin="60,30,0,0" VerticalAlignment="Top"/>
</Grid>
</TabItem>
</TabControl>
<Button x:Name="button_save" Content="Save" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="74" Click="button_save_Click"/>
<Button x:Name="button_load" Content="Load" HorizontalAlignment="Left" Margin="90,10,0,0" VerticalAlignment="Top" Width="74" Click="button_load_click"/>
<DataGrid x:Name="dataGrid" HorizontalAlignment="Left" Height="100" Margin="1046,415,-390,-95.5" VerticalAlignment="Top" Width="100"/>
<Label x:Name="label_copy" Content="By secXsQuared" HorizontalAlignment="Left" Margin="642,7,0,0" VerticalAlignment="Top"/>
<Button x:Name="button_save" Content="Save" HorizontalAlignment="Left" Margin="10,10,0,0"
VerticalAlignment="Top" Width="74" Click="button_save_Click" />
<Button x:Name="button_load" Content="Load" HorizontalAlignment="Left" Margin="90,10,0,0"
VerticalAlignment="Top" Width="74" Click="button_load_click" />
<DataGrid x:Name="dataGrid" HorizontalAlignment="Left" Height="100" Margin="1046,415,-390,-95.5"
VerticalAlignment="Top" Width="100" />
<Button x:Name="button_about" Content="About" HorizontalAlignment="Left" Margin="662,10,0,0" VerticalAlignment="Top" Width="74" Click="button_about_Click"/>
</Grid>
</Window>

View File

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows;
using System.Windows.Forms;
using MessageBox = System.Windows.MessageBox;
@ -12,14 +13,21 @@ namespace MHSEC_G
{
private ViewModel view_model;
private readonly byte[] dummy_data = new byte[Model.SAVE_FILE_SIZE];
private const string Version = "0.11";
private static string get_app_version()
{
Version v = Assembly.GetExecutingAssembly().GetName().Version;
string version = v.Major+ "." + v.Minor + v.Build;
return version;
}
public MainWindow()
{
InitializeComponent();
button_save.IsEnabled = false;
Item.read_item_mappings();
Array.Clear(dummy_data, 0, dummy_data.Length);
this.Title = "MHSEC-G Ver" + Version;
this.Title = "MHSEC-G Ver " + get_app_version();
view_model = new ViewModel(dummy_data);
DataContext = view_model;
}
@ -27,7 +35,7 @@ namespace MHSEC_G
private void button_load_click(object sender, RoutedEventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "MHST Save files|mhr_game0.sav|sav files (*.sav)|*.sav|All files (*.*)|*.*";
dialog.Filter = "MHST Save file|mhr_game0.sav|SAV files (*.sav)|*.sav|All files (*.*)|*.*";
dialog.Title = "Please select your save file.";
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
@ -64,10 +72,10 @@ namespace MHSEC_G
List<Item> items = view_model.items;
for (uint i = 0; i < items.Count; i++)
{
if (items.ElementAt((int)i).offset >= Item.OFFSETA_FIRST_KEY_ITEM)
if (items.ElementAt((int) i).offset >= Item.OFFSETA_FIRST_KEY_ITEM)
break;
items.ElementAt((int)i).count = 986;
items.ElementAt((int) i).count = 986;
}
}
@ -76,10 +84,10 @@ namespace MHSEC_G
List<Item> items = view_model.items;
for (uint i = 0; i < items.Count; i++)
{
if (items.ElementAt((int)i).offset >= Item.OFFSETA_FIRST_KEY_ITEM)
if (items.ElementAt((int) i).offset >= Item.OFFSETA_FIRST_KEY_ITEM)
break;
if (items.ElementAt((int)i).count != 0)
if (items.ElementAt((int) i).count != 0)
{
items.ElementAt((int) i).count = 999;
}
@ -93,8 +101,16 @@ namespace MHSEC_G
private void button_save_Click(object sender, RoutedEventArgs e)
{
File.WriteAllBytes("mhr_game0.hacked", view_model.model.save_file);
MessageBox.Show("Saved to \"mhr_game0.hacked\"", "MHSEC-G",MessageBoxButton.OK, MessageBoxImage.Information);
SaveFileDialog dialog = new SaveFileDialog();
dialog.Filter = "SAV files (*.sav)|*.sav|All files (*.*)|*.*";
dialog.Title = "Please select the save location.";
dialog.FileName = "mhr_game0.sav";
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
File.WriteAllBytes(dialog.FileName, view_model.model.save_file);
MessageBox.Show("Saved to \"" + dialog.FileName + "\"", "MHSEC-G", MessageBoxButton.OK,
MessageBoxImage.Information);
}
}
private void button_give_epony_Click(object sender, RoutedEventArgs e)
@ -109,17 +125,48 @@ namespace MHSEC_G
private void button_give_mtiggy_Click(object sender, RoutedEventArgs e)
{
EggFragment.write_dlc_egg_fragment(view_model.egg_fragments, view_model.model, 0x10);
EggFragment.write_dlc_egg_fragment(view_model.egg_fragments, view_model.model, 0x20);
}
private void button_give_okirin_Click(object sender, RoutedEventArgs e)
{
EggFragment.write_dlc_egg_fragment(view_model.egg_fragments, view_model.model, 0x32);
EggFragment.write_dlc_egg_fragment(view_model.egg_fragments, view_model.model, 0x21);
}
private void button_give_dino_Click(object sender, RoutedEventArgs e)
{
EggFragment.write_dlc_egg_fragment(view_model.egg_fragments, view_model.model, 0x6);
}
private void button_give_wm_Click(object sender, RoutedEventArgs e)
{
EggFragment.write_dlc_egg_fragment(view_model.egg_fragments, view_model.model, 0x1F);
}
private void button_give_pd_Click(object sender, RoutedEventArgs e)
{
EggFragment.write_dlc_egg_fragment(view_model.egg_fragments, view_model.model, 0x3);
}
private void button_about_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("MHSEC-G Version " + get_app_version() +"\nDeveloped by secXsQuared", "About", MessageBoxButton.OK, MessageBoxImage.Information);
}
private void button_mdel_Click(object sender, RoutedEventArgs e)
{
if (view_model.monsters.Count <= 1)
{
MessageBox.Show("Cannot delete the last monster.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
Monster to_delete = view_model.cur_monster;
view_model.monsters.Remove(to_delete);
view_model.cur_monster = view_model.monsters.ElementAt(0);
byte[] template = Properties.Resources.monster_null_template;
Array.Copy(template, 0, view_model.model.save_file, to_delete.offset, Monster.SIZE_MONSTER);
}
}
}

View File

@ -133,6 +133,10 @@ namespace MHSEC_G
{
return false;
}
catch (ArgumentException)
{
return false;
}
return true;
}
}

View File

@ -8,12 +8,13 @@ namespace MHSEC_G
{
public class Monster : INotifyPropertyChanged
{
public const uint LIMIT_MONSTER_EXP = 0xFFFFFF;
public const uint SIZE_MONSTER = 0x478;
private const uint OFFSETA_MONSTER = 0xA150;
private const uint SIZE_MONSTER = 0x478;
private const uint OFFSETR_MONSTER_GENE = 0x424;
private const uint SIZE_MONSTER_GENE = 0x4;
private const uint OFFSETR_MONSTER_EXP = 0xE0;
public const uint LIMIT_MONSTER_EXP = 0xFFFFFF;
private const uint OFFSETR_MONSTER_HIV = 0xD8;
private const uint OFFSETR_MONSTER_AIV = 0xD9;
private const uint OFFSETR_MONSTER_DIV = 0xDA;
@ -32,21 +33,26 @@ namespace MHSEC_G
private readonly Model _model;
private readonly uint _offset;
public uint offset
{
get { return _offset; }
}
public string spe
{
get { return Model.byte_to_uint(_model.save_file[_offset + OFFSETR_MONSTER_SPE]).ToString("X2"); }
set
{
uint parsed;
if (Model.parse_hex_string(value,out parsed) && parsed <= 0xFF)
if (Model.parse_hex_string(value, out parsed) && parsed <= 0xFF)
{
_model.save_file[_offset + OFFSETR_MONSTER_SPE] = (byte)(parsed & 0xFF);
_model.save_file[_offset + OFFSETR_MONSTER_SPE] = (byte) (parsed & 0xFF);
}
else
{
MessageBox.Show("Species must be at most 0xFF.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
OnPropertyChanged(nameof(hiv));
OnPropertyChanged(nameof(spe));
}
}
@ -61,11 +67,13 @@ namespace MHSEC_G
}
else
{
MessageBox.Show("Atk must be at most " + UInt16.MaxValue, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Atk must be at most " + UInt16.MaxValue, "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(atk));
}
}
public uint def
{
get { return Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_DEF); }
@ -77,7 +85,8 @@ namespace MHSEC_G
}
else
{
MessageBox.Show("Def must be at most " + UInt16.MaxValue, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Def must be at most " + UInt16.MaxValue, "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(def));
}
@ -94,7 +103,8 @@ namespace MHSEC_G
}
else
{
MessageBox.Show("HP must be at most " + UInt16.MaxValue, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("HP must be at most " + UInt16.MaxValue, "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(hp));
}
@ -124,7 +134,7 @@ namespace MHSEC_G
{
if (value <= 0xFF)
{
_model.save_file[_offset + OFFSETR_MONSTER_AIV] = (byte)(value & 0xFF);
_model.save_file[_offset + OFFSETR_MONSTER_AIV] = (byte) (value & 0xFF);
}
else
{
@ -133,6 +143,7 @@ namespace MHSEC_G
OnPropertyChanged(nameof(aiv));
}
}
public uint div
{
get { return Model.byte_to_uint(_model.save_file[_offset + OFFSETR_MONSTER_DIV]); }
@ -140,7 +151,7 @@ namespace MHSEC_G
{
if (value <= 0xFF)
{
_model.save_file[_offset + OFFSETR_MONSTER_DIV] = (byte)(value & 0xFF);
_model.save_file[_offset + OFFSETR_MONSTER_DIV] = (byte) (value & 0xFF);
}
else
{
@ -149,6 +160,7 @@ namespace MHSEC_G
OnPropertyChanged(nameof(div));
}
}
public uint hpu
{
get { return Model.byte_to_uint(_model.save_file[_offset + OFFSETR_MONSTER_HPU]); }
@ -156,7 +168,7 @@ namespace MHSEC_G
{
if (value <= 0xFF)
{
_model.save_file[_offset + OFFSETR_MONSTER_HPU] = (byte)(value & 0xFF);
_model.save_file[_offset + OFFSETR_MONSTER_HPU] = (byte) (value & 0xFF);
}
else
{
@ -165,6 +177,7 @@ namespace MHSEC_G
OnPropertyChanged(nameof(hpu));
}
}
public uint apu
{
get { return Model.byte_to_uint(_model.save_file[_offset + OFFSETR_MONSTER_APU]); }
@ -172,7 +185,7 @@ namespace MHSEC_G
{
if (value <= 0xFF)
{
_model.save_file[_offset + OFFSETR_MONSTER_APU] = (byte)(value & 0xFF);
_model.save_file[_offset + OFFSETR_MONSTER_APU] = (byte) (value & 0xFF);
}
else
{
@ -181,6 +194,7 @@ namespace MHSEC_G
OnPropertyChanged(nameof(apu));
}
}
public uint dpu
{
get { return Model.byte_to_uint(_model.save_file[_offset + OFFSETR_MONSTER_DPU]); }
@ -188,7 +202,7 @@ namespace MHSEC_G
{
if (value <= 0xFF)
{
_model.save_file[_offset + OFFSETR_MONSTER_DPU] = (byte)(value & 0xFF);
_model.save_file[_offset + OFFSETR_MONSTER_DPU] = (byte) (value & 0xFF);
}
else
{
@ -205,12 +219,16 @@ namespace MHSEC_G
public string name
{
get { return Model.read_unicode_string(_model.save_file, _offset + OFFSETR_MONSTER_NAME, LIMIT_MONSTER_NAME); }
get
{
return Model.read_unicode_string(_model.save_file, _offset + OFFSETR_MONSTER_NAME, LIMIT_MONSTER_NAME);
}
set
{
if (value.Length <= 10 && value.Length > 0)
{
Model.write_unicode_string(_model.save_file, _offset + OFFSETR_MONSTER_NAME, value, LIMIT_MONSTER_NAME);
Model.write_unicode_string(_model.save_file, _offset + OFFSETR_MONSTER_NAME, value,
LIMIT_MONSTER_NAME);
}
else
{
@ -232,7 +250,8 @@ namespace MHSEC_G
}
else
{
MessageBox.Show("Exp must be at most " + LIMIT_MONSTER_EXP, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Exp must be at most " + LIMIT_MONSTER_EXP, "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(exp));
}
@ -245,11 +264,12 @@ namespace MHSEC_G
{
if (value <= LIMIT_MONSTER_LEVEL)
{
_model.save_file[_offset + OFFSETR_MONSTER_LEVEL] = (byte)(value & 0xFF);
_model.save_file[_offset + OFFSETR_MONSTER_LEVEL] = (byte) (value & 0xFF);
}
else
{
MessageBox.Show("Level must be at most " + LIMIT_MONSTER_LEVEL, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Level must be at most " + LIMIT_MONSTER_LEVEL, "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(level));
OnPropertyChanged(nameof(full_name));
@ -258,25 +278,36 @@ namespace MHSEC_G
public string gene1
{
get { return Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 0 * SIZE_MONSTER_GENE).ToString("X4"); }
get
{
return
Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 0*SIZE_MONSTER_GENE)
.ToString("X4");
}
set
{
uint parsed;
if (Model.parse_hex_string(value, out parsed) && parsed <= 0xFFFF)
{
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 0 * SIZE_MONSTER_GENE, parsed);
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 0*SIZE_MONSTER_GENE, parsed);
}
else
{
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(gene2));
OnPropertyChanged(nameof(gene1));
}
}
public string gene2
{
get { return Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 1 * SIZE_MONSTER_GENE).ToString("X4"); }
get
{
return
Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 1*SIZE_MONSTER_GENE)
.ToString("X4");
}
set
{
uint parsed;
@ -286,126 +317,176 @@ namespace MHSEC_G
}
else
{
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(gene2));
}
}
public string gene3
{
get { return Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 2 * SIZE_MONSTER_GENE).ToString("X4"); }
get
{
return
Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 2*SIZE_MONSTER_GENE)
.ToString("X4");
}
set
{
uint parsed;
if (Model.parse_hex_string(value, out parsed) && parsed <= 0xFFFF)
{
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 2 * SIZE_MONSTER_GENE, parsed);
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 2*SIZE_MONSTER_GENE, parsed);
}
else
{
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(gene3));
}
}
public string gene4
{
get { return Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 3 * SIZE_MONSTER_GENE).ToString("X4"); }
get
{
return
Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 3*SIZE_MONSTER_GENE)
.ToString("X4");
}
set
{
uint parsed;
if (Model.parse_hex_string(value, out parsed) && parsed <= 0xFFFF)
{
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 3 * SIZE_MONSTER_GENE, parsed);
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 3*SIZE_MONSTER_GENE, parsed);
}
else
{
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(gene4));
}
}
public string gene5
{
get { return Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 4 * SIZE_MONSTER_GENE).ToString("X4"); }
get
{
return
Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 4*SIZE_MONSTER_GENE)
.ToString("X4");
}
set
{
uint parsed;
if (Model.parse_hex_string(value, out parsed) && parsed <= 0xFFFF)
{
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 4 * SIZE_MONSTER_GENE, parsed);
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 4*SIZE_MONSTER_GENE, parsed);
}
else
{
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(gene5));
}
}
public string gene6
{
get { return Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 5 * SIZE_MONSTER_GENE).ToString("X4"); }
get
{
return
Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 5*SIZE_MONSTER_GENE)
.ToString("X4");
}
set
{
uint parsed;
if (Model.parse_hex_string(value, out parsed) && parsed <= 0xFFFF)
{
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 5 * SIZE_MONSTER_GENE, parsed);
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 5*SIZE_MONSTER_GENE, parsed);
}
else
{
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(gene6));
}
}
public string gene7
{
get { return Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 6 * SIZE_MONSTER_GENE).ToString("X4"); }
get
{
return
Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 6*SIZE_MONSTER_GENE)
.ToString("X4");
}
set
{
uint parsed;
if (Model.parse_hex_string(value, out parsed) && parsed <= 0xFFFF)
{
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 6 * SIZE_MONSTER_GENE, parsed);
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 6*SIZE_MONSTER_GENE, parsed);
}
else
{
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(gene7));
}
}
public string gene8
{
get { return Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 7 * SIZE_MONSTER_GENE).ToString("X4"); }
get
{
return
Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 7*SIZE_MONSTER_GENE)
.ToString("X4");
}
set
{
uint parsed;
if (Model.parse_hex_string(value, out parsed) && parsed <= 0xFFFF)
{
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 7 * SIZE_MONSTER_GENE, parsed);
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 7*SIZE_MONSTER_GENE, parsed);
}
else
{
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(gene8));
}
}
public string gene9
{
get { return Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 8 * SIZE_MONSTER_GENE).ToString("X4"); }
get
{
return
Model.byte_to_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 8*SIZE_MONSTER_GENE)
.ToString("X4");
}
set
{
uint parsed;
if (Model.parse_hex_string(value, out parsed) && parsed <= 0xFFFF)
{
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 8 * SIZE_MONSTER_GENE, parsed);
Model.write_uint16_le(_model.save_file, _offset + OFFSETR_MONSTER_GENE + 8*SIZE_MONSTER_GENE, parsed);
}
else
{
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Malformed gene value - must be 0x0 to 0xFFFF.", "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
}
OnPropertyChanged(nameof(gene9));
}
@ -426,7 +507,7 @@ namespace MHSEC_G
if (save[i] != 0)
{
byte[] each = new byte[SIZE_MONSTER];
Array.Copy(save, i, each, 0 ,SIZE_MONSTER);
Array.Copy(save, i, each, 0, SIZE_MONSTER);
ret.Add(new Monster(i, model));
}
}
@ -434,7 +515,7 @@ namespace MHSEC_G
if (ret.Count == 0)
{
byte[] dummy = new byte[SIZE_MONSTER];
Array.Clear(dummy, 0, (int)SIZE_MONSTER);
Array.Clear(dummy, 0, (int) SIZE_MONSTER);
// at least one monster
ret.Add(new Monster(OFFSETA_MONSTER, model));
}

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("0.1.1.0")]
[assembly: AssemblyFileVersion("0.1.1.0")]
[assembly: AssemblyVersion("0.1.3.0")]
[assembly: AssemblyFileVersion("0.1.3.0")]

View File

@ -59,5 +59,73 @@ namespace MHSEC_G.Properties {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to 10 1 药草
///18 2 回复药
///20 3 回复G
///28 4 回复粉
///30 5 生命粉
///38 6 生命大粉
///40 7 秘药
///48 16 气合のカタマリ
///50 9 活力剂
///58 8 いにしえの秘药
///60 A 解毒草
///68 B 解毒药
///70 C アロエ草
///78 D 烧伤药
///80 E マヒワリの花
///88 F 麻痹药
///90 10 トウガラシ
///98 11 元気ドリンコ
///A0 12 多肉ニンニク
///A8 13 熱血サプリ
///B0 14 シャンボン菜
///B8 15 爆破落とし洗剤
///C0 18 メニーベリー
///C8 19 目薬
///D0 1A 万能ウチケシ薬
///D8 AE コゲ肉
///E0 AF 生焼け肉
///E8 B0 こんがり肉
///F0 B1 マッスルミート
///F8 B2 タフネスミート
///100 B3 クィックミート
///108 B4 こんがり肉G
///110 1D ハンタードーナツ
///118 1F ロア・ル・リング
///120 20 バルドーナツ
///128 21 ドスドーナツ
///130 24 ギルドーナツ
///138 25 アイルーシュガー
///140 26 メラルーショコラ
///148 27 こ [rest of string was truncated]&quot;;.
/// </summary>
internal static string idmap {
get {
return ResourceManager.GetString("idmap", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon MainIcon {
get {
object obj = ResourceManager.GetObject("MainIcon", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] monster_null_template {
get {
object obj = ResourceManager.GetObject("monster_null_template", resourceCulture);
return ((byte[])(obj));
}
}
}
}

View File

@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
@ -60,6 +60,7 @@
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
@ -68,9 +69,10 @@
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
@ -109,9 +112,19 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="idmap" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\idmap.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
<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>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Binary file not shown.

230
MHSEC-G/MHSEC-G/Talisman.cs Normal file
View File

@ -0,0 +1,230 @@
using System.ComponentModel;
namespace MHSEC_G
{
public class Talisman
{
// private const uint OFFSETA_EGG_FRAGMENTS = 0x9790;
// private const uint OFFSETA_EGG_FRAGMENTS_END = 0x9C3F;
// private const uint SIZE_EGG_FRAGMENT = 0xC;
// private const uint OFFSETR_EF_SPE = 0x0;
// private const uint OFFSETR_EF_POS = 0x1;
// private const uint OFFSETR_EF_NEW = 0x2;
// private const uint OFFSETR_EF_RAR = 0x3;
// private const uint OFFSETR_EF_COL = 0x4;
// private const uint OFFSETR_EF_DLC = 0x5;
// private const uint OFFSETR_EF_6H = 0x6;
// private const uint OFFSETR_EF_7H = 0x7;
//
// private readonly uint _offset;
//
// public uint offset
// {
// get { return _offset; }
// }
// private readonly Model _model;
// public EggFragment(uint offset, Model model)
// {
// _model = model;
// _offset = offset;
// }
//
// public string spe
// {
// get { return Model.byte_to_uint(_model.save_file[_offset + OFFSETR_EF_SPE]).ToString("X2"); }
// set
// {
// uint parsed;
// if (Model.parse_hex_string(value, out parsed) && parsed <= 0x0C)
// {
// Model.write_byte(_model.save_file, _offset + OFFSETR_EF_SPE, parsed);
// }
// else
// {
// MessageBox.Show("Malformed Species value - must be at most 0xC", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
// }
// OnPropertyChanged(nameof(spe));
// }
// }
//
// public string pos
// {
// get { return Model.byte_to_uint(_model.save_file[_offset + OFFSETR_EF_POS]).ToString("X2"); }
// set
// {
// uint parsed;
// if (Model.parse_hex_string(value, out parsed) && parsed <= 0x08)
// {
// Model.write_byte(_model.save_file, _offset + OFFSETR_EF_POS, parsed);
// }
// else
// {
// MessageBox.Show("Malformed Position value - must be at most 0x8", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
// }
// OnPropertyChanged(nameof(pos));
// }
// }
//
// public string new_flag
// {
// get { return Model.byte_to_uint(_model.save_file[_offset + OFFSETR_EF_NEW]).ToString("X2"); }
// set
// {
// uint parsed;
// if (Model.parse_hex_string(value, out parsed) && parsed <= 0x01)
// {
// Model.write_byte(_model.save_file, _offset + OFFSETR_EF_NEW, parsed);
// }
// else
// {
// MessageBox.Show("Malformed New value - must be 0 or 1", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
// }
// OnPropertyChanged(nameof(new_flag));
// }
// }
// public string rarity
// {
// get { return Model.byte_to_uint(_model.save_file[_offset + OFFSETR_EF_RAR]).ToString("X2"); }
// set
// {
// uint parsed;
// if (Model.parse_hex_string(value, out parsed) && parsed <= 0x01)
// {
// Model.write_byte(_model.save_file, _offset + OFFSETR_EF_RAR, parsed);
// }
// else
// {
// MessageBox.Show("Malformed Rarity value - must be 0 or 1", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
// }
// OnPropertyChanged(nameof(rarity));
// }
// }
//
// public string color
// {
// get { return Model.byte_to_uint(_model.save_file[_offset + OFFSETR_EF_COL]).ToString("X2"); }
// set
// {
// uint parsed;
// if (Model.parse_hex_string(value, out parsed) && parsed <= 0xFF)
// {
// Model.write_byte(_model.save_file, _offset + OFFSETR_EF_COL, parsed);
// }
// else
// {
// MessageBox.Show("Malformed Species value - must be at most 0xFF", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
// }
// OnPropertyChanged(nameof(color));
// }
// }
//
// public string dlc
// {
// get { return Model.byte_to_uint(_model.save_file[_offset + OFFSETR_EF_DLC]).ToString("X2"); }
// set
// {
// uint parsed;
// if (Model.parse_hex_string(value, out parsed) && parsed <= 0xFF)
// {
// Model.write_byte(_model.save_file, _offset + OFFSETR_EF_DLC, parsed);
// }
// else
// {
// MessageBox.Show("Malformed DLC value - must be at most 0xFF", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
// }
// OnPropertyChanged(nameof(dlc));
// }
// }
//
// public string unknown_6h
// {
// get { return Model.byte_to_uint(_model.save_file[_offset + OFFSETR_EF_6H]).ToString("X2"); }
// set
// {
// uint parsed;
// if (Model.parse_hex_string(value, out parsed) && parsed <= 0xFF)
// {
// Model.write_byte(_model.save_file, _offset + OFFSETR_EF_6H, parsed);
// }
// else
// {
// MessageBox.Show("Malformed Species value - must be at most 0xFF", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
// }
// OnPropertyChanged(nameof(unknown_6h));
// }
// }
//
// public string unknown_7h
// {
// get { return Model.byte_to_uint(_model.save_file[_offset + OFFSETR_EF_7H]).ToString("X2"); }
// set
// {
// uint parsed;
// if (Model.parse_hex_string(value, out parsed) && parsed <= 0xFF)
// {
// Model.write_byte(_model.save_file, _offset + OFFSETR_EF_7H, parsed);
// }
// else
// {
// MessageBox.Show("Malformed 7h value - must be at most 0xFF", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
// }
// OnPropertyChanged(nameof(unknown_7h));
// }
// }
//
// public static ObservableCollection<EggFragment> read_all_egg_fragments(Model model)
// {
// ObservableCollection<EggFragment> ret = new ObservableCollection<EggFragment>();
// byte[] buffer = model.save_file;
// for (uint offset = OFFSETA_EGG_FRAGMENTS; offset < OFFSETA_EGG_FRAGMENTS_END; offset += SIZE_EGG_FRAGMENT)
// {
// if (buffer[offset] == 0)
// continue;
// ret.Add(new EggFragment(offset, model));
// }
// return ret;
// }
//
//
// private static EggFragment egg_frag_offset_exist(ObservableCollection<EggFragment> fragments, uint offset)
// {
// for (uint i = 0; i < fragments.Count; i++)
// {
// if (fragments.ElementAt((int)i).offset == offset)
// return fragments.ElementAt((int)i);
// }
// return null;
// }
//
// public static void write_dlc_egg_fragment(ObservableCollection<EggFragment> fragments, Model model, uint dlc)
// {
// for (uint offset = OFFSETA_EGG_FRAGMENTS; offset < OFFSETA_EGG_FRAGMENTS + 9 * SIZE_EGG_FRAGMENT; offset += SIZE_EGG_FRAGMENT)
// {
// EggFragment each_frag = egg_frag_offset_exist(fragments, offset);
// if (each_frag == null)
// {
// each_frag = new EggFragment(offset, model);
// fragments.Insert((int)((offset - OFFSETA_EGG_FRAGMENTS) / SIZE_EGG_FRAGMENT), each_frag);
// }
// each_frag.new_flag = "0";
// each_frag.spe = "08";
// each_frag.pos = ((offset - OFFSETA_EGG_FRAGMENTS) / SIZE_EGG_FRAGMENT).ToString();
// each_frag.rarity = "0";
// each_frag.color = "0";
// each_frag.dlc = dlc.ToString("X2");
// each_frag.unknown_6h = "0";
// each_frag.unknown_7h = "0";
//
// }
// }
//
// public event PropertyChangedEventHandler PropertyChanged;
//
// [NotifyPropertyChangedInvocator]
// protected virtual void OnPropertyChanged(string propertyName)
// {
// PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
// }
// }
}
}

Binary file not shown.