示例#1
0
 private void OnExitMenu(ExitMenu E)
 {
     if (E.Menu == MainMenu)
     {
         ToSubMenu = true;
     }
 }
示例#2
0
 private void OnExitMenu(ExitMenu E)
 {
     if (E.Menu == MainMenu)
     {
         GetComponent <SpriteRenderer>().enabled = false;
     }
 }
示例#3
0
        public InGameMenuWiring(ScriptClient client, InGameMenu inGameMenu, ExitMenu exitMenu, WaitScreen waitScreen, Login.Login login, CharacterList characterList, LeaveGameSender leaveMsgSender)
        {
            inGameMenu.BackToMainMenu += sender =>
            {
                leaveMsgSender.SendLeaveGameMessage();
                waitScreen.Message = "Lade Charakterliste...";
                waitScreen.Open();
                sender.Close();
                characterList.RefreshFromServer();
            };


            inGameMenu.BackToLoginSelected += sender =>
            {
                sender.Close();
                waitScreen.Message = "Logout läuft...";
                waitScreen.Open();
                login.StartLogout();
            };


            inGameMenu.ExitGameSelected += sender =>
            {
                sender.Close();
                exitMenu.Open();
            };

            inGameMenu.OnEscape += sender => sender.Close();
        }
示例#4
0
 private void OnExitMenu(ExitMenu E)
 {
     if (E.Menu == gameObject)
     {
         Active = false;
     }
 }
示例#5
0
        public Form1()
        {
            ExitMenu exitMenu = new ExitMenu();

            exitMenu.ExitMenuClick += new EventHandler(exitMenu_ExitMenuClick);

            InitializeComponent();

            InitDefaultHost();
            HostSelected hostSelected = CreateHostSelected();
            EditMenu     editMenu     = CreateEditMenu();

            this.contextMenuStrip1.Items.AddRange(
                AppMenu.CreateAppMenu().
                Builder(HostManagerFactory.GetInstance().GetHostList(),
                        hostSelected,
                        Server.GetInstance().ReadCurrentHostKey()).
                Builder("-").
                Builder("编辑", editMenu).
                Builder("退出", exitMenu).ToMenuList().ToArray()
                );

            this.Hide();
            this.WindowState   = FormWindowState.Minimized;
            this.ShowInTaskbar = false;
        }
示例#6
0
文件: MainForm.cs 项目: gonutz/imv
 private void MainForm_KeyDown(object sender, KeyEventArgs e)
 {
     // Some keys cannot be set as shortcuts in Visual Studio
     // so we handle them manually and call the respective menu items ourselves.
     if (e.KeyCode == Keys.Escape)
     {
         ExitMenu.PerformClick();
     }
     if (e.KeyCode == Keys.Left)
     {
         PreviousImageMenu.PerformClick();
     }
     if (e.KeyCode == Keys.Right)
     {
         NextImageMenu.PerformClick();
     }
     if (e.KeyCode == Keys.D1)
     {
         OriginalImageSizeMenu.PerformClick();
     }
     if (e.KeyCode == Keys.F)
     {
         FitImageToWindowMenu.PerformClick();
     }
 }
示例#7
0
 public VendingMachine(IWallet _wallet, ICart _cart)
 {
     wallet       = _wallet;
     cart         = _cart;
     insertCoin   = new InsertCoinMenu(wallet);
     purchaseItem = new PurchaseItemMenu(wallet, cart);
     exit         = new ExitMenu(wallet);
 }
 private void OnExitMenu(ExitMenu E)
 {
     if (E.Menu == gameObject)
     {
         BackInfo.SetActive(false);
         Image.SetActive(false);
     }
 }
示例#9
0
 private void OnExitMenu(ExitMenu M)
 {
     if (M.Menu == gameObject)
     {
         BackInfo.SetActive(false);
         GameObject Image = transform.Find("Image").gameObject;
         Image.GetComponent <Image>().enabled = false;
     }
 }
