fix eyes color
This commit is contained in:
parent
e29637f08b
commit
77ea4da8a8
5 changed files with 32 additions and 23 deletions
|
@ -8,6 +8,7 @@ var gender = 1
|
||||||
var size = 1.0
|
var size = 1.0
|
||||||
var slot = 0
|
var slot = 0
|
||||||
var ears_size = 0.0
|
var ears_size = 0.0
|
||||||
|
var eyes_color = Color( 0.0, 1.0, 0.0, 1.0 )
|
||||||
|
|
||||||
var dir = Vector3()
|
var dir = Vector3()
|
||||||
const GRAVITY = -24.8
|
const GRAVITY = -24.8
|
||||||
|
@ -69,9 +70,10 @@ func update( start_position = null ):
|
||||||
self.player_mesh.set( "blend_shapes/big_ears", 0 )
|
self.player_mesh.set( "blend_shapes/big_ears", 0 )
|
||||||
self.player_mesh.set( "blend_shapes/small_ears", 0 )
|
self.player_mesh.set( "blend_shapes/small_ears", 0 )
|
||||||
|
|
||||||
|
# skin color
|
||||||
|
|
||||||
self.player_mesh.mesh.get( "surface_2/material" ).set_shader_param( "albedo", self.color )
|
self.player_mesh.mesh.get( "surface_2/material" ).set_shader_param( "albedo", self.color )
|
||||||
|
# eyes color (pupil)
|
||||||
|
self.player_mesh.mesh.get( "surface_4/material" ).set_shader_param( "albedo", self.eyes_color )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -148,9 +148,14 @@ func update_preview():
|
||||||
var size = config_file.get_value( str(slot), "size", 1.0 )
|
var size = config_file.get_value( str(slot), "size", 1.0 )
|
||||||
self.character_preview.size = size
|
self.character_preview.size = size
|
||||||
|
|
||||||
|
# Ears size
|
||||||
var ears_size = config_file.get_value( str(slot), "ears_size", 0.0 )
|
var ears_size = config_file.get_value( str(slot), "ears_size", 0.0 )
|
||||||
self.character_preview.ears_size = ears_size
|
self.character_preview.ears_size = ears_size
|
||||||
|
|
||||||
|
# Eyes color
|
||||||
|
var eyes_color = config_file.get_value( str(slot), "eyes_color", Color( 0.0, 1.0, 0.0, 1.0 ) )
|
||||||
|
self.character_preview.eyes_color = eyes_color
|
||||||
|
|
||||||
self.character_preview.update()
|
self.character_preview.update()
|
||||||
|
|
||||||
|
|
||||||
|
@ -176,6 +181,7 @@ func _on_character_creation_box_creation_button_pressed():
|
||||||
config_file.set_value( str(self.character_preview.slot), "color", self.character_preview.color)
|
config_file.set_value( str(self.character_preview.slot), "color", self.character_preview.color)
|
||||||
config_file.set_value( str(self.character_preview.slot), "size", self.character_preview.size)
|
config_file.set_value( str(self.character_preview.slot), "size", self.character_preview.size)
|
||||||
config_file.set_value( str(self.character_preview.slot), "ears_size", self.character_preview.ears_size)
|
config_file.set_value( str(self.character_preview.slot), "ears_size", self.character_preview.ears_size)
|
||||||
|
config_file.set_value( str(self.character_preview.slot), "eyes_color", self.character_preview.eyes_color)
|
||||||
|
|
||||||
config_file.save( "user://player.cfg" )
|
config_file.save( "user://player.cfg" )
|
||||||
|
|
||||||
|
|
|
@ -23,11 +23,12 @@ func _on_character_selection_menu_character_selected( slot ):
|
||||||
print("Error code when loading player config file: ", err)
|
print("Error code when loading player config file: ", err)
|
||||||
|
|
||||||
character.slot = slot
|
character.slot = slot
|
||||||
character.pseudo = config_file.get_value( str(slot), "name", "player")
|
character.pseudo = config_file.get_value( str(slot), "name", "player" )
|
||||||
character.gender = config_file.get_value( str(slot), "gender", 1)
|
character.gender = config_file.get_value( str(slot), "gender", 1 )
|
||||||
character.color = config_file.get_value( str(slot), "color", Color(1.0, 0.25, 0.25, 1.0) )
|
character.color = config_file.get_value( str(slot), "color", Color(1.0, 0.25, 0.25, 1.0) )
|
||||||
character.size = config_file.get_value( str(slot), "size", 1.0 )
|
character.size = config_file.get_value( str(slot), "size", 1.0 )
|
||||||
character.ears_size = config_file.get_value( str(slot), "ears_size", 0.0 )
|
character.ears_size = config_file.get_value( str(slot), "ears_size", 0.0 )
|
||||||
|
character.eyes_color = config_file.get_value( str(slot), "eyes_color", Color( 0.0, 1.0, 0.0, 1.0 ) )
|
||||||
character.update()
|
character.update()
|
||||||
|
|
||||||
emit_signal( "character_creation_finished" )
|
emit_signal( "character_creation_finished" )
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
[ext_resource path="res://login_scene/character_selection_menu.tscn" type="PackedScene" id=2]
|
[ext_resource path="res://login_scene/character_selection_menu.tscn" type="PackedScene" id=2]
|
||||||
[ext_resource path="res://gui_scene/GUI/login/login_menu.tscn" type="PackedScene" id=3]
|
[ext_resource path="res://gui_scene/GUI/login/login_menu.tscn" type="PackedScene" id=3]
|
||||||
|
|
||||||
[node name="login_scene" type="Node"]
|
[node name="login_scene" type="Node" index="0"]
|
||||||
|
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue