diff --git a/src/HexManiac.Core/ViewModels/Map/MapRepointer.cs b/src/HexManiac.Core/ViewModels/Map/MapRepointer.cs index c17c0419..a46401a7 100644 --- a/src/HexManiac.Core/ViewModels/Map/MapRepointer.cs +++ b/src/HexManiac.Core/ViewModels/Map/MapRepointer.cs @@ -451,7 +451,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Map { public string ExpandPrimaryTilesetText { get { var (currentCount, maxCount) = EstimateTileCount(GetLayout().GetSubTable(Format.PrimaryBlockset)[0]); - return $"This primary blockset contains {currentCount} of {maxCount} tiles."; + return $"This primary tileset contains {currentCount} of {maxCount} tiles."; } } @@ -462,7 +462,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Map { public string ExpandSecondaryTilesetText { get { var (currentCount, maxCount) = EstimateTileCount(GetLayout().GetSubTable(Format.SecondaryBlockset)[0]); - return $"This secondary blockset contains {currentCount} of {maxCount} tiles."; + return $"This secondary tileset contains {currentCount} of {maxCount} tiles."; } } @@ -503,7 +503,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Map { if (blockset.GetValue("isSecondary") != 0) maxTiles = 1024 - maxTiles; int currentTiles = maxTiles; var tilesetAddress = blockset.GetAddress(Format.Tileset); - if (blockset.GetValue("isCompressed") != 0) { + if (blockset.GetValue("isCompressed") == 0) { BlocksetModel.EstimateTileCount(model, ref currentTiles, tilesetAddress); } else { var run = new LZRun(model, tilesetAddress); diff --git a/src/HexManiac.Integration/IntegrationTests.cs b/src/HexManiac.Integration/IntegrationTests.cs index 5da55ee6..e801a5a9 100644 --- a/src/HexManiac.Integration/IntegrationTests.cs +++ b/src/HexManiac.Integration/IntegrationTests.cs @@ -19,7 +19,7 @@ namespace HavenSoft.HexManiac.Integration { static IntegrationTests() { lazyFireRed = new Lazy(() => { var model = new HardcodeTablesModel(singletons, File.ReadAllBytes(fireredName), new StoredMetadata(new string[0])); - return new ViewPort(fireredName, model, InstantDispatch.Instance, singletons); + return new ViewPort(fireredName, model, InstantDispatch.Instance, singletons, new(), new StubFileSystem()); }); } diff --git a/src/HexManiac.Integration/MapTests.cs b/src/HexManiac.Integration/MapTests.cs index 0bcceed5..4cb72253 100644 --- a/src/HexManiac.Integration/MapTests.cs +++ b/src/HexManiac.Integration/MapTests.cs @@ -18,5 +18,16 @@ namespace HavenSoft.HexManiac.Integration { var forest = firered.Model.GetTableModel("data.maps.banks/1/maps/0/map/"); Assert.Equal(1, forest[0].GetSubTable("connections")[0].GetValue("count")); } + + [SkippableFact] + public void MapRepointer_ExpandPrimaryTilesetText_HasMaxTiles() { + var firered = LoadReadOnlyFireRed(); + firered.Goto.Execute("maps.3-0 Palette Town"); + var repointer = firered.MapEditor.PrimaryMap.MapRepointer; + + var text = repointer.ExpandPrimaryTilesetText; + + Assert.Equal("This primary tileset contains 640 of 640 tiles.", text); + } } }