Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GBX.NET 2.0.6 #118

Merged
merged 111 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
ca7b4c6
Fix note
BigBang1112 Jul 1, 2024
a9eea4d
Fix TMUnlimiter 2 block parse issue with v2+
BigBang1112 Jul 3, 2024
99ad58d
Fix waypoint issue
BigBang1112 Jul 3, 2024
4d33261
Fix missing version 2 i--;
BigBang1112 Jul 3, 2024
f20418a
Sort of fix CScriptTraitsPersistent case
BigBang1112 Jul 4, 2024
9ee0a74
Add CScenePhyCharSpecialProperty.chunkl
tomek0055 Jul 4, 2024
e5bd641
Rename Chunk0304301F U01 to NeedUnlock
tomek0055 Jul 4, 2024
776d517
Remove unused Chunk0304301F U02 field
tomek0055 Jul 4, 2024
c70002b
Add proper CGameCtnBlock archivization
tomek0055 Jul 4, 2024
3ff07c4
Remove block.Flags == -1 check in CGameCtnChallenge::Chunk0304301F class
tomek0055 Jul 4, 2024
c48e94a
Make CGameCtnBlock::HasFlags property obsolete
tomek0055 Jul 4, 2024
dee598c
Remove block.Flags == -1 check in CGameCtnChallenge::Chunk03043048 class
tomek0055 Jul 4, 2024
dc92e28
Add default value for DecalIntensity and DecalVariant
tomek0055 Jul 4, 2024
d3d9ce2
Add SafeSkippableChunks
BigBang1112 Jul 4, 2024
5af32b6
Store the buffer
BigBang1112 Jul 4, 2024
d77feae
Merge pull request #117 from tomek0055/dev
BigBang1112 Jul 4, 2024
282182f
Add unlimiter 2 map for testing
BigBang1112 Jul 4, 2024
639e919
Remove Unassigned1 mentions
BigBang1112 Jul 4, 2024
e6910dc
Substract X and Z coord on CGameCtnBlock for v6+ block data
BigBang1112 Jul 4, 2024
15991dc
Fix state of safe chunks
BigBang1112 Jul 4, 2024
56c251d
Add substraction to baked blocks
BigBang1112 Jul 4, 2024
9e59319
Connect DecalId with bit 17
BigBang1112 Jul 4, 2024
9c895a6
Tweaks to SkiaSharp imaging
BigBang1112 Jul 4, 2024
3742e34
Implement Imaging.ImageSharp
BigBang1112 Jul 4, 2024
9c64987
Update nulls in docs
BigBang1112 Jul 4, 2024
525a030
Add ImportIcon to SkiaSharp
BigBang1112 Jul 4, 2024
6e415a0
Add ImportIcon to ImageSharp
BigBang1112 Jul 4, 2024
43532de
Update ImageSharp readme
BigBang1112 Jul 4, 2024
db2dba6
Add missing SupportsFormatting
BigBang1112 Jul 5, 2024
3c7948d
Remove syncgenerator
BigBang1112 Jul 5, 2024
2f8dc96
Add ImageSharp to publish.yml
BigBang1112 Jul 5, 2024
7b490c5
Add NativeSharpLzo to GBX.NET.LZO
BigBang1112 Jul 5, 2024
58e8b2a
Merge branch 'dev' of https://github.com/bigbang1112/gbx-net into dev
BigBang1112 Jul 5, 2024
1b013ec
Replace MiniLZO with Lzo
BigBang1112 Jul 5, 2024
6d0cb88
Include liblzo2
BigBang1112 Jul 5, 2024
1fe64d8
Use latest NativeSharpLzo
BigBang1112 Jul 5, 2024
b257164
Update notes about lzo
BigBang1112 Jul 5, 2024
cafabf6
Fix block direction AppliedWith
BigBang1112 Jul 7, 2024
0d62822
Fix CPlugSurface v4 (for TM2020)
BigBang1112 Jul 7, 2024
59552b0
Add few more NPlugDyna
BigBang1112 Jul 7, 2024
655a579
Add CPlugDynaObjectModel
BigBang1112 Jul 7, 2024
7b304a9
Add support for params in CPlugPrefab
BigBang1112 Jul 7, 2024
e71c0ff
Weird conditions in CPlugSurface again
BigBang1112 Jul 7, 2024
dbfb290
Add missing -1
BigBang1112 Jul 7, 2024
d1ffd21
Add IsPillar, IsReplacement
BigBang1112 Jul 7, 2024
9a72a9b
Fix metadata write with utf8 characters
BigBang1112 Jul 8, 2024
b03a68a
Removed Recompress to reduce confusion
BigBang1112 Jul 14, 2024
bca2917
Remove return from De/Compress, recompress compressed gbxs
BigBang1112 Jul 14, 2024
770e0e6
Simplify GbxDecompress
BigBang1112 Jul 15, 2024
45a77c3
Unignore lightmap chunks
BigBang1112 Jul 16, 2024
b341528
Fix attributes
BigBang1112 Jul 16, 2024
933d719
Fix lightmap write issues
BigBang1112 Jul 16, 2024
e6103fc
Update to beta1
BigBang1112 Jul 16, 2024
5f9e2a7
Fix generator for WriteData
BigBang1112 Jul 16, 2024
71bfc4d
Enhance GetChallenge methods in replay
BigBang1112 Jul 16, 2024
6b16bfa
Add awaits where it makes sense
BigBang1112 Jul 16, 2024
2f2dc52
Update deps
BigBang1112 Jul 16, 2024
9c6c26f
Add trimming reflection note
BigBang1112 Jul 16, 2024
056f03f
Add Color.ToRgba
BigBang1112 Jul 16, 2024
642deb4
Use ToRgba in ImageSharp
BigBang1112 Jul 16, 2024
b450421
Use RotateFlip instead of Rotate and Flip
BigBang1112 Jul 16, 2024
e093e62
Update WASM build tools note
BigBang1112 Jul 16, 2024
5624019
Fix icon colors for skia in wasm
BigBang1112 Jul 16, 2024
44c84f2
Switch to Ubuntu Chiseled to make wasm-tools work
BigBang1112 Jul 16, 2024
82d338e
Update to beta2
BigBang1112 Jul 16, 2024
4968fb0
Fix writing of lightmap data
BigBang1112 Jul 16, 2024
db1584c
Add exceptions parameter
BigBang1112 Jul 17, 2024
bf21712
Add TrimmerRootAssembly note
BigBang1112 Jul 17, 2024
be0afed
Make CPlugSurface.Materials not nullable
BigBang1112 Jul 17, 2024
ab4b4be
Add exceptions parameter to all external nodes
BigBang1112 Jul 17, 2024
cfed157
Add some constructor picking and arg resolve
BigBang1112 Jul 18, 2024
dd0040d
Add very messy ToolInstanceMaker
BigBang1112 Jul 18, 2024
593b246
Refactor ToolInstanceMaker
BigBang1112 Jul 18, 2024
6659241
Cleanup and comments
BigBang1112 Jul 19, 2024
1461c85
Resolve more tool functionality and args
BigBang1112 Jul 19, 2024
e61ced2
Downgrade SyncGenerator
BigBang1112 Jul 19, 2024
40e549e
Fix some warnings
BigBang1112 Jul 19, 2024
319eab4
Complete CPlugPrefab support
BigBang1112 Jul 19, 2024
9123ccb
Fix IMutative
BigBang1112 Jul 19, 2024
9bcd2e2
Implement CPlugSurface.Compound
BigBang1112 Jul 19, 2024
9101c23
Add missing checkpoint prefab nodes
BigBang1112 Jul 19, 2024
a7039c0
Implement some missing material/shader TMUF things
BigBang1112 Jul 19, 2024
3134d18
Rework CPlugTreeVisualMip
BigBang1112 Jul 19, 2024
0760e02
Update class IDs (thx Auris, wtf Nadeo)
BigBang1112 Jul 19, 2024
72042bc
Complete lightmap chunk
BigBang1112 Jul 19, 2024
b1c23dc
Add ConsoleOptions.json creation
BigBang1112 Jul 19, 2024
674b645
Add packages metadata
BigBang1112 Jul 19, 2024
a6045a5
Add brief Tool framework description
BigBang1112 Jul 19, 2024
070103e
Add samples link
BigBang1112 Jul 19, 2024
5cdf7d1
Update to beta3
BigBang1112 Jul 20, 2024
8feeef1
Add GenerateMapUid()
BigBang1112 Jul 20, 2024
48a4eca
Add wip config system
BigBang1112 Jul 20, 2024
5d5a5bd
Add InputExtractConfig test
BigBang1112 Jul 20, 2024
ec28e3f
Add missing ArgumentNullException
BigBang1112 Jul 20, 2024
2f6e6be
Process output (finally)
BigBang1112 Jul 20, 2024
eabf15e
Fix indentation
BigBang1112 Jul 21, 2024
496ea0d
Distribute immediately after result (random idea from bed)
BigBang1112 Jul 21, 2024
2787b39
Migrate Gbx properties to output
BigBang1112 Jul 21, 2024
3119362
Add trimming stuff to NewtonsoftJson
BigBang1112 Jul 21, 2024
99a0854
Update docs
BigBang1112 Jul 21, 2024
d10b8c2
Ignore extension
BigBang1112 Jul 22, 2024
5faae8c
Add missing appliedwith to clip
BigBang1112 Jul 22, 2024
cc58ec9
Bump SixLabors.ImageSharp in /Src/GBX.NET.Imaging.ImageSharp
dependabot[bot] Jul 22, 2024
7254f24
Merge pull request #119 from BigBang1112/dependabot/nuget/Src/GBX.NET…
BigBang1112 Jul 23, 2024
9b57dc4
Add missing thumbnail chunk attributes
BigBang1112 Jul 23, 2024
eaf054f
Add IntroText, LogLevel some more logging to tool
BigBang1112 Jul 23, 2024
a89f131
Merge branch 'dev' of https://github.com/bigbang1112/gbx-net into dev
BigBang1112 Jul 23, 2024
ca58c86
Fix material count bug in CPlugSolid2Model
BigBang1112 Jul 23, 2024
012af6f
Fix mistakes during car tunings port
BigBang1112 Jul 23, 2024
1a5cdbb
Fix CGameCtnCollection 0x038
BigBang1112 Jul 23, 2024
625e6bb
Update from prereleases
BigBang1112 Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,17 @@ jobs:

