Ajout d'ue fenêtre de chat.

This commit is contained in:
osquallo 2018-08-18 10:22:19 +02:00
parent a9c9c857f0
commit 70848d64e4
14 changed files with 188 additions and 1368 deletions

View file

@ -235,6 +235,7 @@ func _enter_tree():
content_scroll_container.name = "scroll_container" content_scroll_container.name = "scroll_container"
content_scroll_container.size_flags_horizontal = SIZE_FILL content_scroll_container.size_flags_horizontal = SIZE_FILL
content_scroll_container.size_flags_vertical = SIZE_FILL content_scroll_container.size_flags_vertical = SIZE_FILL
content_scroll_container.scroll_deadzone = 0
content_box.add_child( content_scroll_container ) content_box.add_child( content_scroll_container )
content_scroll_container.set_owner( content_box ) content_scroll_container.set_owner( content_box )
### ###

View file

@ -36,5 +36,6 @@ align = 1
percent_visible = 1.0 percent_visible = 1.0
lines_skipped = 0 lines_skipped = 0
max_lines_visible = -1 max_lines_visible = -1
_sections_unfolded = [ "Mouse" ]

View file

@ -20,6 +20,8 @@ var current_map = null
var current_state = "login" var current_state = "login"
var font_size= 14
func _ready(): func _ready():
var root = get_tree().get_root() var root = get_tree().get_root()
# current_scene = root.get_child(root.get_child_count() -1) # current_scene = root.get_child(root.get_child_count() -1)

View file

@ -3,7 +3,7 @@
[ext_resource path="res://global.gd" type="Script" id=1] [ext_resource path="res://global.gd" type="Script" id=1]
[ext_resource path="res://background_loader_scene/background_loader.tscn" type="PackedScene" id=2] [ext_resource path="res://background_loader_scene/background_loader.tscn" type="PackedScene" id=2]
[node name="global" type="Node" index="0"] [node name="global" type="Node"]
pause_mode = 2 pause_mode = 2
script = ExtResource( 1 ) script = ExtResource( 1 )

View file

@ -42,7 +42,8 @@ ui_pause=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":
ui_reload=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":true,"meta":false,"command":true,"pressed":false,"scancode":82,"unicode":0,"echo":false,"script":null) ui_reload=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":true,"meta":false,"command":true,"pressed":false,"scancode":82,"unicode":0,"echo":false,"script":null)
] ]
ui_free_cursor=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) ui_free_cursor=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null)
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null) , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":true,"meta":false,"command":true,"pressed":false,"scancode":72,"unicode":0,"echo":false,"script":null)
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":3,"pressed":false,"doubleclick":false,"script":null)
] ]
move_up=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) move_up=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
@ -87,6 +88,9 @@ test_change_map_2=[ Object(InputEventKey,"resource_local_to_scene":false,"resour
] ]
test_change_map_3=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777252,"unicode":0,"echo":false,"script":null) test_change_map_3=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777252,"unicode":0,"echo":false,"script":null)
] ]
chat_accept=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"unicode":0,"echo":false,"script":null)
]
[locale] [locale]

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,23 @@
extends VBoxContainer
var line_edit_path = "../../../../footer_box/footer/footer_line_edit"
func _process(delta):
var content_scroll = get_node( "../.." )
content_scroll.scroll_vertical = 2*self.rect_size.y
func _on_footer_line_edit_gui_input( event ):
if event is InputEventKey:
if event.is_action_released( "chat_accept" ):
var line_edit = get_node( line_edit_path )
var new_text = line_edit.text
var new_line = RichTextLabel.new()
new_line.bbcode_enabled = true
new_line.bbcode_text = new_text
new_line.rect_min_size.y = global.font_size+4
new_line.scroll_active = false
new_line.selection_enabled = true
self.add_child( new_line )
line_edit.text = ""

View file

