From 75793bd23d275d10d6a0bd8024a7e412b64557ce Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 15 Dec 2024 16:53:12 +0100 Subject: next commit --- ui/character_selection_item.gd | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ui/character_selection_item.gd (limited to 'ui/character_selection_item.gd') 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() -- cgit v1.2.3