Skip to content
Divided by Zer0 edited this page Jul 11, 2021 · 9 revisions

Token

Extends: HBoxContainer

Description

The token class is controlling the creation of new tokens as well as the control of their counter

Property Descriptions

count

export var count: int = 0
  • Setter: set_count
  • Getter: get_count

token_drawer

var token_drawer

count_label

var count_label

Method Descriptions

setup

func setup(token_name: String, _token_drawer = null) -> void

Initializes the token with the right texture and name based on the values in the configuration

set_count

func set_count(value: int = 1) -> void

Sets the token counter to the specified value

get_count

func get_count() -> int

Returns the amount of tokens of this type

get_count_and_alterants

func get_count_and_alterants() -> var

Discovers the modified value of this token from alterants

Returns a dictionary with the following keys:

  • count: The final value of this token after all modifications
  • alteration: The full dictionary returned by CFScriptUtils.get_altered_value()

expand

func expand() -> void

Reveals the Name label.

Used when the token drawer is expanded

retract

func retract() -> void

Hides the Name label.

Used when the token drawer is withdrawn

get_token_name

func get_token_name() -> String

Returns the lowercase name of the token

Clone this wiki locally