Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
floxay committed Aug 4, 2021
1 parent a5ed0a2 commit 047c0da
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion AssetCatalog/AssetCatalog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="FirebaseAuthentication.net" Version="4.0.0-alpha.2" />
<PackageReference Include="Google.Cloud.Firestore" Version="2.3.0" />
<PackageReference Include="Google.Cloud.Firestore" Version="2.4.0" />
<PackageReference Include="LiteDB" Version="5.0.11" />
<PackageReference Include="ModernWpfUI" Version="0.9.3" />
<PackageReference Include="OpenTK.GLWpfControl" Version="4.1.0" />
Expand Down
2 changes: 1 addition & 1 deletion AssetCatalog/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
mc:Ignorable="d"
DataContext="{x:Static local:ForgeCatalog.Instance}"
Loaded="MainWindow_OnLoaded"
Title="{Binding Status, Converter={StaticResource CatalogStatusToTitle}}" Height="1024" Width="1440">
Title="{Binding Status, Converter={StaticResource CatalogStatusToTitle}}" Height="960" Width="1440">

<Window.Resources>
<Style x:Key="AppTitleBarStyle" TargetType="ui:TitleBarControl">
Expand Down
4 changes: 3 additions & 1 deletion AssetCatalog/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ private void OnDumpUid_Click(object sender, RoutedEventArgs e)
try
{
var metaEntry = forge.Entries.First(entry1 => entry1.Uid == ForgeCatalog.Instance.SelectedEntry.Uid);
DumpHelper.Dump(forge, metaEntry, Environment.CurrentDirectory);
var outputDir = Path.Combine(Environment.CurrentDirectory, $"_export");
Directory.CreateDirectory(outputDir);
DumpHelper.Dump(forge, metaEntry, outputDir);

// Console.Error.WriteLine($"Dumped UID {Uid}"); // there's no console here :>
}
Expand Down
12 changes: 6 additions & 6 deletions DumpTool/DumpAllCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ public static void Run(DumpAllCommand args)
{
var forge = Program.GetForge(args.ForgeFilename);

try
foreach (var entry in forge.Entries)
{
foreach (var entry in forge.Entries)
try
{
DumpHelper.Dump(forge, entry, Environment.CurrentDirectory);
Console.Error.WriteLine($"Dumped UID {entry.Uid}");
}
}
catch (Exception e)
{
Console.Error.WriteLine($"Error while dumping: {e}");
catch (Exception e)
{
Console.Error.WriteLine($"Error while dumping: UID {entry.Uid}\n{e}");
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion DumpTool/FindAllMeshPropsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void Run(FindAllMeshPropsCommand args)
}
catch (Exception e)
{
Console.Error.WriteLine($"Error while dumping: {e}");
// Console.Error.WriteLine($"Error while dumping: {e}");
}
}

Expand Down
14 changes: 6 additions & 8 deletions DumpTool/FindAllMeshPropsGlobalCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,19 @@ public static void Run(FindAllMeshPropsGlobalCommand args)
Program.AssertDirectoryExists(args.ForgeDirectory);

foreach (var file in Directory.GetFiles(args.ForgeDirectory, "*.forge"))
try
{
var forge = Program.GetForge(file);
for (var i = 0; i < forge.Entries.Length; i++)
{
var forge = Program.GetForge(file);
for (var i = 0; i < forge.Entries.Length; i++)
try
{
var entry = forge.Entries[i];

if (FindAllMeshPropsCommand.SearchFlatArchive(forge, entry, args.Uid))
Console.WriteLine($"{Path.GetFileName(file)}: {entry.Uid}");
}
catch { }
}
catch (Exception e)
{
Console.Error.WriteLine($"Error while dumping: {e}");
}
}
}
}
}
3 changes: 2 additions & 1 deletion DumpTool/InspectCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public static void Run(InspectCommand args)
Console.WriteLine("Name Table:");

Console.WriteLine($"\tFile Magic: {magic}");
Console.WriteLine($"\tTimestamp: {metaEntry.Name.Timestamp}");
DateTime date = DateTimeOffset.FromUnixTimeSeconds(metaEntry.Name.Timestamp).DateTime;
Console.WriteLine($"\tTimestamp: {date} (epoch: {metaEntry.Name.Timestamp})");

switch (entry)
{
Expand Down

0 comments on commit 047c0da

Please sign in to comment.