@ -1,20 +1,9 @@
extends HBoxContainer extends HBoxContainer
# class member variables go here, for example:
# var a = 2
# var b = "textvar"
func _ready():
# Called when the node is added to the scene for the first time.
# Initialization here
pass
#func _process(delta):
# # Called every frame. Delta is time since last frame.
# # Update game logic here.
# pass
func _process(delta):
self.get_node( "ProgressBar" ).value = character.douleur
func _on_ProgressBar_value_changed(value): func _on_ProgressBar_value_changed(value):
self.modulate = Color( 1.0, 1.0, 1.0, clamp(value/50, 0.4, 1 ) ) self.modulate.a = clamp(value/50, 0.4, 1 )
get_node( "../../overlay_douleur" ).modulate.a = self.modulate.a/2 get_node( "../../overlay_douleur" ).modulate.a = self.modulate.a/2

View file

@ -1,20 +1,9 @@
extends HBoxContainer extends HBoxContainer
# class member variables go here, for example:
# var a = 2
# var b = "textvar"
func _ready():
# Called when the node is added to the scene for the first time.
# Initialization here
pass
#func _process(delta):
# # Called every frame. Delta is time since last frame.
# # Update game logic here.
# pass
func _process(delta):
self.get_node( "ProgressBar" ).value = character.oubli
func _on_ProgressBar_value_changed(value): func _on_ProgressBar_value_changed(value):
self.modulate = Color( 1.0, 1.0, 1.0, clamp(value/50, 20/255, 1 ) ) self.modulate.a = clamp(value/50, 20/255, 1 )
get_node( "../../overlay_oubli" ).modulate.a = self.modulate.a/2 get_node( "../../overlay_oubli" ).modulate.a = self.modulate.a/2

View file

@ -0,0 +1,16 @@
extends RichTextLabel
# class member variables go here, for example:
# var a = 2
# var b = "textvar"
func _ready():
# Called when the node is added to the scene for the first time.
# Initialization here
pass
func _process(delta):
self.rect_min_size.y = global.font_size + 4
# # Called every frame. Delta is time since last frame.
# # Update game logic here.
# pass

View file

@ -1,20 +1,7 @@
extends HBoxContainer extends HBoxContainer
# class member variables go here, for example: func _process(delta):
# var a = 2 self.get_node( "ProgressBar" ).value = character.trauma
# var b = "textvar"
func _ready():
# Called when the node is added to the scene for the first time.
# Initialization here
pass
#func _process(delta):
# # Called every frame. Delta is time since last frame.
# # Update game logic here.
# pass
func _on_ProgressBar_value_changed(value): func _on_ProgressBar_value_changed(value):
self.modulate = Color( 1.0, 1.0, 1.0, clamp(value/50, 20/255, 1 ) ) self.modulate = Color( 1.0, 1.0, 1.0, clamp(value/50, 20/255, 1 ) )

View file

@ -28,11 +28,11 @@ func load_settings():
elif not err == OK: elif not err == OK:
print("Error code when loading config file: ", err) print("Error code when loading config file: ", err)
var font_size = config_file.get_value( "theme", "font_size" ) global.font_size = config_file.get_value( "theme", "font_size" )
if $Menus.get_theme() and font_size: if $Menus.get_theme():
$Menus.get_theme().default_font.size = font_size $Menus.get_theme().default_font.size = global.font_size
$Menus/TabContainer/Test/ScrollContainer/VBoxContainer/font_size_bar.value = font_size $Menus/TabContainer/Test/ScrollContainer/VBoxContainer/font_size_bar.value = global.font_size
$Menus/TabContainer/Test/ScrollContainer/VBoxContainer/font_size/font_size_value.text = str( font_size ) $Menus/TabContainer/Test/ScrollContainer/VBoxContainer/font_size/font_size_value.text = str( global.font_size )

View file

