Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.

Commit 1f059bb

Browse files
v1.80
Added support for Monster Hunter Wilds Beta MDF files (mdf2.45) Added a few new UI elements, displaying texture and material parameter count. Fixed a handful of bugs.
1 parent 32ff44a commit 1f059bb

File tree

6 files changed

+35
-13
lines changed

6 files changed

+35
-13
lines changed

MDF-Manager/Classes/Compendium.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public class Compendium : INotifyPropertyChanged
116116
public CompendiumTopLevel SF6 { get; set; }
117117
public CompendiumTopLevel RE4 { get; set; }
118118
public CompendiumTopLevel DD2 { get; set; }
119+
public CompendiumTopLevel MHWilds { get; set; }
119120

120121
protected void OnPropertyChanged([CallerMemberName] string name = null)
121122
{
@@ -131,8 +132,9 @@ public Compendium()
131132
Sunbreak = new CompendiumTopLevel("Version 23 (MHRS)");
132133
SF6 = new CompendiumTopLevel("Version 31 (SF6)");
133134
RE4 = new CompendiumTopLevel("Version 32 (RE4)");
134-
DD2 = new CompendiumTopLevel("Version 40 (DD2)");
135-
entries = new ObservableCollection<CompendiumTopLevel> { RE7, RE2DMC5, RE3, MHRiseRE8, RERT, Sunbreak, SF6, RE4, DD2 };
135+
DD2 = new CompendiumTopLevel("Version 40 (DD2/DRDR)");
136+
MHWilds = new CompendiumTopLevel("Version 45 (MHWilds)");
137+
entries = new ObservableCollection<CompendiumTopLevel> { RE7, RE2DMC5, RE3, MHRiseRE8, RERT, Sunbreak, SF6, RE4, DD2, MHWilds };
136138

137139
}
138140
public void SetEntries(ObservableCollection<CompendiumTopLevel> newEntries)
@@ -169,9 +171,12 @@ public void SetEntries(ObservableCollection<CompendiumTopLevel> newEntries)
169171
case "Version 32 (RE4)":
170172
RE4.Items = entry.Items;
171173
break;
172-
case "Version 40 (DD2)":
174+
case "Version 40 (DD2/DRDR)":
173175
DD2.Items = entry.Items;
174176
break;
177+
case "Version 45 (MHWilds)":
178+
MHWilds.Items = entry.Items;
179+
break;
175180
}
176181
}
177182
OnPropertyChanged("entries");
@@ -197,6 +202,7 @@ public void Sort()
197202
SF6.Sort();
198203
RE4.Sort();
199204
DD2.Sort();
205+
MHWilds.Sort();
200206
OnPropertyChanged("entries");
201207
}
202208
public event PropertyChangedEventHandler PropertyChanged;

MDF-Manager/Classes/MDFFile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public List<byte> GenerateStringTable(ref List<int> offsets)
157157
return outputBuff;
158158
}
159159

160-
public void Export(BinaryWriter bw,MDFTypes type)
160+
public void Export(BinaryWriter bw, MDFTypes type)
161161
{
162162
bw.Write(magic);
163163
bw.Write((short)1);
@@ -249,7 +249,7 @@ public void Export(BinaryWriter bw,MDFTypes type)
249249
adjustedSize++;
250250
while (adjustedSize % 64 != 0)
251251
adjustedSize++;*/
252-
Materials[i].Export(bw,type, ref materialOffset, ref textureOffset, ref propHeadersOffset, runningGPBFStart, stringTableOffset, strTableOffsets, ref propertiesOffset, Materials[i].matSize);
252+
Materials[i].Export(bw, type, ref materialOffset, ref textureOffset, ref propHeadersOffset, runningGPBFStart, stringTableOffset, strTableOffsets, ref propertiesOffset, Materials[i].matSize);
253253
runningGPBFStart += Materials[i].GPBFCount * Materials[i].GetGPBFSize();
254254
}
255255
}

MDF-Manager/Classes/Material.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public enum MDFTypes
7777
Sunbreak = 23,
7878
SF6 = 31,
7979
DD2 = 40,
80+
MHWilds = 45,
8081
}
8182

