Пример #1
0
        // Token: 0x06000153 RID: 339 RVA: 0x0000A7B4 File Offset: 0x000089B4
        public static void Label(Rect position, GUIContent content, bool selected, Color selectedColor, GUIStyle selectedStyle, Color unselectedColor, GUIStyle unselectedStyle)
        {
            if (content == null)
            {
                content = new GUIContent("");
            }
            if (selectedStyle == null)
            {
                selectedStyle = EditorStyles.whiteLabel;
            }
            if (unselectedStyle == null)
            {
                unselectedStyle = EditorStyles.whiteLabel;
            }
            Color color = GUI.color;

            GUI.color = (selected ? selectedColor : unselectedColor);
            if (EditorStyles.label.CalcSize(content).x > position.width)
            {
                Rect rect = position;
                rect.x    += rect.width - 18f;
                rect.width = 16f;
                string tooltip = string.IsNullOrEmpty(content.tooltip) ? content.text : content.text;
                position.width -= rect.width;
                GUI.Label(position, GUIContent2.Temp(content.text, content.image, tooltip), selected ? selectedStyle : unselectedStyle);
                GUI.Label(rect, GUIContent2.Temp("...", tooltip), selected ? selectedStyle : unselectedStyle);
            }
            else
            {
                GUI.Label(position, content, selected ? selectedStyle : unselectedStyle);
            }
            GUI.color = color;
        }
Пример #2
0
        // Token: 0x06000219 RID: 537 RVA: 0x0000E92C File Offset: 0x0000CB2C
        protected override void DoGUI()
        {
            Vector2 vector = this.Style.CalcSize(GUIContent2.Temp(this.Text));
            Rect    rect   = GUILayoutUtility.GetRect(vector.x, vector.y, this.Style, this.LayoutOptions);

            EditorGUI2.PathLabel(rect, this.Text, false);
        }
Пример #3
0
        // Token: 0x06000215 RID: 533 RVA: 0x0000E834 File Offset: 0x0000CA34
        protected override void DoGUI()
        {
            GUIContent guicontent = GUIContent2.Temp(this.Text, this.Image, this.Tooltip);
            bool       flag       = (base.OnQueryStatus() & GUIControlStatus.Checked) != GUIControlStatus.None;
            bool       flag2      = GUILayout.Toggle(flag, guicontent, this.Style, this.LayoutOptions);

            if (flag2 != flag && this.Execute != null)
            {
                this.Execute(this);
            }
        }
Пример #4
0
        // Token: 0x06000211 RID: 529 RVA: 0x0000E6E8 File Offset: 0x0000C8E8
        protected override void DoGUI()
        {
            GUIContent guicontent = GUIContent2.Temp(this.Text, this.Image, this.Tooltip);
            bool       flag       = object.ReferenceEquals(base.RadioGroup.CheckedControl, this);
            bool       flag2      = GUILayout.Toggle(flag, guicontent, this.Style, this.LayoutOptions);

            if (flag2 != flag && this.Execute != null)
            {
                base.RadioGroup.OnCheckedControl(this);
                this.Execute(this);
            }
        }
Пример #5
0
        // Token: 0x06000227 RID: 551 RVA: 0x0000EC6C File Offset: 0x0000CE6C
        protected override void DoGUI()
        {
            Rect   rect       = GUILayoutUtility.GetRect(GUIContent2.Temp(this.Text), this.Style, this.LayoutOptions);
            int    searchMode = this.SearchMode;
            string text       = EditorGUI2.ToolbarSearchField(rect, this.Text, this.SearchModes, ref this.SearchMode);
            Rect   lastRect   = GUILayoutUtility.GetLastRect();

            if (this.AcceptDrop && lastRect.Contains(Event.current.mousePosition) && DragAndDrop.paths != null && DragAndDrop.paths.Length > 0 && !string.IsNullOrEmpty(DragAndDrop.paths[0]))
            {
                if ((int)Event.current.type == 9 || (int)Event.current.type == 10)
                {
                    DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
                }
                if ((int)Event.current.type == 10 && DragAndDrop.paths != null)
                {
                    string text2 = "";
                    foreach (string text3 in DragAndDrop.paths)
                    {
                        if (text2.Length > 0)
                        {
                            text2 += " || ";
                        }
                        object obj = text2;
                        text2 = string.Concat(new object[]
                        {
                            obj,
                            '"',
                            text3.Trim(),
                            '"'
                        });
                    }
                    text = text2;
                    DragAndDrop.AcceptDrag();
                    base.Editor.Repaint();
                }
            }
            if (searchMode != this.SearchMode || !string.Equals(text, this.Text, StringComparison.Ordinal))
            {
                if (this._triggerTime < 0f)
                {
                    EditorApplication.update = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.update, new EditorApplication.CallbackFunction(this.OnEditorApplicationUpdate));
                }
                Event.current.Use();
                this.Text         = text;
                this._triggerTime = Time.realtimeSinceStartup;
                if (!string.IsNullOrEmpty(this.Text) && searchMode == this.SearchMode)
                {
                    this._triggerTime += this.ExecDelay;
                }
            }
        }
