private void UpdateSelection()
        {
            if (SelectedDescriptor == null || !SelectedDescriptor.IsLoaded)
            {
                return;
            }

            PropertiesPanel.ClearChildren();
            GridLayout layout = new GridLayout(GUI, PropertiesPanel, 5, 1);

            ImagePanel worldPanel = new ImagePanel(GUI, layout, SelectedDescriptor.Button.Image)
            {
                KeepAspectRatio = true
            };

            layout.SetComponentPosition(worldPanel, 0, 1, 1, 1);

            Label worldLabel = new Label(GUI, PropertiesPanel, SelectedDescriptor.WorldName, GUI.DefaultFont);

            layout.SetComponentPosition(worldLabel, 0, 2, 1, 1);

            Button loadButton = new Button(GUI, layout, "Load", GUI.DefaultFont, Button.ButtonMode.ToolButton, GUI.Skin.GetSpecialFrame(GUISkin.Tile.Save));

            layout.SetComponentPosition(loadButton, 0, 3, 1, 1);

            loadButton.OnClicked += loadButton_OnClicked;

            Button deleteButton = new Button(GUI, layout, "Delete", GUI.DefaultFont, Button.ButtonMode.ToolButton, GUI.Skin.GetSpecialFrame(GUISkin.Tile.Ex));

            layout.SetComponentPosition(deleteButton, 0, 4, 1, 1);

            deleteButton.OnClicked += deleteButton_OnClicked;
        }
Beispiel #2
0
        void InitForms()
        {
            if (frmProperties == null)
            {
                frmProperties = new Form()
                {
                    Text            = "FlexChart Designer",
                    FormBorderStyle = FormBorderStyle.SizableToolWindow,
                    TopMost         = true,
                    MinimumSize     = new Size(300, 300)
                };

                propertiesPanel1 = new PropertiesPanel()
                {
                    Dock = DockStyle.Fill
                };
                propertiesPanel1.LinkClicked += LinkClicked;
                propertiesPanel1.DataSource   = DataSource;
                propertiesPanel1.Chart        = chart;
                frmProperties.FormClosed     += (s, e) =>
                {
                    adorner.HoverElement = adorner.SelectedElement = C1.Chart.ChartElement.None;
                    frmProperties        = null;
                };
                frmProperties.Controls.Add(propertiesPanel1);
            }
        }
Beispiel #3
0
    private void ShowPropertiesPanel(PropertiesPanel panel)
    {
        if (panel == propertiesPanel)
        {
            return;
        }

        if (propertiesPanel == null)
        {
            infoMessage.gameObject.SetActive(false);
        }
        else
        {
            propertiesPanel.gameObject.SetActive(false);
        }

        propertiesPanel            = panel;
        confirmButton.interactable = false;

        if (propertiesPanel == null)
        {
            infoMessage.gameObject.SetActive(true);
        }
        else
        {
            propertiesPanel.gameObject.SetActive(true);
        }
    }
Beispiel #4
0
 private void AfterStyleChanged()
 {
     RefreshSelectedItem();
     PropertiesPanel.StopLayout();
     ClearStyleProperties();
     AddStyleProperties();
     PropertiesPanel.StartLayout();
 }
Beispiel #5
0
        public void DeleteDescriptor(GameLoadDescriptor selectedDescriptor)
        {
            Games.Remove(selectedDescriptor);
            int cols = Math.Max(scroller.LocalBounds.Width / 256, 1);

            CreateGamePictures(scrollGrid, cols);
            PropertiesPanel.ClearChildren();
            System.IO.Directory.Delete(selectedDescriptor.FileName, true);
        }
Beispiel #6
0
        public static void PreUILoad()
        {
            //init panels
            viewportPanel   = new ViewportPanel(false);
            propertiesPanel = new PropertiesPanel(false);
            outputPanel     = new OutputPanel();

            viewportPanel.Init();
            propertiesPanel.Init();
            outputPanel.Init();
        }
        public void DeleteDescriptor(WorldLoadDescriptor selectedDescriptor)
        {
            Worlds.Remove(selectedDescriptor);
            int cols = Math.Max(scroller.LocalBounds.Width / 256, 1);

            CreateWorldPictures(scrollGrid, cols);
            PropertiesPanel.ClearChildren();

            try
            {
                System.IO.Directory.Delete(selectedDescriptor.DirectoryName, true);
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.Message);
            }
        }
        private void LoadDefaultLayout()
        {
            foreach (var content in DockPanelControl.Contents.ToArray())
            {
                content.DockHandler.DockPanel = null;
            }

            try
            {
                var layoutStream = ResourceHelper.GetResourceStream("DefaultLayout.xml");
                if (layoutStream != null)
                {
                    DockPanelControl.LoadFromXml(layoutStream, DockContentLoadingHandler);
                }
                return;
            }
            catch { }

            ViewportPanel.Show(DockPanelControl, DockState.Document);

            StudConnectionPanel.Show(DockPanelControl, DockState.Document);

            ViewportPanel.Activate();

            DockPanelControl.DockLeftPortion = 250;

            NavigationPanel.Show(DockPanelControl, DockState.DockLeft);

            DockPanelControl.DockWindows[DockState.DockBottom].BringToFront();
            DockPanelControl.DockBottomPortion = 250;

            PropertiesPanel.Show(DockPanelControl, DockState.DockBottom);

            DetailPanel.Show(PropertiesPanel.Pane, null);

            ConnectionPanel.Show(PropertiesPanel.Pane, null);

            ValidationPanel.Show(PropertiesPanel.Pane, null);

            InfoPanel.Show(PropertiesPanel.Pane, null);
        }
