Skip to content

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 ObjectPropertyDrawerCfgIdDrawer<TValue>

Returns the header text displayed at the top of the dropdown window.

protected abstract string GetHeader()

String

Returns the array of config ID values to populate the dropdown.

protected abstract TValue[] GetIdValues()

TValue[]

Returns the array of display strings corresponding to each ID value.

protected abstract string[] GetDisplayNames()

String[]

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)

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.

String[]

OnGUI(Rect, SerializedProperty, GUIContent)

Section titled “OnGUI(Rect, SerializedProperty, GUIContent)”
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)

position Rect

property SerializedProperty

label GUIContent