Beispiel #1
0
    public void DrawSocket(Rect rect, int index, bool active, bool focus)
    {
        GUI.Label(VxlGUI.GetLeftColumn(rect, 0, 0.5f), "Socket " + index.ToString(), "LeftListLabel");
        EditorGUI.BeginChangeCheck();
        int socket = EditorGUI.IntField(VxlGUI.GetRightElement(rect, 0, VxlGUI.INTFIELD), _sockets[index]);

        if (EditorGUI.EndChangeCheck())
        {
            if (target == null || !target.IsValid())
            {
                return;
            }
            List <int> socketlist;
            if (_is_edge)
            {
                socketlist = target.GetEdgeSocketList(_invx, _invy, _axilist.index);
            }
            else
            {
                socketlist = target.GetFaceSocketList(_invx, _invy, _axilist.index);
            }
            if (socketlist == null || index < 0 || index >= socketlist.Count)
            {
                return;
            }
            Undo.RecordObject(target, "Updated Socket");
            socketlist[index] = socket;
            _repaint_menu     = true;
            _render_mesh      = true;
            _update_mesh      = true;
            EditorUtility.SetDirty(target);
        }
    }
Beispiel #2
0
    private void DrawPatternElement(Rect rect, int index, bool active, bool focus)
    {
        Rect rect_content = VxlGUI.GetPaddedRect(rect, VxlGUI.MED_PAD);

        float two = rect_content.width / 2f;
        //row 0 - a1 a0
        Rect rect_row = VxlGUI.GetAboveElement(rect_content, 0, VxlGUI.SM_BAR);

        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Above:", GUI.skin.GetStyle("LeftLightHeader"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 1, two / 2f), _patterns[index].a1_p.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 0, two / 2f), _patterns[index].a0_p.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        //row 1 - b1 b0
        rect_row = VxlGUI.GetAboveElement(rect_content, 1, VxlGUI.SM_BAR);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Below:", GUI.skin.GetStyle("LeftLightHeader"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 1, two / 2f), _patterns[index].b1_p.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 0, two / 2f), _patterns[index].b0_p.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        //row 2 - vin vout
        rect_row = VxlGUI.GetAboveElement(rect_content, 2, VxlGUI.SM_BAR);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Voxels:", GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 1, two / 2f), _patterns[index].vin.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 0, two / 2f), _patterns[index].vout.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        //row 3 - flipx flipy
        rect_row = VxlGUI.GetAboveElement(rect_content, 3, VxlGUI.SM_BAR);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two / 2f), "FlipX", GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 1, two / 2f), _patterns[index].xflip.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 2, two / 2f), "FlipY", GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 3, two / 2f), _patterns[index].yflip.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
    }
Beispiel #3
0
    private void DrawPatternElement(Rect rect, int index, bool active, bool focus)
    {
        Rect rect_content = VxlGUI.GetPaddedRect(rect, VxlGUI.MED_PAD);

        float two = rect_content.width / 2f;
        //row 0 - (4) (5) (0)
        Rect rect_row = VxlGUI.GetAboveElement(rect_content, 0, VxlGUI.SM_BAR);

        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Plugs:", GUI.skin.GetStyle("LeftLightHeader"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 2, two / 3f), _patterns[index].c4_p.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 1, two / 3f), _patterns[index].c5_p.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 0, two / 3f), _patterns[index].c0_p.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        //row 1 - (3) (2) (1)
        rect_row = VxlGUI.GetAboveElement(rect_content, 1, VxlGUI.SM_BAR);
        GUI.Label(VxlGUI.GetRightElement(rect_row, 2, two / 3f), _patterns[index].c3_p.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 1, two / 3f), _patterns[index].c2_p.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 0, two / 3f), _patterns[index].c1_p.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        //row 2 - above below
        rect_row = VxlGUI.GetAboveElement(rect_content, 2, VxlGUI.SM_BAR);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Voxels:", GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 1, two / 2f), _patterns[index].vb.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 0, two / 2f), _patterns[index].va.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        //row 3 - flipx flipy
        rect_row = VxlGUI.GetAboveElement(rect_content, 3, VxlGUI.SM_BAR);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two / 2f), "FlipX", GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 1, two / 2f), _patterns[index].xflip.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 2, two / 2f), "FlipY", GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 3, two / 2f), _patterns[index].yflip.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
    }
    private void DrawPlugElement(Rect rect, int index, bool active, bool focus)
    {
        rect = VxlGUI.GetPaddedRect(rect, 1);
        float field_width = Mathf.Min(100f, (rect.width - VxlGUI.SM_SPACE) / 2f);

        //draw left label
        GUI.Label(VxlGUI.GetSandwichedRectX(rect, 0, field_width + VxlGUI.SM_SPACE), _plug_labels[index], GUI.skin.GetStyle("LeftListLabel"));
        //draw right int field
        EditorGUI.BeginChangeCheck();
        int plug = Mathf.Max(EditorGUI.IntField(VxlGUI.GetRightElement(rect, 0, field_width), _plugs[index], GUI.skin.GetStyle("DarkNumberField")), -1);

        if ((EditorGUI.EndChangeCheck() || _plugs[index] != plug))
        {
            if (target == null || plugs == null || plugs.Count != _plug_cnt)
            {
                return;
            }
            Undo.RecordObject(target, "Modify Plugs");
            plugs[index]  = plug;
            _update_mesh  = true;
            _render_mesh  = true;
            _repaint_menu = true;
            //dirty target object
            EditorUtility.SetDirty(target);
        }
    }