8283
public class BooleanHolder : INotifyPropertyChanged
@@ -160,10 +161,11 @@ public int MatSize {
160161
public int GPBF0 { get; set; }
161162
public int GPBF1 { get; set; }
162163
public int GetGPBFSize() { return 16; }
164+
public int MaterialPropertyCount { get; set; }
165+
public int MaterialTextureCount { get; set; }
163166
public ObservableCollection<BooleanHolder> flags { get; set; }
164167
public List<TextureBinding> Textures { get; set; }
165168
public List<IVariableProp> Properties { get; set; }
166-
167169
public List<GPUBuffer> GPUBuffers { get; set; }
168170

169171
public event PropertyChangedEventHandler PropertyChanged;
@@ -463,7 +465,9 @@ public Material(BinaryReader br,MDFTypes type, int matIndex, MDFFile owner)
463465
int PropBlockSize = br.ReadInt32();
464466
matSize = PropBlockSize;
465467
int PropertyCount = br.ReadInt32();
468+
MaterialPropertyCount = PropertyCount;
466469
int TextureCount = br.ReadInt32();
470+
MaterialTextureCount = TextureCount;
467471
if(type >= MDFTypes.MHRiseRE8)
468472
{
469473
gpbf0 = br.ReadInt32();
@@ -491,7 +495,7 @@ public Material(BinaryReader br,MDFTypes type, int matIndex, MDFFile owner)
491495
//it's possible that this is an offset for something that is not used by most mdfs, this will need to be looked into
492496
//given the extra Int64, I find this very likely
493497
*/
494-
//SILVER: This is only used in DD2
498+
//SILVER: This is only used in games after DD2, but possibly used in some SF6 MDFs. 10.31.2024
495499
GPBFOffset = br.ReadInt64();
496500
}
497501
Int64 PropDataOff = br.ReadInt64();

MDF-Manager/MDF-Manager.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net5.0-windows</TargetFramework>
5+
<TargetFramework>net8.0-windows10.0.22000.0</TargetFramework>
66
<RootNamespace>MDF_Manager</RootNamespace>
77
<UseWPF>true</UseWPF>
88
<ApplicationIcon>MDF-Manager_Icon.ico</ApplicationIcon>
@@ -21,7 +21,7 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.1.0" />
24+
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.6.1" />
2525
<PackageReference Include="murmurhash" Version="1.0.3" />
2626
</ItemGroup>
2727

MDF-Manager/MainWindow.xaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
xmlns:System="clr-namespace:System;assembly=mscorlib"
1212
mc:Ignorable="d"
1313
Closing="Window_Closing"
14-
Title="MDF Manager 1.70" Background="#EEEEEE" MinHeight="800" MinWidth="1200" MaxHeight="2160" MaxWidth="3840">
14+
Title="MDF Manager 1.80" Background="#EEEEEE" MinHeight="800" MinWidth="1200" MaxHeight="2160" MaxWidth="3840">
1515
<Window.Resources>
1616
<ResourceDictionary>
1717
<SolidColorBrush x:Key="TextColor" Color="Black"/>
@@ -218,6 +218,14 @@
218218
<Label Foreground="{DynamicResource TextColor}" Content="MasterMaterial Path: "/>
219219
<Label Foreground="{DynamicResource TextColor}" Margin="5,0,0,0" Content="{Binding ElementName=MatSelect, Path=SelectedItem.MasterMaterial}"/>
220220
</StackPanel>
221+
<StackPanel Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="0" HorizontalAlignment="Left" Margin="10,0,0,-40" VerticalAlignment="Center" Orientation="Horizontal">
222+
<Label Foreground="{DynamicResource TextColor}" Content="Material Texture Count: "/>
223+
<Label Foreground="{DynamicResource TextColor}" Margin="11,0,0,0" Content="{Binding ElementName=MatSelect, Path=SelectedItem.MaterialTextureCount}"/>
224+
</StackPanel>
225+
<StackPanel Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="0" HorizontalAlignment="Left" Margin="10,0,0,-70" VerticalAlignment="Center" Orientation="Horizontal">
226+
<Label Foreground="{DynamicResource TextColor}" Content="Material Property Count: "/>
227+
<Label Foreground="{DynamicResource TextColor}" Margin="5,0,0,0" Content="{Binding ElementName=MatSelect, Path=SelectedItem.MaterialPropertyCount}"/>
228+
</StackPanel>
221229
<ComboBox Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" Height="20" Width="Auto" Margin="10,0,0,0" ItemsSource="{Binding ShadingTypes}" SelectedItem="{Binding ElementName=MatSelect, Path=SelectedItem.ShaderType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
222230
<xctk:CheckComboBox Background="{DynamicResource ForegroundColor}" Foreground="{DynamicResource TextColor}" Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Margin="10,0,0,0" HorizontalAlignment="Stretch" Height="20" Grid.ColumnSpan="2" Delimiter=", " ItemsSource="{Binding ElementName=MatSelect, Path=SelectedItem.flags}" DisplayMemberPath="Name" SelectedMemberPath="Selected"/>
223231
<StackPanel Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" Margin="0,10,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

MDF-Manager/MainWindow.xaml.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace MDF_Manager
2727
/// </summary>
2828
public partial class MainWindow : Window
2929
{
30-
public static string MDFFilter = "All readable files (*.mdf2)|*.mdf2.6*;*.mdf2.10*;*.mdf2.13*;*.mdf2.19*;*.mdf2.21*;*.mdf2.23*;*.mdf2.31*;*.mdf2.32*;*.mdf2.40*|" +
30+
public static string MDFFilter = "All readable files (*.mdf2)|*.mdf2.6*;*.mdf2.10*;*.mdf2.13*;*.mdf2.19*;*.mdf2.21*;*.mdf2.23*;*.mdf2.31*;*.mdf2.32*;*.mdf2.40*;*.mdf2.45*|" +
3131
"RE7 Material file (*.mdf2.6)|*.mdf2.6*|" +
3232
"RE2/DMC5 Material file (*.mdf2.10)|*.mdf2.10*|" +
3333
"RE3 Material file (*.mdf2.13)|*.mdf2.13*|" +
@@ -36,7 +36,8 @@ public partial class MainWindow : Window
3636
"MH Rise Sunbreak Material file (*.mdf2.23)|*.mdf2.23*|" +
3737
"Street Fighter 6 Material file (*.mdf2.31)|*.mdf2.31*|" +
3838
"RE4 Material file (*.mdf2.32)|*.mdf2.32*|" +
39-
"Dragon's Dogma 2 Material file (*.mdf2.40)|*.mdf2.40*";
39+
"Dragon's Dogma 2 Material file (*.mdf2.40)|*.mdf2.40*|" +
40+
"Monster Hunter Wilds Material file (*.mdf2.45)|*.mdf2.45*";
4041
public ObservableCollection<MDFFile> MDFs { get; set; }
4142
public Defs defs { get; set; }
4243
public Library lib { get; set; }
@@ -309,7 +310,7 @@ private void TabControl_Drop(object sender, DragEventArgs e)
309310
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
310311
for(int i = 0; i < files.Length; i++)
311312
{
312-
if (files[i].Contains(".6") || files[i].Contains(".10") || files[i].Contains(".13") || files[i].Contains(".19") || files[i].Contains(".21") || files[i].Contains(".23") || files[i].Contains(".31") || files[i].Contains(".32") || files[i].Contains(".40"))
313+
if (files[i].Contains(".6") || files[i].Contains(".10") || files[i].Contains(".13") || files[i].Contains(".19") || files[i].Contains(".21") || files[i].Contains(".23") || files[i].Contains(".31") || files[i].Contains(".32") || files[i].Contains(".40") || files[i].Contains(".45"))
313314
{
314315
BinaryReader readFile = HelperFunctions.OpenFileR(files[i], Encoding.Unicode);
315316
if(readFile != null)
@@ -628,6 +629,9 @@ private void ExtendCompendium(OpenFileDialog dialog)
628629
case MDFTypes.DD2:
629630
parent = compendium.DD2;
630631
break;
632+
case MDFTypes.MHWilds:
633+
parent = compendium.MHWilds;
634+
break;
631635
default:
632636
break;
633637
}

0 commit comments

Comments
 (0)