コード例 #1
0
 /// <summary>
 /// Draws a help box around the member.
 /// </summary>
 /// <param name="message">The message of the box.</param>
 /// <param name="type">The type of the box. It can be Info, Warning or Error (default: Info).</param>
 /// <param name="visibleCallback">callback to define whether or not the box is visible.
 /// The callback type should be bool.</param>
 /// <param name="positionCallback">Callback for the position options of the decoration.
 /// The callback type should be DecoratorPosition.</param>
 public HelpBoxAttribute(string message, HelpBoxType type, string visibleCallback, string positionCallback)
     : base(positionCallback, DecoratorPosition.Before)
 {
     Message         = message;
     Type            = type;
     VisibleCallback = visibleCallback;
 }
コード例 #2
0
ファイル: GuiHelpers.cs プロジェクト: gimoz71/Elfi-VR
        /// <summary>
        /// Displays a helpbox
        /// </summary>
        /// <param name="text">The text shown in the box</param>
        /// <param name="type">The type of box (icon) shown</param>
        public static void DrawHelpBox(string text, HelpBoxType type)
        {
            EditorGUILayout.BeginHorizontal(GuiStyles.ButtonNoHoverNoBorder);
            GUIContent content = new GUIContent();

            switch (type)
            {
            case HelpBoxType.Warning:
            {
                content.image = Aura.ResourcesCollection.warningIconTexture;
                content.text  = "\n<b>WARNING : </b>\n\n" + text + "\n";
            }
            break;

            case HelpBoxType.Experimental:
            {
                content.image = Aura.ResourcesCollection.experimentalIconTexture;
                content.text  = "\n<b>PREVIEW : </b>\n\n" + text + "\n";
            }
            break;

            case HelpBoxType.Question:
            {
                content.image = Aura.ResourcesCollection.questionIconTexture;
                content.text  = "\n" + text + "\n";
            }
            break;
            }
            GUILayout.Label(content, GuiStyles.Label);
            EditorGUILayout.EndHorizontal();
        }
コード例 #3
0
 /// <summary>
 /// Draws a help box around the member.
 /// </summary>
 /// <param name="message">The message of the box.</param>
 /// <param name="type">The type of the box. It can be Info, Warning or Error (default: Info).</param>
 /// <param name="visibleCallback">callback to define whether or not the box is visible.
 /// The callback type should be bool.</param>
 /// <param name="position">The position options of the decoration (default: Before).</param>
 public HelpBoxAttribute(string message, HelpBoxType type = HelpBoxType.Info, string visibleCallback = null,
                         DecoratorPosition position       = DecoratorPosition.Before) : base(position)
 {
     Message         = message;
     Type            = type;
     VisibleCallback = visibleCallback;
 }
コード例 #4
0
 public HelpBoxAttribute(string text, HelpBoxType messageType = HelpBoxType.None, int spaceAbove = 12, int spaceBelow = 4)
 {
     this.text        = text;
     this.messageType = messageType;
     this.spaceAbove  = spaceAbove;
     this.spaceBelow  = spaceBelow;
 }
コード例 #5
0
    /// <summary> 取得訊息圖示 </summary>
    /// <param name="type"> 訊息類型 </param>
    private Texture GetHelpIcon(HelpBoxType type)
    {
        switch (type)
        {
        case HelpBoxType.None:
            return(null);

        case HelpBoxType.Info:
            return(EditorGUIUtility.IconContent("console.infoicon").image);

        case HelpBoxType.Warning:
            return(EditorGUIUtility.IconContent("console.warnicon").image);

        case HelpBoxType.Error:
            return(EditorGUIUtility.IconContent("console.erroricon").image);

        case HelpBoxType.C8763:
            if (customIcon_1 == null)
            {
                customIcon_1 = Resources.Load <Texture>("C8763");
            }
            return(customIcon_1);

        //return EditorGUIUtility.IconContent("BuildSettings.SelectedIcon").image;
        default:
            return(null);
        }
    }
コード例 #6
0
ファイル: BoxAttributesDrawers.cs プロジェクト: ChubbRck/SFB
 public MessageType GetMessageType( HelpBoxType type )
 {
     switch ( type )
     {
         case HelpBoxType.Error:     return MessageType.Error;
         case HelpBoxType.Info:      return MessageType.Info;
         case HelpBoxType.None:      return MessageType.None;
         case HelpBoxType.Warning:   return MessageType.Warning;
     }
     return 0;
 }
コード例 #7
0
        private MessageType GetHelpBoxType(HelpBoxType type)
        {
            switch (type)
            {
            case HelpBoxType.Info: return(MessageType.Info);

            case HelpBoxType.Warning: return(MessageType.Warning);

            case HelpBoxType.Error: return(MessageType.Error);

            default: return(MessageType.None);
            }
        }