Beispiel #5
0
    private void DrawPatternElement(Rect rect, int index, bool active, bool focus)
    {
        Rect  rect_content = VxlGUI.GetPaddedRect(rect, VxlGUI.MED_PAD);
        Rect  rect_row     = VxlGUI.GetAboveElement(rect_content, 0, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);
        float two          = rect_row.width / 2f;

        //plugs row
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Plugs:", GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 1, two / 2f), _patterns[index].p0.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 0, two / 2f), _patterns[index].p1.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        //above voxels
        rect_row = VxlGUI.GetAboveElement(rect_content, 1, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Above:", GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 1, two / 2f), _patterns[index].a0.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 0, two / 2f), _patterns[index].a1.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        //below voxels
        rect_row = VxlGUI.GetAboveElement(rect_content, 2, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Below:", GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 1, two / 2f), _patterns[index].b0.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetRightElement(rect_row, 0, two / 2f), _patterns[index].b1.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        //flips
        rect_row = VxlGUI.GetAboveElement(rect_content, 3, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two / 2f), "FlipX", GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 1, two / 2f), _patterns[index].xflip.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 2, two / 2f), "FlipY", GUI.skin.GetStyle("LeftDarkLabel"));
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 3, two / 2f), _patterns[index].yflip.ToString(), GUI.skin.GetStyle("LeftDarkLabel"));
    }
Beispiel #6
0
    public override void DrawGUI(Rect rect)
    {
        //update lists
        UpdateVertexList();
        //update important layout elements
        UpdateRects(rect);
        //disable panel check
        EditorGUI.BeginDisabledGroup(target == null);
        //draw vertex build title
        VxlGUI.DrawRect(_rect_vertex_title, "DarkGradient");
        GUI.Label(_rect_vertex_title, "Vertex Builds", GUI.skin.GetStyle("LeftLightHeader"));
        //draw vertex build list
        VxlGUI.DrawRect(_rect_vertex_scrollview, "DarkWhite");
        _vertex_scroll = GUI.BeginScrollView(_rect_vertex_scrollview, _vertex_scroll, _rect_vertex_content);
        _vertexlist.DoList(_rect_vertex_content);
        GUI.EndScrollView();
        //draw vertex build button panel
        float button_width = Mathf.Min(60f, _rect_vertex_panel.width / 2f);

        VxlGUI.DrawRect(_rect_vertex_panel, "DarkGradient");
        //draw vertex add button
        if (GUI.Button(VxlGUI.GetRightElement(_rect_vertex_panel, 0, button_width), "Add", GUI.skin.GetStyle("LightButton")))
        {
            AddVertexElement();
        }
        //disable operation check
        EditorGUI.BeginDisabledGroup((_vertices.Count <= 0) || (selectlist.Count <= 0));
        //draw vertex delete button
        if (GUI.Button(VxlGUI.GetLeftElement(_rect_vertex_panel, 0, button_width), "Delete", GUI.skin.GetStyle("LightButton")))
        {
            DeleteSelectedVertex();
        }
        EditorGUI.EndDisabledGroup();

        //draw import panel
        VxlGUI.DrawRect(_rect_import, "DarkWhite");
        Rect importpad_rect = VxlGUI.GetPaddedRect(_rect_import, VxlGUI.MED_PAD);
        Rect importrow_rect = VxlGUI.GetAboveElement(importpad_rect, 0, VxlGUI.MED_BAR);

        GUI.Label(importrow_rect, "Import Obj Vertex and Triangles", GUI.skin.GetStyle("LeftLrgDarkLabel"));
        importrow_rect = VxlGUI.GetAboveElement(importpad_rect, 1, VxlGUI.MED_BAR);

        float import_width = Mathf.Min(100f, (importrow_rect.width - VxlGUI.SM_SPACE) / 2f);

        _importmesh = (Mesh)EditorGUI.ObjectField(
            VxlGUI.GetSandwichedRectX(importrow_rect, 0, import_width + VxlGUI.SM_SPACE),
            _importmesh,
            typeof(Mesh),
            false
            );
        EditorGUI.BeginDisabledGroup(_importmesh == null);
        if (GUI.Button(VxlGUI.GetRightElement(importrow_rect, 0, import_width), "Import", GUI.skin.GetStyle("DarkButton")))
        {
            ImportVertexAndTriangle();
        }
        EditorGUI.EndDisabledGroup();
        EditorGUI.EndDisabledGroup();
    }
Beispiel #7
0
    private void UpdateLayoutRects()
    {
        Rect window_rect = new Rect(Vector2.zero, position.size);

        _rect_mode = VxlGUI.GetAboveElement(window_rect, 0, VxlGUI.MODE);
        Rect  content_rect = VxlGUI.GetSandwichedRectY(window_rect, VxlGUI.MODE, 0);
        float pixels       = Mathf.Clamp(0.5f * content_rect.width, VxlGUI.MINWIDTH_WINDOW, VxlGUI.MAXWIDTH_WINDOW);

        _rect_menucontent = VxlGUI.GetLeftElement(content_rect, 0, pixels);
        _rect_preview     = VxlGUI.GetRightElement(content_rect, 0, content_rect.width - pixels);
    }
