Example #1
0
        public void ctor(int index, OuiFileSelect fileSelect, SaveData data)
        {
            // Temporarily set the current save data to the file slot's save data.
            // This enables filtering the areas by the save data's current levelset.
            SaveData prev = SaveData.Instance;

            SaveData.Instance = data;
            orig_ctor(index, fileSelect, data);
            SaveData.Instance = prev;
        }
Example #2
0
        public static bool IsLoading()
        {
            SummitVignette summit = Engine.Scene as SummitVignette;

            if (summit != null)
            {
                return(!summit.ready);
            }
            Overworld overworld = Engine.Scene as Overworld;

            if (overworld != null)
            {
                OuiFileSelect slot = overworld.Current as OuiFileSelect;
                return(slot != null && slot.SlotIndex >= 0 && slot.Slots[slot.SlotIndex].StartingGame);
            }
            return((Engine.Scene is LevelExit) || (Engine.Scene is LevelLoader) || (Engine.Scene is OverworldLoader) || (Engine.Scene is GameLoader));
        }
Example #3
0
        public void ctor(int index, OuiFileSelect fileSelect, SaveData data)
        {
            // Temporarily set the current save data to the file slot's save data.
            // This enables filtering the areas by the save data's current levelset.
            SaveData prev = SaveData.Instance;

            SaveData.Instance = data;

            orig_ctor(index, fileSelect, data);

            LevelSetStats stats = data?.GetLevelSetStats();

            if (stats != null)
            {
                StrawberriesCounter strawbs = Strawberries;
                strawbs.Amount    = stats.TotalStrawberries;
                strawbs.OutOf     = stats.MaxStrawberries;
                strawbs.ShowOutOf = stats.Name != "Celeste" || strawbs.OutOf <= 0;
            }

            SaveData.Instance = prev;
        }
Example #4
0
 // Patching constructors is ugly.
 public extern void orig_ctor(int index, OuiFileSelect fileSelect, SaveData data);
Example #5
0
 public patch_OuiFileSelectSlot(int index, OuiFileSelect fileSelect, SaveData data)
     : base(index, fileSelect, data)
 {
     // no-op. MonoMod ignores this - we only need this to make the compiler shut up.
 }
Example #6
0
        private static IEnumerator onFileSelectLeave(On.Celeste.OuiFileSelect.orig_Leave orig, OuiFileSelect self, Oui next)
        {
            yield return(new SwapImmediately(orig(self, next)));

            isFileSelect = false;
        }
Example #7
0
 private static IEnumerator onFileSelectEnter(On.Celeste.OuiFileSelect.orig_Enter orig, OuiFileSelect self, Oui from)
 {
     isFileSelect = true;
     return(orig(self, from));
 }