extends ReferenceRect onready var rect_frontrow := Rect2($'%ref_frontrow'.rect_position, $'%ref_frontrow'.rect_size) onready var rect_backrow := Rect2($'%ref_backrow'.rect_position, $'%ref_backrow'.rect_size) onready var row_rects := [rect_frontrow, rect_backrow] onready var ls = [$ref_commands/l1, $ref_commands/l2, $ref_commands/l3, $ref_commands/l4] onready var ts = [$ref_commands/t1, $ref_commands/t2, $ref_commands/t3, $ref_commands/t4] var t1s = [] # Ability icon shadows func update_labels(data: Dictionary, i: int): var c = data.characters[i] var character = c.character_id var job = c.current_job_id var cj_idx = character*22 + job $'%lbl_name'.text = data.character_names_decoded[character] $'%lbl_lv_cur'.text = '%d' % c.level $'%lbl_job'.text = StringLoader.tables.job_names[job] $'%lbl_abp_lv_cur'.text = '%d-' % c.current_job_level $'%lbl_abp_progress'.text = '' if job == 21 else ('%d/' % c.current_job_abp) $'%lbl_abp_next'.text = '' if job == 21 else ('%d' % RomLoader.snes_data.job_levels[job][c.current_job_level].ABP) $'%lbl_hp_cur'.text = '%d/' % c.hp_current $'%lbl_hp_max'.text = '%d' % c.hp_max $'%lbl_mp_cur'.text = '%d/' % c.mp_current $'%lbl_mp_max'.text = '%d' % c.mp_max for i in 4: ls[i].text = StringLoader.get_ability_name(c.equipped_abilities[i]) ts[i].texture = ThemeManager.get_ability_icon(c.equipped_abilities[i]) t1s[i].texture = ts[i].texture # Draw character battle sprite in either ref_frontrow or ref_backrow $'%PC'.position = row_rects[c.is_back_row].position $'%PC'.material.set_shader_param('palette', SpriteLoader.character_battle_sprite_palette_textures[cj_idx]) $'%PC'.texture = SpriteLoader.strip_textures[cj_idx] # Think about status icons # Called when the node enters the scene tree for the first time. func _ready() -> void: for t in ts: t1s.append(t.duplicate(0)) t1s[-1].rect_position += Vector2(1, 1) t1s[-1].modulate = Color(0, 0, 0, 0.5) $ref_commands.add_child(t1s[-1]) $ref_commands.move_child(t1s[-1], 0)