Пример #1
0
 private void KeyboardHandler_KeysPressed(object sender, Microsoft.Xna.Framework.Input.Keys e)
 {
     if (e == SettingsManager.Keybindings.Settings.OpenActionMenu)
     {
         if (BoundHandler.GUIWindows.Contains(ActionMenu.AMenu))
         {
             BoundHandler.RemoveContainer(ActionMenu.AMenu);
         }
         else
         {
             ActionMenu.Initialize();
         }
     }
 }
Пример #2
0
        public override void Click(MouseEventArgs e)
        {
            ServerSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(true));
            Server.Load();
            Client.Load();
            Server.StartGame();
            NewGameInputHandler a = new NewGameInputHandler();

            a.StartNewGame();
            BoundHandler.RemoveContainer(NewWorldMenu.NewWorldMenuM);
            MenuHandler.Clear();
            BoundHandler.HideAll();
            In_Game_GUI.InGameGUI.Initialize();
            BoundHandler.Popup(In_Game_GUI.InGameGUI.InGame);
        }
Пример #3
0
        public override void Click(MouseEventArgs e, GUIContainer container)
        {
            World.Mode = MagicalLifeAPI.Networking.EngineMode.ServerAndClient;
            Server.Load();
            ClientSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings());
            FMODUtil.RaiseEvent(EffectsTable.UIClick);
            ServerSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings());
            Client.Load();
            NewGameInputHandler a = new NewGameInputHandler();

            a.StartNewGame();
            Server.StartGame();
            BoundHandler.RemoveContainer(NewWorldMenu.NewWorldMenuM);
            MenuHandler.Clear();
            BoundHandler.HideAll();
            InGameGUI.Initialize();
            BoundHandler.Popup(InGameGUI.InGame);
        }
Пример #4
0
        private void NewWorldNextButton_ClickEvent(object sender, Reusable.Event.ClickEventArgs e)
        {
            World.Mode = MagicalLifeAPI.Networking.EngineMode.ServerAndClient;
            Server.Load();
            ClientSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient));
            FMODUtil.RaiseEvent(SoundsTable.UIClick);
            //FMODUtil.RaiseEvent(SoundsTable.Ambience);
            ServerSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient));
            Client.Load();
            NewGameInputHandler a = new NewGameInputHandler();

            a.StartNewGame();
            Server.StartGame();
            RenderInfo.Camera2D.InitializeForDimension(0);
            BoundHandler.RemoveContainer(NewWorldMenu.NewWorldMenuM);
            MenuHandler.Clear();
            BoundHandler.HideAll();
            InGameGUI.Initialize();
            BoundHandler.Popup(InGameGUI.InGame);
        }
Пример #5
0
        private void HandleEscapeKey()
        {
            //Show main menu.
            MasterLog.DebugWriteLine("Escape key pressed");

            if (ActionMenu.AMenu.Visible == true)
            {
                BoundHandler.RemoveContainer(ActionMenu.AMenu);
            }

            if (World.Dimensions.Count > 0)
            {
                //Ingame: Open up in game menu
                InGameEscapeMenu.Initialize();
            }
            else
            {
                //Pregame:
                MenuHandler.Back();
            }
        }
Пример #6
0
        public override void Click(MouseEventArgs e, GUIContainer container)
        {
            int selected = LoadGameMenu.Menu.SaveSelectListBox.SelectedIndex;

            if (selected != -1)
            {
                FMODUtil.RaiseEvent(SoundsTable.UIClick);
                World.Mode = MagicalLifeAPI.Networking.EngineMode.ServerAndClient;
                RenderableString selectedItem = (RenderableString)LoadGameMenu.Menu.SaveSelectListBox.Items[selected];
                WorldStorage.LoadWorld(selectedItem.Text);

                Server.Load();
                ClientSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient));
                ServerSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient));
                Client.Load();
                Server.StartGame();
                BoundHandler.RemoveContainer(LoadGameMenu.Menu);
                MenuHandler.Clear();
                BoundHandler.HideAll();
                InGameGUI.Initialize();
                BoundHandler.Popup(InGameGUI.InGame);
            }
        }
Пример #7
0
        private void LoadSaveButton_ClickEvent(object sender, Reusable.Event.ClickEventArgs e)
        {
            int selected = LoadGameMenu.Menu.SaveSelectListBox.SelectedIndex;

            if (selected != -1)
            {
                FMODUtil.RaiseEvent(SoundsTable.UIClick);
                World.Mode = MagicalLifeAPI.Networking.EngineMode.ServerAndClient;
                RenderableString selectedItem = (RenderableString)LoadGameMenu.Menu.SaveSelectListBox.Items[selected];
                WorldStorage.LoadWorld(selectedItem.Text);

                Server.Load();
                ClientSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient));
                ServerSendRecieve.Initialize(new MagicalLifeAPI.Networking.NetworkSettings(MagicalLifeAPI.Networking.EngineMode.ServerAndClient));
                Client.Load();
                Server.StartGame();
                BoundHandler.RemoveContainer(LoadGameMenu.Menu);
                MenuHandler.Clear();
                BoundHandler.HideAll();
                InGameGUI.Initialize();
                BoundHandler.Popup(InGameGUI.InGame);
                RenderInfo.Camera2D.InitializeForDimension(0);
            }
        }
Пример #8
0
 private void X_XClicked(object sender, EventArgs e)
 {
     BoundHandler.RemoveContainer(this);
 }
Пример #9
0
 private void X_ClickEvent(object sender, Reusable.Event.ClickEventArgs e)
 {
     BoundHandler.RemoveContainer(this);
 }