Beispiel #8
0
    public override void DrawGUI(Rect rect)
    {
        //update and populate lists
        UpdateLists();
        //update layout rects
        UpdateLayoutRect(rect);
        //draw header
        VxlGUI.DrawRect(_rect_header, "DarkGradient");
        GUI.Label(_rect_header, _title, GUI.skin.GetStyle("LeftLightHeader"));
        //GUID
        VxlGUI.DrawRect(_rect_guidscroll, "DarkWhite");
        _guidscroll = GUI.BeginScrollView(_rect_guidscroll, _guidscroll, _rect_guidcontent);
        _guidlist.DoList(_rect_guidcontent);
        GUI.EndScrollView();
        //transfer panel
        bool disable_guid = _guidlist.index < 0 || _guidlist.index >= _guidlist.count;
        bool disable_lib  = _libobjlist.index < 0 || _libobjlist.index >= _libobjlist.count;

        VxlGUI.DrawRect(_rect_panel, "DarkGradient");
        float boundwidth = Mathf.Min(60f, _rect_panel.width / 3f);
        //down button
        Rect rect_button = VxlGUI.GetMiddleX(VxlGUI.GetLeftElement(_rect_panel, 0, boundwidth), _rect_panel.height);

        EditorGUI.BeginDisabledGroup(disable_guid);
        if (GUI.Button(rect_button, "", GUI.skin.GetStyle("ArrowDown")))
        {
            AddSelected();
        }
        EditorGUI.EndDisabledGroup();
        //up button
        rect_button = VxlGUI.GetMiddleX(VxlGUI.GetMiddleX(_rect_panel, boundwidth), _rect_panel.height);
        EditorGUI.BeginDisabledGroup(disable_lib);
        if (GUI.Button(rect_button, "", GUI.skin.GetStyle("ArrowUp")))
        {
            RemoveSelected();
        }
        EditorGUI.EndDisabledGroup();
        //swap button
        rect_button = VxlGUI.GetMiddleX(VxlGUI.GetRightElement(_rect_panel, 0, boundwidth), _rect_panel.height);
        EditorGUI.BeginDisabledGroup(disable_guid || disable_lib);
        if (GUI.Button(rect_button, "", GUI.skin.GetStyle("ArrowSwap")))
        {
            SwapSelected();
        }
        EditorGUI.EndDisabledGroup();
        //library
        VxlGUI.DrawRect(_rect_libscroll, "DarkWhite");
        _libscroll = GUI.BeginScrollView(_rect_libscroll, _libscroll, _rect_libcontent);
        _libobjlist.DoList(_rect_libcontent);
        GUI.EndScrollView();
    }
    private void UpdateLayoutRects(Rect rect)
    {
        Rect  rect_left       = VxlGUI.GetLeftColumn(rect, VxlGUI.MED_SPACE, 0.5f);
        float template_height = (2 * VxlGUI.SM_PAD) + (6 * VxlGUI.MED_BAR) + (5 * VxlGUI.MED_SPACE) + (3 * VxlGUI.LRG_SPACE);

        _rect_selectheader   = VxlGUI.GetAboveElement(rect_left, 0, VxlGUI.MED_BAR);
        _rect_selectscroll   = VxlGUI.GetSandwichedRectY(rect_left, VxlGUI.MED_BAR + VxlGUI.SM_SPACE, VxlGUI.SM_SPACE + template_height);
        _rect_select_content = VxlGUI.GetScrollViewRect(_cornerlist, _rect_selectscroll.width, _rect_selectscroll.height);

        Rect rect_right = VxlGUI.GetRightColumn(rect, VxlGUI.MED_SPACE, 0.5f);

        _rect_patheader  = VxlGUI.GetAboveElement(rect_right, 0, VxlGUI.MED_BAR);
        _rect_patscroll  = VxlGUI.GetSandwichedRectY(rect_right, VxlGUI.MED_BAR + VxlGUI.SM_SPACE, VxlGUI.SM_SPACE + VxlGUI.MED_BAR);
        _rect_patcontent = VxlGUI.GetScrollViewRect(_patternlist, _rect_patscroll.width, _rect_patscroll.height);
        _rect_patpanel   = VxlGUI.GetBelowElement(rect_right, 0, VxlGUI.MED_BAR);



        _rect_temparea = VxlGUI.GetBelowElement(rect_left, 0, template_height);
        Rect rect_content = VxlGUI.GetPaddedRect(_rect_temparea, VxlGUI.SM_PAD, VxlGUI.MED_PAD);

        _rect_tempheader = VxlGUI.GetAboveElement(rect_content, 0, VxlGUI.MED_BAR, VxlGUI.MED_SPACE, 0);
        Rect rect_row = VxlGUI.GetAboveElement(rect_content, 1, VxlGUI.MED_BAR, VxlGUI.MED_SPACE, VxlGUI.LRG_SPACE);

        _rect_voxelid  = VxlGUI.GetSandwichedRectX(rect_row, 0, (3 * VxlGUI.INTFIELD) + (2 * VxlGUI.SM_SPACE) + VxlGUI.MED_SPACE);
        _rect_d5       = VxlGUI.GetRightElement(rect_row, 2, VxlGUI.INTFIELD, VxlGUI.SM_SPACE, 0);
        _rect_d1       = VxlGUI.GetRightElement(rect_row, 1, VxlGUI.INTFIELD, VxlGUI.SM_SPACE, 0);
        _rect_d3       = VxlGUI.GetRightElement(rect_row, 0, VxlGUI.INTFIELD, VxlGUI.SM_SPACE, 0);
        rect_row       = VxlGUI.GetAboveElement(rect_content, 2, VxlGUI.MED_BAR, VxlGUI.MED_SPACE, VxlGUI.LRG_SPACE);
        _rect_above    = VxlGUI.GetSandwichedRectX(rect_row, 0, (3 * VxlGUI.INTFIELD) + (2 * VxlGUI.SM_SPACE) + VxlGUI.MED_SPACE);
        _rect_above_d5 = VxlGUI.GetRightElement(rect_row, 2, VxlGUI.INTFIELD, VxlGUI.SM_SPACE, 0);
        _rect_above_d1 = VxlGUI.GetRightElement(rect_row, 1, VxlGUI.INTFIELD, VxlGUI.SM_SPACE, 0);
        _rect_above_d3 = VxlGUI.GetRightElement(rect_row, 0, VxlGUI.INTFIELD, VxlGUI.SM_SPACE, 0);
        rect_row       = VxlGUI.GetAboveElement(rect_content, 3, VxlGUI.MED_BAR, VxlGUI.MED_SPACE, VxlGUI.LRG_SPACE);
        _rect_below    = VxlGUI.GetSandwichedRectX(rect_row, 0, (3 * VxlGUI.INTFIELD) + (2 * VxlGUI.SM_SPACE) + VxlGUI.MED_SPACE);
        _rect_below_d5 = VxlGUI.GetRightElement(rect_row, 2, VxlGUI.INTFIELD, VxlGUI.SM_SPACE, 0);
        _rect_below_d1 = VxlGUI.GetRightElement(rect_row, 1, VxlGUI.INTFIELD, VxlGUI.SM_SPACE, 0);
        _rect_below_d3 = VxlGUI.GetRightElement(rect_row, 0, VxlGUI.INTFIELD, VxlGUI.SM_SPACE, 0);
        rect_row       = VxlGUI.GetAboveElement(rect_content, 4, VxlGUI.MED_BAR, VxlGUI.MED_SPACE, 2 * VxlGUI.LRG_SPACE);
        float quarter = rect_row.width / 4f;

        _rect_flipx      = VxlGUI.GetSandwichedRectX(VxlGUI.GetLeftColumn(rect_row, 0, 0.5f), quarter - 20, 0);
        _rect_flipy      = VxlGUI.GetSandwichedRectX(VxlGUI.GetRightColumn(rect_row, 0, 0.5f), quarter - 20, 0);
        rect_row         = VxlGUI.GetAboveElement(rect_content, 5, VxlGUI.MED_BAR, VxlGUI.MED_SPACE, 3 * VxlGUI.LRG_SPACE);
        _rect_tempbutton = VxlGUI.GetRightElement(rect_row, 0, 80);
    }
