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

Add Credits spoiler log #102

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading