Exemplo n.º 1
0
    void EditorsScrollView()
    {
        for (int i = 0; i < editors.Length; i++)
        {
            if (IsNULL(editors))
            {
                return;
            }

            if (propSearch)
            {
                if (SplitFilter(editors[i]))
                {
                    continue;
                }
            }
            else
            {
                if (Filter(editors[i]))
                {
                    continue;
                }
            }

            if (!IsVisible(editors[i]))
            {
                continue;
            }

            SUI.Vertical(() => DrawEditor(i));
        }
    }
    void DrawValues(int k, int v, string text, string name, Texture texture)
    {
        // Space
        SUI.Space(SUI.VerticalSpace);

        bool isSelected = selected.Contains(prefabs[k, v]);

        // Horizontal
        SUI.Horizontal(() =>
        {
            texture = GetThumbnail(prefabs[k, v]);

            GUILayout.Box(texture, "Label", SUI.Width(SUI.LineHeight), SUI.Height(SUI.LineHeight));

            text = string.Format("{0} - {1}", v, prefabs[k, v].name);

            if (isSelected)
            {
                RemoveButton(text, prefabs[k, v]);
            }
            else
            {
                AddButton(text, prefabs[k, v]);
            }
        });
    }
Exemplo n.º 3
0
        public override void UpdateState()
        {
            base.UpdateState();
            SUI.Update();
            Vivid.Texture.Texture2D.UpdateLoading();

            int hx, hy;

            return;

#pragma warning disable CS0162 // Unreachable code detected
            if (tView.Graph != null)
#pragma warning restore CS0162 // Unreachable code detected
            {
                var node = tView.Graph.Pick(10, 10);
                if (node != null)
                {
                    hx = (int)node.X / 64;
                    hy = (int)node.Y / 64;

                    CurSetMap.HighlightTile(hx, hy);
                    //CurSetMap.UpdateGraph();
#pragma warning disable CS7036 // There is no argument given that corresponds to the required formal parameter 'tw' of 'Map.UpdateGraph(int, int)'
                    tView.Graph = CurSetMap.UpdateGraph();
#pragma warning restore CS7036 // There is no argument given that corresponds to the required formal parameter 'tw' of 'Map.UpdateGraph(int, int)'
                    //  tView.Graph.X = -32 + tView.W / 2;
                    // tView.Graph.Y = -32 + tView.H / 2;
                }
            }
        }
Exemplo n.º 4
0
    void DrawToggle(int i, Editor value)
    {
        value.serializedObject.Update();

        Component component = value.target as Component;

        bool isVisible = IsVisible(value);

        SUI.GUIChanged(() =>
        {
            GUIContent content = SUI.Content(component);

            content.text = string.Format("{0} - {1}", i, component.GetType().Name);

            isVisible = SUI.Toggle(isVisible, content, "Radio", SUI.Height(SUI.LineHeight));
        },
                       () =>
        {
            SetVisible(value, isVisible);
        });

        value.serializedObject.ApplyModifiedProperties();

        editor.Repaint();

        Repaint();
    }
Exemplo n.º 5
0
        public override void DrawState()
        {
            base.DrawState();

            GameHost.Render();
            SUI.Render();
        }
    void DrawMenuGUIFields()
    {
        // Label
        GUILayout.Label("Main", "boldlabel");
        // Active
        SUI.Field("Edit (ESC)", () => active = SUI.Toggle(active));
        // Mode
        SUI.Field("Mode (C)", () => mode = (Mode)SUI.EnumField(mode, "label"));
        // Paint
        SUI.Field("Paint (B)", () => paint = (Paint)SUI.EnumField(paint, "label"));
        // Layer
        SUI.Field("Layer", () => layer = SUI.LayerField(layer, "label"));
        // Height
        SUI.Field("Height (+/-)", () => height = EditorGUILayout.FloatField(height));
        // Size
        SUI.Field("Size", () => size = Vector3Int.RoundToInt(SUI.VectorCustom(size)));

        // Label
        GUILayout.Label("Snap", "boldlabel");
        // Move
        SUI.Field("Move", () => move = SUI.VectorCustom(move));
        // Rotate
        SUI.Field("Rotate", () => rotate = SUI.VectorCustom(rotate));
        // Scale
        SUI.Field("Scale", () => scale = SUI.VectorCustom(scale));
    }
Exemplo n.º 7
0
 public override void UpdateState()
 {
     base.UpdateState();
     Texture2D.UpdateLoading();
     GameHost.Update();
     SUI.Update();
     RainFX.Update();
 }
Exemplo n.º 8
0
 void DrawEditors()
 {
     SplitFilter();
     SearchPropertyLabel();
     EditorGUIUtility.hierarchyMode = true;
     EditorGUIUtility.wideMode      = true;
     editorsScroll = SUI.ScrollView(editorsScroll, EditorsScrollView, SUI.DontExpandHeight);
 }
Exemplo n.º 9
0
        public override void DrawState()
        {
            //return;

            base.DrawState();
            SUI.Render();
            FXGrid.Process(null);
        }
Exemplo n.º 10
0
    EditorExpanse DrawTitle(int i)
    {
        EditorExpanse expanse = new EditorExpanse(editors[i]);

        if (!SISettings.titles)
        {
            return(expanse);
        }
        expanse.IsExpanded = SUI.Title(expanse.IsExpanded, editors[i]);
        return(expanse);
    }
 void DrawSelectedGUIContents()
 {
     if (selected.Count == 0)
     {
         GUILayout.Box(GUIContent.none, SUI.Width(imgWidth), SUI.Height(imgHeight));
     }
     else
     {
         DrawSelectedPreview();
     }
 }
    void AddButton(string text, GameObject gameObject)
    {
        SUI.Button(text, "Label", () =>
        {
            selected.Add(gameObject);

            view.Repaint();

            Repaint();
        });
    }
    void RemoveButton(string text, GameObject gameObject)
    {
        SUI.Button(text, "assetlabel", () =>
        {
            selected.Remove(gameObject);

            view.Repaint();

            Repaint();
        }, SUI.ExpandWidth);
    }
Exemplo n.º 14
0
    void DrawToggles()
    {
        SUI.Horizontal(DrawTogglesHeader);

        SUI.Space(SUI.VerticalSpace);

        DrawSearchBar();

        SUI.Label("Components");

        toggleScroll = SUI.ScrollView(toggleScroll, EditorStyles.inspectorFullWidthMargins, DrawTogglesScroll);
    }
 void DrawSelectedPreview()
 {
     for (int k = 0; k < prefabs.KeyCount; k++)
     {
         for (int v = 0; v < prefabs.Values[k].Count; v++)
         {
             if (selected.Contains(prefabs[k, v]))
             {
                 GUILayout.Box(GetPreview(prefabs[k, v]), "label", SUI.Width(imgWidth), SUI.Height(imgHeight));
             }
         }
     }
 }
    void DrawObjectsGUI()
    {
        SUI.Label("Objects", titleSyle);

        SUI.Vertical(areaStyle, () =>
        {
            DrawSearchBar();

            SUI.Space(SUI.VerticalSpace);

            objsViewPos = SUI.ScrollView(objsViewPos, DrawKeylistAndValues, SUI.DontExpandHeight);
        });
    }
Exemplo n.º 17
0
 void SearchPropertyLabel()
 {
     // E x i t
     if (splitFilter.Length <= 1)
     {
         return;
     }
     // Label
     SUI.Space(SUI.VerticalSpace);
     EditorGUILayout.BeginVertical(EditorStyles.inspectorFullWidthMargins);
     SUI.Label(string.Format("(Beta) Property Search: {0}", splitFilter[1]), "assetlabel");
     EditorGUILayout.EndVertical();
 }
Exemplo n.º 18
0
 public override void UpdateState()
 {
     base.UpdateState();
     SUI.Update();
     Texture2D.UpdateLoading();
     if (powerSnd != null)
     {
         if (powerSnd.Playing == false)
         {
             Environment.Exit(0);
         }
     }
 }
