class_name CharacterSelectionItem
extends Control


signal activated
signal selected


func initialize_with_info(info: CharacterInformation):
	%Head.texture = load(
		"%s/%s/000.png" % [
			"res://client_data/data/sprite",
			Constants.FilePaths.get_player_head(info.gender, info.head),
		]
	)
	
	%Body.texture = load(
		"%s/%s/000.png" % [
			"res://client_data/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():
		activated.emit()


func _on_login_button_pressed() -> void:
	selected.emit()