Esempio n. 1
0
        public override IEnumerator Leave(Oui next)
        {
            Audio.SetMusic(audioPrevMusic);
            Audio.SetAmbience(audioPrevAmbience);
            Audio.Play(SFX.ui_main_whoosh_large_out);

            if (playing != null)
            {
                Audio.Stop(playing);
            }

            Focused = false;

            Vector2 posFrom = Position;
            Vector2 posTo   = new Vector2(0f, 1080f);

            for (float t = 0f; t < 1f; t += Engine.DeltaTime * 2f)
            {
                ease     = 1f - Ease.CubeIn(t);
                Position = posFrom + (posTo - posFrom) * Ease.CubeInOut(t);
                yield return(null);
            }

            Visible = false;

            musicParamMenu = null;
            playingPath    = null;
        }
Esempio n. 2
0
        private IEnumerator EaseOut(Oui next)
        {
            OuiChapterSelectIcon selected = null;

            if (next is OuiChapterPanel)
            {
                (selected = icons[area]).Select();
            }

            bool isVanilla = currentLevelSet == "Celeste";

            foreach (OuiChapterSelectIcon icon in icons)
            {
                AreaData area = AreaData.Get(icon.Area);
                if (area == null || area.GetLevelSet() != currentLevelSet)
                {
                    continue;
                }

                if (selected != icon)
                {
                    icon.Hide();
                }

                if (isVanilla)
                {
                    yield return(0.01f);
                }
            }

            Visible = false;
            yield break;
        }
        public override IEnumerator Leave(Oui next)
        {
            Everest.Loader.AutoLoadNewMods = true;
            Everest.Loader.OnCrawlMod     -= logCrawlMod;

            return(base.Leave(next));
        }
Esempio n. 4
0
        public override IEnumerator Enter(Oui from)
        {
            Overworld.ShowInputUI = true;
            fromModOptions        = from is OuiModOptions;

            if (fromModOptions)
            {
                Add(new Coroutine(FadeBgTo(1f)));
            }
            else
            {
                fade = 1f;
            }

            steps.Clear();
            step = 0;
            ReloadMenu();

            menu.Visible = Visible = true;
            menu.Focused = false;

            for (float p = 0f; p < 1f; p += Engine.DeltaTime * 4f)
            {
                menu.X = offScreenRightX - 1920f * Ease.CubeOut(p);
                yield return(null);
            }

            menu.Focused = true;
        }
        public override IEnumerator Enter(Oui from)
        {
            if (Direction == 0)
            {
                Overworld.Goto <OuiChapterSelect>();
                goto Done;
            }
            Direction = Math.Sign(Direction);

            yield return(0.25f);

            int    startID       = SaveData.Instance.LastArea.ID;
            string startLevelSet = SaveData.Instance.GetLevelSet();
            int    count         = AreaData.Areas.Count;

            for (int i = (count + startID + Direction) % count; i != startID; i = (count + i + Direction) % count)
            {
                AreaData area = AreaData.Areas[i];
                if (area.GetLevelSet() != startLevelSet)
                {
                    SaveData.Instance.LastArea = area.ToKey();
                    goto Done;
                }
            }

Done:
            Audio.Play("event:/ui/main/whoosh_large_in");
            Overworld.Goto <OuiChapterSelect>();
            yield break;
        }
Esempio n. 6
0
 private IEnumerator EnterClose(Oui from)
 {
     Overworld.Goto <OuiChapterSelect>();
     Visible      = false;
     instantClose = false;
     yield break;
 }
Esempio n. 7
0
        public override IEnumerator Enter(Oui from)
        {
            Everest.Loader.AutoLoadNewMods = false;

            menu = new TextMenu();

            // display the title and a dummy "Fetching" button
            menu.Add(new TextMenu.Header(Dialog.Clean("MODUPDATECHECKER_MENU_TITLE")));

            menu.Add(subHeader = new TextMenuExt.SubHeaderExt(Dialog.Clean("MODUPDATECHECKER_MENU_HEADER")));

            fetchingButton          = new TextMenu.Button(Dialog.Clean("MODUPDATECHECKER_FETCHING"));
            fetchingButton.Disabled = true;
            menu.Add(fetchingButton);

            Scene.Add(menu);

            currentCheckForUpdates = new CheckForUpdates();
            task = new Task(() => currentCheckForUpdates.Fetch());
            task.Start();

            menu.Visible = Visible = true;
            menu.Focused = false;

            for (float p = 0f; p < 1f; p += Engine.DeltaTime * 4f)
            {
                menu.X = offScreenX + -1920f * Ease.CubeOut(p);
                alpha  = Ease.CubeOut(p);
                yield return(null);
            }

            menu.Focused = true;
            menuOnScreen = true;
        }
