Пример #1
0
        public override IEnumerator Routine()
        {
            while (titleDisplayed.Length < title.Length)
            {
                titleDisplayed += title[titleDisplayed.Length].ToString();
                yield return(0.05f);
            }
            yield return(PressButton());

            Audio.Play("event:/new_content/game/10_farewell/ppt_wavedash_whoosh");
            while (clipArtEase < 1f)
            {
                clipArtEase = Calc.Approach(clipArtEase, 1f, Engine.DeltaTime);
                yield return(null);
            }
            yield return(0.25f);

            infoText = FancyText.Parse(Presentation.GetDialog("PAGE3_INFO"), Width - 240, 32, 1f, new Color?(Color.Black * 0.7f), null);
            yield return(PressButton());

            Audio.Play("event:/new_content/game/10_farewell/ppt_its_easy");
            easyText = new AreaCompleteTitle(new Vector2(Width / 2f, Height - 150), Presentation.GetCleanDialog("PAGE3_EASY"), 2f, true);
            yield return(1f);

            yield break;
        }
Пример #2
0
        public override IEnumerator Routine()
        {
            yield return(0.5f);

            list = FancyText.Parse(Presentation.GetDialog("PAGE4_LIST"), Width, 32, 1f, new Color?(Color.Black * 0.7f), null);
            float delay = 0f;

            while (listIndex < list.Nodes.Count)
            {
                if (list.Nodes[listIndex] is FancyText.NewLine)
                {
                    yield return(PressButton());
                }
                else
                {
                    delay += 0.008f;
                    if (delay >= 0.016f)
                    {
                        delay -= 0.016f;
                        yield return(0.016f);
                    }
                }
                listIndex++;
            }
            yield break;
        }
Пример #3
0
        public Option(string key)
        {
            this.Key = key;
            this.Tag = (int)Tags.HUD;

            int maxLineWidth = 1828;

            this.Text = FancyText.Parse(Dialog.Get(this.Key), maxLineWidth, -1);
            foreach (FancyText.Node node in this.Text.Nodes)
            {
                if (!(node is FancyText.Portrait portrait))
                {
                    continue;
                }

                this.Portrait = GFX.PortraitsSpriteBank.Create(portrait.SpriteId);
                this.Portrait.Play(portrait.IdleAnimation);
                this.PortraitSide = (Facings)portrait.Side;
                this.Textbox      = "textbox/" + portrait.Sprite + "_ask";
                XmlElement xml = GFX.PortraitsSpriteBank.SpriteData[portrait.SpriteId].Sources[0].XML;
                if (xml != null)
                {
                    this.PortraitSize = xml.AttrInt("size", 160);
                }

                break;
            }
        }
Пример #4
0
 public Display(Vector2 position, string text, string tutorial, Vector2 tutorialOffset)
 {
     Position          = position;
     Info              = FancyText.Parse(text, 896, 8, 1f, new Color?(Color.Black * 0.6f), null);
     Tutorial          = new WallbouncePlayback(tutorial, tutorialOffset);
     Tutorial.OnRender = delegate()
     {
         Draw.Line(-64f, 20f, 64f, 20f, Color.Black);
         Draw.Line(-64f, 20f, -64f, -60f, Color.Black);
     };
     routine = new Coroutine(Routine(), true);
 }
