Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Randomizing sprite at the end of all because sprite rando and another rando are fucking with each other
  • Loading branch information
Towandaa committed Nov 6, 2022
1 parent d3fa760 commit 5ce51e6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
6 changes: 6 additions & 0 deletions TRRandomizerCore/Editors/TR2RandoEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ protected override void SaveImpl(AbstractTRScriptEditor scriptEditor, TRSaveMoni
}.Randomize(Settings.NightModeSeed);
}
}

if (!monitor.IsCancelled && Settings.RandomizeItems && Settings.RandomizeItemSprites)
{
monitor.FireSaveStateBeginning(TRSaveCategory.Custom, "Randomizing Sprites");
itemRandomizer.RandomizeLevelsSprites();
}
}
}
}
Expand Down
25 changes: 23 additions & 2 deletions TRRandomizerCore/Randomizers/TR2/TR2ItemRandomizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public override void Randomize(int seed)

RandomizeSeraph();

if (Settings.RandomizeItemSprites)
RandomizeSprites();
// if (Settings.RandomizeItemSprites)
// RandomizeSprites();

//Write back the level file
SaveLevelInstance();
Expand All @@ -74,6 +74,27 @@ public override void Randomize(int seed)
}
}

public void RandomizeLevelsSprites()
{

foreach (TR2ScriptedLevel lvl in Levels)
{
//Read the level into a combined data/script level object
LoadLevelInstance(lvl);

RandomizeSprites();

//Write back the level file
SaveLevelInstance();

if (!TriggerProgress())
{
break;
}
}

}


private void RandomizeSprites()
{
Expand Down

0 comments on commit 5ce51e6

Please sign in to comment.