Skip to content

StatsDataEditor ​

Inherits: VBoxContainer

The editor of a StatsData: the pools (as cards), the stats (a table of the ones that are set, with what the template or the definition says, how they grow and what they are at a level), the core stats, the immunities and, folded away, the level growth. It is the Stats page of the NPC, interactable and player class editors and of the Unique Object panel. It is built in code and takes the place of the older scene editors. Compared with a reference (the template an entity follows, or the definition of a placed one) a value that differs is amber.

Variables ​

StatsDatacurrent_stats_data
boolis_loadingfalse
Resourcetemplate_holder
boolis_entity_modetrue
StatsDatacompare_statsnull
Stringcompare_word_override""
intpreview_level10
OptionButtonstat_group_filter_option_button
boolpreview_onfalse

Methods ​

voidset_entity_mode( enabled: bool )
voidload_stats_data( stats_data: StatsData )
voidset_template_holder( holder: Resource )
voidset_compare_stats( stats: StatsData, word: String = "definition" )
voidsetup_managers( _resource_manager: Variant = null, _dialog_manager: Variant = null )

Signals ​

stats_configuration_changed() ​

show_info_dialog( title: String, message: String ) ​

show_error_dialog( message: String ) ​

Constants ​

  • int FILTER_SET = -3 - The choices of the stat filter: the stats that are set, all of them, one stat group (its id), or the ones in no group
  • int FILTER_ALL = 0
  • int FILTER_NO_GROUP = -2
  • Color OVERRIDE_COLOR = Color(0.82, 0.6, 0.23, 1.0)
  • Color GROWTH_COLOR = Color(0.47, 0.72, 0.64, 1.0)
  • Color DIM = Color(1.0, 1.0, 1.0, 0.55)
  • Array[int] CORE_STAT_IDS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - The core stats are edited under "Combat basics", not in the table (their ids)
  • Array CORE_ROWS = [ - What "Combat basics" edits: label, the StatsData property or the core stat id, tooltip
  • Dictionary CORE_IDS = {"movement_speed_base": 1, "attack_speed_base": 2, "global_cooldown_duration_... - The core stats whose value is read with get_core_value (the id), the others are properties of the StatsData

Variable descriptions ​

StatsData current_stats_data ​

No description yet.

bool is_loading = false ​

No description yet.

Resource template_holder ​

The NPC or interactable these stats are of, when it can follow a template (or a placed one that follows its definition)

bool is_entity_mode = true ​

Entities have core stats and growth; the stats of an interactable only have pools, stats and immunities

StatsData compare_stats = null ​

What the values are compared with when it is not the template of template_holder (the Unique Object panel gives the definition of an NPC that has no stats of its own yet)

String compare_word_override = "" ​

No description yet.

int preview_level = 10 ​

No description yet.

OptionButton stat_group_filter_option_button ​

No description yet.

bool preview_on = false ​

Is the preview on? Then the table has the Growth and At level columns and the pool cards say what they are at the level

Method descriptions ​

void set_entity_mode( enabled: bool ) ​

Whether this editor is for entities (true) or interactables (false)

void load_stats_data( stats_data: StatsData ) ​

Loads the StatsData for editing

void set_template_holder( holder: Resource ) ​

Tells the editor whose stats these are, so that it can show what differs from the template the entity follows. Call before load_stats_data (null: no template)

void set_compare_stats( stats: StatsData, word: String = "definition" ) ​

Compares the values with these stats instead of the template of the holder (a placed NPC compares with its definition before it has stats of its own)

void setup_managers( _resource_manager: Variant = null, _dialog_manager: Variant = null ) ​

Kept for the editors that call it (they have nothing to hand over)