コード例 #8
0
    public MessageType GetMessageType(HelpBoxType type)
    {
        switch (type)
        {
        case HelpBoxType.Error:     return(MessageType.Error);

        case HelpBoxType.Info:      return(MessageType.Info);

        case HelpBoxType.None:      return(MessageType.None);

        case HelpBoxType.Warning:   return(MessageType.Warning);
        }
        return(0);
    }
コード例 #9
0
        private MessageType GetType(HelpBoxType helpBoxType)
        {
            switch (helpBoxType)
            {
            default:
            case HelpBoxType.None: return(MessageType.None);

            case HelpBoxType.Info: return(MessageType.Info);

            case HelpBoxType.Warning: return(MessageType.Warning);

            case HelpBoxType.Error: return(MessageType.Error);
            }
        }
コード例 #10
0
 public HelpBoxAttribute(string message, HelpBoxType type, int order)
 {
     Message    = message;
     Type       = type;
     this.order = order;
 }
コード例 #11
0
 public HelpBoxAttribute(string message, HelpBoxType type)
 {
     Message    = message;
     Type       = type;
     this.order = 0;
 }
コード例 #12
0
 public HelpBoxAttribute(string message)
 {
     Message    = message;
     Type       = HelpBoxType.None;
     this.order = 0;
 }
コード例 #13
0
 public HelpBox()
 {
     Height = 40;
     Text   = "";
     Type   = HelpBoxType.Info;
 }
コード例 #14
0
 public HelpBox(string text, float height, HelpBoxType type = HelpBoxType.Info)
 {
     Text   = text;
     Height = height;
     Type   = type;
 }
コード例 #15
0
 public HelpBoxAttribute(string message, HelpBoxType type = HelpBoxType.None, int order = 0)
 {
     Message    = message;
     Type       = type;
     this.order = order; //PropertyAttribute.order 在多个DecoratorDrawer叠加时 设置调用次序
 }
コード例 #16
0
 /// <summary>
 /// Draws a help box around the member.
 /// </summary>
 /// <param name="message">The message of the box.</param>
 /// <param name="type">The type of the box. It can be Info, Warning or Error (default: Info).</param>
 /// <param name="position">The position options of the decoration (default: Before).</param>
 public HelpBoxAttribute(string message, HelpBoxType type, DecoratorPosition position) : this(message, type, null, position)
 {
 }
コード例 #17
0
 /// <summary>
 /// Draws a help box around the member.
 /// </summary>
 /// <param name="message">The message of the box.</param>
 /// <param name="type">The type of the box. It can be Info, Warning or Error (default: Info).</param>
 /// <param name="positionCallback">Callback for the position options of the decoration.
 /// The callback type should be DecoratorPosition.</param>
 public HelpBoxAttribute(string message, HelpBoxType type, string positionCallback) : this(message, type, null, positionCallback)
 {
 }
コード例 #18
0
 public HelpBox()
 {
     Text   = string.Empty;
     Height = 40;
     Type   = HelpBoxType.Info;
 }
コード例 #19
0
ファイル: BoxAttributes.cs プロジェクト: ChubbRck/SFB
 public HelpBoxAttribute( string message)
 {
     Message     = message;
     Type        = HelpBoxType.None;
     this.order  = 0;
 }
コード例 #20
0
 /// <summary> 顯示一個訊息欄位 </summary>
 /// <param name="tText"        > 訊息內容 </param>
 /// <param name="tBoxType"     > 訊息分類 </param>
 /// <param name="tIsAlwaysOpen"> 是否關閉摺疊功能 (true = 關閉) </param>
 public HelpBoxAttribute(string tText, HelpBoxType tBoxType = HelpBoxType.Info, bool tIsAlwaysOpen = false)
 {
     this.text         = tText;
     this.BoxType      = tBoxType;
     this.isAlwaysOpen = tIsAlwaysOpen;
 }
コード例 #21
0
ファイル: BoxAttributes.cs プロジェクト: ChubbRck/SFB
 public HelpBoxAttribute( string message, HelpBoxType type)
 {
     Message     = message;
     Type        = type;
     this.order  = 0;
 }
コード例 #22
0
 public HelpBox(string text, HelpBoxType type = HelpBoxType.Info)
 {
     Text   = text;
     Height = 40;
     Type   = type;
 }
コード例 #23
0
ファイル: BoxAttributes.cs プロジェクト: ChubbRck/SFB
 public HelpBoxAttribute( string message, HelpBoxType type, int order)
 {
     Message     = message;
     Type        = type;
     this.order  = order;
 }
コード例 #24
0
        /********************************
         *******   CONSTRUCTORS   *******
         *******************************/

        /// <summary>
        /// Display a help box with a message in the editor.
        /// </summary>
        /// <param name="_label">Label to display in the box.</param>
        /// <param name="_type">Type of box to display.</param>
        public HelpBoxAttribute(string _label, HelpBoxType _type)
        {
            Type  = _type;
            Label = _label;
        }
コード例 #25
0
 public HelpBoxAttribute(string text, HelpBoxType type)
 {
     this.text = text;
     this.type = type;
 }