diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-12-15 16:53:12 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-12-15 16:53:12 +0100 |
commit | 75793bd23d275d10d6a0bd8024a7e412b64557ce (patch) | |
tree | eef8145a645a88c718a4004e3a5e5f8f7700fa47 /ui/character_selection_item.gd | |
parent | a14e88ff4d0d87841a44254e2bff1784da6e8b48 (diff) |
next commit
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() |