Пример #6
0
        // Token: 0x06000155 RID: 341 RVA: 0x0000A8E0 File Offset: 0x00008AE0
        public static void PathLabel(Rect position, string text, bool selected, Color selectedColor, GUIStyle selectedStyle, Color unselectedColor, GUIStyle unselectedStyle)
        {
            string text2 = text;
            Color  color = GUI.color;

            GUI.color = (selected ? selectedColor : unselectedColor);
            int num = 0;

            for (;;)
            {
                num++;
                if (num >= 5 || EditorStyles.label.CalcSize(GUIContent2.Temp(text)).x <= position.width)
                {
                    goto IL_158;
                }
                text = text.Replace("/.../", "/");
                int num2 = text.LastIndexOf('/');
                if (num2 == -1)
                {
                    break;
                }
                int num3 = text.LastIndexOf('/', num2 - 1);
                if (num3 == -1)
                {
                    break;
                }
                string str  = text.Substring(num2 + 1);
                string str2 = text.Substring(0, num3);
                text = str2 + "/.../" + str;
            }
            text = ".../" + FileUtil2.GetFileName(text2);
            if (EditorStyles.label.CalcSize(GUIContent2.Temp(text)).x > position.width)
            {
                Rect rect = position;
                rect.x         += rect.width - 18f;
                rect.width      = 16f;
                position.width -= rect.width;
                GUI.Label(position, GUIContent2.Temp(text, text2), selected ? selectedStyle : unselectedStyle);
                GUI.Label(rect, GUIContent2.Temp("...", text2), selected ? selectedStyle : unselectedStyle);
                goto IL_179;
            }
            GUI.Label(position, GUIContent2.Temp(text), selected ? selectedStyle : unselectedStyle);
            goto IL_179;
IL_158:
            GUI.Label(position, GUIContent2.Temp(text, (num > 1) ? text2 : ""), selected ? selectedStyle : unselectedStyle);
IL_179:
            GUI.color = color;
        }
Пример #7
0
        // Token: 0x0600023D RID: 573 RVA: 0x0000F150 File Offset: 0x0000D350
        protected override void DoGUI()
        {
            this.CheckItemRebuild();
            bool flag = GUILayout.Button(GUIContent2.Temp(this.Text, this.Image, this.Tooltip), this.Style, this.LayoutOptions);

            if ((int)Event.current.type == 7)
            {
                this._rect       = GUILayoutUtility.GetLastRect();
                this._rect.y     = this._rect.y + this._rect.height;
                this._rect.width = (this._rect.height = 0f);
            }
            if (flag)
            {
                if (this.Execute != null)
                {
                    this.Execute(this);
                    this.CheckItemRebuild();
                }
                GenericMenu genericMenu = new GenericMenu();
                foreach (GUIToolbarMenuItem guitoolbarMenuItem in this.Items)
                {
                    GUIControlStatus guicontrolStatus = GUIControlStatus.Enable | GUIControlStatus.Visible;
                    if (guitoolbarMenuItem.QueryStatus != null)
                    {
                        guicontrolStatus = guitoolbarMenuItem.QueryStatus(guitoolbarMenuItem);
                    }
                    if ((guicontrolStatus & GUIControlStatus.Visible) != GUIControlStatus.None)
                    {
                        if (guitoolbarMenuItem.Text.text == "-")
                        {
                            genericMenu.AddSeparator("");
                        }
                        else if ((guicontrolStatus & GUIControlStatus.Enable) != GUIControlStatus.None && guitoolbarMenuItem.Execute != null)
                        {
                            genericMenu.AddItem(guitoolbarMenuItem.Text, (guicontrolStatus & GUIControlStatus.Checked) != GUIControlStatus.None, new GenericMenu.MenuFunction2(this.OnMenu), guitoolbarMenuItem);
                        }
                        else
                        {
                            genericMenu.AddItem(guitoolbarMenuItem.Text, (guicontrolStatus & GUIControlStatus.Checked) != GUIControlStatus.None, null);
                        }
                    }
                }
                genericMenu.DropDown(this._rect);
            }
        }
Пример #8
0
        // Token: 0x06000217 RID: 535 RVA: 0x0000E8C4 File Offset: 0x0000CAC4
        protected override void DoGUI()
        {
            GUIContent guicontent = GUIContent2.Temp(this.Text, this.Image, this.Tooltip);

            GUILayout.Label(guicontent, this.Style, this.LayoutOptions);
        }
Пример #9
0
 // Token: 0x06000152 RID: 338 RVA: 0x0000A794 File Offset: 0x00008994
 public static void Label(Rect position, string text, bool selected, Color color)
 {
     EditorGUI2.Label(position, GUIContent2.Temp(text), selected, GUIColors.SelectedText, EditorStyles.whiteLabel, color, EditorStyles.whiteLabel);
 }