MapParser: yield xblock alongside map data, add bgNight - #79
Merged
Conversation
Parse() now returns (Id, Name, MapData, MapXBlockDataRoot?) — the xblock is loaded once via ParseXBlocks() and looked up per map by data.xblock.name so consumers no longer need a separate call. Xblock is nullable because a declared xblock name might not resolve to a file on disk. ClientProperty gains bgNight — not in retail xblocks, but downstream can author it as a sibling to bgDay for a day/night bg cycle. Fog.color and HeightFog.color switch from [M2dColor] Color to string: xblock format is decimal "R,G,B" (e.g. "199,237,255"), not the hex the M2dColor generator expects, so the previous type failed to deserialize. HeightFog.percentage switches int -> float because real xblocks carry scientific-notation values (e.g. "1.27798e-042"). These fields were never exercised before ParseXBlocks started actually deserializing them. Adds TestParseXBlocks covering the round-trip and asserting Tria's bgDay.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MapParser.Parse()now yields(Id, Name, MapData, MapXBlockDataRoot?). Xblock is loaded once via a new publicParseXBlocks()and looked up per map bydata.xblock.name.ToLower(), so consumers no longer need a second call. Nullable because a declared xblock name might not resolve to a file on disk.ClientPropertygainsbgNightnext to the existingbgDay. Not in retail xblocks; downstream can author it for a day/night bg cycle.Fog.color/HeightFog.colorswitch from[M2dColor] Colortostring— xblock format is decimal"R,G,B"(e.g."199,237,255"), not the hex theM2dColorgenerator expects, so the previous type failed to deserialize the moment we started actually reading these files.HeightFog.percentageswitchesint→float— real xblocks carry scientific-notation values (e.g."1.27798e-042").2.4.21→2.4.22.Test plan
dotnet test Maple2.File.Tests --filter TestParseXBlocks— new test asserts Tria xblock deserializes andbgDay == "BG_Tria.dds".dotnet test Maple2.File.Tests --filter TestMapParser— existing map count assertion still passes with the new 4-tuple.dotnet build— solution builds clean.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.