Esempio n. 8
0
        public override IEnumerator Enter(Oui from)
        {
            IEnumerator orig = orig_Enter(from);

            // Populate page list
            // The page list is always populated before the first yield statement
            bool   done  = !orig.MoveNext();
            object first = done ? null : orig.Current;

            Everest.Events.OuiJournal.Enter(this, from);

            // Recalculate page numbers
            int pageNum = 0;

            foreach (OuiJournalPage page in Pages)
            {
                page.PageIndex = pageNum++;
            }

            // Iterate over the rest of the enumerator
            if (!done)
            {
                yield return(first);

                while (orig.MoveNext())
                {
                    yield return(orig.Current);
                }
            }
        }
Esempio n. 9
0
        public override IEnumerator Enter(Oui from)
        {
            // Fix "out of bounds" level selection.
            int areaOffs = SaveData.Instance.GetLevelSetStats().AreaOffset;
            int areaMax  = Math.Max(areaOffs, SaveData.Instance.UnlockedAreas);

            area = Calc.Clamp(area, areaOffs, areaMax);

            Visible = true;
            EaseCamera();
            display = true;

            journalEnabled = Celeste.PlayMode == Celeste.PlayModes.Debug || (SaveData.Instance?.CheatMode ?? false);
            for (int i = 0; i <= SaveData.Instance.UnlockedAreas && !journalEnabled; i++)
            {
                if (SaveData.Instance.Areas[i].Modes[0].TimePlayed > 0L && !AreaData.Get(i).Interlude)
                {
                    journalEnabled = true;
                }
            }

            OuiChapterSelectIcon unselected = null;

            if (from is OuiChapterPanel)
            {
                (unselected = icons[area]).Unselect();
            }

            currentLevelSet = SaveData.Instance?.GetLevelSet() ?? "Celeste";
            foreach (OuiChapterSelectIcon icon in icons)
            {
                AreaData area = AreaData.Areas[icon.Area];
                if (area.GetLevelSet() != currentLevelSet)
                {
                    continue;
                }

                int index = area.ToKey().ID;
                if (index <= Math.Max(1, SaveData.Instance.UnlockedAreas) && icon != unselected)
                {
                    icon.Position = icon.HiddenPosition;
                    icon.Show();
                    icon.AssistModeUnlockable = false;
                }
                else if (SaveData.Instance.AssistMode && index == SaveData.Instance.UnlockedAreas + 1)
                {
                    icon.Position = icon.HiddenPosition;
                    icon.Show();
                    icon.AssistModeUnlockable = true;
                }

                // yield return 0.01f; // Originally returns 0.01f
            }

            if (from is OuiChapterPanel)
            {
                yield return(0.25f);
            }
        }
Esempio n. 10
0
 public override IEnumerator Enter(Oui from)
 {
     if (!Everest.Flags.IsDisabled)
     {
         TextInput.OnInput += OnTextInput;
     }
     return(orig_Enter(from));
 }
Esempio n. 11
0
 public override IEnumerator Leave(Oui next)
 {
     if (!Everest.Flags.IsDisabled)
     {
         TextInput.OnInput -= OnTextInput;
     }
     return(orig_Leave(next));
 }
Esempio n. 12
0
 public override IEnumerator Enter(Oui from)
 {
     if (instantClose)
     {
         return(EnterClose(from));
     }
     return(orig_Enter(from));
 }
Esempio n. 13
0
 public override IEnumerator Leave(Oui next)
 {
     Engine.Commands.Enabled = true;
     if (!Everest.Flags.IsDisabled)
     {
         TextInput.OnInput -= OnTextInput;
     }
     return(orig_Leave(next));
 }
Esempio n. 14
0
 public override IEnumerator Leave(Oui next)
 {
     Engine.Commands.Enabled = (Celeste.PlayMode == Celeste.PlayModes.Debug);
     if (!Everest.Flags.IsDisabled)
     {
         TextInput.OnInput -= OnTextInput;
     }
     return(orig_Leave(next));
 }
Esempio n. 15
0
 public override IEnumerator Enter(Oui from)
 {
     Focused = false;
     new FadeWipe(Scene, false, delegate {
         Engine.Scene = new Scene();
         Engine.Instance.Exit();
     });
     yield break;
 }
