Skip to content

Commit

Permalink
Add support for FA2 NEWURBAN hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Rampastring committed Oct 17, 2024
1 parent 4f1c9f2 commit 1f02445
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
16 changes: 1 addition & 15 deletions src/TSMapEditor/CCEngine/Theater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,6 @@ public Theater(string name)
UIName = name;
}

public Theater(string uiName, string configIniName, List<string> contentMixName,
List<string> optionalContentMixName, string paletteName, string unitPaletteName,
string tiberiumPaletteName, string fileExtension, char newTheaterBuildingLetter)
{
UIName = uiName;
ConfigINIPath = configIniName;
ContentMIXName = contentMixName;
OptionalContentMIXName = optionalContentMixName;
TerrainPaletteName = paletteName;
UnitPaletteName = unitPaletteName;
TiberiumPaletteName = tiberiumPaletteName;
FileExtension = fileExtension;
NewTheaterBuildingLetter = newTheaterBuildingLetter;
}

public string UIName { get; }
public string ConfigINIPath { get; set; }
public List<string> ContentMIXName { get; set; }
Expand All @@ -79,6 +64,7 @@ public Theater(string uiName, string configIniName, List<string> contentMixName,
public string UnitPaletteName { get; set; }
public string TiberiumPaletteName { get; set; }
public string FileExtension { get; set; }
public string FallbackTileFileExtension { get; set; }
public char NewTheaterBuildingLetter { get; set; }

public List<string> RoughConnectToTileSets { get; set; }
Expand Down
11 changes: 10 additions & 1 deletion src/TSMapEditor/Rendering/TheaterGraphics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,16 @@ private void ReadTileTextures()
}

string fileName = baseName + Theater.FileExtension;
byte[] data = fileManager.LoadFile(baseName + Theater.FileExtension);
byte[] data = fileManager.LoadFile(fileName);

if (data == null && !string.IsNullOrWhiteSpace(Theater.FallbackTileFileExtension))
{
// Support for FA2 NEWURBAN hack. FA2 Marble.mix does not contain Marble Madness graphics for NEWURBAN, only URBAN.
// To allow Marble Madness to work in NEWURBAN, FA2 also loads .urb files for NEWURBAN.
// We must do the same at least for now.
fileName = baseName + Theater.FallbackTileFileExtension;
data = fileManager.LoadFile(fileName);
}

if (data == null)
{
Expand Down

0 comments on commit 1f02445

Please sign in to comment.