示例#1
0
        public override bool HandleEvent(Event e)
        {
            if (e is Dialog.EndedEvent dee)
            {
                if (dee.Dialog.Id == "bk_10")
                {
                    Timer.Add(() => {
                        // Really, well, thank you, Limpor
                        GetComponent <DialogComponent>().StartAndClose("dm_1", 5);
                    }, 1f);
                }
            }
            else if (e is ItemTakenEvent ite)
            {
                if (ite.Stand is DarkMageStand)
                {
                    // Yes, yes, I need more power!
                    // MORE POWER!!!
                    // I can feel the energy growing in me!
                    GetComponent <DialogComponent>().StartAndClose($"dm_{Rnd.Int(2, 4)}", 5);
                }
            }

            return(base.HandleEvent(e));
        }
        public void Show(Item item)
        {
            Tint   = Color.White;
            Tint.A = 0;

            Tween.To(255, 0, x => Tint.A = (byte)x, 0.4f);


            title = item.Name;
            Label = item.Description;
            Depth = 3;

            var size = Font.Small.MeasureString(Label);

            Width  = size.Width;
            Height = size.Height;
            FinishTyping();

            CenterX = Display.UiWidth / 2f;
            Y       = 64f;

            titleWidth = (int)Font.Medium.MeasureString(title).Width;

            Timer.Add(() => {
                Tween.To(0, 255, x => Tint.A = (byte)x, 0.3f).OnEnd = () => {
                    title = null;
                    Done  = true;
                };
            }, 3f);
        }