2018-08-05 12:47:18 +00:00
|
|
|
extends Control
|
|
|
|
|
2018-08-08 12:31:51 +00:00
|
|
|
var character_mesh = null
|
2018-08-07 13:25:50 +00:00
|
|
|
var name_input = null
|
|
|
|
onready var error_label = $v_box_container/h_box_container/margin_container/margin_container/v_box_container/error_label
|
2018-08-05 12:47:18 +00:00
|
|
|
|
|
|
|
signal valid_button_pressed
|
2018-08-05 18:25:15 +00:00
|
|
|
signal return_button_pressed
|
2018-08-05 12:47:18 +00:00
|
|
|
|
2018-08-07 13:25:50 +00:00
|
|
|
func _ready():
|
2018-08-08 12:31:51 +00:00
|
|
|
character_mesh = $v_box_container/h_box_container/center_container/character_creation_scene/mesh_instance
|
2018-08-07 13:25:50 +00:00
|
|
|
name_input = $v_box_container/h_box_container/margin_container/margin_container/v_box_container/name_box/line_edit
|
|
|
|
|
2018-08-08 12:31:51 +00:00
|
|
|
|
|
|
|
|
2018-08-05 12:47:18 +00:00
|
|
|
func _on_h_scroll_bar_value_changed(value):
|
|
|
|
if value == 1:
|
2018-08-08 12:31:51 +00:00
|
|
|
global.character_sex = 1
|
|
|
|
character_mesh.get_surface_material(0).albedo_color = Color( 1.0, 0.25, 0.25, 1.0 )
|
2018-08-05 12:47:18 +00:00
|
|
|
else:
|
2018-08-08 12:31:51 +00:00
|
|
|
global.character_sex = 0
|
|
|
|
character_mesh.get_surface_material(0).albedo_color = Color( 0.0, 0.0, 1.0, 1.0 )
|
2018-08-05 12:47:18 +00:00
|
|
|
|
|
|
|
func _on_valid_button_pressed():
|
2018-08-07 13:25:50 +00:00
|
|
|
if not name_input.text or name_input.text == "":
|
|
|
|
error_label.text = "You need to choose a character's name."
|
|
|
|
return
|
2018-08-08 12:31:51 +00:00
|
|
|
global.character_name = name_input.text
|
|
|
|
global.character_color = character_mesh.get_surface_material(0).albedo_color
|
2018-08-05 12:47:18 +00:00
|
|
|
emit_signal( "valid_button_pressed" )
|
2018-08-05 18:25:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_return_button_pressed():
|
|
|
|
emit_signal( "return_button_pressed" )
|