コード例 #1
0
ファイル: Tutorial.cs プロジェクト: XZelnar/MicroWorld
        void Tutorial_OnTutorialClicked(object sender, Tutorial.TutorialClickedArgs e)
        {
            if (e.button == 1)
            {
                if (!Main.curState.StartsWith("GAME"))
                {
                    return;
                }
                if (_link != null && _link != "")
                {
                    //GUIEngine.s_encyclopediaPage.LastState = Main.curState;
                    //GUIEngine.s_encyclopediaPage.LastScene = GUIEngine.curScene;
                    //Main.curState = "GUIEncyclopedia";
                    //GUIEngine.curScene = GUIEngine.s_encyclopediaPage;
                    //GUIEngine.s_encyclopediaPage.OpenPage("Content/Encyclopedia/" + _link);

                    GUIEngine.AddHUDScene(GUIEngine.s_mainMenu);
                    GUIEngine.s_mainMenu.Show();
                    GUIEngine.s_mainMenu.InitForHandbook(true);
                    GUIEngine.s_handbook.InitForFolder("Content/Encyclopedia/" + _link.Substring(0, _link.IndexOf("/")));
                    GUIEngine.s_handbook.OpenPage("Content/Encyclopedia/" + _link);
                }
            }
            else if (e.button == 0)
            {
                if (Timeout != Logics.LevelEngine.NO_TIMEOUT)
                {
                    ForceClose();
                }
            }
        }
コード例 #2
0
        public static YesNoMessageBox Show(String txt)
        {
            var a = new YesNoMessageBox(txt);

            a.Initialize();
            a.isVisible = true;
            GUIEngine.AddHUDScene(a);
            return(a);
        }
コード例 #3
0
        public static ColorSelector Show(Vector2 pos)
        {
            var a = new ColorSelector(pos);

            a.Initialize();
            a.isVisible = true;
            GUIEngine.AddHUDScene(a);
            a.wasJustOpened = true;
            return(a);
        }
コード例 #4
0
 private void lv_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lv.SelectedIndices.Count > 0)
     {
         GUIEngine.RemoveHUDScene(Graphics.GUI.GUIEngine.s_subComponentButtons);
         GUIEngine.s_subComponentButtons.SelectedComponent =
             Components.ComponentsManager.Components[lv.SelectedIndices[0]];
         GUIEngine.s_subComponentButtons.isVisible = true;
         GUIEngine.AddHUDScene(Graphics.GUI.GUIEngine.s_subComponentButtons);
     }
 }
コード例 #5
0
ファイル: SaveMenu.cs プロジェクト: XZelnar/MicroWorld
 protected void deleteClick(object sender, InputEngine.MouseArgs e)
 {
     Sound.SoundPlayer.PlayButtonClick();
     if (saves.SelectedIndex == -1)
     {
         return;
     }
     mb = YesNoMessageBox.Show("Are you sure you want\r\nto delete the following file: \r\n" +
                               saves.GetSelected() + "?");
     mb.onButtonClicked += new YesNoMessageBox.ButtonClickedEventHandler(mb_onButtonClicked);
     GUIEngine.AddHUDScene(mb);
 }
コード例 #6
0
        void help_onClicked(object sender, InputEngine.MouseArgs e)
        {
            String link = AssociatedComponent.Graphics.GetHandbookFile();

            if (!Main.curState.StartsWith("GAME") || link == null)
            {
                return;
            }
            if (link != null && link != "")
            {
                GUIEngine.AddHUDScene(GUIEngine.s_mainMenu);
                GUIEngine.s_mainMenu.Show();
                GUIEngine.s_mainMenu.InitForHandbook(true);
                GUIEngine.s_handbook.InitForFolder("Content/Encyclopedia/" + link.Substring(0, link.IndexOf("/")));
                GUIEngine.s_handbook.OpenPage("Content/Encyclopedia/" + link);
                InputEngine.eventHandled = true;
            }
        }
コード例 #7
0
        public override void onButtonClick(InputEngine.MouseArgs e)
        {
            if (e.Handled || !isVisible)
            {
                return;
            }
            if (e.button == 2 && IsIn(e.curState.X, e.curState.Y))//wheel
            {
                String link = componentGraphics.GetHandbookFile();

                if (!Main.curState.StartsWith("GAME") || link == null)
                {
                    return;
                }
                if (link != null && link != "")
                {
                    GUIEngine.AddHUDScene(GUIEngine.s_mainMenu);
                    GUIEngine.s_mainMenu.Show();
                    GUIEngine.s_mainMenu.InitForHandbook(true);
                    GUIEngine.s_handbook.InitForFolder("Content/Encyclopedia/" + link.Substring(0, link.IndexOf("/")));
                    GUIEngine.s_handbook.OpenPage("Content/Encyclopedia/" + link);
                    e.Handled = true;
                }
            }
            else
            {
                base.onButtonClick(e);
                if (e.button == 0 &&
                    e.curState.X >= position.X + SIZE_X - 12 && e.curState.X <= position.X + SIZE_X &&
                    e.curState.Y >= position.Y && e.curState.Y <= position.Y + 12)
                {
                    component.IsFavourite = !component.IsFavourite;
                    e.Handled             = true;
                }
            }
        }
コード例 #8
0
 public virtual void Show()
 {
     GUIEngine.AddHUDScene(this);
 }