示例#10
0
 void OpenExit()
 {
     MainMenu.Active(false);
     ExitMenu.Active(true);
     State = MenuState.ExitOpened;
     MainBackgroundLayer.Visible = false;
     ExitLayer.Visible           = true;
     SetMenuSize(new Vector2(ExitBackground.Texture.Width, ExitBackground.Texture.Height));
 }
示例#11
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        gameObject.SetActive(false);
    }
 private void OnExitMenu(ExitMenu E)
 {
     if (E.Menu == gameObject)
     {
         GetComponent <ButtonSelection>().enabled = false;
         foreach (Transform child in transform)
         {
             child.gameObject.SetActive(false);
         }
     }
 }
示例#13
0
 private void OnExitMenu(ExitMenu E)
 {
     if (E.Menu == gameObject)
     {
         Activated = false;
         foreach (Transform child in transform)
         {
             child.gameObject.SetActive(false);
         }
     }
 }
示例#14
0
        public ExitMenuEventWiring(ExitMenu exitMenu, MainMenu mainMenu)
        {
            exitMenu.ExitGameSelected += sender => Program.Exit();

            exitMenu.BackToMainMenu += sender =>
            {
                sender.Close();
                mainMenu.Open();
            };

            exitMenu.OnEscape += sender => sender.Close();
        }
示例#15
0
        public void OpenOrCloseMainMenu(object sender, EventArgs e)
        {
            var screen = (ScreenService)GetServices().GetService(typeof(ScreenService));
            var sound  = (SoundService)GetServices().GetService(typeof(SoundService));

            sound.PlaySound(SoundsHelper.GetSoundPath(Sounds.OpenMenu),
                            screen.GameWindowSize.X, screen.GameWindowSize.Y);

            if (State == MenuState.AllClosed)
            {
                State = MenuState.MainOpened;
                MainBackgroundLayer.Visible = true;
                MainMenu.Active(true);
                SetMenuSize(new Vector2(MainBackground.Texture.Width, MainBackground.Texture.Height));
                screenService.IsMouseVisible = true;
            }
            else if (State == MenuState.MainOpened)
            {
                State = MenuState.AllClosed;
                MainBackgroundLayer.Visible = false;
                MainMenu.UnselectItems();
                MainMenu.Active(false);
                screenService.IsMouseVisible = false;
            }
            else if (State == MenuState.AudioOpened)
            {
                State = MenuState.MainOpened;
                AudioBackgroundLayer.Visible = false;
                MainBackgroundLayer.Visible  = true;
                AudioMenu.Active(false);
                MainMenu.Active(true);
                SetMenuSize(new Vector2(MainBackground.Texture.Width, MainBackground.Texture.Height));
            }
            else if (State == MenuState.VideoOpened)
            {
                State = MenuState.MainOpened;
                VideoBackgroundLayer.Visible = false;
                MainBackgroundLayer.Visible  = true;
                VideoMenu.Active(false);
                MainMenu.Active(true);
                SetMenuSize(new Vector2(MainBackground.Texture.Width, MainBackground.Texture.Height));
            }
            else if (State == MenuState.ExitOpened)
            {
                State                       = MenuState.MainOpened;
                ExitLayer.Visible           = false;
                MainBackgroundLayer.Visible = true;
                ExitMenu.Active(false);
                MainMenu.Active(true);
                SetMenuSize(new Vector2(MainBackground.Texture.Width, MainBackground.Texture.Height));
            }
        }
示例#16
0
 private void OnExitMenu(ExitMenu E)
 {
     if (E.Menu == gameObject)
     {
         ConfirmInfo.SetActive(false);
         BackInfo.SetActive(false);
         GetComponent <ButtonSelection>().enabled = false;
         for (int i = 0; i < GetComponent <ButtonSelection>().ButtonList.Count; i++)
         {
             GetComponent <ButtonSelection>().ButtonList[i].SetActive(false);
         }
     }
 }
