Пример #1
0
        public override void Exit()
        {
            UIManager.Instance.HideCursor();
            editor.Dispose();
            OverlayContainer.ChildIterator children = editorPanel.GetChildIterator();
            while (children.MoveNext())
            {
                OverlayElement currentElement = children.Current;
                editorPanel.RemoveChild(currentElement.Name);
            }

            UIManager.Instance.DestroyWidget(btnAddObject);
            UIManager.Instance.DestroyWidget(btnAIMeshCreateLine);
            UIManager.Instance.DestroyWidget(btnAIMeshCreateVertex);
            UIManager.Instance.DestroyWidget(btnClose);
            UIManager.Instance.DestroyWidget(btnSave);
            UIManager.Instance.DestroyWidget(lbAIMesh);
            UIManager.Instance.DestroyWidget(lbGeneral);
            UIManager.Instance.DestroyWidget(lbObjects);
            UIManager.Instance.DestroyWidget(lsvObjects);
            Widget.NukeOverlayElement(horline);
            Widget.NukeOverlayElement(horline2);

            UIManager.Instance.GetTraysLayer().Remove2D(editorPanel);
            Widget.NukeOverlayElement(editorPanel);
        }
Пример #2
0
 public static void ChangeContainerColour(OverlayContainer cont, ColourValue c1, ColourValue c2)
 {
     OverlayContainer.ChildIterator i = cont.GetChildIterator();
     while (i.MoveNext())
     {
         OverlayElement element = i.Current;
         if (element != null)
         {
             ChangeElementColour(element, c1, c2);
         }
     }
 }
Пример #3
0
 public void killTextInput()
 {
     foreach (OverlayContainer container in mO.GetChildContainerIterator())
     {
         foreach (OverlayElement element in container.GetChildIterator())
         {
             OverlayManager.Singleton.DestroyOverlayElement(element);
         }
     }
     foreach (OverlayElement element in mO.GetChildIterator())
     {
         OverlayManager.Singleton.DestroyOverlayElement(element);
     }
     mO.Parent.RemoveChild(mO.Name);
     OverlayManager.Singleton.DestroyOverlayElement(mO);
 }
Пример #4
0
        protected override void CreateGUI()
        {
            base.CreateGUI();
            Vector2 m = GetMargin();
            int     h = (int)GetTextVSpacing();


            guiWindow = mGui.createWindow(new Vector4(m.x,
                                                      m.y, Viewport.ActualWidth / 2,
                                                      Viewport.ActualHeight - m.y - h),
                                          "bgui.window", (int)wt.NONE, LanguageResources.GetString(LanguageKey.HallOfFame));

            Callback cc = new Callback(this); // remember to give your program the BetaGUIListener interface

            float y = 0;

            for (int i = 0; i < highscores.Count; i++)
            {
                OverlayContainer c;


                c = guiWindow.createStaticText(new Vector4(105, 2 * GetTextVSpacing() + y, 100, GetTextVSpacing()), highscores[i].Score.ToString());

                c = guiWindow.createStaticText(new Vector4(5, 2 * GetTextVSpacing() + y, 100, GetTextVSpacing()), highscores[i].Name);

                y += GetTextVSpacing();
                if (i == 2)
                {
                    y += GetTextVSpacing();
                }
                foreach (OverlayElement element in c.GetChildIterator())
                {
                    if (i == 0)
                    {
                        // element.SetParameter("char_height", StringConverter.ToString(50f));
                        element.SetParameter("colour_top", "1.0 0.8 0.0");
                        element.SetParameter("colour_bottom", "0.9 0.7 0.0");
                    }
                    else
                    if (i == 1)
                    {
                        element.SetParameter("colour_top", "0.89 0.89 0.89");
                        element.SetParameter("colour_bottom", "1.0 1.0 0.9");
                    }
                    else
                    if (i == 2)
                    {
                        element.SetParameter("colour_top", "0.71 0.41 0.08");
                        element.SetParameter("colour_bottom", "0.80 0.50 0.25");
                    }
                }
            }

            if (survivalTime > 0)
            {
                y += 3 * GetTextVSpacing();

                OverlayContainer c = guiWindow.createStaticText(new Vector4(5, y, 100, GetTextVSpacing()),
                                                                LanguageResources.GetString(LanguageKey.SurvivalTime));

                foreach (OverlayElement element in c.GetChildIterator())
                {
                    element.SetParameter("colour_top", "0.6 0.1 0.1");
                    element.SetParameter("colour_bottom", "0.6 0.2 0.2");
                }
                c = guiWindow.createStaticText(new Vector4(275, y, 100, GetTextVSpacing()), String.Format("{0:f}s.", survivalTime));
                foreach (OverlayElement element in c.GetChildIterator())
                {
                    element.SetParameter("colour_top", "0.6 0.1 0.1");
                    element.SetParameter("colour_bottom", "0.6 0.2 0.2");
                }
            }

            y += 2 * GetTextVSpacing();

            initButtons(1, 0);
            buttons[0] = guiWindow.createButton(new Vector4(0, y, Viewport.ActualWidth / 2, GetTextVSpacing()), "bgui.button",
                                                LanguageResources.GetString(LanguageKey.OK), cc, 0);
            selectButton(0);
            guiWindow.show();
        }