strategy:
matrix:
lib: [GBX.NET, GBX.NET.Hashing, GBX.NET.Imaging, GBX.NET.Imaging.SkiaSharp, GBX.NET.LZO, GBX.NET.ZLib, GBX.NET.NewtonsoftJson]
lib:
- GBX.NET
- GBX.NET.Hashing
- GBX.NET.Imaging
- GBX.NET.Imaging.SkiaSharp
- GBX.NET.Imaging.ImageSharp
- GBX.NET.LZO
- GBX.NET.ZLib
- GBX.NET.NewtonsoftJson
- GBX.NET.Tool
- GBX.NET.Tool.CLI

name: Publish ${{ matrix.lib }}
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Benchmarks/GBX.NET.Benchmarks/MapParseBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class MapParseBenchmarks

public MapParseBenchmarks()
{
Gbx.LZO = new MiniLZO();
Gbx.LZO = new Lzo();
stream = new MemoryStream(File.ReadAllBytes(Path.Combine("Gbx", "CGameCtnChallenge", "GBX-NET 2 CGameCtnChallenge TMU 001.Challenge.Gbx")));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ private void AppendPropertiesRecursive(IEnumerable<IChunkMember> members, HashSe

sb.Append(" Get");
sb.Append(propName);
sb.Append("(GbxReadSettings settings = default) => ");
sb.Append("(GbxReadSettings settings = default, bool exceptions = false) => ");
sb.Append(fieldName);
sb.Append("File?.GetNode(ref ");
sb.Append(fieldName);
sb.Append(", settings) ?? ");
sb.Append(", settings, exceptions) ?? ");
sb.Append(fieldName);
sb.AppendLine(";");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ private void AppendWrite(int indent, ChunkProperty chunkProperty)
sb.Append("Array");
}

if (chunkProperty.Type.PrimaryType == "data")
{
sb.Append("Data");
}

var mappedType = MapType(chunkProperty.Type.PrimaryType, out var noMatch);

if (noMatch)
Expand Down
63 changes: 58 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ For any questions, open an issue, join the [GameBox Sandbox Discord server](http
- [Modify and save a map](#modify-and-save-a-map)
- [Processing multiple Gbx types](#processing-multiple-gbx-types)
- [Read a large amount of replay metadata quickly](#read-a-large-amount-of-replay-metadata-quickly)
- [Tool framework](#tool-framework)
- [Clarity](#clarity)
- [Differences between `Gbx.Parse/Header/Node`](#differences-between-gbxparseheadernode)
- [Do not repeat `gbx.Node.[any]` too often!](#do-not-repeat-gbxnodeany-too-often)
Expand Down Expand Up @@ -172,7 +173,7 @@ C# code:
using GBX.NET;
using GBX.NET.LZO;

Gbx.LZO = new MiniLZO();
Gbx.LZO = new Lzo();
```

You should run this line of code **only once** for the whole program lifetime.
Expand All @@ -194,7 +195,7 @@ using GBX.NET;
using GBX.NET.Engines.Game;
using GBX.NET.LZO;

Gbx.LZO = new MiniLZO();
Gbx.LZO = new Lzo();

var map = Gbx.ParseNode<CGameCtnChallenge>("Path/To/My.Map.Gbx");

Expand All @@ -221,7 +222,7 @@ using GBX.NET;
using GBX.NET.Engines.Game;
using GBX.NET.LZO;

Gbx.LZO = new MiniLZO();
Gbx.LZO = new Lzo();

var gbx = Gbx.Parse<CGameCtnChallenge>("Path/To/My.Map.Gbx");
var map = gbx.Node; // See Clarity section for more info
Expand Down Expand Up @@ -269,7 +270,7 @@ using GBX.NET;
using GBX.NET.Engines.Game;
using GBX.NET.LZO;

Gbx.LZO = new MiniLZO();
Gbx.LZO = new Lzo();

var node = Gbx.ParseNode("Path/To/My.Gbx");

Expand Down Expand Up @@ -336,6 +337,42 @@ This code should only crash in case of a file system problem. Other problems wil
> [!NOTE]
> It is still valuable to parse the full Gbx even when you just want a piece of information available in header, because **body info overwrites header info**. So you can use the benefit of full parse to fool people tackling with the Gbx header.

## Tool framework

Tool framework (`GBX.NET.Tool*` libraries) is a simple way to create rich tools that can be adapted to different environments.

Currently supported environments:
- **Console** (`GBX.NET.Tool.CLI`)

Planned environments:
- Blazor (`GBX.NET.Tool.Blazor`) - both server and WebAssembly
- HTTP server (`GBX.NET.Tool.Server`)
- Discord bot (`GBX.NET.Tool.Discord.Bot`)

The tool framework guides you with this project structure:

```mermaid
graph LR
A(GBX.NET.Tool) --> B(YourToolProject)
C(GBX.NET.Tool.CLI) --> D(YourToolProjectCLI)
B --> D
A --> C
E(GBX.NET) --> A
F(GBX.NET.LZO) --> C
E --> F
G(Spectre.Console) --> C
```

- Structure: Tool library (`YourToolProject`) and at least 1 implementation application of it (`YourToolProjectCLI`).
- Tool library references `GBX.NET.Tool` and implementation application references `GBX.NET.Tool.CLI`.
- `GBX.NET.Tool.CLI` currently uses LZO by default, no need to reference it additionally.

Tool library has a primary tool class that implements `ITool` interface. There should be only one.

Tool class accepts input through constructors (best one is picked according to input provided by implementation). The tool can output as "produce" (`IProductive`), which creates objects without mutating the input (for example, create MediaTracker clip from replay inputs), or "mutate" (`IMutative`) which creates objects while also causing changes to the input (for example, modifying a map without having to recreate it again).

Samples are available [here](Samples/Tool/).

## Clarity

This section describes best practices to keep your projects clean when using GBX.NET 2.
Expand Down Expand Up @@ -436,6 +473,22 @@ GBX.NET is a huge library when everything is included (over 1.5MB), so please us
> [!NOTE]
> Expect this to work only with `dotnet publish`.

However, in case you wanna use reflection on GBX.NET, it is strongly recommended to simply turn off trimming of this library. **In case of Blazor WebAssembly specifically, it's worth noting that the release build trims automatically**, so in case you're using reflection, modify your library reference:

```xml
<PackageReference Include="GBX.NET">
<IsTrimmable>false</IsTrimmable> <!-- add this line -->
</PackageReference>
```

In case this is not enough, you can specify `TrimmerRootAssembly` on the project you're building that this library should absolutely not be trimmed:

```xml
<ItemGroup>
<TrimmerRootAssembly Include="GBX.NET" />
</ItemGroup>
```

### Explicit vs. Implicit parse

*In the past, the difference between these two used to be only to reduce the amount of written code by the consumer and making the type more strict, the performance was exactly the same.*
Expand Down Expand Up @@ -528,7 +581,7 @@ Make sure you have these framework SDKs available:

**Visual Studio 2022** should be able to install those with default installation settings. Using Visual Studio 2019 will likely not work.

You should also have **.NET WebAssembly Build Tools** installed additionally to build the full solution. It may not be required, but it will definitely help figuring out some problems.
You should also have **.NET WebAssembly Build Tools** installed additionally to build the full solution. It is required for Gbx Explorer to work properly, as it uses native LZO implementation compiled into WebAssembly.

In Visual Studio, you can just use Build Solution and everything should build. JetBrains Rider has been tested and also works.

Expand Down
Binary file modified Resources/ClassId.txt
Binary file not shown.
1 change: 1 addition & 0 deletions SUPPORTED_GBX_FILE_TYPES.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ Older extensions | Latest extension | Class | Read (whole) | Write | Read (heade
| | Material.Gbx | [CPlugMaterial](Src/GBX.NET/Engines/Plug/CPlugMaterial.cs) | Up to TM2 | No
| | Texture.Gbx | [CPlugBitmap](Src/GBX.NET/Engines/Plug/CPlugBitmap.cs) | Up to TMUF | No
| | Light.Gbx | [CPlugLight](Src/GBX.NET/Engines/Plug/CPlugLight.cs) | Yes | Yes
| | Prefab.Gbx | [CPlugPrefab](Src/GBX.NET/Engines/Plug/CPlugPrefab.cs) | Yes | Yes

- <sup>1</sup>Safety reasons. Consider extracting `CGameCtnGhost` from `CGameCtnReplayRecord`, transfer it over to `CGameCtnMediaBlockGhost`, add it to `CGameCtnMediaClip`, and save it as `.Clip.Gbx`, which you can then import in MediaTracker.
2 changes: 1 addition & 1 deletion Samples/Advanced/Blik/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using GBX.NET.LZO;
using GBX.NET.ZLib;

Gbx.LZO = new MiniLZO();
Gbx.LZO = new Lzo();
Gbx.ZLib = new ZLib();

var gbxMap = Gbx.Parse<CGameCtnChallenge>(args[0]);
Expand Down
2 changes: 1 addition & 1 deletion Samples/Advanced/ItemPacker/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using GBX.NET.LZO;
using Microsoft.Extensions.Logging;

Gbx.LZO = new MiniLZO();
Gbx.LZO = new Lzo();

var logger = LoggerFactory.Create(builder =>
{
Expand Down
2 changes: 1 addition & 1 deletion Samples/Beginner/EnvimixForTM2020/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using TmEssentials;

Gbx.LZO = new MiniLZO();
Gbx.LZO = new Lzo();
Gbx.CRC32 = new CRC32();

var cars = new[] { "CarSport", "CarSnow", "CarRally", "CarDesert", "CharacterPilot" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using GBX.NET.Engines.Game;
using GBX.NET.LZO;

Gbx.LZO = new MiniLZO();
Gbx.LZO = new Lzo();

var gbxMap = Gbx.Parse<CGameCtnChallenge>(args[0]);

Expand Down
2 changes: 1 addition & 1 deletion Samples/Beginner/FullMapInfo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

var watch = Stopwatch.StartNew();

Gbx.LZO = new MiniLZO();
Gbx.LZO = new Lzo();
var map = Gbx.ParseNode<CGameCtnChallenge>(args[0]);

watch.Stop();
Expand Down
2 changes: 1 addition & 1 deletion Samples/Beginner/Legomania/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
return;
}

Gbx.LZO = new MiniLZO();
Gbx.LZO = new Lzo();

var map = Gbx.ParseNode<CGameCtnChallenge>(args[0]);

Expand Down
2 changes: 1 addition & 1 deletion Samples/Beginner/SolidExtract/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using GBX.NET.Engines.Plug;
using GBX.NET.LZO;

Gbx.LZO = new MiniLZO();
Gbx.LZO = new Lzo();

foreach (var filePath in args)
{
Expand Down
11 changes: 8 additions & 3 deletions Samples/Tool/GhostExtract/GhostExtractTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ namespace GhostExtract;

public class GhostExtractTool : ITool, IProductive<IEnumerable<Gbx<CGameCtnGhost>>>
{
private readonly Gbx gbx;
private readonly string? fileName;
private readonly IEnumerable<CGameCtnGhost> ghosts;
private readonly ILogger logger;

public GhostExtractTool(Gbx<CGameCtnReplayRecord> gbxReplay, ILogger logger)
{
gbx = gbxReplay;
fileName = Path.GetFileName(gbxReplay.FilePath);
ghosts = gbxReplay.Node.GetGhosts();
this.logger = logger;
}

public GhostExtractTool(Gbx<CGameCtnMediaClip> gbxClip, ILogger logger)
{
gbx = gbxClip;
fileName = Path.GetFileName(gbxClip.FilePath);
ghosts = gbxClip.Node.GetGhosts();
this.logger = logger;
Expand All @@ -31,11 +34,13 @@ public IEnumerable<Gbx<CGameCtnGhost>> Produce()
{
logger.LogInformation("Extracting ghost {GhostIndex} from {FileName}...", i + 1, fileName);

return new Gbx<CGameCtnGhost>(ghost)
return new Gbx<CGameCtnGhost>(ghost, gbx.Header.Basic)
{
FilePath = ghost.CanBeGameVersion(GameVersion.MP3)
? Path.Combine("Replays", "GbxTools", "GhostExtract", $"{GbxPath.GetFileNameWithoutExtension(fileName ?? "Ghost")}_{i + 1:00}.Gbx.Gbx")
: Path.Combine("Tracks", "Replays", "GbxTools", "GhostExtract", $"{GbxPath.GetFileNameWithoutExtension(fileName ?? "Ghost")}_{i + 1:00}.Gbx")
? Path.Combine("Replays", "GbxTools", "GhostExtract", $"{GbxPath.GetFileNameWithoutExtension(fileName ?? "Ghost")}_{i + 1:00}.Ghost.Gbx")
: Path.Combine("Tracks", "Replays", "GbxTools", "GhostExtract", $"{GbxPath.GetFileNameWithoutExtension(fileName ?? "Ghost")}_{i + 1:00}.Ghost.Gbx"),
ClassIdRemapMode = gbx.ClassIdRemapMode,
PackDescVersion = gbx.PackDescVersion,
};
});
}
Expand Down
8 changes: 8 additions & 0 deletions Samples/Tool/InputExtract/InputExtractConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using GBX.NET.Tool;

namespace InputExtract;

public class InputExtractConfig : Config
{
public string Format { get; set; } = "test";
}
4 changes: 3 additions & 1 deletion Samples/Tool/InputExtract/InputExtractTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

namespace InputExtract;

public class InputExtractTool : ITool
public class InputExtractTool : ITool, IConfigurable<InputExtractConfig>
{
public InputExtractConfig Config { get; } = new();

public InputExtractTool(CGameCtnReplayRecord replay)
{

Expand Down
1 change: 1 addition & 0 deletions Samples/Tool/InputExtractCLI/InputExtractCLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<ItemGroup>
<ProjectReference Include="..\..\..\Src\GBX.NET.Tool.CLI\GBX.NET.Tool.CLI.csproj" />
<ProjectReference Include="..\InputExtract\InputExtract.csproj" />
</ItemGroup>

</Project>
6 changes: 4 additions & 2 deletions Samples/Tool/InputExtractCLI/Program.cs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
using GBX.NET.Tool.CLI;
using InputExtract;

await ToolConsole<InputExtractTool>.RunAsync(args);
2 changes: 1 addition & 1 deletion Src/GBX.NET.Hashing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using GBX.NET.Engines.Game;
using GBX.NET.LZO;
using GBX.NET.Hashing;

Gbx.LZO = new MiniLZO();
Gbx.LZO = new Lzo();
Gbx.CRC32 = new CRC32(); // You need to add this

var map = Gbx.ParseNode<CGameCtnChallenge>("Path/To/My.Map.Gbx");
Expand Down
Loading
Loading