Beispiel #10
0
    public override void DrawGUI(Rect rect)
    {
        RefreshOptionLabels();
        UpdateTriangleList();
        UpdateRects(rect);
        EditorGUI.BeginDisabledGroup(target == null);
        //draw title
        VxlGUI.DrawRect(_rect_title, "DarkGradient");
        GUI.Label(_rect_title, "Triangles", GUI.skin.GetStyle("LeftLightHeader"));
        //draw triangle list
        VxlGUI.DrawRect(_rect_tri_scroll, "DarkWhite");
        _scroll = GUI.BeginScrollView(_rect_tri_scroll, _scroll, _rect_tri_content);
        _trianglelist.DoList(_rect_tri_content);
        GUI.EndScrollView();
        //draw button panel
        VxlGUI.DrawRect(_rect_panel, "DarkGradient");
        float button_width = Mathf.Min(60, _rect_panel.width / 4f);

        //draw add button
        if (GUI.Button(VxlGUI.GetRightElement(_rect_panel, 0, button_width), "Add", GUI.skin.GetStyle("LightButton")))
        {
            AddTriangle();
        }
        //draw add triangle button
        EditorGUI.BeginDisabledGroup(_preview.secondaryCount != 3);
        if (GUI.Button(VxlGUI.GetRightElement(_rect_panel, 1, button_width), "S Add", GUI.skin.GetStyle("LightButton")))
        {
            AddSecondaryTriangle();
        }
        EditorGUI.EndDisabledGroup();
        //draw flip button
        EditorGUI.BeginDisabledGroup((_triangles.Count <= 0) || (selectlist.Count <= 0));
        if (GUI.Button(VxlGUI.GetRightElement(_rect_panel, 2, button_width), "Flip", GUI.skin.GetStyle("LightButton")))
        {
            FlipSelectedTriangles();
        }
        //draw delete button
        if (GUI.Button(VxlGUI.GetLeftElement(_rect_panel, 0, button_width), "Delete", GUI.skin.GetStyle("LightButton")))
        {
            DeleteSelectedTriangles();
        }
        EditorGUI.EndDisabledGroup();
        EditorGUI.EndDisabledGroup();
    }
