HammeriteSkyPropertySchema
Core: files, names and extension. Inherits RefCounted
A set of properties a game or an addon adds to the sky (see HammeriteSkyPropertyRegistry): weather, a haze, whatever it draws under a sky that Hammerite has no opinion about.
A property is declared exactly as a brush property is, with the same HammeriteBrushPropertyDef, and stored the same way: sparsely, on HammeriteSkybox.properties, under a key namespaced by this schema's id (weather/rain), so two schemas can never collide. A property added after the schema is registered is declared all the same.
Properties
| Type | Name | Default |
|---|---|---|
StringName | id | &"" |
String | label | "" |
HammeriteBrushPropertyDef[] | defs | [] |
Methods
| Returns | Method |
|---|---|
HammeriteBrushPropertyDef | add(name: StringName, prop_label: String, default) |
HammeriteBrushPropertyDef | add_enum(name: StringName, prop_label: String, options: PackedStringArray, default: int = 0) |
Property descriptions
id
var id: StringName = &""
The namespace every key this schema declares goes under: <id>/<name>. What HammeriteSkyPropertyRegistry.unregister() and HammeriteSkyPropertyRegistry.get_schema() name it by.
label
var label: String = ""
What the Sky tool heads this schema's section with.
defs
var defs: HammeriteBrushPropertyDef[] = []
The properties this schema declares, in the order the Sky tool shows them. Declare them with add(), which a registered schema's registry hears about; one appended here directly is not.
Method descriptions
add()
func add(name: StringName, prop_label: String, default) -> HammeriteBrushPropertyDef
Declare a property. name is un-namespaced; the stored key becomes <id>/<name>. Returns the new def so hints can be chained onto it.
add_enum()
func add_enum(name: StringName, prop_label: String, options: PackedStringArray, default: int = 0) -> HammeriteBrushPropertyDef
Declare an enum property: an int index into options, drawn as a dropdown.