Пример #1
0
        public override void OnStart(Dictionary <string, object> args)
        {
            if (!(Core.I.CurrentAreaInfo is AreaInfo area && Core.I.CurrentMap is MapData map))
            {
                // todo: エラーシーンを作成してそこで表示するようにする
                throw new InvalidOperationException();
            }

            InitializeMap(area);
            InitializeHUD();

            messageBox = new Container();
            var backdrop = new Sprite(ResourceManager.MesBox);

            messageBox.Add(backdrop);
            messageBox.Width  = (int)backdrop.Width;
            messageBox.Height = (int)backdrop.Height;
            message           = new DEText("", Color.Black)
            {
                Location = Vector.One * 16,
            };
            messageBox.Add(message);

            Core.I.Entities.EntityAdded   += EntityAdded;
            Core.I.Entities.EntityRemoved += EntityRemoved;
            EventRuntime.PostTeleport     += HandleTeleport;

            Core.I.BgmPlay(Core.I.CurrentAreaInfo.Music);
        }
Пример #2
0
 public override void OnStart(Dictionary <string, object> args)
 {
     BackgroundColor = Color.Black;
     text            = new DEText($"Level {Core.I.CurrentLevel} {Core.I.CurrentLevelData?.Desc ?? "No Description"}", Color.White);
     text.Location   = new Vector(Const.Width / 2 - text.Width / 2, Const.Height / 2 - text.Height);
     Root.Add(text);
     CoroutineRunner.Start(Main())
     .Then(_ => DF.Router.ChangeScene <StageScene>());
 }
Пример #3
0
        private void InitializeHUD()
        {
            hud    = new DEText("", Color.White);
            shadow = new DEText("", Color.Black)
            {
                Location = Vector.One
            };

            Root.Add(shadow);
            Root.Add(hud);
        }
Пример #4
0
        public override void OnStart(Dictionary <string, object> args)
        {
            if (DF.Window.IsFocused && DFKeyboard.Enter)
            {
                hasToSkip = true;
                return;
            }

            BackgroundColor = Color.White;
            Core.I.BgmPlay("bgm_prologue.mid");
            var file = Core.I.CurrentGender == PlayerGender.Male ? "male" : "female";

            var prologue = File.ReadAllText($"Resources/Document/prolog-{file}.txt");

            text          = new DEText(prologue, Color.Black);
            text.Location = new Vector(16, Const.Height + 16);
            Root.Add(text);
        }