diff options
Diffstat (limited to 'ui/character_selection_item.gd')
-rw-r--r-- | ui/character_selection_item.gd | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ui/character_selection_item.gd b/ui/character_selection_item.gd new file mode 100644 index 0000000..67ebea7 --- /dev/null +++ b/ui/character_selection_item.gd @@ -0,0 +1,27 @@ +extends Control + + +signal pressed + + +func initialize_with_info(info: CharacterInformation): + %Head.texture = load( + "%s/%s/000.png" % [ + "res://data/extracted/data/sprite", + Constants.FilePaths.get_player_head(info.gender, info.head), + ] + ) + + %Body.texture = load( + "%s/%s/000.png" % [ + "res://data/extracted/data/sprite", + Constants.FilePaths.get_player_body(info.gender, info.job), + ] + ) + + %Name.text = info.name + + +func _on_gui_input(event: InputEvent) -> void: + if event.is_pressed(): + pressed.emit() |