Skip to content

Commit

Permalink
Add support for credits spoiler log
Browse files Browse the repository at this point in the history
  • Loading branch information
Miepee committed Oct 20, 2023
1 parent 06f3cd2 commit 57d491d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion YAMS-LIB/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ void AddAllSpritesFromDir(string dirPath)

foreach (var filePath in Directory.GetFiles(dirPath))
{
string extension = new FileInfo(filePath).Extension;
if (String.IsNullOrWhiteSpace(extension) || extension == ".md" || extension == ".txt")
continue;
var sprite = Image.Load(filePath);
currentShelfHeight = Math.Max(currentShelfHeight, sprite.Height);
if ((lastUsedX + sprite.Width) > pageDimension)
Expand Down Expand Up @@ -770,7 +773,7 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
"d0str = get_text(\"Title-Additions\", \"GameSlot_NewGame_NormalGame\")", "d0str = \"Randovania\";");

// Add Credits
ReplaceGMLInCode(gmData.Code.ByName("gml_Object_oCreditsText_Create_0"), "/Japanese Community;;;;", "/Japanese Community;;;*AM2R Randovania Credits;;*Development;Miepee=JesRight;;*Logic Database;Miepee=JeffGainsNGames;/Esteban 'DruidVorse' Criado;;*Art;ShirtyScarab=AbyssalCreature;;/With contributions from many others;;");
ReplaceGMLInCode(gmData.Code.ByName("gml_Object_oCreditsText_Create_0"), "/Japanese Community;;;;", "/Japanese Community;;;*AM2R Randovania Credits;;*Development;Miepee=JesRight;;*Logic Database;Miepee=JeffGainsNGames;/Esteban 'DruidVorse' Criado;;*Art;ShirtyScarab=AbyssalCreature;;/With contributions from many others;;;");

// Unlock fusion etc. by default
var unlockStuffCode = gmData.Code.ByName("gml_Object_oControl_Other_2");
Expand Down Expand Up @@ -3527,6 +3530,9 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te

// TODO: rewrite log rendering to have color

// Add spoiler log in credits when finished game normally
ReplaceGMLInCode(gmData.Code.ByName("gml_Object_oCreditsText_Create_0"), "TEXT_ROWS = ", $"if (!global.creditsmenuopt) text = \"{seedObject.CreditsSpoiler}\" + text;\n TEXT_ROWS = ");


// Multiworld stuff

Expand Down
4 changes: 4 additions & 0 deletions YAMS-LIB/SeedObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ [JsonInclude] [JsonPropertyName("door_locks")]
[JsonInclude]
[JsonPropertyName("cosmetics")]
public GameCosmetics Cosmetics;

[JsonInclude]
[JsonPropertyName("credits_spoiler")]
public string CreditsSpoiler;
}

public class DoorLock
Expand Down

0 comments on commit 57d491d

Please sign in to comment.