Esempio n. 16
0
 public override IEnumerator Enter(Oui from)
 {
     Engine.Commands.Enabled = false;
     if (!Everest.Flags.IsDisabled)
     {
         TextInput.OnInput += OnTextInput;
     }
     return(orig_Enter(from));
 }
        public override IEnumerator Enter(Oui from)
        {
            yield return(0.25f);

            Reload();

            Audio.Play(Sfxs.ui_world_whoosh_400ms_back);
            Overworld.Goto <OuiChapterSelect>();
        }
Esempio n. 18
0
        public new IEnumerator Enter(Oui from)
        {
            if (!Loaded)
            {
                int maxSaveFile;

                if (CoreModule.Settings.MaxSaveSlots != null)
                {
                    maxSaveFile = Math.Max(3, CoreModule.Settings.MaxSaveSlots.Value);
                }
                else
                {
                    // first load: we want to check how many slots there are by checking which files exist in the Saves folder.
                    maxSaveFile = 1; // we're adding 2 later, so there will be at least 3 slots.
                    string saveFilePath = patch_UserIO.GetSaveFilePath();
                    if (Directory.Exists(saveFilePath))
                    {
                        foreach (string filePath in Directory.GetFiles(saveFilePath))
                        {
                            string fileName = Path.GetFileName(filePath);
                            // is the file named [number].celeste?
                            if (fileName.EndsWith(".celeste") && int.TryParse(fileName.Substring(0, fileName.Length - 8), out int fileIndex))
                            {
                                maxSaveFile = Math.Max(maxSaveFile, fileIndex);
                            }
                        }
                    }

                    // if 2.celeste exists, slot 3 is the last slot filled, therefore we want 4 slots (2 + 2) to always have the latest one empty.
                    maxSaveFile += 2;
                }

                Slots = new OuiFileSelectSlot[maxSaveFile];
            }

            int         slotIndex = 0;
            IEnumerator orig      = orig_Enter(from);

            while (orig.MoveNext())
            {
                if (orig.Current is float f && f == 0.02f)
                {
                    // only apply the delay if the slot is on-screen (less than 2 slots away from the selected one).
                    if (Math.Abs(SlotIndex - slotIndex) <= 2)
                    {
                        yield return(orig.Current);
                    }
                    slotIndex++;
                }
 protected override bool IsDeeperThan(Oui other)
 {
     if (other is OuiRandoMode)
     {
         return(true);
     }
     else if (other is GenericOui)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Esempio n. 20
0
        public override IEnumerator Leave(Oui next)
        {
            Overworld.ShowInputUI = true;

            Audio.SetMusic(audioPrevMusic);
            Audio.SetAmbience(audioPrevAmbience);
            Audio.Play(SFX.ui_main_whoosh_large_out);

            for (float t = 0f; t < 1f; t += Engine.DeltaTime * 4f)
            {
                alpha = 1f - Ease.CubeIn(t);
                yield return(null);
            }

            Visible = false;
        }
Esempio n. 21
0
        public override IEnumerator Enter(Oui from)
        {
            ReloadMenu();

            menu.Visible = (Visible = true);
            menu.Focused = false;

            for (float p = 0f; p < 1f; p += Engine.DeltaTime * 4f)
            {
                menu.X = offScreenX + -1920f * Ease.CubeOut(p);
                alpha  = Ease.CubeOut(p);
                yield return(null);
            }

            menu.Focused = true;
        }
Esempio n. 22
0
    private void CheckInput()
    {
        float ax = Input.GetAxisRaw("Horizontal");

        if (ax != 0 && jouerActive)
        {
            if (ax < 0)
            {
                Oui.GetComponent <Button>().Select();
            }
            else
            {
                Non.GetComponent <Button>().Select();
            }
        }
    }
Esempio n. 23
0
        public override IEnumerator Leave(Oui next)
        {
            Audio.Play(SFX.ui_main_whoosh_large_out);
            menu.Focused = false;

            for (float p = 0f; p < 1f; p += Engine.DeltaTime * 4f)
            {
                menu.X = onScreenX + 1920f * Ease.CubeIn(p);
                alpha  = 1f - Ease.CubeIn(p);
                yield return(null);
            }

            menu.Visible = Visible = false;
            menu.RemoveSelf();
            menu = null;
        }
Esempio n. 24
0
        public override IEnumerator Enter(Oui from)
        {
            Everest.Loader.AutoLoadNewMods = false;

            Title          = Dialog.Clean("DEPENDENCYDOWNLOADER_TITLE");
            task           = new Task(downloadAllDependencies);
            Lines          = new List <string>();
            Progress       = 0;
            ProgressMax    = 0;
            shouldAutoExit = true;
            shouldRestart  = false;

            task.Start();

            return(base.Enter(from));
        }
Esempio n. 25
0
        public override IEnumerator Leave(Oui next)
        {
            this.Menu.Active = false;

            var toRight    = this.IsDeeperThan(next);
            var OffScreenX = toRight ? OffScreenXGeneric : -OffScreenXGeneric;

            for (float p = 0f; p < 1f; p += Engine.DeltaTime * 4f)
            {
                this.Menu.X = OnScreenX + (OffScreenX - OnScreenX) * Ease.CubeIn(p);
                yield return(null);
            }

            this.Menu.RemoveSelf();
            this.Menu    = null;
            this.Visible = false;
        }
Esempio n. 26
0
        public override IEnumerator Leave(Oui next)
        {
            Audio.Play("event:/ui/main/whoosh_large_out");
            Overworld.Maddy.Show = true;
            menu.Focused         = false;

            for (float p = 0f; p < 1f; p += Engine.DeltaTime * 4f)
            {
                menu.X = onScreenX + 1920f * Ease.CubeIn(p);
                alpha  = 1f - Ease.CubeIn(p);
                yield return(null);
            }

            menu.Visible = Visible = false;
            menu.RemoveSelf();
            menu = null;
        }
Esempio n. 27
0
        public override IEnumerator Enter(Oui from)
        {
            if (!OuiModOptionString.Cancelled)
            {
                var task = new Task(() => {
                    BingoClient.Instance.Connect();
                });
                task.Start();

                while (!task.IsCompleted)
                {
                    yield return(null);
                }
            }

            this.Overworld.Goto <OuiFileSelect>();
        }
Esempio n. 28
0
        public override IEnumerator Leave(Oui next)
        {
            Overworld.ShowInputUI = true;
            Focused = false;

            Vector2 posFrom = Position;
            Vector2 posTo   = new Vector2(0f, 1080f);

            for (float t = 0f; t < 1f; t += Engine.DeltaTime * 2f)
            {
                ease     = 1f - Ease.CubeIn(t);
                Position = posFrom + (posTo - posFrom) * Ease.CubeInOut(t);
                yield return(null);
            }

            Visible = false;
        }
Esempio n. 29
0
        public override IEnumerator Enter(Oui from)
        {
            Overworld.ShowInputUI = false;

            audioPrevMusic = Audio.GetEventName(Audio.CurrentMusicEventInstance);
            Audio.SetMusic(null);
            audioPrevAmbience = Audio.GetEventName(Audio.CurrentAmbienceEventInstance);
            Audio.SetAmbience(null);

            Visible = true;

            for (float t = 0f; t < 1f; t += Engine.DeltaTime * 4f)
            {
                alpha = Ease.CubeOut(t);
                yield return(null);
            }
        }
Esempio n. 30
0
        public override IEnumerator Enter(Oui from)
        {
            audioPrevMusic = Audio.GetEventName(Audio.CurrentMusicEventInstance);
            Audio.SetMusic(null);
            audioPrevAmbience = Audio.GetEventName(Audio.CurrentAmbienceEventInstance);
            Audio.SetAmbience(null);

            Visible = true;

            musicParamMenu          = new TextMenu();
            musicParamMenu.Focused  = false;
            musicParamMenu.MinWidth = 500f;

            for (int i = 0; i < digits.Length; i++)
            {
                digits[i] = 0;
            }
            selectedDigit = digits.Length - 1;
            UpdateSelectedPath();

            Vector2 posFrom = Position;
            Vector2 posTo   = Vector2.Zero;

            for (float t = 0f; t < 1f; t += Engine.DeltaTime * 2f)
            {
                ease     = Ease.CubeIn(t);
                Position = posFrom + (posTo - posFrom) * Ease.CubeInOut(t);
                yield return(null);
            }
            ease    = 1f;
            posFrom = Vector2.Zero;
            posTo   = Vector2.Zero;

            yield return(0.2f);

            Focused = true;

            yield return(0.2f);

            for (int i = 0; i < digits.Length; i++)
            {
                wigglerDigits[i].Start();
            }
            wigglerPath.Start();
            wigglerBankPath.Start();
        }