Beispiel #11
0
    private void DrawAddPatternPanel()
    {
        EditorGUI.BeginChangeCheck();
        VxlGUI.DrawRect(_rect_pattemplateheader, "DarkGradient");
        GUI.Label(_rect_pattemplateheader, "Add Rect Pattern", GUI.skin.GetStyle("LeftLightHeader"));
        VxlGUI.DrawRect(_rect_pattemplate, "DarkWhite");
        Rect rect_content = VxlGUI.GetPaddedRect(_rect_pattemplate, VxlGUI.MED_PAD);

        float two = rect_content.width / 2f;
        //row 0 - a1 a0
        Rect rect_row = VxlGUI.GetAboveElement(rect_content, 0, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);

        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Above:", GUI.skin.GetStyle("LeftLightHeader"));
        int c4 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 2, Mathf.Min(two / 3f, 40)), _addpat.c4_p);
        int c5 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 1, Mathf.Min(two / 3f, 40)), _addpat.c5_p);
        int c0 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 0, Mathf.Min(two / 3f, 40)), _addpat.c0_p);

        //row 1 - b1 b0
        rect_row = VxlGUI.GetAboveElement(rect_content, 1, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Below:", GUI.skin.GetStyle("LeftLightHeader"));
        int c3 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 2, Mathf.Min(two / 3f, 40)), _addpat.c3_p);
        int c2 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 1, Mathf.Min(two / 3f, 40)), _addpat.c2_p);
        int c1 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 0, Mathf.Min(two / 3f, 40)), _addpat.c1_p);

        //row 2 - vin vout
        rect_row = VxlGUI.GetAboveElement(rect_content, 2, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Voxels:", GUI.skin.GetStyle("LeftLightHeader"));
        int vb = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 1, Mathf.Min(two / 2f, 40)), _addpat.vb);
        int va = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 0, Mathf.Min(two / 2f, 40)), _addpat.va);

        //row 3 - flipx flipy
        rect_row = VxlGUI.GetAboveElement(rect_content, 3, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);
        bool flipx = EditorGUI.Foldout(VxlGUI.GetLeftElement(rect_row, 0, two), _addpat.xflip, "FlipX", true, GUI.skin.GetStyle("LightFoldout"));
        bool flipy = EditorGUI.Foldout(VxlGUI.GetLeftElement(rect_row, 1, two), _addpat.yflip, "FlipY", true, GUI.skin.GetStyle("LightFoldout"));

        //apply change
        if (EditorGUI.EndChangeCheck())
        {
            _addpat       = new HexagonPattern(flipx, flipy, c0, c1, c2, c3, c4, c5, va, vb);
            _repaint_menu = false;
        }
    }
Beispiel #12
0
    private void DrawAddPatternPanel()
    {
        EditorGUI.BeginChangeCheck();
        VxlGUI.DrawRect(_rect_pattemplateheader, "DarkGradient");
        GUI.Label(_rect_pattemplateheader, "Add Rect Pattern", GUI.skin.GetStyle("LeftLightHeader"));
        VxlGUI.DrawRect(_rect_pattemplate, "DarkWhite");
        Rect rect_content = VxlGUI.GetPaddedRect(_rect_pattemplate, VxlGUI.MED_PAD);

        float two = rect_content.width / 2f;
        //row 0 - a1 a0
        Rect rect_row = VxlGUI.GetAboveElement(rect_content, 0, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);

        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Above:", GUI.skin.GetStyle("LeftLightHeader"));
        int a1 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 1, Mathf.Min(two / 2f, 40)), _addpat.a1_p);
        int a0 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 0, Mathf.Min(two / 2f, 40)), _addpat.a0_p);

        //row 1 - b1 b0
        rect_row = VxlGUI.GetAboveElement(rect_content, 1, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Below:", GUI.skin.GetStyle("LeftLightHeader"));
        int b1 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 1, Mathf.Min(two / 2f, 40)), _addpat.b1_p);
        int b0 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 0, Mathf.Min(two / 2f, 40)), _addpat.b0_p);

        //row 2 - vin vout
        rect_row = VxlGUI.GetAboveElement(rect_content, 2, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Voxels:", GUI.skin.GetStyle("LeftLightHeader"));
        int vin  = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 1, Mathf.Min(two / 2f, 40)), _addpat.vin);
        int vout = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 0, Mathf.Min(two / 2f, 40)), _addpat.vout);

        //row 3 - flipx flipy
        rect_row = VxlGUI.GetAboveElement(rect_content, 3, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);
        bool flipx = EditorGUI.Foldout(VxlGUI.GetLeftElement(rect_row, 0, two), _addpat.xflip, "FlipX", true, GUI.skin.GetStyle("LightFoldout"));
        bool flipy = EditorGUI.Foldout(VxlGUI.GetLeftElement(rect_row, 1, two), _addpat.yflip, "FlipY", true, GUI.skin.GetStyle("LightFoldout"));

        //apply change
        if (EditorGUI.EndChangeCheck())
        {
            _addpat       = new RectPattern(flipx, flipy, a0, b0, a1, b1, vin, vout);
            _repaint_menu = false;
        }
    }