@ -19,6 +19,11 @@ onready var player_infos_billboard = $infos_spatial/character_infos_billboard
onready var player_mesh = $MeshInstance onready var player_mesh = $MeshInstance
onready var flashlight = $MeshInstance/Flashlight onready var flashlight = $MeshInstance/Flashlight
### Caractéristiques du personnage.
var douleur = 0
var trauma = 0
var oubli = 0
func set_info_billboard_position(): func set_info_billboard_position():
var above_head = $infos_spatial var above_head = $infos_spatial
player_infos_billboard.get_node("label").text = global.character_name player_infos_billboard.get_node("label").text = global.character_name
@ -109,16 +114,16 @@ func process_movement(delta):
if collision_info: if collision_info:
vel = vel.bounce(collision_info.normal) vel = vel.bounce(collision_info.normal)
var obj = collision_info.collider var obj = collision_info.collider
if obj.is_class( "RigidBody" ): if obj.is_class( "RigidBody" ) or obj.is_class( "StaticBody" ):
obj.sleeping = false obj.sleeping = false
obj.apply_impulse( collision_info.position, -collision_info.normal*delta ) obj.apply_impulse( collision_info.position, -collision_info.normal*delta )
if not obj.get_node( "MeshInstance" ).get_surface_material(0).get("albedo_color") == null: if not obj.get_node( "MeshInstance" ).get_surface_material(0).get("albedo_color") == null:
obj.get_node( "MeshInstance" ).get_surface_material(0).albedo_color = Color( 1, 0, 1, 1 ) obj.get_node( "MeshInstance" ).get_surface_material(0).albedo_color = Color( 1, 0, 1, 1 )
get_tree().get_root().get_node( "game_scene/GUI/HUD/Jauges/douleur/ProgressBar" ).value += 0.25 self.douleur += 0.25
if get_tree().get_root().get_node( "game_scene/GUI/HUD/Jauges/douleur/ProgressBar" ).value >= 100: if self.douleur >= 100:
get_tree().get_root().get_node( "game_scene/GUI/HUD/Jauges/trauma/ProgressBar" ).value += 0.25 self.trauma += 0.25
if get_tree().get_root().get_node( "game_scene/GUI/HUD/Jauges/trauma/ProgressBar" ).value >= 100: if self.trauma >= 100:
get_tree().get_root().get_node( "game_scene/GUI/HUD/Jauges/oubli/ProgressBar" ).value += 0.25 self.oubli += 0.25

View file

