Appearance
types.feature
A registered feature
Functions
on(name : string, handler : function)
Registers an event handler
- name (
string) The name of the event to listen to - handler (
function) The event handler function
- A list of supported events can be found in Events
register_boolean(name : string, value : bool, opt_visibility : function): types.boolean_property
Registers a boolean property
- name (
string) The name of the boolean property - value (
bool) The default boolean value - opt_visibility (
function) The optional setting gui visibility - returns (
types.boolean_property) The registered boolean property
lua
local property = feature.register_boolean("Hello Test", false, function() return true end)
local property = feature.register_boolean("Hello Test", false)register_string(name : string, value : string, opt_visibility : function): types.string_property
Registers a string property
- name (
string) The name of the string property - value (
string) The default string value - opt_visibility (
function) The optional setting gui visibility - returns (
types.string_property) The registered string property
lua
local property = feature.register_string("Hello Test", "Hello World", function() return true end)
local property = feature.register_string("Hello Test", "Hello World")register_number(name : number, value : number, opt_visibility : function): types.number_property
Registers a number property
- name (
number) The name of the number property - min (
number) The minimum number value - max (
number) The maximum number value - step (
number) The step number value - value (
number) The default number value - opt_visibility (
function) The optional setting gui visibility - returns (
types.number_property) The registered number property
lua
local property = feature.register_number("Hello Test", 0, 10, 1, 5, function() return true end)
local property = feature.register_number("Hello Test", 0, 10, 0.1, 5)register_color(name : string, value : types.color, opt_visibility : function): types.color_property
Registers a color property
- name (
string) The name of the color property - value (
types.color) The defaulttypes.colorvalue - opt_visibility (
function) The optional setting gui visibility - returns (
types.color_property) The registered color property
lua
local property = feature.register_color("Hello Test", types.color.white, function() return true end)
local property = feature.register_color("Hello Test", types.color.new(255, 0, 255))