Beispiel #13
0
    private void UpdateRects(Rect rect)
    {
        Rect rect_col = VxlGUI.GetLeftColumn(rect, VxlGUI.SM_SPACE, 0.5f);

        //calculate axi rects
        _rect_axititle   = VxlGUI.GetAboveElement(rect_col, 0, VxlGUI.MED_BAR);
        _rect_axiscroll  = VxlGUI.GetSandwichedRectY(rect_col, VxlGUI.MED_BAR + VxlGUI.SM_SPACE, 0);
        _rect_axicontent = VxlGUI.GetScrollViewRect(_axilist, _rect_axiscroll.width, _rect_axiscroll.height);

        rect_col = VxlGUI.GetRightColumn(rect, VxlGUI.SM_SPACE, 0.5f);
        //calculate socket rects
        _rect_sockethead        = VxlGUI.GetAboveElement(rect_col, 0, (2 * VxlGUI.MED_BAR) + VxlGUI.MED_SPACE);
        _rect_sockettitle       = VxlGUI.GetAboveElement(_rect_sockethead, 0, VxlGUI.MED_BAR);
        _rect_invx              = VxlGUI.GetBelowLeftElement(_rect_sockethead, 0, _rect_sockethead.width / 2f, 0, VxlGUI.MED_BAR);
        _rect_invy              = VxlGUI.GetBelowRightElement(_rect_sockethead, 0, _rect_sockethead.width / 2f, 0, VxlGUI.MED_BAR);
        _rect_socketscroll      = VxlGUI.GetSandwichedRectY(rect_col, _rect_sockethead.height + VxlGUI.SM_SPACE, VxlGUI.MED_BAR + VxlGUI.SM_SPACE);
        _rect_socketcontent     = VxlGUI.GetScrollViewRect(_socketlist, _rect_socketscroll.width, _rect_socketscroll.height);
        _rect_socketbuttonpanel = VxlGUI.GetBelowElement(rect_col, 0, VxlGUI.MED_BAR);
        float button_width = Mathf.Min(60, _rect_socketbuttonpanel.width / 3f);

        _rect_addsocket       = VxlGUI.GetRightElement(_rect_socketbuttonpanel, 0, button_width);
        _rect_delsocket       = VxlGUI.GetLeftElement(_rect_socketbuttonpanel, 0, button_width);
        _rect_secondaddsocket = VxlGUI.GetRightElement(_rect_socketbuttonpanel, 1, button_width);
    }
    public override void DrawGUI(Rect rect)
    {
        UpdateRects(rect);

        //rename - do later
        EditorGUI.BeginDisabledGroup(selected == null);
        VxlGUI.DrawRect(_rect_rename, "LightBlack");
        EditorGUI.BeginChangeCheck();
        GUI.Label(VxlGUI.GetLeftColumn(_rect_rename, 0, 0.5f), "Rename:", GUI.skin.GetStyle("RightLightLabel"));
        string name = "";

        if (selected != null)
        {
            name = selected.objname;
        }
        name = EditorGUI.DelayedTextField(
            VxlGUI.GetPaddedRect(VxlGUI.GetRightColumn(_rect_rename, 0, 0.5f), VxlGUI.SM_PAD),
            name,
            GUI.skin.GetStyle("RightLightText")
            );
        if (EditorGUI.EndChangeCheck())
        {
            if (RenameSelectedUnsaved(name) || RenameSelectedAsset(name))
            {
                if (!_unsaved_selected)
                {
                    SetSelectedFromGUIDList();
                }
                RefreshAssets();
            }
        }
        EditorGUI.EndDisabledGroup();

        //guid list
        VxlGUI.DrawRect(_rect_guidheader, "DarkGradient");
        VxlGUI.DrawRect(_rect_guidfooter, "DarkGradient");
        VxlGUI.DrawRect(_rect_guidscroll, "DarkWhite");
        GUI.Label(_rect_guidheader, "Project Assets", GUI.skin.GetStyle("LeftLightHeader"));
        _scroll_guid = GUI.BeginScrollView(_rect_guidscroll, _scroll_guid, _rect_guidcontent);
        _guidlist.DoList(_rect_guidcontent);
        GUI.EndScrollView();
        float width = Mathf.Min(60f, _rect_guidfooter.width);

        if (GUI.Button(VxlGUI.GetRightElement(_rect_guidfooter, 0, width), "Refresh", GUI.skin.GetStyle("LightButton")))
        {
            RefreshAssets();
        }

        //unsaved list
        VxlGUI.DrawRect(_rect_unsavedheader, "DarkGradient");
        VxlGUI.DrawRect(_rect_unsavedfooter, "DarkGradient");
        VxlGUI.DrawRect(_rect_unsavedscroll, "DarkWhite");
        GUI.Label(_rect_unsavedheader, "Unsaved Objects", GUI.skin.GetStyle("LeftLightHeader"));
        _scroll_unsaved = GUI.BeginScrollView(_rect_unsavedscroll, _scroll_unsaved, _rect_unsavedcontent);
        if (_unsavedlist != null)
        {
            _unsavedlist.DoList(_rect_unsavedcontent);
        }
        GUI.EndScrollView();
        width = Mathf.Min(60f, _rect_unsavedfooter.width / 3f);
        if (GUI.Button(VxlGUI.GetRightElement(_rect_unsavedfooter, 0, width), "Add", GUI.skin.GetStyle("LightButton")))
        {
            AddUnsaved();
        }
        EditorGUI.BeginDisabledGroup(!_unsaved_selected || _index < 0 || _index >= _unsaveds.Count);
        if (GUI.Button(VxlGUI.GetRightElement(_rect_unsavedfooter, 1, width), "Save", GUI.skin.GetStyle("LightButton")))
        {
            SaveAsset();
            RefreshAssets();
            SetSelectedFromGUIDList();
        }
        if (GUI.Button(VxlGUI.GetLeftElement(_rect_unsavedfooter, 0, width), "Delete", GUI.skin.GetStyle("LightButton")))
        {
            DeleteUnsaved();
        }
        EditorGUI.EndDisabledGroup();
    }