@ -1,10 +1,10 @@
[gd_scene load_steps=9 format=2] [gd_scene load_steps=9 format=2]
[ext_resource path="res://scenes/Game/Character/Character.gd" type="Script" id=1] [ext_resource path="res://scenes/Game/Character/Character.gd" type="Script" id=1]
[ext_resource path="res://game_scene/suzanne/suzanne.obj" type="ArrayMesh" id=2] [ext_resource path="res://scenes/Game/Character/infos_spatial.gd" type="Script" id=2]
[ext_resource path="res://game_scene/suzanne/suzanne_albedo.png" type="Texture" id=3] [ext_resource path="res://game_scene/character_infos_billboard.tscn" type="PackedScene" id=3]
[ext_resource path="res://scenes/Game/Character/infos_spatial.gd" type="Script" id=4] [ext_resource path="res://game_scene/suzanne/suzanne.obj" type="ArrayMesh" id=4]
[ext_resource path="res://game_scene/character_infos_billboard.tscn" type="PackedScene" id=5] [ext_resource path="res://game_scene/suzanne/suzanne_albedo.png" type="Texture" id=5]
[sub_resource type="Shader" id=1] [sub_resource type="Shader" id=1]
@ -60,7 +60,7 @@ shader_param/uv1_scale = Vector3( 1, 1, 1 )
shader_param/uv1_offset = Vector3( 0, 0, 0 ) shader_param/uv1_offset = Vector3( 0, 0, 0 )
shader_param/uv2_scale = Vector3( 1, 1, 1 ) shader_param/uv2_scale = Vector3( 1, 1, 1 )
shader_param/uv2_offset = Vector3( 0, 0, 0 ) shader_param/uv2_offset = Vector3( 0, 0, 0 )
shader_param/texture_albedo = ExtResource( 3 ) shader_param/texture_albedo = ExtResource( 5 )
_sections_unfolded = [ "shader_param" ] _sections_unfolded = [ "shader_param" ]
[sub_resource type="SphereShape" id=3] [sub_resource type="SphereShape" id=3]
@ -84,7 +84,21 @@ collision/safe_margin = 0.001
script = ExtResource( 1 ) script = ExtResource( 1 )
_sections_unfolded = [ "Axis Lock", "Transform", "collision" ] _sections_unfolded = [ "Axis Lock", "Transform", "collision" ]
[node name="Camera_rotation_helper" type="Spatial" parent="." index="0"] [node name="infos_spatial" type="Spatial" parent="." index="0"]
editor/display_folded = true
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5.20802, 0 )
script = ExtResource( 2 )
[node name="character_infos_billboard" parent="infos_spatial" index="0" instance=ExtResource( 3 )]
visible = false
mouse_default_cursor_shape = 2
_sections_unfolded = [ "Mouse", "Rect", "Size Flags", "Visibility" ]
[node name="Camera_rotation_helper" type="Spatial" parent="." index="1"]
editor/display_folded = true
[node name="Camera" type="Camera" parent="Camera_rotation_helper" index="0"] [node name="Camera" type="Camera" parent="Camera_rotation_helper" index="0"]
@ -120,8 +134,9 @@ near = 0.05
far = 100.0 far = 100.0
_sections_unfolded = [ "Transform" ] _sections_unfolded = [ "Transform" ]
[node name="MeshInstance" type="MeshInstance" parent="." index="1"] [node name="MeshInstance" type="MeshInstance" parent="." index="2"]
editor/display_folded = true
transform = Transform( -0.281766, 0, -2.3459e-008, 0, 0.491282, 0, 2.46328e-008, 0, -0.26834, 0.0433697, 4.3256, 4.76837e-007 ) transform = Transform( -0.281766, 0, -2.3459e-008, 0, 0.491282, 0, 2.46328e-008, 0, -0.26834, 0.0433697, 4.3256, 4.76837e-007 )
layers = 1 layers = 1
material_override = null material_override = null
@ -132,7 +147,7 @@ lod_min_distance = 0.0
lod_min_hysteresis = 0.0 lod_min_hysteresis = 0.0
lod_max_distance = 0.0 lod_max_distance = 0.0
lod_max_hysteresis = 0.0 lod_max_hysteresis = 0.0
mesh = ExtResource( 2 ) mesh = ExtResource( 4 )
skeleton = NodePath("..") skeleton = NodePath("..")
material/0 = SubResource( 2 ) material/0 = SubResource( 2 )
_sections_unfolded = [ "Transform", "material" ] _sections_unfolded = [ "Transform", "material" ]
@ -160,17 +175,6 @@ spot_angle = 22.2473
spot_angle_attenuation = 1.0 spot_angle_attenuation = 1.0
_sections_unfolded = [ "Light", "Shadow" ] _sections_unfolded = [ "Light", "Shadow" ]
[node name="infos_spatial" type="Spatial" parent="." index="2"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5.20802, 0 )
script = ExtResource( 4 )
[node name="character_infos_billboard" parent="infos_spatial" index="0" instance=ExtResource( 5 )]
visible = false
mouse_default_cursor_shape = 2
_sections_unfolded = [ "Mouse", "Rect", "Size Flags", "Visibility" ]
[node name="collision_shape" type="CollisionShape" parent="." index="3"] [node name="collision_shape" type="CollisionShape" parent="." index="3"]
transform = Transform( 0.754381, 0, 0, 0, 0.927224, 0, 0, 0, 0.540596, 0.0499596, 4.35001, -0.0363884 ) transform = Transform( 0.754381, 0, 0, 0, 0.927224, 0, 0, 0, 0.540596, 0.0499596, 4.35001, -0.0363884 )