Beispiel #9
0
        public void LoadContent()
        {
            Debuging.UITesting.AddUI(this);

            Color color = Color.Black;

            color *= 0.25f;

            ConsoleWindow = new ConsoleWindow(new PanelProps {
                Size = new Vector2(0, p_ScreenHeight / 3), EntityAnchor = Anchor.TopLeft, Backgroundtexture = SpritesData.B_BGSprite, OverlayColor = color
            });

            Root.AddChild(ConsoleWindow);

            ConsoleTextWriter = new ConsoleTextWriter();

            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");
            LogHelper.Log(LogTarget.Console, LogLevel.Info, this + ": Initialize");

            drawUtils  = new DrawUtils();
            debugUtils = new DebugUtils();

            p_testform = new PropertiesPanel();

            p_testform.Init();

            p_testform.FormClosed += P_testform_FormClosed;

            p_Cursors[0] = p_ContentManager.Load <Texture2D>("Textures/Cursors/Default_Cursor");
            p_Cursors[1] = p_ContentManager.Load <Texture2D>("Textures/Cursors/Default_S_BL");
            p_Cursors[2] = p_ContentManager.Load <Texture2D>("Textures/Cursors/Default_S_BR");
            p_Cursors[3] = p_ContentManager.Load <Texture2D>("Textures/Cursors/Default_S_Horz");
            p_Cursors[4] = p_ContentManager.Load <Texture2D>("Textures/Cursors/Default_S_Vert");
            p_Cursors[5] = p_ContentManager.Load <Texture2D>("Textures/Cursors/Default_S_Dragging");

            p_CursorTexture = p_Cursors[0];

            p_Cursor = p_Cursors[0];

            p_testform.Hide();
        }
Beispiel #10
0
        public MainForm()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

            if (File.Exists(shaderPath))
            {
                shaderSource = File.ReadAllText(shaderPath);
            }
            else
            {
                MessageBox.Show("Base shader not found.");
            }

            Log.Filename = "log.txt";

            InitializeComponent();

            Text = "Zwerg " + Application.ProductVersion.Substring(0, 5) + " - Distance Field Editor by movAX13h";

            string nl = Environment.NewLine + Environment.NewLine;

            usageLabel.Text = "Use right mouse button context menu of the scene panel to add and remove nodes." + nl
                              + "Click the 'Apply changes' button or press ENTER to update the preview at any time." + nl
                              + "Use the wasd-keys or move your mouse while holding the left button to rotate the camera around the selected object." + nl
                              + "In free fly mode use the wasd-keys to move the camera and left mouse button drag to look around." + nl
                              + "Mouse wheel increases/decreases the distance to the target." + nl
                              + "A mouse click on a distance object in the preview selects the node in the scene view (experimental)." + nl
                              + "Right mouse button controls light direction (rotates around y-axis).";

            propertiesPanel = new PropertiesPanel(propertiesPanelControl);
            editor          = new Editor.Editor(sceneTreeView, propertiesPanel, shaderSource);
            if (!editor.Setup(functionsXmlPath))
            {
                MessageBox.Show(editor.Errors + "\n\nNo nodes available.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            cameraRotationModeBox.SelectedItem = cameraRotationModeBox.Items[0];

            // setup project tree view context menu
            ToolStripMenuItem menuItem;
            ContextMenuStrip  contextMenu = new ContextMenuStrip();

            contextMenu.RenderMode      = ToolStripRenderMode.System;
            contextMenu.ShowImageMargin = false;
            contextMenu.ShowCheckMargin = false;
            contextMenu.ItemClicked    += contextMenu_ItemClicked;
            contextMenu.Opening        += contextMenu_Opening;

            ToolStripMenuItem i = new ToolStripMenuItem();

            i.Text = "Primitives";
            i.DropDownItemClicked += contextMenu_ItemClicked;
            foreach (DistancePrimitive type in editor.DistanceFieldTypes)
            {
                menuItem      = newToolStripMenuItem();
                menuItem.Text = type.Name;
                menuItem.Tag  = type;
                i.DropDownItems.Add(menuItem);
            }
            contextMenu.Items.Add(i);

            i      = new ToolStripMenuItem();
            i.Text = "Operations";
            i.DropDownItemClicked += contextMenu_ItemClicked;
            foreach (DistanceOperation type in editor.DistanceOperations)
            {
                menuItem      = newToolStripMenuItem();
                menuItem.Text = type.Name;
                menuItem.Tag  = type;
                i.DropDownItems.Add(menuItem);
            }
            contextMenu.Items.Add(i);

            i      = new ToolStripMenuItem();
            i.Text = "Domain";
            i.DropDownItemClicked += contextMenu_ItemClicked;
            foreach (DomainOperation type in editor.DomainOperations)
            {
                menuItem      = newToolStripMenuItem();
                menuItem.Text = type.Name;
                menuItem.Tag  = type;
                i.DropDownItems.Add(menuItem);
            }
            contextMenu.Items.Add(i);

            deleteItem      = newToolStripMenuItem();
            deleteItem.Text = "Delete [DEL]";
            deleteItem.Tag  = "delete";
            contextMenu.Items.Add(deleteItem);

            sceneTreeView.ContextMenuStrip = contextMenu;
            resetView();

            keys      = new List <Keys>();
            stopwatch = new Stopwatch();
            assets    = new List <Asset>();
            canvas    = new Canvas(glControl1.Width, glControl1.Height);
        }
Beispiel #11
0
 private void Start()
 {
     main            = FindObjectOfType <Main>();
     propertiesPanel = FindObjectOfType <PropertiesPanel>();
 }