@@ -44,8 +44,6 @@ public interface ISubmenu { }
4444
4545 private OuiFileSelectSlotLevelSetPicker newGameLevelSetPicker ;
4646
47- public bool MissingVanillaData ;
48-
4947 // computed maximums for stamp rendering
5048 private int maxStrawberryCount ;
5149 private int maxGoldenStrawberryCount ;
@@ -206,6 +204,8 @@ private void OnExistingFileRenameSelected() {
206204
207205 public extern void orig_OnNewGameSelected ( ) ;
208206 public void OnNewGameSelected ( ) {
207+ patch_SaveData . TryDeleteModSaveData ( FileSlot ) ;
208+
209209 orig_OnNewGameSelected ( ) ;
210210
211211 string newGameLevelSet = newGameLevelSetPicker ? . NewGameLevelSet ;
@@ -291,7 +291,6 @@ public class Button {
291291 public float Scale = 1f ;
292292 }
293293
294- [ PatchFileSelectSlotRenderMissingVanillaDataDialog ]
295294 [ PatchFileSelectSlotRender ] // manually manipulate the method via MonoModRules
296295 public extern void orig_Render ( ) ;
297296 public override void Render ( ) {
@@ -355,12 +354,6 @@ class PatchFileSelectSlotRenderAttribute : Attribute { }
355354 [ MonoModCustomMethodAttribute ( nameof ( MonoModRules . PatchOuiFileSelectSlotOnContinueSelected ) ) ]
356355 class PatchOuiFileSelectSlotOnContinueSelectedAttribute : Attribute { }
357356
358- /// <summary>
359- /// Patches the method to differentiate between Corrupted and MissingVanillaData.
360- /// </summary>
361- [ MonoModCustomMethodAttribute ( nameof ( MonoModRules . PatchFileSelectSlotRenderMissingVanillaDataDialog ) ) ]
362- class PatchFileSelectSlotRenderMissingVanillaDataDialog : Attribute { }
363-
364357 static partial class MonoModRules {
365358
366359 public static void PatchOuiFileSelectSlotUpdate ( ILContext context , CustomAttribute attrib ) {
@@ -377,48 +370,6 @@ public static void PatchOuiFileSelectSlotUpdate(ILContext context, CustomAttribu
377370 cursor . Next . OpCode = OpCodes . Brfalse ;
378371 }
379372
380- public static void PatchFileSelectSlotRenderMissingVanillaDataDialog ( ILContext context , CustomAttribute attrib ) {
381- TypeDefinition declaringType = context . Method . DeclaringType ;
382- FieldDefinition f_MissingVanillaData = declaringType . FindField ( "MissingVanillaData" ) ;
383-
384- ILCursor cursor = new ILCursor ( context ) ;
385-
386- // C# change:
387- // [...]
388- // else if (Corrupted)
389- // {
390- // - ActiveFont.Draw(Dialog.Clean("file_corrupted"), slide2, new Vector2(0.5f, 0.5f), Vector2.One, Color.Black * 0.8f);
391- // + ActiveFont.Draw(Dialog.Clean((!MissingVanillaData) ? "file_corrupted" : "MISSING_VANILLA_DATA"), vector3, new Vector2(0.5f, 0.5f), Vector2.One, Color.Black * 0.8f);
392- // }
393- // [...]
394-
395- // IL change:
396- // [...]
397- // ldfld System.Boolean Celeste.OuiFileSelectSlot::Corrupted
398- // brfalse.s (...)
399- // + ldarg.0
400- // + ldfld bool Celeste.OuiFileSelectSlot::MissingVanillaData
401- // + brfalse.s ldstr
402- // + ldstr "MISSING_VANILLA_DATA"
403- // + br.s ldnull
404- // ldstr : ldstr "file_corrupted"
405- // ldnull : ldnull
406- // call string Celeste.Dialog::Clean(string, class Celeste.Language)
407- // [...]
408-
409- cursor . GotoNext ( MoveType . Before , instr => instr . MatchLdstr ( "file_corrupted" ) ) ;
410- ILLabel ldstr = cursor . MarkLabel ( ) ;
411- cursor . GotoNext ( ) ;
412- ILLabel ldnull = cursor . MarkLabel ( ) ;
413-
414- cursor . GotoLabel ( ldstr , MoveType . Before ) ;
415- cursor . EmitLdarg0 ( ) ;
416- cursor . EmitLdfld ( f_MissingVanillaData ) ;
417- cursor . EmitBrfalse ( ldstr ) ;
418- cursor . EmitLdstr ( "MISSING_VANILLA_DATA" ) ;
419- cursor . EmitBr ( ldnull ) ;
420- }
421-
422373 public static void PatchFileSelectSlotRender ( ILContext context , CustomAttribute attrib ) {
423374 TypeDefinition declaringType = context . Method . DeclaringType ;
424375 FieldDefinition f_maxStrawberryCount = declaringType . FindField ( "maxStrawberryCount" ) ;
0 commit comments