示例#17
0
 private void OnExitMenu(ExitMenu E)
 {
     if (E.Menu == gameObject)
     {
         BackInfo.SetActive(false);
         transform.Find("InfoText").gameObject.SetActive(false);
         GetComponent <ButtonSelection>().enabled      = false;
         GetComponent <ButtonSelection>().SelectedMenu = 0;
         for (int i = 0; i < GetComponent <ButtonSelection>().ButtonList.Count; i++)
         {
             GetComponent <ButtonSelection>().ButtonList[i].SetActive(false);
         }
     }
 }
示例#18
0
        protected override void OnLoad(ContentManager content, GraphicsDevice gd)
        {
            AddChild(PlacementLayer);

            PlacementLayer.AddChild(MainMenu, 2);
            PlacementLayer.AddChild(AudioMenu, 2);
            PlacementLayer.AddChild(VideoMenu, 2);
            PlacementLayer.AddChild(MainBackgroundLayer, 1);
            PlacementLayer.AddChild(AudioBackgroundLayer, 1);
            PlacementLayer.AddChild(VideoBackgroundLayer, 1);
            PlacementLayer.AddChild(ExitLayer, 1);

            VideoBackgroundLayer.AddChild(VideoBackground, 1);
            VideoBackgroundLayer.AddChild(new DrawableLabel()
            {
                Text     = "*Changes will take effect after the next restart.",
                Scale    = new Vector2(0.6f, 0.6f),
                Position = new Vector2(20, 150)
            });

            VideoBackgroundLayer.AddChild(GearVideo, 0);
            VideoBackgroundLayer.AddChild(GearVideo2, 0);

            AudioBackgroundLayer.AddChild(AudioBackground, 1);
            AudioBackgroundLayer.AddChild(GearAudio, 0);

            MainBackgroundLayer.AddChild(GearMain, 0);
            MainBackgroundLayer.AddChild(GearMiniMain, 0);
            MainBackgroundLayer.AddChild(MainBackground, 1);

            ExitLayer.AddChild(ExitBackground, 1);
            ExitLayer.AddChild(new DrawableLabel()
            {
                Text = "Do you really want to quit?", Position = new Vector2(30, 25)
            });
            ExitLayer.AddChild(ExitMenu, 2);
            ExitLayer.AddChild(GearExit, 0);
            ExitLayer.AddChild(GearExit2, 0);
            ExitLayer.AddChild(GearExitMini, 0);

            inputManager.RegisterEvent(InputActions.Escape, new EventHandler(OpenOrCloseMainMenu));

            MainMenu.Active(false);
            AudioMenu.Active(false);
            VideoMenu.Active(false);
            ExitMenu.Active(false);

            SetMenuSize(new Vector2(MainBackground.Texture.Width, MainBackground.Texture.Height));
        }
示例#19
0
 private void OnExitMenu(ExitMenu E)
 {
     if (E.Menu == gameObject)
     {
         Active = false;
         BackInfo.SetActive(false);
         NewGameInfo.SetActive(false);
         LoadInfo.SetActive(false);
         DeleteInfo.SetActive(false);
         for (int i = 0; i < Slots.Count; i++)
         {
             Slots[i].SetActive(false);
         }
     }
 }
示例#20
0
    // Use this for initialization
    void Start()
    {
//		PlayerPrefs.DeleteAll();

        Invoke("HideSplashScreen", 3f);
        Lives          = 3;
        s              = true;
        ExitControl    = false;
        ss             = true;
        OnlyForExit    = false;
        Time.timeScale = 1;
        ExitAnim       = ExitMenu.GetComponent <Animator>();
        DontDestroyOnLoad(gameObject);
                #if UNITY_ANDROID
        StartAppWrapper.init();
        StartAppWrapper.loadAd();
                #endif
    }
