Skip to content

TemplateButton ​

Inherits: MarginContainer

TemplateButton - Button for selecting character templates or custom creation Used in the character creation template list

Properties ​

Colortext_normal_colorColor(0.8, 0.8, 0.8)
Colortext_highlight_colorColor(1.0, 1.0, 1.0)
Coloractive_background_colorColor(0.333, 0.486, 0.574)
Colorinactive_background_colorColor(0.274, 0.4, 0.473)
Colorborder_selected_colorColor(1.0, 0.843, 0.0)
Colorborder_unselected_colorColor(0.5, 0.5, 0.5)
booluses_iconfalse

Variables ​

CharacterDefinitiontemplatenull
boolis_custom_optionfalse
boolselectedfalse

Methods ​

voidsetup_custom()
voidsetup_template( char_template: CharacterDefinition )
voidset_text( text: String )
voidset_selected( is_selected: bool )

Signals ​

pressed() ​

Emitted when the button is pressed.

template_selected( is_custom: bool, template: CharacterDefinition ) ​

Emitted when a template is picked (or the custom character).

Property descriptions ​

Color text_normal_color = Color(0.8, 0.8, 0.8) ​

The color of the text.

Color text_highlight_color = Color(1.0, 1.0, 1.0) ​

The color of the text under the mouse.

Color active_background_color = Color(0.333, 0.486, 0.574) ​

The color of the background when it is the one picked.

Color inactive_background_color = Color(0.274, 0.4, 0.473) ​

The color of the background when it is not.

Color border_selected_color = Color(1.0, 0.843, 0.0) ​

Gold

Color border_unselected_color = Color(0.5, 0.5, 0.5) ​

Grey

bool uses_icon = false ​

True when the button shows an icon.

Variable descriptions ​

CharacterDefinition template = null ​

The template this button represents (null for "Custom Character")

bool is_custom_option = false ​

Whether this is the "Custom Character" option

bool selected = false ​

True when this is the template picked.

Method descriptions ​

void setup_custom() ​

Setup as "Custom Character" option

void setup_template( char_template: CharacterDefinition ) ​

Setup with a character template

void set_text( text: String ) ​

Set the button text directly

void set_selected( is_selected: bool ) ​

Set selection state