Beispiel #15
0
    public override void DrawGUI(Rect rect)
    {
        //update both visual lists
        UpdateEdgeList();
        UpdatePatternList();
        //update layout rects
        UpdateLayoutRects(rect);

        //draw key selection header
        VxlGUI.DrawRect(_rect_selectheader, "DarkGradient");
        GUI.Label(_rect_selectheader, _title, GUI.skin.GetStyle("LeftLightHeader"));
        //draw key selection list
        VxlGUI.DrawRect(_rect_selectscroll, "DarkWhite");
        _selectscroll = GUI.BeginScrollView(_rect_selectscroll, _selectscroll, _rect_select_content);
        _edgelist.DoList(_rect_select_content);
        GUI.EndScrollView();
        //draw add pattern template
        VxlGUI.DrawRect(_rect_pattemplateheader, "DarkGradient");
        GUI.Label(_rect_pattemplateheader, "Add Lateral Edge", GUI.skin.GetStyle("LeftLightHeader"));
        VxlGUI.DrawRect(_rect_pattemplate, "DarkWhite");
        Rect rect_content = VxlGUI.GetPaddedRect(_rect_pattemplate, VxlGUI.MED_PAD);

        EditorGUI.BeginChangeCheck();
        Rect rect_row = VxlGUI.GetAboveElement(rect_content, 0, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);

        float two = rect_row.width / 2f;

        //plugs row
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Plugs:", GUI.skin.GetStyle("LeftLrgDarkLabel"));
        int p0 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 1, Mathf.Min(two / 2f, 40)), _addpat.p0);
        int p1 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 0, Mathf.Min(two / 2f, 40)), _addpat.p1);

        //above voxels
        rect_row = VxlGUI.GetAboveElement(rect_content, 1, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Above:", GUI.skin.GetStyle("LeftLrgDarkLabel"));
        int a0 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 1, Mathf.Min(two / 2f, 40)), _addpat.a0);
        int a1 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 0, Mathf.Min(two / 2f, 40)), _addpat.a1);

        //below voxels
        rect_row = VxlGUI.GetAboveElement(rect_content, 2, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);
        GUI.Label(VxlGUI.GetLeftElement(rect_row, 0, two), "Below:", GUI.skin.GetStyle("LeftLrgDarkLabel"));
        int b0 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 1, Mathf.Min(two / 2f, 40)), _addpat.b0);
        int b1 = EditorGUI.IntField(VxlGUI.GetRightElement(rect_row, 0, Mathf.Min(two / 2f, 40)), _addpat.b1);

        //flips
        rect_row = VxlGUI.GetAboveElement(rect_content, 3, VxlGUI.MED_BAR, VxlGUI.SM_SPACE, 0);
        bool flipx = EditorGUI.Foldout(VxlGUI.GetLeftElement(rect_row, 0, two), _addpat.xflip, "FlipX", true, GUI.skin.GetStyle("LightFoldout"));
        bool flipy = EditorGUI.Foldout(VxlGUI.GetLeftElement(rect_row, 1, two), _addpat.yflip, "FlipY", true, GUI.skin.GetStyle("LightFoldout"));

        //apply change
        if (EditorGUI.EndChangeCheck())
        {
            _addpat       = new LateralPattern(flipx, flipy, p0, p1, a0, b0, a1, b1);
            _repaint_menu = false;
        }
        //draw pattern header
        VxlGUI.DrawRect(_rect_patheader, "DarkGradient");
        GUI.Label(_rect_patheader, "Patterns", GUI.skin.GetStyle("LeftLightHeader"));
        //draw pattern list
        VxlGUI.DrawRect(_rect_patscroll, "DarkWhite");
        _patscroll = GUI.BeginScrollView(_rect_patscroll, _patscroll, _rect_patcontent);
        _patternlist.DoList(_rect_patcontent);
        GUI.EndScrollView();
        //draw pattern panel
        VxlGUI.DrawRect(_rect_patpanel, "DarkGradient");
        float button_width = Mathf.Min(60f, _rect_patpanel.width / 2f);

        bool invalid_addpat    = !_addpat.IsValid() || _addpat.IsEmpty();
        bool invalid_edgeindex = _edgelist.count <= 0 || _edgelist.index < 0 || _edgelist.index >= _edgelist.count;
        bool invalid_exists    = target != null && target.LateralPatternExists(_addpat);

        EditorGUI.BeginDisabledGroup(target == null || invalid_addpat || invalid_edgeindex || invalid_exists);
        if (GUI.Button(VxlGUI.GetRightElement(_rect_patpanel, 0, button_width), "Add", GUI.skin.GetStyle("LightButton")))
        {
            if (target != null)
            {
                Undo.RecordObject(target, "Add Lateral Pattern");
                target.AddLateralPattern(_edges[_edgelist.index], _addpat);
                _repaint_menu = false;
                //dirty target
                EditorUtility.SetDirty(target);
                //update pattern list
                UpdatePatternList();
            }
        }
        EditorGUI.EndDisabledGroup();

        bool invalid_patternindex = _patternlist.count <= 0 || _patternlist.index < 0 || _patternlist.index >= _patternlist.count;

        EditorGUI.BeginDisabledGroup(target == null || invalid_edgeindex || invalid_patternindex);
        if (GUI.Button(VxlGUI.GetLeftElement(_rect_patpanel, 0, button_width), "Delete", GUI.skin.GetStyle("LightButton")))
        {
            if (target != null)
            {
                Undo.RecordObject(target, "Delete Lateral Pattern");
                target.DeleteLateralPattern(_edges[_edgelist.index], _patterns[_patternlist.index]);
                _repaint_menu = false;
                //dirty target
                EditorUtility.SetDirty(target);
                //update pattern list
                UpdatePatternList();
            }
        }
        EditorGUI.EndDisabledGroup();
    }
