Class MakerToolUi
- Namespace
- SurvivorsMaker.Editor
- Assembly
- SurvivorsMaker.Editor.dll
Small shared pieces of the maker tool windows (rows, notes, tables, number text, colors).
public static class MakerToolUi
- Inheritance
-
MakerToolUi
- Inherited Members
Fields
StylePath
public const string StylePath = "Packages/com.flycat.survivors-maker/Editor/Windows/MakerTools/Common/MakerTools.uss"
Field Value
Methods
Button(VisualElement, string, Action, string)
public static Button Button(VisualElement parent, string text, Action click, string name = null)
Parameters
Returns
- Button
DiffColor(float)
Text color for a positive/negative difference, readable in both editor themes.
public static Color DiffColor(float diff)
Parameters
difffloat
Returns
- Color
Heading(VisualElement, string)
public static Label Heading(VisualElement parent, string text)
Parameters
parentVisualElementtextstring
Returns
- Label
JoinInts(IEnumerable<int>)
public static string JoinInts(IEnumerable<int> values)
Parameters
valuesIEnumerable<int>
Returns
N(double)
public static string N(double value)
Parameters
valuedouble
Returns
N(int)
public static string N(int value)
Parameters
valueint
Returns
N(float)
public static string N(float value)
Parameters
valuefloat
Returns
Note(VisualElement, string)
public static Label Note(VisualElement parent, string text)
Parameters
parentVisualElementtextstring
Returns
- Label
ParseInts(string, int)
Parses "1, 5, 10" into ascending distinct positive ints. Invalid parts are skipped.
public static List<int> ParseInts(string text, int min = 1)
Parameters
Returns
Pct(float)
public static string Pct(float value)
Parameters
valuefloat
Returns
Row(VisualElement)
public static VisualElement Row(VisualElement parent)
Parameters
parentVisualElement
Returns
- VisualElement
Signed(float)
public static string Signed(float value)
Parameters
valuefloat
Returns
Style(VisualElement)
Adds the maker classes and style sheets to a window root.
public static void Style(VisualElement root)
Parameters
rootVisualElement
Table(VisualElement, IReadOnlyList<string>, IEnumerable<string[]>, float)
A simple read-only table; returns the row elements so callers can add click handlers.
public static List<VisualElement> Table(VisualElement parent, IReadOnlyList<string> headers, IEnumerable<string[]> rows, float minWidth = 600)
Parameters
parentVisualElementheadersIReadOnlyList<string>rowsIEnumerable<string[]>minWidthfloat
Returns
- List<VisualElement>