Пример #5
0
        public override IEnumerator Routine()
        {
            string[] text = Presentation.GetCleanDialog("PAGE2_TITLE").Split(new char[]
            {
                '|'
            });
            Vector2 pos = new Vector2(128f, 128f);
            int     num;

            for (int i = 0; i < text.Length; i = num + 1)
            {
                TitleText item = new TitleText(pos, text[i]);
                title.Add(item);
                yield return(item.Stamp());

                pos.X += item.Width + ActiveFont.Measure(' ').X * 1.5f;
                item   = null;
                num    = i;
            }
            text = null;
            pos  = default;
            yield return(PressButton());

            list = FancyText.Parse(Presentation.GetDialog("PAGE2_LIST"), Width, 32, 1f, new Color?(Color.Black * 0.7f), null);
            float delay = 0f;

            while (listIndex < list.Nodes.Count)
            {
                if (list.Nodes[listIndex] is FancyText.NewLine)
                {
                    yield return(PressButton());
                }
                else
                {
                    delay += 0.008f;
                    if (delay >= 0.016f)
                    {
                        delay -= 0.016f;
                        yield return(0.016f);
                    }
                }
                listIndex++;
            }
            yield return(PressButton());

            Audio.Play("event:/new_content/game/10_farewell/ppt_impossible");
            while (impossibleEase < 1f)
            {
                impossibleEase = Calc.Approach(impossibleEase, 1f, Engine.DeltaTime);
                yield return(null);
            }
            yield break;
        }
Пример #6
0
 private NonFrozenMiniTextbox(string dialogId, string message = null) : base(dialogId)
 {
     RemoveTag(Tags.HUD);
     AddTag(Tags.Global | TagsExt.SubHUD | Tags.FrozenUpdate | Tags.TransitionUpdate);
     Add(new IgnoreSaveLoadComponent());
     if (message != null)
     {
         this.SetFieldValue(
             typeof(MiniTextbox),
             "text",
             FancyText.Parse($"{{portrait {(IsPlayAsBadeline() ? "BADELINE" : "MADELINE")} left normal}}{message}", 1544, 2)
             );
     }
 }
Пример #7
0
        public CustomTextVignette(Session session, string text, HiresSnow snow = null)
        {
            this.session = session;
            areaMusic    = session.Audio.Music.Event;
            session.Audio.Music.Event = null;
            session.Audio.Apply();

            sfx = Audio.Play(SFX.music_prologue_intro_vignette);

            if (snow == null)
            {
                fade = 1f;
                snow = new HiresSnow();
            }
            Add(renderer  = new HudRenderer());
            Add(this.snow = snow);
            RendererList.UpdateLists();

            this.text     = FancyText.Parse(Dialog.Get(text), 960, 8, 0f);
            textCoroutine = new Coroutine(TextSequence());
        }
Пример #8
0
        void RandomizeTextboxText(On.Celeste.Textbox.orig_ctor_string_Language_Func1Array orig, Textbox self, string dialog, Language language, Func <IEnumerator>[] events)
        {
            if (InRandomizer && RandoLogic.RandomDialogMappings.ContainsKey(dialog.ToLower()))
            {
                DynData <Textbox> selfData = new DynData <Textbox>(self);
                FancyText.Text    origText = FancyText.Parse(Dialog.Get(dialog, language), (int)selfData.Get <float>("maxLineWidth"), selfData.Get <int>("linesPerPage"), 0f, null, language);
                var origTriggers           = new List <FancyText.Trigger>(origText.Nodes.OfType <FancyText.Trigger>());
                orig(self, RandoLogic.RandomDialogMappings[dialog.ToLower()], language, events);

                // Replace triggers from randomized text with triggers from original text
                int origIndex = 0;
                for (int i = 0; i < self.Nodes.Count; i++)
                {
                    if (self.Nodes[i] is FancyText.Trigger trigger)
                    {
                        if (origIndex < origTriggers.Count)
                        {
                            trigger.Index  = origTriggers[origIndex].Index;
                            trigger.Label  = origTriggers[origIndex].Label;
                            trigger.Silent = origTriggers[origIndex].Silent;
                            origIndex++;
                        }
                        else
                        {
                            // This effectively disables the trigger if we've run out of original triggers
                            trigger.Index = -1;
                        }
                    }
                }
                // Add the remaining original triggers on to the end
                if (origIndex < origTriggers.Count)
                {
                    self.Nodes.AddRange(origTriggers.GetRange(origIndex, origTriggers.Count - origIndex));
                }
            }
            else
            {
                orig(self, dialog, language, events);
            }
        }