Beispiel #16
0
    public override void DrawGUI(Rect rect)
    {
        //update both visual lists
        UpdateFaceList();
        UpdatePatternList();
        //update layout rects
        UpdateLayoutRects(rect);

        //draw key selection header
        VxlGUI.DrawRect(_rect_selectheader, "DarkGradient");
        GUI.Label(_rect_selectheader, _title, GUI.skin.GetStyle("LeftLightHeader"));
        //draw key selection list
        VxlGUI.DrawRect(_rect_selectscroll, "DarkWhite");
        _selectscroll = GUI.BeginScrollView(_rect_selectscroll, _selectscroll, _rect_select_content);
        _facelist.DoList(_rect_select_content);
        GUI.EndScrollView();
        //draw add pattern template
        DrawAddPatternPanel();

        //draw pattern header
        VxlGUI.DrawRect(_rect_patheader, "DarkGradient");
        GUI.Label(_rect_patheader, "Patterns", GUI.skin.GetStyle("LeftLightHeader"));
        //draw pattern list
        VxlGUI.DrawRect(_rect_patscroll, "DarkWhite");
        _patscroll = GUI.BeginScrollView(_rect_patscroll, _patscroll, _rect_patcontent);
        _patternlist.DoList(_rect_patcontent);
        GUI.EndScrollView();
        //draw pattern panel
        VxlGUI.DrawRect(_rect_patpanel, "DarkGradient");
        float button_width = Mathf.Min(60f, _rect_patpanel.width / 2f);

        bool invalid_addpat    = _addpat.IsEmpty() || !_addpat.IsValid();
        bool invalid_faceindex = _facelist.count <= 0 || _facelist.index < 0 || _facelist.index >= _facelist.count;
        bool invalid_exists    = target == null || target.HexagonPatternExists(_addpat);

        EditorGUI.BeginDisabledGroup(target == null || invalid_addpat || invalid_faceindex || invalid_exists);
        if (GUI.Button(VxlGUI.GetRightElement(_rect_patpanel, 0, button_width), "Add", GUI.skin.GetStyle("LightButton")))
        {
            if (target != null)
            {
                Undo.RecordObject(target, "Add Hexagon Pattern");
                target.AddHexagonPattern(_faces[_facelist.index], _addpat);
                _repaint_menu = false;
                //set target dirty
                EditorUtility.SetDirty(target);
                //update pattern list
                UpdatePatternList();
            }
        }
        EditorGUI.EndDisabledGroup();

        bool invalid_patindex = _patternlist.count <= 0 || _patternlist.index < 0 || _patternlist.index >= _patternlist.count;

        EditorGUI.BeginDisabledGroup(target == null || invalid_faceindex || invalid_patindex);
        if (GUI.Button(VxlGUI.GetLeftElement(_rect_patpanel, 0, button_width), "Delete", GUI.skin.GetStyle("LightButton")))
        {
            if (target != null)
            {
                Undo.RecordObject(target, "Delete Hexagon Pattern");
                target.DeleteHexagonPattern(_faces[_facelist.index], _patterns[_patternlist.index]);
                _repaint_menu = false;
                //set target dirty
                EditorUtility.SetDirty(target);
                //update pattern list
                UpdatePatternList();
            }
        }
        EditorGUI.EndDisabledGroup();
    }
Beispiel #17
0
    private TriIndex DrawTriangleEditElement(Rect rect, TriIndexType type, ushort vertexcode)
    {
        rect = VxlGUI.GetRightColumn(rect, 0, 0.95f);
        float element_factor = 0.6f;
        float segment_width  = (rect.width - (2 * VxlGUI.SM_SPACE)) / 3;
        float unit_width     = (rect.width - (5 * VxlGUI.SM_SPACE)) / 6f;
        //Type Options
        Rect segrect = VxlGUI.GetRightElement(rect, 2, segment_width, VxlGUI.SM_SPACE, 0);

        EditorGUI.LabelField(
            VxlGUI.GetLeftColumn(segrect, 0, 1 - element_factor),
            "Type:",
            GUI.skin.GetStyle("RightDarkText")
            );
        int type_index = EditorGUI.Popup(
            VxlGUI.GetRightColumn(segrect, 0, element_factor),
            OptionIndex(type),
            _optionstrs,
            GUI.skin.GetStyle("DarkDropdown")
            );

        if (type_index >= 0 && type_index < _options.Length)
        {
            type = _options[type_index];
        }
        if (type == TriIndexType.CornerPlug || type == TriIndexType.EdgePlug)
        {
            //Axis Options
            segrect = VxlGUI.GetRightElement(rect, 1, segment_width, VxlGUI.SM_SPACE, 0);
            EditorGUI.LabelField(
                VxlGUI.GetLeftColumn(segrect, 0, 1 - element_factor),
                "Axis:",
                GUI.skin.GetStyle("RightDarkText")
                );
            string[] labels;
            if (type == TriIndexType.CornerPlug)
            {
                labels = _cornerplug_labels;
            }
            else
            {
                labels = _edgeplug_labels;
            }
            int axis_index = EditorGUI.Popup(
                VxlGUI.GetRightColumn(segrect, 0, element_factor),
                TriIndex.DecodeAxiIndex(vertexcode),
                labels,
                GUI.skin.GetStyle("DarkDropdown")
                );
            //Socket Options
            segrect = VxlGUI.GetRightElement(rect, 0, segment_width, VxlGUI.SM_SPACE, 0);
            EditorGUI.LabelField(
                VxlGUI.GetLeftColumn(segrect, 0, 1 - element_factor),
                "Socket:",
                GUI.skin.GetStyle("RightDarkText")
                );
            int socket_index = EditorGUI.IntField(
                VxlGUI.GetRightColumn(segrect, 0, element_factor),
                TriIndex.DecodeIndex(vertexcode),
                GUI.skin.GetStyle("DarkNumberField")
                );
            vertexcode = TriIndex.EncodeIndex((byte)axis_index, (byte)socket_index);
        }
        else
        {
            //Vertex Index Options
            segrect = VxlGUI.GetRightElement(rect, 0, segment_width, VxlGUI.SM_SPACE, 0);
            EditorGUI.LabelField(
                VxlGUI.GetLeftColumn(segrect, 0, 1 - element_factor),
                "Index:",
                GUI.skin.GetStyle("RightDarkText")
                );
            vertexcode = (ushort)EditorGUI.IntField(
                VxlGUI.GetRightColumn(segrect, 0, element_factor),
                vertexcode,
                GUI.skin.GetStyle("DarkNumberField")
                );
        }
        return(new TriIndex(type, vertexcode));
    }