示例#21
0
        private Workspace InitializeMainMenu()
        {
            var mainMenu = new FF6MainMenu(new FF6MainMenuProps
            {
                Name           = "main",
                Model          = Model,
                OnExit         = e => ExitMenu?.Invoke(),
                OnArrangeItems = e => ArrangeItems(),
                OnUseItem      = UseItem,
                OnSwapItems    = SwapItems,
                OnEquip        = EquipItem,
                OnEquipRemove  = UnequipItem,
                OnEquipEmpty   = EmptyEquipment,
                OnEquipOptimum = EquipOptimum,
            });

            return(new Workspace("default", mainMenu));
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public Main()
        {
            // Setup device
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            // Capture device settings event
            graphics.PreparingDeviceSettings += new EventHandler <PreparingDeviceSettingsEventArgs>(Graphics_PreparingDeviceSettings);

            // Read INI file
            ReadINISettings();

            // Timing
            this.IsFixedTimeStep = true;
            graphics.SynchronizeWithVerticalRetrace = true;
            this.Window.Title = title;

            // Set display mode
            displayPreference = (windowedMode) ? DisplayPreferences.Windowed : DisplayPreferences.Fullscreen;

            // Create engine core
            core = new DeepCore(arena2Path, this.Services);

            // Create game state manager
            gameManager = new GameStateManager(this);
            Components.Add(gameManager);

            // Create game states
            titleScreen     = new TitleScreen1(core, this);
            playground1     = new Playground1(core, this);
            playground2     = new Playground2(core, this);
            gameOptionsMenu = new ExitMenu(core, this);

            // Apply settings
            playground1.MouseLookSpeed = mouseLookSpeed;
            playground2.MouseLookSpeed = mouseLookSpeed;

            // Setup title events
            titleScreen.OnStartClicked += new EventHandler(TitleScreen_OnStartClicked);
            titleScreen.OnExitClicked  += new EventHandler(TitleScreen_OnExitClicked);

            // Set initial game state
            gameManager.ChangeState(titleScreen);
        }
示例#23
0
        public MainMenuEventWiring(
            MainMenu mainMenu,
            CharCreationMenu charCreationMenu,
            ExitMenu exitMenu,
            ScriptClient client,
            LoginMenu loginMenu,
            Login.Login login,
            WaitScreen waitScreen,
            CharacterSelectionMenu selectionMenu,
            JoinGameSender joinGameSender,
            CharacterList characterList,
            ErrorScreenManager errorScreenManager)
        {
            mainMenu.CharacterCreationSelected += sender =>
            {
                sender.Close();
                charCreationMenu.Open();
            };

            mainMenu.JoinGameSelected += sender =>
            {
                if (!characterList.TryGetActiveCharacter(out Character.Character character))
                {
                    mainMenu.Close();
                    errorScreenManager.ShowError("Kein Character gewählt!", mainMenu.Open);
                    return;
                }

                joinGameSender.StartJoinGame(character);
                waitScreen.Message = "Trete Spiel bei...";
                waitScreen.Open();
                mainMenu.Close();

                //client.SendSpectateMessage();
            };

            mainMenu.BackToLoginSelected += sender =>
            {
                sender.Close();
                waitScreen.Message = "Logout läuft...";
                waitScreen.Open();
                login.StartLogout();
            };

            mainMenu.CharacterSelectionSelected += sender =>
            {
                selectionMenu.Open();
                sender.Close();
            };

            mainMenu.ExitGameSelected += sender =>
            {
                sender.Close();
                exitMenu.Open();
            };

            joinGameSender.JoinGameRequestSuccessful += sender =>
            {
                //The server accepted the join request, close the ui, from here on the server does most of the controlling.
                waitScreen.Close();
            };

            joinGameSender.JoinGameFailed += (sender, args) =>
            {
                //Something went wrong show an error message to the player and then return to the main menu.
                waitScreen.Close();
                errorScreenManager.ShowError(args.ReasonText, mainMenu.Open);
            };
        }
示例#24
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            text        = Content.Load <SpriteFont>("Text");

            Texture2D player_Atlas_Texture     = Content.Load <Texture2D>("Player_Atlas");
            Texture2D chunk_Of_Stone_Texture   = Content.Load <Texture2D>("chunk");
            Texture2D ground_Grass_Texture     = Content.Load <Texture2D>("Grass");
            Texture2D cloud_Texture            = Content.Load <Texture2D>("Cloud");
            Texture2D quit_Menu_Texture        = Content.Load <Texture2D>("Menu/Quit");
            Texture2D quit_Menu_Select_Texture = Content.Load <Texture2D>("Menu/QuitSelectBox");
            Texture2D quit_Background          = Content.Load <Texture2D>("Menu/ExitBackground");
            Texture2D inventory_texture        = Content.Load <Texture2D>("Menu/Inventory");
            Texture2D inventory_Select_Texture = Content.Load <Texture2D>("Menu/InventorySelect");
            Texture2D hotbar_Texture           = Content.Load <Texture2D>("Menu/Hotbar");

            items = new Dictionary <string, Texture2D>()
            {
                { "Log", Content.Load <Texture2D>("items/itemLog") }
            };

            player = new Player(player_Atlas_Texture);

            solid_Sprites = new List <Sprite>()
            {
                new Sprite(chunk_Of_Stone_Texture)
                {
                    Position = new Vector2(1100, 850)
                },
                new Sprite(chunk_Of_Stone_Texture)
                {
                    Position = new Vector2(1400, 550)
                },
                new Sprite(chunk_Of_Stone_Texture)
                {
                    Position = new Vector2(1700, 500)
                },
                new Sprite(chunk_Of_Stone_Texture)
                {
                    Position = new Vector2(1950, 300)
                },
                new Sprite(chunk_Of_Stone_Texture)
                {
                    Position = new Vector2(2475, 500)
                },
                new Sprite(ground_Grass_Texture)
                {
                    Position = new Vector2(0, 1010)
                },
                new Sprite(ground_Grass_Texture)
                {
                    Position = new Vector2(1920, 1010)
                },
                new Sprite(ground_Grass_Texture)
                {
                    Position = new Vector2(-1920, 1010)
                }
            };

            decoration_Sprites = new List <Sprite>();
            var random         = new Random();
            int cloudPlacement = -2500;

            for (int i = 0; i < 20; i++)//clouds
            {
                decoration_Sprites.Add(new Sprite(cloud_Texture)
                {
                    Position = new Vector2(cloudPlacement += random.Next(200, 800), random.Next(0, 300))
                });
            }

            Sprite quitMenuSprite = new Sprite(quit_Menu_Texture)
            {
                Position = new Vector2((GraphicsDevice.DisplayMode.Width - quit_Menu_Texture.Width) / 2, (GraphicsDevice.DisplayMode.Height - quit_Menu_Texture.Height) / 2)
            };
            Sprite quitBackgroundSprite = new Sprite(quit_Background)
            {
                SetColor = Color.Black * .5f
            };

            exitMenu = new ExitMenu(quitMenuSprite, quitBackgroundSprite, quit_Menu_Select_Texture);

            Sprite inventorySprite = new Sprite(inventory_texture)
            {
                Position = new Vector2((GraphicsDevice.DisplayMode.Width - inventory_texture.Width) / 2, (GraphicsDevice.DisplayMode.Height - inventory_texture.Height) / 2)
            };
            Sprite hotbarSprite = new Sprite(inventory_texture);

            inventory = new Inventory(inventorySprite, hotbarSprite, inventory_Select_Texture, items, text);
        }
示例#25
0
#pragma warning restore 0219, 414

    protected override void OnEnable()
    {
        base.OnEnable();

        this._sExitMenu = this.target as ExitMenu;
    }