Exemplo n.º 19
0
    //
    // Header
    //

    void DrawHeader()
    {
        if (!SISettings.DrawHeader)
        {
            SUI.Space(SUI.VerticalSpace * 2);

            return;
        }

        SUI.NoSpace();

        editor.DrawHeader();
    }
Exemplo n.º 20
0
    //
    // GUI
    //

    void MainGUI()
    {
        if (SISettings.toggles)
        {
            OnToggleGUI();
        }
        else
        {
            DrawHeader();
            DrawMaskField();
            SUI.Space(SUI.VerticalSpace);
            DrawSearchBar();
            DrawEditors();
        }
    }
Exemplo n.º 21
0
        public override void UpdateState()
        {
            base.UpdateState();
            //return;
            Texture2D.UpdateLoading();
            SUI.Update();
            Console.WriteLine("Testing!");
            if (Vivid.Input.XIn.Start())
            {
                while (Vivid.Input.XIn.Start())
                {
                    System.Threading.Thread.Sleep(50);
                }

                vid.Stop();
                VividApp.PushState(new ScopeNineMenu());
            }
        }
    void DrawKeylistAndValues()
    {
        string    text    = "";
        string    name    = "";
        Texture2D texture = null;

        for (int k = 0; k < prefabs.KeyCount; k++)
        {
            SUI.Horizontal(() =>
            {
                SUI.Toggle(isExpanded[k], GUIContent.none, "ol toggle", SUI.DontExpandWidth);
                isExpanded[k] = SUI.Toggle(isExpanded[k], prefabs.Keys[k], "exposablepopupmenu");
            });

            if (false == isExpanded[k])
            {
                continue;
            }

            DrawKeys(k, text, name, texture);
        }
    }
Exemplo n.º 23
0
        public SUI_Element AddUI(SUI element, string name, int[] args = null, Node nn = null)
        {
            needUdate = true;
            SUI_Element result = null;
            Node        n      = null;

            if (nn == null)
            {
                n = Node.CreateChild(name);
            }
            else
            {
                n = nn.CreateChild(name);
                //nn.GetComponent<SUI_Element>().needUpdate = true;
            }

            switch (element)
            {
            default:
                result = n.CreateComponent <SUI_Element>();
                break;

            case SUI.WINDOW:
                result = n.CreateComponent <SUI_Window>();
                break;

            case SUI.NODE:
                result = n.CreateComponent <SUI_Node>();
                break;
            }
            if (args != null)
            {
                result.SetArgs(args);
            }
            result.simpleUI = this;
            return(result);
        }
Exemplo n.º 24
0
 public override void UpdateState()
 {
     base.UpdateState();
     Texture2D.UpdateLoading();
     SUI.Update();
 }
Exemplo n.º 25
0
 public extern static int EnumChildWindows(IntPtr hWndParent, SUI.Base.SUIWindow.EnumSMARTUIWindowsProc lpEnumFunc, int lParam);
Exemplo n.º 26
0
 public extern static int EnumWindows(SUI.Base.SUIWindow.EnumSMARTUIWindowsProc lpEnumFunc, int lParam);
Exemplo n.º 27
0
 void SearchBarLayout()
 {
     filter = GUILayout.TextField(filter, "ToolbarSeachTextField");
     SUI.Button(GUIContent.none, "ToolbarSeachCancelButton", () => filter = "");
 }
Exemplo n.º 28
0
    //
    // Searchbar
    //

    void DrawSearchBar()
    {
        SUI.Horizontal(EditorStyles.inspectorFullWidthMargins, SearchBarLayout);
        SUI.Space(SUI.VerticalSpace);
    }
Exemplo n.º 29
0
 // Vertical area
 void MaskFieldVertical()
 {
     SUI.Horizontal(EditorStyles.inspectorFullWidthMargins, MaskFieldLayout);
 }
Exemplo n.º 30
0
 public override void DrawState()
 {
     SUI.Render();
     base.DrawState();
 }
Exemplo n.º 31
0
 // Main
 void DrawMaskField()
 {
     SUI.GUIChanged(MaskFieldVertical, UpdateVisibility);
 }
Exemplo n.º 32
0
 public override void UpdateState()
 {
     SUI.Update();
     base.UpdateState();
 }