Skip to content

Commit

Permalink
LibDat2: Fix reading array of unknown type when using schema.min.json
Browse files Browse the repository at this point in the history
VisualGGPK2 now use schema.min.json by default
  • Loading branch information
aianlinb committed Feb 11, 2023
1 parent 6eab41e commit b4939cf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions LibDat2/DatContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public static void DownloadSchemaMin() {
foreach (var field in columns.EnumerateArray()) {
var name = field.GetProperty("name").GetString() ?? "Unknown" + Unknown++.ToString();
var type = field.GetProperty("type").GetString()!;
if (type == "array")
type = "i32"; // Array of unknown type
if (field.GetProperty("array").GetBoolean())
type = "array|" + type;
array[index++] = new(name, type);
Expand Down
12 changes: 7 additions & 5 deletions LibDat2/DatDefinitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4362,7 +4362,7 @@
"Domain": "i32",
"Name": "string",
"GenerationType": "i32",
"CorrectGroup": "array|foreignrow",
"Families": "array|foreignrow",
"Stat1Min": "i32",
"Stat1Max": "i32",
"Stat2Min": "i32",
Expand Down Expand Up @@ -4404,9 +4404,9 @@
"Heist_AddStatValue1": "i32",
"Heist_AddStatValue2": "i32",
"InfluenceTypes": "i32",
"Unknown4": "array|foreignrow",
"ImplicitTagsKeys": "array|foreignrow",
"Unknown4": "bool",
"Unknown5": "i32",
"Flag0": "bool",
"Unknown6": "i32",
"Unknown7": "i32",
"Unknown8": "i32",
Expand All @@ -4422,10 +4422,12 @@
"Unknown18": "i32",
"Unknown19": "i32",
"Unknown20": "i32",
"BuffTemplateKey0": "row",
"BuffTemplate": "row",
"ArchnemesisMinionMod": "foreignrow",
"HASH32": "u32",
"BuffTemplateKey1": "array|foreignrow"
"Unknown21": "array|foreignrow",
"Unknown22": "i32",
"Unknown23": "array|foreignrow"
},
"ModSellPriceTypes": {
"Id": "string"
Expand Down
2 changes: 1 addition & 1 deletion LibDat2/LibDat2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<Authors>aianlinb</Authors>
<Copyright>Copyright © 2020-2022 aianlinb</Copyright>
<Version>0.15.4</Version>
<Version>0.15.5</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>embedded</DebugType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion VisualGGPK2/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<RowDefinition MinHeight="10"/>
<RowDefinition MinHeight="10"/>
</Grid.RowDefinitions>
<CheckBox x:Name="SchemaMin" Content="Use schema.min.json" VerticalContentAlignment="Center" Margin="5,0,0,0" Checked="OnSchemaMinChecked" Unchecked="OnSchemaMinChecked"/>
<CheckBox x:Name="SchemaMin" Content="Use schema.min.json" VerticalContentAlignment="Center" Margin="5,0,0,0" Checked="OnSchemaMinChecked" Unchecked="OnSchemaMinChecked" IsChecked="True"/>
<Button Content="Save" Click="OnSaveDatClicked" Padding="5,0" HorizontalAlignment="Right" Margin="0,0,350,0"/>
<Button Content="Reload DatDefinitions" Click="OnReloadClicked" Padding="5,0" HorizontalAlignment="Right" Margin="0,0,210,0"/>
<Button Content="Import from .csv" Click="OnImportClicked" Padding="5,0" HorizontalAlignment="Right" Margin="0,0,90,0"/>
Expand Down
2 changes: 1 addition & 1 deletion VisualGGPK2/VisualGGPK2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net6.0-windows</TargetFramework>
<Authors>aianlinb</Authors>
<Copyright>Copyright © 2020-2022 aianlinb</Copyright>
<Version>0.15.4</Version>
<Version>0.15.5</Version>
<OutputType>WinExe</OutputType>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
Expand Down

0 comments on commit b4939cf

Please sign in to comment.