Example #1
0
        protected override void OnInitialize()
        {
            _gui = new GuiManager(GraphicsContext.WindowSize)
            {
                Desktop = { Transparent = true }
            };

            _font = GraphicsContext.GetFont();

            _guiLoader = new XmlLoader(_gui);

            InventorySlot.Register(_guiLoader);

            _guiRenderer     = new GuiRenderer(GraphicsContext, new Faceless());
            _consoleRenderer = new ConsoleRenderer(GraphicsContext, StaticConsole.Console)
            {
                Visible = false
            };

            UVMapper.Register(_guiLoader);

            StaticTaskQueue.TaskQueue.CreateRepeatingTask("GUI Update", _gui.Update, 33);

            StaticConsole.Console.CommandBindings.Bind("load", "Load a GUI layout", LoadLayoutCommandHandler);
            StaticConsole.Console.CommandBindings.Bind("clear", "Clear the GUI", ClearLayoutCommandHandler);
            StaticConsole.Console.CommandBindings.Bind("loadw", "Load a GUI layout using file open dialog", LoadLayoutFileDialogCommandHandler);
            StaticConsole.Console.CommandBindings.Bind("ed", "Opens GUI xml in editor", OpenXmlForEditing);

            Logger.Add(new ConsoleLogger());

            base.OnInitialize();
        }
Example #2
0
        private void InitializeUI()
        {
            _guiManager  = new GuiManager(GraphicsContext.WindowSize);
            _guiRenderer = new GuiRenderer(GraphicsContext, new Faceless());
            _guiLoader   = new XmlLoader(_guiManager);
            UVMapper.Register(_guiLoader);
            MatImage.Register(_guiLoader);

            ModelPartWindow     = new ModelPartWindow(_guiLoader.Load("modelEditorSelectedModelPart.xml", _guiManager.Desktop), _editor);
            ModelPartFaceWindow = new ModelPartFaceWindow(_guiLoader.Load("modelEditorSelectedModelPartFace.xml", _guiManager.Desktop), _editor);
            ButtonPanelWindow   = new ButtonPanelWindow(_guiLoader.Load("epicEditButtons.xml", _guiManager.Desktop), _editor);
            MaterialsWindow     = new MaterialsWindow(_guiLoader.Load("materialsWindow.xml", _guiManager.Desktop), _editor);
            AnchorWindow        = new AnchorWindow(_guiLoader.Load("modelEditorSelectedAnchor.xml", _guiManager.Desktop), _editor);
            AnimationWindow     = new AnimationWindow(_guiLoader.Load("animationWindow.xml", _guiManager.Desktop), _editor);

            _editor.EditMode = EditMode.Geometry;

            _guiManager.Desktop.Transparent = true;
            StaticTaskQueue.TaskQueue.CreateRepeatingTask("UpdateUI", _guiManager.Update, 20);
        }