示例#1
0
    public void HideWindow()
    {
        if (window == null)
        {
            return;
        }

        window.Hide();
    }
示例#2
0
        public LocationScene(Module App)
            : base(App)
        {
            Size = app.Engine.GameResolution;

            view          = new MapView(this, App);
            view.Position = new Vector2(16, 0);
            view.Size     = new Vector2(Size.x - 32, Size.y - 40);
            //view.Position = new Vector2(0, 0);
            //view.Size = new Vector2(Size.x, Size.y - 16);
            view.MouseClickEvent += OnMouseClickMap;
            view.Overlays.Add(new Maps.MapViewOverlayDroppedItems(App));
            view.Overlays.Add(charOverlay = new Maps.MapViewOverlayCharacters(App));
            view.Overlays.Add(hoverInfo   = new Maps.MapViewOverlayHoverText(App));
            view.ClickObject += new EventHandler <ObjectArgs>(view_ClickObject);
            view.Scroll      += new EventHandler <MapScrollArgs>(view_Scroll);
            Windows          += view;

            menu        = new MenuWindow(App);
            menu.Layer += 50;
            menu.Hide();
            Windows += menu;

            cursorAni            = new Image(App);
            cursorAni.Background = "[email protected]?10-13";
            cursorAni.Background.Animation.Progressive = false;
            cursorAni.Layer += 59;
            Windows         += cursorAni;

            gui        = new MapGuiWindow(App);
            gui.Layer += 60;
            Windows   += gui;

            dialog          = new DialogWindow(app);
            dialog.Position = new Vector2(33, 20);
            dialog.Hide();
            dialog.Layer      += 55;
            dialog.WindowHide += new EventHandler(dialog_WindowHide);
            dialog.WindowShow += new EventHandler(dialog_WindowShow);
            Windows           += dialog;
        }
示例#3
0
        public MapScene(Module App)
            : base(App)
        {
            Size = app.Engine.GameResolution;

            view          = new ClassicMapView(this, App);
            view.Position = new Vector2(16, 0);
            view.Size     = new Vector2(Size.x - 32, Size.y - 40);
            //view.Position = new Vector2(0, 0);
            //view.Size = new Vector2(Size.x, Size.y - 16);
            view.Overlays.Add(new Maps.MapViewOverlayFlags(app));
            view.Overlays.Add(new Maps.MapViewOverlayPlayer(app));
            view.Overlays.Add(new Maps.MapViewOverlayHoverText(app));
            view.Scroll += new EventHandler <MapScrollArgs>(view_Scroll);
            Windows     += view;

            menu        = new MenuWindow(App);
            menu.Layer += 50;
            menu.AddLine("@burn?351", (CommandHandler)OnMenuInfo);
            menu.AddLine("@burn?367", (CommandHandler)OnMenuInventory);
            menu.AddLine("@burn?359", (CommandHandler)OnMenuStatistics);
            menu.AddLine("@burn?361", (CommandHandler)OnMenuOptions);
            menu.AddLine("@burn?357", (CommandHandler)OnMenuTurn);
            menu.Hide();
            Windows += menu;

            cursorAni            = new Image(App);
            cursorAni.Background = "[email protected]?24-27";
            cursorAni.Background.Animation.Progressive = false;
            cursorAni.Layer += 59;
            Windows         += cursorAni;

            gui        = new MapGuiWindow(App);
            gui.Layer += 60;
            Windows   += gui;

            BurntimeClassic classic = app as BurntimeClassic;

            debugNoTravel = classic.Settings["debug"].GetBool("no_travel") && classic.Settings["debug"].GetBool("enable_cheats");
        }
示例#4
0
 public void CloseMenuWindow()
 {
     MenuWindow.Hide();
 }
示例#5
0
        private void HandleGameMenu()
        {
            for (AsciiKey press = Messager.GetNextKeyPress(); press.Key != Keys.None; press = Messager.GetNextKeyPress())
            {
                string readable = Readable(press);
                Log.Info($"At menu, pressed [{readable}]");

                // Quit
                if (press.Key == Keys.Q)
                {
                    if (ConfirmExit())
                    {
                        Game.Instance.Exit();
                    }
                }

                //0.0: Load saved game and resume play
                if (press.Key == Keys.L)
                {
                    GameMode.PopEngineMode();
                    MenuWindow.Hide();
                    LoadSavedGame();

                    // 1.+.SAVE: Hardcore/roguelike load game mode:
                    // delete save file

                    return;
                }

                if (GameInProgress)
                {
                    // Return to game
                    if (press.Key == Keys.R || press.Key == Keys.Escape)
                    {
                        GameMode.PopEngineMode();
                        MenuWindow.Hide();
                        return;
                    }

                    //0.0: Save current game
                    if (press.Key == Keys.S)
                    {
                        SaveTheGame();

                        // 1.+.SAVE: Hardcore/roguelike save game mode:
                        // GameInProgress = false;
                        // UnloadGane();
                        // redraw menu options
                    }
                }
                else
                {
                    // Begin new game
                    if (press.Key == Keys.B)
                    {
                        GameMode.PopEngineMode();
                        MenuWindow.Hide();
                        BeginNewGame();
                        return;
                    }

                    //0.0: Generate new seed, or enter new seed
                }
            }
        }