Hide
Separator/BelowSeparator
Important
Enable SaintsEditor before using

Draw text, separator, spaces for field/property/button/layout/class/struct on above / below with rich text & dynamic text support.

Parameters:

  • string title=null display a title. null for no title, only separator.

    If it starts with $, the leading $ will be removed and isCallback will be set to true. Use \$ to escape the starting $.

  • EColor color=EColor.Gray color for the title and the separator

  • EAlign eAlign=EAlign.Start how the title is positioned, options are:

    • EAlign.Start
    • EAlign.Center
    • EAlign.End
  • bool isCallback=false when true, use title as a callback to get a dynamic title

  • int space=0 leave some space above or below the separator, like what Space does.

  • bool below=false when true, draw the separator below the field.

[Separator("Separator", EAlign.Center)] public string separator; [Separator("Left", EAlign.Start)] public string left; [Separator("
quot;
+ nameof(right), EAlign.End)] public string right; [Separator(20)] [Separator("Space 20")] public string[] arr; [Separator("End", below: true)] public string end;

image

Using it with Layout, you can create some fancy appearance:

[LayoutStart("Equipment", ELayout.TitleBox)] [LayoutStart("./Head")] [Separator("Head", EAlign.Center)] public string st; [LayoutCloseHere] public MyStruct inOneStruct; [LayoutStart("./Upper Body")] [InfoBox("Note:left hand can be empty, but not right hand", EMessageType.Warning)] [LayoutStart("./Horizontal", ELayout.Horizontal)] [LayoutStart("./Left Hand")] [Separator("Left Hand", EAlign.Center)] public string g11; public string g12; public MyStruct myStruct; public string g13; [LayoutStart("../Right Hand")] [Separator("Right Hand", EAlign.Center)] public string g21; [LabelText("<color=lime><label/>")] public string g22; [LabelText("
quot;
+ nameof(g23))] public string g23; public bool toggle;

image

Use it on a class to get a class default seperator. This is useful for inherent.

// AbsSepMono.cs [BelowSeparator("Inherent Fields of <color=brown><container.Type/>", EColor.Brown, EAlign.Center)] [BelowSeparator(10)] public abstract class AbsSepMono : SaintsMonoBehaviour { public string absField1; public string absField2; } // ChildSepMono.cs [Separator("Begin of <container.Type/>", EAlign.Center)] public class ChildSepMono : AbsSepMono { public string childField; }