CfgIdDrawer<TValue>
Namespace: Shadop.Archmage.Sdk.Editor
Abstract base for config ID property drawers. Renders an ArchmageTools.DrawEasyDropdown<TValue> dropdown in the Inspector. Subclasses provide the ID values and display names, typically populated from a config table at editor load time.
public abstract class CfgIdDrawer<TValue> : PropertyDrawer where TValue : IComparable<TValue>Inheritance Object → PropertyDrawer → CfgIdDrawer<TValue>
Methods
Section titled “Methods”GetHeader()
Section titled “GetHeader()”Returns the header text displayed at the top of the dropdown window.
protected abstract string GetHeader()Returns
Section titled “Returns”GetIdValues()
Section titled “GetIdValues()”Returns the array of config ID values to populate the dropdown.
protected abstract TValue[] GetIdValues()Returns
Section titled “Returns”TValue[]
GetDisplayNames()
Section titled “GetDisplayNames()”Returns the array of display strings corresponding to each ID value.
protected abstract string[] GetDisplayNames()Returns
Section titled “Returns”BuildDisplayNames(TValue[], Func<TValue, String>, Int32)
Section titled “BuildDisplayNames(TValue[], Func<TValue, String>, Int32)”Builds a display-name array from values. Entries before start are left as null so the caller can fill them manually (e.g., a “Default” label at index 0).
protected static string[] BuildDisplayNames(TValue[] values, Func<TValue, string> format, int start)Parameters
Section titled “Parameters”values TValue[]
The ID values array.
format Func<TValue, String>
Formatter that converts an ID value to its display string.
start Int32
Index to start formatting from.
Returns
Section titled “Returns”OnGUI(Rect, SerializedProperty, GUIContent)
Section titled “OnGUI(Rect, SerializedProperty, GUIContent)”public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)Parameters
Section titled “Parameters”position Rect
property SerializedProperty
label GUIContent