réorganisation des fichiers et correction de l'ecran de chargement qui ne s'adaptai pas a la taille du viewport.

This commit is contained in:
osquallo 2018-08-25 10:05:54 +02:00
parent f8a76a8fdd
commit 3d00c52d73
65 changed files with 8550 additions and 56 deletions

View file

@ -1,11 +1,10 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://assets/GUI/loading_screens/new_loading_bg_0.tga" type="Texture" id=1]
[ext_resource path="res://assets/GUI/loading_screens/new_loading_bg_1.tga" type="Texture" id=2]
[ext_resource path="res://background_loader_scene/new_loading_bg_0.tga" type="Texture" id=1]
[ext_resource path="res://background_loader_scene/new_loading_bg_1.tga" type="Texture" id=2]
[node name="background_loader" type="Panel"]
[node name="background_loader" type="Panel" index="0"]
visible = false
self_modulate = Color( 0, 0, 0, 1 )
anchor_left = 0.0
anchor_top = 0.0
@ -15,11 +14,11 @@ rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
_sections_unfolded = [ "Mouse", "Visibility", "custom_constants" ]
size_flags_horizontal = 3
size_flags_vertical = 3
_sections_unfolded = [ "Mouse", "Size Flags", "Textures", "Visibility", "custom_constants" ]
[node name="center_container" type="MarginContainer" parent="." index="0"]
[node name="center_container" type="CenterContainer" parent="." index="0"]
anchor_left = 0.0
anchor_top = 0.0
@ -27,11 +26,12 @@ anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
_sections_unfolded = [ "Mouse" ]
size_flags_horizontal = 3
size_flags_vertical = 3
use_top_left = false
_sections_unfolded = [ "Size Flags" ]
[node name="texture_progress" type="TextureProgress" parent="center_container" index="0"]
@ -39,15 +39,16 @@ anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 8.0
margin_right = 1032.0
margin_bottom = 600.0
margin_left = 509.0
margin_top = 297.0
margin_right = 515.0
margin_bottom = 303.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
size_flags_horizontal = 3
size_flags_vertical = 3
min_value = 0.0
max_value = 100.0
step = 1.0
@ -60,7 +61,11 @@ texture_over = null
texture_progress = ExtResource( 2 )
radial_fill_degrees = 360.0
radial_center_offset = Vector2( 0, 0 )
nine_patch_stretch = false
_sections_unfolded = [ "Mouse", "Textures" ]
nine_patch_stretch = true
stretch_margin_left = 3
stretch_margin_top = 3
stretch_margin_right = 3
stretch_margin_bottom = 3
_sections_unfolded = [ "Rect", "Size Flags", "Textures" ]

View file

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

View file

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

View file

@ -1,9 +1,9 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://assets/Game/basekits/Kit_dispensaire.meshlib" type="MeshLibrary" id=1]
[ext_resource path="res://scenes/Game/portail/portail.tscn" type="PackedScene" id=2]
[ext_resource path="res://game_scene/Game/portail/portail.tscn" type="PackedScene" id=2]
[node name="dispensaire_gridmap" type="Node" index="0"]
[node name="dispensaire_gridmap" type="Node"]
[node name="start_position" type="Spatial" parent="." index="0"]
@ -23,7 +23,7 @@ cell_scale = 1.0
collision_layer = 1
collision_mask = 1
data = {
"cells": PoolIntArray( 3, 0, 655361, 5, 0, 655361, 65535, 0, 1048579, 2, 65534, 1073741825, 4, 65534, 1, 0, 65535, 1441797, 1, 65535, 1441797, 2, 65535, 1441798, 3, 65535, 537919494, 4, 65535, 1441798, 5, 65535, 537919494, 6, 65535, 1075183617, 65535, 65535, 1048578 )
"cells": PoolIntArray( 3, 0, 655361, 5, 0, 655361, 65535, 0, 1048579, 2, 65534, 1, 4, 65534, 1, 0, 65535, 1441797, 1, 65535, 1441797, 2, 65535, 538312710, 3, 65535, 1048582, 4, 65535, 1441798, 5, 65535, 1048582, 6, 65535, 1441793, 65535, 65535, 1048578 )
}
_sections_unfolded = [ "Cell" ]
__meta__ = {
@ -33,6 +33,6 @@ __meta__ = {
[node name="portail" parent="world" index="1" instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.65801, 0, 3.40425 )
scene_path = NodePath("res://scenes/Game/Game.tscn")
scene_path = NodePath("res://game_scene/Game/Game.tscn")

View file

@ -4,9 +4,9 @@
[ext_resource path="res://assets/Game/basekits/dispensaire_scenes/DisCor2wDoLAA01.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/Game/basekits/dispensaire_scenes/DisCor1wAA01.tscn" type="PackedScene" id=3]
[ext_resource path="res://assets/Game/basekits/dispensaire_scenes/DisCor2wDoLRAA01.tscn" type="PackedScene" id=4]
[ext_resource path="res://scenes/Game/portail/portail.tscn" type="PackedScene" id=5]
[ext_resource path="res://game_scene/Game/portail/portail.tscn" type="PackedScene" id=5]
[node name="dispensaire_scenes" type="Node" index="0"]
[node name="dispensaire_scenes" type="Node"]
[node name="world" type="Spatial" parent="." index="0"]
@ -50,7 +50,7 @@ transform = Transform( -1, 0, -8.74228e-008, 0, 1, 0, 8.74228e-008, 0, -1, -4.48
[node name="portail" parent="." index="1" instance=ExtResource( 5 )]
transform = Transform( -4.37114e-008, 0, -1, 0, 1, 0, 1, 0, -4.37114e-008, 0.679648, -1, 2.97083e-008 )
scene_path = NodePath("res://scenes/Game/Game.tscn")
scene_path = NodePath("res://game_scene/Game/Game.tscn")
start_position_path = NodePath("World/portail_scenes/start_position")
[node name="start_position" type="Spatial" parent="." index="2"]

7
game_scene/Game/Box.gd Normal file
View file

@ -0,0 +1,7 @@
extends RigidBody
func _on_Box_sleeping_state_changed():
if self.sleeping:
$MeshInstance.get_surface_material(0).albedo_color = Color( 0.0, 1.0, 0.0, 1 )
else:
$MeshInstance.get_surface_material(0).albedo_color = Color( 0.0, 0.0, 1.0, 1 )

View file

@ -0,0 +1,192 @@
extends KinematicBody
########
#### Caracteristic
var pseudo = ""
var color = Color( 1.0, 0.25, 0.25, 1.0 )
var gender = 1
var size = 1.0
var slot = 0
var dir = Vector3()
const GRAVITY = -24.8
var vel = Vector3()
const MAX_SPEED = 20
const ACCEL= 4.5
const FLY_SPEED = 7
const DEACCEL= 16
const MAX_SLOPE_ANGLE = 40
var MOUSE_SENSITIVITY = 0.05
onready var camera_rotation = $Camera_rotation_helper
onready var camera = $Camera_rotation_helper/Camera
onready var player_infos_billboard = $infos_spatial/character_infos_billboard
onready var player_mesh = $MeshInstance
onready var flashlight = $MeshInstance/Flashlight
### Caractéristiques du personnage.
var douleur = 0
var trauma = 0
var oubli = 0
func set_info_billboard_position():
var above_head = $infos_spatial
player_infos_billboard.get_node("label").text = self.pseudo
var offset = Vector2(-(player_infos_billboard.get_size().x/2), 0)
var unprojected_translation = camera.unproject_position(above_head.global_transform.xform(Vector3(0,0,0)))
player_infos_billboard.rect_position = (unprojected_translation + offset)
func _ready():
self.show_third_person_camera()
self.set_info_billboard_position()
self.update()
#func _enter_tree():
# print("qsdfghjklkjhgfdsqsdfghj")
# if self.get_parent().has_node( "start_position" ):
# self.translation = self.get_parent().get_node( "start_position" ).translation
func update( start_position = null ):
if start_position:
self.translation = start_position.translation
self.rotation = start_position.rotation
self.player_mesh.scale = Vector3( self.size, self.size, self.size )
self.player_mesh.get_surface_material(0).set_shader_param( "albedo", self.color )
func _process(delta):
process_input(delta)
process_movement(delta)
set_info_billboard_position()
func process_input(delta):
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
# ----------------------------------
# Walking
dir = Vector3()
var cam_xform = camera.get_global_transform()
var input_movement_vector = Vector3()
var cam_scroll = 0.0
if Input.is_action_pressed("move_up"):
input_movement_vector.z += 1
if Input.is_action_pressed("move_down"):
input_movement_vector.z -= 1
if Input.is_action_pressed("move_left"):
input_movement_vector.x -= 1
if Input.is_action_pressed("move_right"):
input_movement_vector.x += 1
input_movement_vector = input_movement_vector.normalized()
dir += -cam_xform.basis.z.normalized() * input_movement_vector.z
dir += cam_xform.basis.x.normalized() * input_movement_vector.x
if Input.is_action_pressed("fly_up"):
vel.y = FLY_SPEED
elif Input.is_action_pressed("fly_down"):
vel.y = -FLY_SPEED
else:
vel.y = 0
func process_movement(delta):
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
dir.y = 0
dir = dir.normalized()
# vel.y += delta*GRAVITY
var hvel = vel
hvel.y = 0
var target = dir
target *= MAX_SPEED
var accel
if dir.dot(hvel) > 0:
accel = ACCEL
else:
accel = DEACCEL
hvel = hvel.linear_interpolate(target, accel*delta)
vel.x = hvel.x
vel.z = hvel.z
var collision_info = move_and_collide(vel * delta)
if collision_info:
vel = vel.bounce(collision_info.normal)
var obj = collision_info.collider
if obj.is_class( "RigidBody" ):
obj.sleeping = false
obj.apply_impulse( collision_info.position, -collision_info.normal*delta )
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 )
self.douleur += 0.25
if self.douleur >= 100:
self.trauma += 0.25
if self.trauma >= 100:
self.oubli += 0.25
func _input(event):
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
if event is InputEventMouseMotion :
camera_rotation.rotate_x(deg2rad(event.relative.y * MOUSE_SENSITIVITY * -1))
self.rotate_y(deg2rad(event.relative.x * MOUSE_SENSITIVITY * -1))
var camera_rot = camera_rotation.rotation_degrees
camera_rot.x = clamp(camera_rot.x, -30, 30)
camera_rotation.rotation_degrees = camera_rot
if event is InputEventMouseButton:
# to prevent the cam sliding effect when clamp limit reached.
var old_x_translation = camera.translation.x
var old_y_translation = camera.translation.y
var cam_scroll = Vector3( 0.0, 0.0, 0.0 )
if event.button_index == BUTTON_WHEEL_UP:
cam_scroll.z = -1.0 * MOUSE_SENSITIVITY
if event.button_index == BUTTON_WHEEL_DOWN:
cam_scroll.z = 1.0 * MOUSE_SENSITIVITY
camera.translate( cam_scroll )
camera.translation.x = old_x_translation
camera.translation.y = old_y_translation
camera.translation.z = clamp(camera.translation.z, 0, 5)
# TODO trouver pourquoi cela ne se fait plus:
if Input.is_action_just_pressed("game_flashlight"):
# flashlight.visible = not flashlight.visible
if flashlight.is_visible_in_tree():
flashlight.hide()
else:
flashlight.show()
if Input.is_action_pressed( "hide_char" ):
if self.visible:
self.hide()
else:
self.show()
func hide_infos():
$infos_spatial/character_infos_billboard.hide()
func show_infos():
$infos_spatial/character_infos_billboard.show()
########
#### Cameras
func show_third_person_camera():
$Camera_rotation_helper/Camera.make_current()

View file

@ -0,0 +1,182 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://game_scene/Game/Character/Character.gd" type="Script" id=1]
[ext_resource path="res://game_scene/Game/Character/infos_spatial.gd" type="Script" id=2]
[ext_resource path="res://game_scene/character_infos_billboard.tscn" type="PackedScene" id=3]
[ext_resource path="res://game_scene/suzanne/suzanne.obj" type="ArrayMesh" id=4]
[sub_resource type="Shader" id=4]
code = "shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
uniform float specular;
uniform float metallic;
uniform float roughness : hint_range(0,1);
uniform float point_size : hint_range(0,128);
uniform sampler2D texture_metallic : hint_white;
uniform vec4 metallic_texture_channel;
uniform sampler2D texture_roughness : hint_white;
uniform vec4 roughness_texture_channel;
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;
uniform vec3 uv2_scale;
uniform vec3 uv2_offset;
void vertex() {
UV=UV*uv1_scale.xy+uv1_offset.xy;
}
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
ALBEDO = albedo.rgb * albedo_tex.rgb;
float metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);
METALLIC = metallic_tex * metallic;
float roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);
ROUGHNESS = roughness_tex * roughness;
SPECULAR = specular;
}
"
[sub_resource type="ShaderMaterial" id=5]
render_priority = 0
shader = SubResource( 4 )
shader_param/albedo = Color( 1, 1, 1, 1 )
shader_param/specular = 0.0
shader_param/metallic = 0.0
shader_param/roughness = 1.0
shader_param/point_size = 1.0
shader_param/metallic_texture_channel = Plane( 1, 0, 0, 0 )
shader_param/roughness_texture_channel = Plane( 1, 0, 0, 0 )
shader_param/uv1_scale = Vector3( 1, 1, 1 )
shader_param/uv1_offset = Vector3( 0, 0, 0 )
shader_param/uv2_scale = Vector3( 1, 1, 1 )
shader_param/uv2_offset = Vector3( 0, 0, 0 )
_sections_unfolded = [ "shader_param" ]
[sub_resource type="SphereShape" id=3]
radius = 0.520354
[node name="Character" type="KinematicBody"]
transform = Transform( 0.371345, 0, 0, 0, 0.218854, 0, 0, 0, 0.371345, -0.00167466, -0.475751, 6.02408 )
visible = false
input_ray_pickable = false
input_capture_on_drag = false
collision_layer = 1
collision_mask = 1
axis_lock_linear_x = false
axis_lock_linear_y = false
axis_lock_linear_z = false
axis_lock_angular_x = false
axis_lock_angular_y = false
axis_lock_angular_z = false
collision/safe_margin = 0.001
script = ExtResource( 1 )
_sections_unfolded = [ "Axis Lock", "Transform", "collision" ]
[node name="infos_spatial" type="Spatial" parent="." index="0"]
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_filter = 2
mouse_default_cursor_shape = 2
_sections_unfolded = [ "Mouse", "Size Flags", "Visibility" ]
[node name="Camera_rotation_helper" type="Spatial" parent="." index="1"]
[node name="Camera" type="Camera" parent="Camera_rotation_helper" index="0"]
transform = Transform( 1, 0, 0, 0, 0.972208, 0.397244, 0, -0.137979, 0.972208, 0, 6.00296, 1.22667 )
keep_aspect = 1
cull_mask = 1048575
environment = null
h_offset = 0.0
v_offset = 0.0
doppler_tracking = 0
projection = 0
current = false
fov = 70.0
size = 1.0
near = 0.05
far = 10000.0
_sections_unfolded = [ "Transform" ]
[node name="face_camera_bak" type="Camera" parent="Camera_rotation_helper" index="1"]
transform = Transform( -1, 0, -8.74228e-008, 0, 1, 0, 8.74228e-008, 0, -1, 0, 4.27532, -2.96733 )
visible = false
keep_aspect = 1
cull_mask = 1048575
environment = null
h_offset = 0.0
v_offset = 0.0
doppler_tracking = 0
projection = 1
current = false
fov = 70.0
size = 2.0
near = 0.05
far = 100.0
_sections_unfolded = [ "Transform" ]
[node name="MeshInstance" type="MeshInstance" parent="." index="2"]
transform = Transform( -0.281766, 0, -2.3459e-008, 0, 0.491282, 0, 2.46328e-008, 0, -0.26834, 0.00342001, 4.32337, -0.0753574 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = ExtResource( 4 )
skeleton = NodePath("..")
material/0 = SubResource( 5 )
_sections_unfolded = [ "Transform", "material" ]
[node name="Flashlight" type="SpotLight" parent="MeshInstance" index="0"]
transform = Transform( -2.54929, -1.60184e-009, 3.70147e-007, 0, 2.42833, 0.0302507, -2.34015e-007, 0.0192396, -4.44583, -0.0164189, -0.0857301, 1.36415 )
layers = 1
light_color = Color( 1, 1, 1, 1 )
light_energy = 2.0
light_indirect_energy = 2.0
light_negative = false
light_specular = 0.5
light_bake_mode = 1
light_cull_mask = -1
shadow_enabled = true
shadow_color = Color( 0, 0, 0, 1 )
shadow_bias = 0.15
shadow_contact = 0.0
shadow_reverse_cull_face = true
editor_only = false
spot_range = 9.90764
spot_attenuation = 1.0
spot_angle = 22.2473
spot_angle_attenuation = 1.0
_sections_unfolded = [ "Light", "Shadow" ]
[node name="collision_shape" type="CollisionShape" parent="." index="3"]
transform = Transform( 0.754381, 0, 0, 0, 0.927224, 0, 0, 0, 0.540596, 0.0063323, 4.35001, -0.0641537 )
shape = SubResource( 3 )
disabled = false

View file

@ -0,0 +1,7 @@
extends Spatial
func show():
$character_infos_billboard.show()
func hide():
$character_infos_billboard.hide()

View file

@ -0,0 +1,122 @@
[gd_scene load_steps=5 format=2]
[sub_resource type="SphereMesh" id=1]
custom_aabb = AABB( 0, 0, 0, 0, 0, 0 )
radius = 1.0
height = 2.0
radial_segments = 64
rings = 32
is_hemisphere = false
[sub_resource type="Shader" id=2]
code = "shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
uniform float specular;
uniform float metallic;
uniform float roughness : hint_range(0,1);
uniform float point_size : hint_range(0,128);
uniform sampler2D texture_metallic : hint_white;
uniform vec4 metallic_texture_channel;
uniform sampler2D texture_roughness : hint_white;
uniform vec4 roughness_texture_channel;
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;
uniform vec3 uv2_scale;
uniform vec3 uv2_offset;
void vertex() {
UV=UV*uv1_scale.xy+uv1_offset.xy;
}
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
ALBEDO = albedo.rgb * albedo_tex.rgb;
float metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);
METALLIC = metallic_tex * metallic;
float roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);
ROUGHNESS = roughness_tex * roughness;
SPECULAR = specular;
}
"
_sections_unfolded = [ "Resource" ]
[sub_resource type="ShaderMaterial" id=3]
render_priority = 0
shader = SubResource( 2 )
shader_param/albedo = Color( 0.513085, 0.250778, 0.675781, 1 )
shader_param/specular = 1.0
shader_param/metallic = 1.0
shader_param/roughness = 0.5
shader_param/point_size = 0.0
shader_param/metallic_texture_channel = null
shader_param/roughness_texture_channel = null
shader_param/uv1_scale = null
shader_param/uv1_offset = null
shader_param/uv2_scale = null
shader_param/uv2_offset = null
_sections_unfolded = [ "shader_param" ]
[sub_resource type="ConvexPolygonShape" id=4]
points = PoolVector3Array( -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1 )
[node name="CubeShaderTest" type="RigidBody"]
input_ray_pickable = true
input_capture_on_drag = false
collision_layer = 1
collision_mask = 1
mode = 0
mass = 1.0
friction = 1.0
bounce = 0.0
gravity_scale = 1.0
custom_integrator = false
continuous_cd = false
contacts_reported = 0
contact_monitor = false
sleeping = false
can_sleep = true
axis_lock_linear_x = false
axis_lock_linear_y = false
axis_lock_linear_z = false
axis_lock_angular_x = false
axis_lock_angular_y = false
axis_lock_angular_z = false
linear_velocity = Vector3( 0, 0, 0 )
linear_damp = -1.0
angular_velocity = Vector3( 0, 0, 0 )
angular_damp = -1.0
[node name="MeshInstance" type="MeshInstance" parent="." index="0"]
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 1 )
skeleton = NodePath("..")
material/0 = SubResource( 3 )
_sections_unfolded = [ "material" ]
[node name="CollisionShape" type="CollisionShape" parent="." index="1"]
shape = SubResource( 4 )
disabled = false

143
game_scene/Game/Game.gd Normal file
View file

@ -0,0 +1,143 @@
extends Spatial
var dir = Vector3()
const GRAVITY = -24.8
var vel = Vector3()
const MAX_SPEED = 20
const ACCEL= 4.5
const FLY_SPEED = 7
const DEACCEL= 16
const MAX_SLOPE_ANGLE = 40
var camera_rotation
var camera
var flashlight
var MOUSE_SENSITIVITY = 0.05
func _ready():
camera_rotation = $Character/Camera_rotation_helper
camera = $Character/Camera_rotation_helper/Camera
camera.make_current()
flashlight = $Character/MeshInstance/Flashlight
func _process(delta):
process_input(delta)
process_movement(delta)
func process_input(delta):
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
# ----------------------------------
# Walking
dir = Vector3()
var cam_xform = camera.get_global_transform()
var input_movement_vector = Vector3()
var cam_scroll = 0.0
if Input.is_action_pressed("move_up"):
input_movement_vector.z += 1
if Input.is_action_pressed("move_down"):
input_movement_vector.z -= 1
if Input.is_action_pressed("move_left"):
input_movement_vector.x -= 1
if Input.is_action_pressed("move_right"):
input_movement_vector.x += 1
input_movement_vector = input_movement_vector.normalized()
dir += -cam_xform.basis.z.normalized() * input_movement_vector.z
dir += cam_xform.basis.x.normalized() * input_movement_vector.x
if Input.is_action_pressed("fly_up"):
vel.y = FLY_SPEED
elif Input.is_action_pressed("fly_down"):
vel.y = -FLY_SPEED
else:
vel.y = 0
func process_movement(delta):
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
dir.y = 0
dir = dir.normalized()
# vel.y += delta*GRAVITY
var hvel = vel
hvel.y = 0
var target = dir
target *= MAX_SPEED
var accel
if dir.dot(hvel) > 0:
accel = ACCEL
else:
accel = DEACCEL
hvel = hvel.linear_interpolate(target, accel*delta)
vel.x = hvel.x
vel.z = hvel.z
var collision_info = $Character.move_and_collide(vel * delta)
if collision_info:
vel = vel.bounce(collision_info.normal)
var obj = collision_info.collider
if obj.is_class( "RigidBody" ):
obj.sleeping = false
obj.apply_impulse( collision_info.position, -collision_info.normal*delta )
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 )
$Character.get_node( "../../GUI/HUD/Jauges/douleur/ProgressBar" ).value += 0.25
if $Character.get_node( "../../GUI/HUD/Jauges/douleur/ProgressBar" ).value >= 100:
$Character.get_node( "../../GUI/HUD/Jauges/trauma/ProgressBar" ).value += 0.25
if $Character.get_node( "../../GUI/HUD/Jauges/trauma/ProgressBar" ).value >= 100:
$Character.get_node( "../../GUI/HUD/Jauges/oubli/ProgressBar" ).value += 0.25
func _input(event):
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
if event is InputEventMouseMotion :
camera_rotation.rotate_x(deg2rad(event.relative.y * MOUSE_SENSITIVITY * -1))
$Character.rotate_y(deg2rad(event.relative.x * MOUSE_SENSITIVITY * -1))
var camera_rot = camera_rotation.rotation_degrees
camera_rot.x = clamp(camera_rot.x, -30, 30)
camera_rotation.rotation_degrees = camera_rot
if event is InputEventMouseButton:
# to prevent the cam sliding effect when clamp limit reached.
var old_x_translation = camera.translation.x
var old_y_translation = camera.translation.y
var cam_scroll = Vector3( 0.0, 0.0, 0.0 )
if event.button_index == BUTTON_WHEEL_UP:
cam_scroll.z = -1.0 * MOUSE_SENSITIVITY
if event.button_index == BUTTON_WHEEL_DOWN:
cam_scroll.z = 1.0 * MOUSE_SENSITIVITY
camera.translate( cam_scroll )
camera.translation.x = old_x_translation
camera.translation.y = old_y_translation
camera.translation.z = clamp(camera.translation.z, 0, 5)
# TODO trouver pourquoi cela ne se fait plus:
if Input.is_action_just_pressed("game_flashlight"):
# flashlight.visible = not flashlight.visible
if flashlight.is_visible_in_tree():
flashlight.hide()
else:
flashlight.show()
if Input.is_action_pressed( "hide_char" ):
$MeshInstance.visible = not $MeshInstance.visible

1357
game_scene/Game/Game.tscn Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,360 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://assets/Game/Brick08/Bricks08_col.jpg" type="Texture" id=1]
[ext_resource path="res://assets/Game/Brick08/Bricks08_AO.jpg" type="Texture" id=2]
[ext_resource path="res://assets/Game/Brick08/Bricks08_disp.jpg" type="Texture" id=3]
[ext_resource path="res://assets/Game/Brick08/Bricks08_nrm.jpg" type="Texture" id=4]
[ext_resource path="res://assets/Game/Brick08/Bricks08_rgh.jpg" type="Texture" id=5]
[sub_resource type="PlaneMesh" id=1]
custom_aabb = AABB( 0, 0, 0, 0, 0, 0 )
size = Vector2( 2, 2 )
subdivide_width = 0
subdivide_depth = 0
[sub_resource type="SpatialMaterial" id=2]
render_priority = 1
flags_transparent = false
flags_unshaded = false
flags_vertex_lighting = false
flags_no_depth_test = false
flags_use_point_size = false
flags_world_triplanar = false
flags_fixed_size = false
flags_albedo_tex_force_srgb = false
vertex_color_use_as_albedo = false
vertex_color_is_srgb = false
params_diffuse_mode = 0
params_specular_mode = 0
params_blend_mode = 0
params_cull_mode = 0
params_depth_draw_mode = 0
params_line_width = 1.0
params_point_size = 1.0
params_billboard_mode = 0
params_grow = false
params_use_alpha_scissor = false
albedo_color = Color( 1, 1, 1, 1 )
albedo_texture = ExtResource( 1 )
metallic = 0.0
metallic_specular = 0.0
metallic_texture_channel = 0
roughness = 1.0
roughness_texture = ExtResource( 5 )
roughness_texture_channel = 3
emission_enabled = false
normal_enabled = true
normal_scale = 1.0
normal_texture = ExtResource( 4 )
rim_enabled = false
clearcoat_enabled = false
anisotropy_enabled = false
ao_enabled = true
ao_light_affect = 0.0
ao_texture = ExtResource( 2 )
ao_on_uv2 = false
ao_texture_channel = 0
depth_enabled = true
depth_scale = 0.05
depth_deep_parallax = true
depth_min_layers = 8
depth_max_layers = 32
depth_texture = ExtResource( 3 )
subsurf_scatter_enabled = false
transmission_enabled = false
refraction_enabled = false
detail_enabled = false
uv1_scale = Vector3( 2, 2, 2 )
uv1_offset = Vector3( 0, 0, 0 )
uv1_triplanar = false
uv1_triplanar_sharpness = 1.0
uv2_scale = Vector3( 1, 1, 1 )
uv2_offset = Vector3( 0, 0, 0 )
uv2_triplanar = false
uv2_triplanar_sharpness = 1.0
proximity_fade_enable = false
distance_fade_enable = false
_sections_unfolded = [ "Albedo", "Ambient Occlusion", "Anisotropy", "Clearcoat", "Depth", "Detail", "Distance Fade", "Emission", "Flags", "Metallic", "NormalMap", "Parameters", "Proximity Fade", "Refraction", "Roughness", "Subsurf Scatter", "Transmission", "UV1", "UV2", "Vertex Color" ]
[sub_resource type="ConvexPolygonShape" id=3]
points = PoolVector3Array( 1, 0, 1, -1, 0, 1, 1, 0, -1, -1, 0, -1 )
[sub_resource type="SpatialMaterial" id=4]
render_priority = 0
flags_transparent = true
flags_unshaded = false
flags_vertex_lighting = false
flags_no_depth_test = false
flags_use_point_size = false
flags_world_triplanar = false
flags_fixed_size = false
flags_albedo_tex_force_srgb = false
vertex_color_use_as_albedo = false
vertex_color_is_srgb = false
params_diffuse_mode = 0
params_specular_mode = 0
params_blend_mode = 0
params_cull_mode = 0
params_depth_draw_mode = 0
params_line_width = 1.0
params_point_size = 1.0
params_billboard_mode = 0
params_grow = false
params_use_alpha_scissor = false
albedo_color = Color( 1, 1, 1, 0 )
metallic = 0.0
metallic_specular = 0.5
metallic_texture_channel = 0
roughness = 0.0
roughness_texture_channel = 0
emission_enabled = false
normal_enabled = false
rim_enabled = false
clearcoat_enabled = false
anisotropy_enabled = false
ao_enabled = false
depth_enabled = false
subsurf_scatter_enabled = false
transmission_enabled = false
refraction_enabled = false
detail_enabled = false
uv1_scale = Vector3( 1, 1, 1 )
uv1_offset = Vector3( 0, 0, 0 )
uv1_triplanar = false
uv1_triplanar_sharpness = 1.0
uv2_scale = Vector3( 1, 1, 1 )
uv2_offset = Vector3( 0, 0, 0 )
uv2_triplanar = false
uv2_triplanar_sharpness = 1.0
proximity_fade_enable = false
distance_fade_enable = false
_sections_unfolded = [ "Albedo", "Flags" ]
[node name="Terrain" type="Spatial"]
[node name="Floor" type="StaticBody" parent="." index="0"]
editor/display_folded = true
input_ray_pickable = true
input_capture_on_drag = false
collision_layer = 1
collision_mask = 1
friction = 1.0
bounce = 0.0
constant_linear_velocity = Vector3( 0, 0, 0 )
constant_angular_velocity = Vector3( 0, 0, 0 )
[node name="MeshInstance" type="MeshInstance" parent="Floor" index="0"]
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 1 )
skeleton = NodePath("..")
material/0 = SubResource( 2 )
_sections_unfolded = [ "Geometry", "Transform", "material" ]
[node name="CollisionShape" type="CollisionShape" parent="Floor" index="1"]
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0 )
shape = SubResource( 3 )
disabled = false
[node name="Ceilling" type="StaticBody" parent="." index="1"]
editor/display_folded = true
transform = Transform( 1, 0, 0, 0, -0.984809, -0.173641, 0, 0.173641, -0.984809, 0, 20, 0 )
input_ray_pickable = true
input_capture_on_drag = false
collision_layer = 1
collision_mask = 1
friction = 1.0
bounce = 0.0
constant_linear_velocity = Vector3( 0, 0, 0 )
constant_angular_velocity = Vector3( 0, 0, 0 )
_sections_unfolded = [ "Transform" ]
[node name="MeshInstance" type="MeshInstance" parent="Ceilling" index="0"]
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 1 )
skeleton = NodePath("..")
material/0 = SubResource( 4 )
_sections_unfolded = [ "Transform", "material" ]
[node name="CollisionShape" type="CollisionShape" parent="Ceilling" index="1"]
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0 )
shape = SubResource( 3 )
disabled = false
[node name="Wall1" type="StaticBody" parent="." index="2"]
editor/display_folded = true
transform = Transform( -4.37114e-008, 1, 0, -1, -4.37114e-008, 0, 0, 0, 1, -10, 10, 0 )
input_ray_pickable = true
input_capture_on_drag = false
collision_layer = 1
collision_mask = 1
friction = 1.0
bounce = 0.0
constant_linear_velocity = Vector3( 0, 0, 0 )
constant_angular_velocity = Vector3( 0, 0, 0 )
_sections_unfolded = [ "Transform" ]
[node name="MeshInstance" type="MeshInstance" parent="Wall1" index="0"]
transform = Transform( -4.37114e-007, 0, -10, 0, 10, 0, 10, 0, -4.37114e-007, 0, 0, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 1 )
skeleton = NodePath("..")
material/0 = SubResource( 2 )
_sections_unfolded = [ "Transform", "material" ]
[node name="CollisionShape" type="CollisionShape" parent="Wall1" index="1"]
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0 )
shape = SubResource( 3 )
disabled = false
_sections_unfolded = [ "Transform" ]
[node name="Wall2" type="StaticBody" parent="." index="3"]
editor/display_folded = true
transform = Transform( -4.37114e-008, -1, 0, 1, -4.37114e-008, 0, 0, 0, 1, 10, 10, 0 )
input_ray_pickable = true
input_capture_on_drag = false
collision_layer = 1
collision_mask = 1
friction = 1.0
bounce = 0.0
constant_linear_velocity = Vector3( 0, 0, 0 )
constant_angular_velocity = Vector3( 0, 0, 0 )
_sections_unfolded = [ "Transform" ]
[node name="MeshInstance" type="MeshInstance" parent="Wall2" index="0"]
transform = Transform( -4.37114e-007, 0, 10, 0, 10, 0, -10, 0, -4.37114e-007, 0, 0, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 1 )
skeleton = NodePath("..")
material/0 = SubResource( 2 )
_sections_unfolded = [ "Transform", "material" ]
[node name="CollisionShape" type="CollisionShape" parent="Wall2" index="1"]
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0 )
shape = SubResource( 3 )
disabled = false
[node name="Wall3" type="StaticBody" parent="." index="4"]
editor/display_folded = true
transform = Transform( 1.91069e-015, 4.37114e-008, 1, 1, -4.37114e-008, 0, 4.37114e-008, 1, -4.37114e-008, 0, 10, -10 )
input_ray_pickable = true
input_capture_on_drag = false
collision_layer = 1
collision_mask = 1
friction = 1.0
bounce = 0.0
constant_linear_velocity = Vector3( 0, 0, 0 )
constant_angular_velocity = Vector3( 0, 0, 0 )
_sections_unfolded = [ "Transform" ]
[node name="MeshInstance" type="MeshInstance" parent="Wall3" index="0"]
transform = Transform( -4.37114e-007, 0, 10, 0, 10, 0, -10, 0, -4.37114e-007, 0, 0, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 1 )
skeleton = NodePath("..")
material/0 = SubResource( 2 )
_sections_unfolded = [ "Transform", "material" ]
[node name="CollisionShape" type="CollisionShape" parent="Wall3" index="1"]
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0 )
shape = SubResource( 3 )
disabled = false
[node name="Wall4" type="StaticBody" parent="." index="5"]
editor/display_folded = true
transform = Transform( 1.91069e-015, 4.37114e-008, -1, 1, -4.37114e-008, 0, -4.37114e-008, -1, -4.37114e-008, 0, 10, 10 )
input_ray_pickable = true
input_capture_on_drag = false
collision_layer = 1
collision_mask = 1
friction = 1.0
bounce = 0.0
constant_linear_velocity = Vector3( 0, 0, 0 )
constant_angular_velocity = Vector3( 0, 0, 0 )
_sections_unfolded = [ "Transform" ]
[node name="MeshInstance" type="MeshInstance" parent="Wall4" index="0"]
transform = Transform( -4.37114e-007, 0, 10, 0, 10, 0, -10, 0, -4.37114e-007, 0, 0, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 1 )
skeleton = NodePath("..")
material/0 = SubResource( 2 )
_sections_unfolded = [ "Transform", "material" ]
[node name="CollisionShape" type="CollisionShape" parent="Wall4" index="1"]
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0 )
shape = SubResource( 3 )
disabled = false

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,27 @@
[gd_scene load_steps=1 format=2]
[sub_resource id=1 type="ArrayMesh"]
surfaces/0 = {
"primitive":4,
"arrays":[
Vector3Array(1.0, 4.0, -1.0, -1.0, 4.0, 1.0, -1.0, 4.0, -1.0, 1.0, 4.0, 1.0),
Vector3Array(0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0),
null, ; No Tangents,
null, ; no Vertex Colors,
null, ; No UV1,
null, ; No UV2,
null, ; No Bones,
null, ; No Weights,
IntArray(0, 2, 1, 0, 1, 3)
],
"morph_arrays":[]
}
[node type="Spatial" name="Scene"]
[node name="Plane" type="MeshInstance" parent="."]
mesh = SubResource(1)
visible = true
transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0)

Binary file not shown.

View file

@ -0,0 +1,27 @@
[gd_scene load_steps=1 format=2]
[sub_resource id=1 type="ArrayMesh"]
surfaces/0 = {
"primitive":4,
"arrays":[
Vector3Array(1.0, 0.0, 1.0, -1.0, 0.0, -1.0, -1.0, 0.0, 1.0, 1.0, 0.0, -1.0),
Vector3Array(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0),
null, ; No Tangents,
null, ; no Vertex Colors,
null, ; No UV1,
null, ; No UV2,
null, ; No Bones,
null, ; No Weights,
IntArray(0, 2, 1, 0, 1, 3)
],
"morph_arrays":[]
}
[node type="Spatial" name="Scene"]
[node name="Plane" type="MeshInstance" parent="."]
mesh = SubResource(1)
visible = true
transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0)

Binary file not shown.

View file

@ -0,0 +1,71 @@
[gd_scene load_steps=1 format=2]
[sub_resource id=1 type="ArrayMesh"]
surfaces/0 = {
"primitive":4,
"arrays":[
Vector3Array(1.0, 0.0, -1.0, -1.0, 2.0, -1.0, -1.0, 0.0, -1.0, 1.0, 2.0, -1.0, -1.0, 4.0, -1.0, -1.0, 2.0, -1.0, -1.0, 0.0, 1.0, -1.0, 0.0, -1.0, -1.0, 4.0, -1.0, -1.0, 2.0, 1.0, 1.0, 4.0, -1.0, -1.0, 4.0, 1.0),
Vector3Array(0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0),
null, ; No Tangents,
null, ; no Vertex Colors,
null, ; No UV1,
null, ; No UV2,
null, ; No Bones,
null, ; No Weights,
IntArray(0, 2, 1, 3, 1, 4, 5, 7, 6, 8, 5, 9, 0, 1, 3, 3, 4, 10, 5, 6, 9, 8, 9, 11)
],
"morph_arrays":[]
}
[sub_resource id=2 type="ArrayMesh"]
surfaces/0 = {
"primitive":4,
"arrays":[
Vector3Array(1.0, 0.0, -1.0, -1.0, 2.0, -1.0, -1.0, 0.0, -1.0, 1.0, 2.0, -1.0, -1.0, 4.0, -1.0, 1.0, 4.0, -1.0),
Vector3Array(0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0),
null, ; No Tangents,
null, ; no Vertex Colors,
null, ; No UV1,
null, ; No UV2,
null, ; No Bones,
null, ; No Weights,
IntArray(0, 2, 1, 3, 1, 4, 0, 1, 3, 3, 4, 5)
],
"morph_arrays":[]
}
[node type="Spatial" name="Scene"]
[node name="Plane001" type="MeshInstance" parent="."]
mesh = SubResource(1)
visible = true
transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 3.0, 0.0, 0.0)
[node name="Plane" type="MeshInstance" parent="."]
mesh = SubResource(2)
visible = true
transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0)
[node name="Lamp" type="OmniLight" parent="."]
light_specular = 1.0
light_energy = 1.0
light_color = Color(1.0, 1.0, 1.0, 1.0)
shadow_color = Color(0.0, 0.0, 0.0, 1.0)
omni_range = 30.0
transform = Transform(-0.290865, -0.771101, 0.566393, -0.0551891, 0.604525, 0.794672, -0.955171, 0.199883, -0.218391, 4.07625, 5.90386, -1.00545)
shadow_enabled = true
light_negative = false
[node name="Camera" type="Camera" parent="."]
far = 100.0
near = 0.1
size = 7.31429
projection = 0
fov = 49.1343
transform = Transform(0.685921, -0.324014, 0.651558, 0.0, 0.895396, 0.445271, -0.727676, -0.305421, 0.61417, 7.48113, 5.34367, 6.50764)

Binary file not shown.

View file

@ -0,0 +1,11 @@
extends WorldEnvironment
func _process(delta):
$sky_sphere.rotate( Vector3(0, 1, 0), delta*global.time_scale )
$sky_sphere.rotate( Vector3(0, 0, 1), delta*global.time_scale )
$sun.translation = Vector3( 0, 0, 0 )
$sun.rotate( Vector3(0, 1, 0), delta*global.time_scale )
$sun.rotate( Vector3(0, 0, 1), delta*global.time_scale )
$sun.translate( Vector3( 1000, 1000, 1000 ) )

View file

@ -0,0 +1,62 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://assets/Game/materials/ps_fire_01.tres" type="Material" id=1]
[ext_resource path="res://assets/Game/materials/flamme_01.tres" type="QuadMesh" id=2]
[ext_resource path="res://game_scene/Game/smoke.tscn" type="PackedScene" id=3]
[node name="fire_01" type="Particles" index="0"]
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
emitting = true
amount = 50
lifetime = 2.0
one_shot = false
preprocess = 0.5
speed_scale = 4.5
explosiveness = 0.0
randomness = 1.0
fixed_fps = 0
fract_delta = true
visibility_aabb = AABB( -4, -4, -3.96729, 8, 8, 8 )
local_coords = false
draw_order = 0
process_material = ExtResource( 1 )
draw_passes = 1
draw_pass_1 = ExtResource( 2 )
_sections_unfolded = [ "Draw Passes", "Drawing", "Geometry", "Process Material", "Time", "Transform", "Visibility" ]
[node name="OmniLight" type="OmniLight" parent="." index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.305395, 0 )
layers = 1
light_color = Color( 1, 1, 1, 1 )
light_energy = 0.5
light_indirect_energy = 1.0
light_negative = false
light_specular = 0.5
light_bake_mode = 1
light_cull_mask = -1
shadow_enabled = true
shadow_color = Color( 1, 1, 1, 1 )
shadow_bias = 0.15
shadow_contact = 0.0
shadow_reverse_cull_face = false
editor_only = false
omni_range = 5.0
omni_attenuation = 1.0
omni_shadow_mode = 1
omni_shadow_detail = 1
_sections_unfolded = [ "Editor", "Light", "Omni", "Shadow" ]
[node name="smoke" parent="." index="1" instance=ExtResource( 3 )]

View file

@ -0,0 +1,72 @@
extends Spatial
# Member variables
var prev_pos = null
var last_click_pos = null
var viewport = null
func _input(event):
# Check if the event is a non-mouse event
var is_mouse_event = false
var mouse_events = [InputEventMouseButton, InputEventMouseMotion, InputEventScreenDrag, InputEventScreenTouch]
for mouse_event in mouse_events:
if (event is mouse_event):
is_mouse_event = true
break
# If it is, then pass the event to the viewport
if (is_mouse_event == false):
viewport.input(event)
# Mouse events for Area
func _on_area_input_event(camera, event, click_pos, click_normal, shape_idx):
print("AREA")
# Use click pos (click in 3d space, convert to area space)
var pos = get_node("Area").get_global_transform().affine_inverse()
# the click pos is not zero, then use it to convert from 3D space to area space
if (click_pos.x != 0 or click_pos.y != 0 or click_pos.z != 0):
pos *= click_pos
last_click_pos = click_pos
else:
# Otherwise, we have a motion event and need to use our last click pos
# and move it according to the relative position of the event.
# NOTE: this is not an exact 1-1 conversion, but it's pretty close
pos *= last_click_pos
if (event is InputEventMouseMotion or event is InputEventScreenDrag):
pos.x += event.relative.x / viewport.size.x
pos.y += event.relative.y / viewport.size.y
last_click_pos = pos
# Convert to 2D
pos = Vector2(pos.x, pos.y)
# Convert to viewport coordinate system
# Convert pos to a range from (0 - 1)
pos.y *= -1
pos += Vector2(1, 1)
pos = pos / 2
# Convert pos to be in range of the viewport
pos.x *= viewport.size.x
pos.y *= viewport.size.y
# Set the position in event
event.position = pos
event.global_position = pos
if (prev_pos == null):
prev_pos = pos
if (event is InputEventMouseMotion):
event.relative = pos - prev_pos
prev_pos = pos
# Send the event to the viewport
viewport.input(event)
func _ready():
viewport = get_node("Viewport")
get_node("Area").connect("input_event", self, "_on_area_input_event")

View file

@ -0,0 +1,161 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://game_scene/Game/jukebox/JukeboxPannel.gd" type="Script" id=1]
[ext_resource path="res://gui_scene/GUI/MusicControls/MusicControls.tscn" type="PackedScene" id=2]
[sub_resource type="PlaneMesh" id=1]
custom_aabb = AABB( 0, 0, 0, 0, 0, 0 )
size = Vector2( 2, 2 )
subdivide_width = 0
subdivide_depth = 0
[sub_resource type="ViewportTexture" id=2]
resource_local_to_scene = true
flags = 0
viewport_path = NodePath("Viewport")
[sub_resource type="SpatialMaterial" id=3]
resource_local_to_scene = true
render_priority = 0
flags_transparent = true
flags_unshaded = true
flags_vertex_lighting = false
flags_no_depth_test = false
flags_use_point_size = false
flags_world_triplanar = false
flags_fixed_size = false
flags_albedo_tex_force_srgb = true
vertex_color_use_as_albedo = false
vertex_color_is_srgb = false
params_diffuse_mode = 0
params_specular_mode = 0
params_blend_mode = 0
params_cull_mode = 0
params_depth_draw_mode = 0
params_line_width = 1.0
params_point_size = 1.0
params_billboard_mode = 0
params_grow = false
params_use_alpha_scissor = false
albedo_color = Color( 1, 1, 1, 0.784314 )
albedo_texture = SubResource( 2 )
metallic = 0.0
metallic_specular = 0.5
metallic_texture_channel = 0
roughness = 0.0
roughness_texture_channel = 0
emission_enabled = false
normal_enabled = false
rim_enabled = false
clearcoat_enabled = false
anisotropy_enabled = false
ao_enabled = false
depth_enabled = false
subsurf_scatter_enabled = false
transmission_enabled = false
refraction_enabled = false
detail_enabled = false
uv1_scale = Vector3( 1, 1, 1 )
uv1_offset = Vector3( 0, 0, 0 )
uv1_triplanar = false
uv1_triplanar_sharpness = 1.0
uv2_scale = Vector3( 1, 1, 1 )
uv2_offset = Vector3( 0, 0, 0 )
uv2_triplanar = false
uv2_triplanar_sharpness = 1.0
proximity_fade_enable = false
distance_fade_enable = false
_sections_unfolded = [ "Albedo", "Flags", "Resource" ]
[sub_resource type="ConvexPolygonShape" id=4]
points = PoolVector3Array( 1, 0, 1, -1, 0, 1, 1, 0, -1, -1, 0, -1 )
[node name="JukeboxPannel" type="Spatial"]
script = ExtResource( 1 )
[node name="Viewport" type="Viewport" parent="." index="0"]
arvr = false
size = Vector2( 256, 256 )
own_world = false
world = null
transparent_bg = true
msaa = 2
hdr = true
disable_3d = false
usage = 0
debug_draw = 0
render_target_v_flip = true
render_target_clear_mode = 0
render_target_update_mode = 2
audio_listener_enable_2d = false
audio_listener_enable_3d = false
physics_object_picking = false
gui_disable_input = false
gui_snap_controls_to_pixels = true
shadow_atlas_size = 0
shadow_atlas_quad_0 = 2
shadow_atlas_quad_1 = 2
shadow_atlas_quad_2 = 3
shadow_atlas_quad_3 = 4
_sections_unfolded = [ "Render Target", "Rendering" ]
[node name="Music" parent="Viewport" index="0" instance=ExtResource( 2 )]
size_flags_horizontal = 5
size_flags_vertical = 5
[node name="Area" type="Area" parent="." index="1"]
input_ray_pickable = false
input_capture_on_drag = false
space_override = 0
gravity_point = false
gravity_distance_scale = 0.0
gravity_vec = Vector3( 0, -1, 0 )
gravity = 9.8
linear_damp = 0.1
angular_damp = 1.0
priority = 0.0
monitoring = true
monitorable = true
collision_layer = 1
collision_mask = 1
audio_bus_override = false
audio_bus_name = "Master"
reverb_bus_enable = false
reverb_bus_name = "Master"
reverb_bus_amount = 0.0
reverb_bus_uniformity = 0.0
[node name="MeshInstance" type="MeshInstance" parent="Area" index="0"]
transform = Transform( -1, 8.74228e-008, 3.82137e-015, 0, -4.37114e-008, 1, 8.74228e-008, 1, 4.37114e-008, 0, 0, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 1 )
skeleton = NodePath("..")
material/0 = SubResource( 3 )
_sections_unfolded = [ "material" ]
[node name="CollisionShape" type="CollisionShape" parent="Area" index="1"]
transform = Transform( -1, 8.74228e-008, 3.82137e-015, 0, -4.37114e-008, 1, 8.74228e-008, 1, 4.37114e-008, 0, 0, 0 )
shape = SubResource( 4 )
disabled = false

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,80 @@
extends Spatial
# Member variables
var prev_pos = null
var last_click_pos = null
var viewport = null
func _ready():
viewport = get_node("Viewport")
get_node("Area").connect("input_event", self, "_on_area_input_event")
func _input(event):
# Check if the event is a non-mouse event
var is_mouse_event = false
var mouse_events = [InputEventMouseButton, InputEventMouseMotion, InputEventScreenDrag, InputEventScreenTouch]
for mouse_event in mouse_events:
if (event is mouse_event):
is_mouse_event = true
break
# If it is, then pass the event to the viewport
if (is_mouse_event == false):
viewport.input(event)
# Mouse events for Area
func _on_area_input_event(camera, event, click_pos, click_normal, shape_idx):
# Use click pos (click in 3d space, convert to area space)
var pos = get_node("Area").get_global_transform().affine_inverse()
# the click pos is not zero, then use it to convert from 3D space to area space
if (click_pos.x != 0 or click_pos.y != 0 or click_pos.z != 0):
pos *= click_pos
last_click_pos = click_pos
else:
# Otherwise, we have a motion event and need to use our last click pos
# and move it according to the relative position of the event.
# NOTE: this is not an exact 1-1 conversion, but it's pretty close
pos *= last_click_pos
if (event is InputEventMouseMotion or event is InputEventScreenDrag):
pos.x += event.relative.x / viewport.size.x
pos.y += event.relative.y / viewport.size.y
last_click_pos = pos
# Convert to 2D
pos = Vector2(pos.x, pos.y)
# Convert to viewport coordinate system
# Convert pos to a range from (0 - 1)
pos.y *= -1
pos += Vector2(1, 1)
pos = pos / 2
# Convert pos to be in range of the viewport
pos.x *= viewport.size.x
pos.y *= viewport.size.y
# Set the position in event
event.position = pos
event.global_position = pos
if (prev_pos == null):
prev_pos = pos
if (event is InputEventMouseMotion):
event.relative = pos - prev_pos
prev_pos = pos
# Send the event to the viewport
viewport.input(event)
func _on_Area_body_entered(body):
if get_node( "Area" ) and body.name == "Character":
get_node( "Area" ).show()
func _on_Area_body_exited(body):
if get_node( "Area" ) and body.name == "Character":
get_node( "Area" ).hide()

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,139 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://portail.gd" type="Script" id=1]
[sub_resource type="CubeMesh" id=1]
custom_aabb = AABB( 0, 0, 0, 0, 0, 0 )
size = Vector3( 2, 2, 2 )
subdivide_width = 0
subdivide_height = 0
subdivide_depth = 0
[sub_resource type="SpatialMaterial" id=2]
render_priority = 0
flags_transparent = false
flags_unshaded = false
flags_vertex_lighting = false
flags_no_depth_test = false
flags_use_point_size = false
flags_world_triplanar = false
flags_fixed_size = false
flags_albedo_tex_force_srgb = false
vertex_color_use_as_albedo = false
vertex_color_is_srgb = false
params_diffuse_mode = 0
params_specular_mode = 0
params_blend_mode = 0
params_cull_mode = 0
params_depth_draw_mode = 0
params_line_width = 1.0
params_point_size = 1.0
params_billboard_mode = 0
params_grow = false
params_use_alpha_scissor = false
albedo_color = Color( 0.589844, 0.589844, 0.589844, 1 )
metallic = 1.0
metallic_specular = 0.5
metallic_texture_channel = 0
roughness = 0.2
roughness_texture_channel = 0
emission_enabled = false
normal_enabled = false
rim_enabled = false
clearcoat_enabled = false
anisotropy_enabled = false
ao_enabled = false
depth_enabled = false
subsurf_scatter_enabled = false
transmission_enabled = false
refraction_enabled = false
detail_enabled = false
uv1_scale = Vector3( 1, 1, 1 )
uv1_offset = Vector3( 0, 0, 0 )
uv1_triplanar = false
uv1_triplanar_sharpness = 1.0
uv2_scale = Vector3( 1, 1, 1 )
uv2_offset = Vector3( 0, 0, 0 )
uv2_triplanar = false
uv2_triplanar_sharpness = 1.0
proximity_fade_enable = false
distance_fade_enable = false
_sections_unfolded = [ "Albedo", "Metallic", "Roughness" ]
[sub_resource type="ConvexPolygonShape" id=3]
points = PoolVector3Array( -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1 )
[node name="portail" type="Spatial"]
script = ExtResource( 1 )
scene_path = ""
start_position_path = "start_position"
[node name="mesh_instance" type="MeshInstance" parent="." index="0"]
transform = Transform( 1.86317, 0, 0, 0, 2.71355, 0, 0, 0, 0.105108, 0, 2.64718, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 1 )
skeleton = NodePath("..")
material/0 = SubResource( 2 )
_sections_unfolded = [ "material" ]
[node name="static_body" type="StaticBody" parent="mesh_instance" index="0"]
input_ray_pickable = true
input_capture_on_drag = false
collision_layer = 1
collision_mask = 1
friction = 1.0
bounce = 0.0
constant_linear_velocity = Vector3( 0, 0, 0 )
constant_angular_velocity = Vector3( 0, 0, 0 )
[node name="collision_shape" type="CollisionShape" parent="mesh_instance/static_body" index="0"]
shape = SubResource( 3 )
disabled = false
[node name="area" type="Area" parent="mesh_instance" index="1"]
input_ray_pickable = false
input_capture_on_drag = false
space_override = 0
gravity_point = false
gravity_distance_scale = 0.0
gravity_vec = Vector3( 0, -1, 0 )
gravity = 9.8
linear_damp = 0.1
angular_damp = 1.0
priority = 0.0
monitoring = true
monitorable = true
collision_layer = 1
collision_mask = 1
audio_bus_override = false
audio_bus_name = "Master"
reverb_bus_enable = false
reverb_bus_name = "Master"
reverb_bus_amount = 0.0
reverb_bus_uniformity = 0.0
[node name="collision_shape2" type="CollisionShape" parent="mesh_instance/area" index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 9.40695, 0, 0, 0 )
shape = SubResource( 3 )
disabled = false
[connection signal="body_shape_entered" from="mesh_instance/area" to="." method="_on_area_body_shape_entered"]

View file

@ -0,0 +1,41 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://assets/Game/materials/ps_smoke_01.tres" type="Material" id=1]
[ext_resource path="res://assets/Game/materials/smoke_mesh_02.tres" type="QuadMesh" id=2]
[ext_resource path="res://assets/Game/materials/smoke_mesh_01.tres" type="QuadMesh" id=3]
[ext_resource path="res://assets/Game/materials/smoke_mesh_04.tres" type="QuadMesh" id=4]
[ext_resource path="res://assets/Game/materials/smoke_mesh_05.tres" type="QuadMesh" id=5]
[node name="smoke" type="Particles"]
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
emitting = true
amount = 30
lifetime = 4.0
one_shot = false
preprocess = 1.0
speed_scale = 0.1
explosiveness = 0.0
randomness = 0.0
fixed_fps = 0
fract_delta = true
visibility_aabb = AABB( -4.36976, -0.176441, -7.10573, 8.73952, 14.8617, 11.7749 )
local_coords = false
draw_order = 0
process_material = ExtResource( 1 )
draw_passes = 4
draw_pass_1 = ExtResource( 2 )
draw_pass_2 = ExtResource( 3 )
draw_pass_3 = ExtResource( 4 )
draw_pass_4 = ExtResource( 5 )
_sections_unfolded = [ "Draw Passes", "Drawing", "Geometry", "Process Material", "Time" ]

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://game_scene/game_scene.gd" type="Script" id=1]
[ext_resource path="res://scenes/Game/Game.tscn" type="PackedScene" id=2]
[ext_resource path="res://game_scene/Game/Game.tscn" type="PackedScene" id=2]
[node name="game_scene" type="Node"]

View file

@ -70,25 +70,21 @@ func load_scene( scene_path ):
return true
func change_level( p_next_state, p_next_scene_path, p_parent_next_scene = null, p_old_scene = null, p_start_position = "start_position" ):
if not load_scene( p_next_scene_path ):
print( "Erreur lors du chargement de la scene: "+str(p_next_scene_path) )
return
character.hide()
# get_node("background_loader/center_container").rect_min_size = get_viewport().size
progress_texture.rect_min_size = get_viewport().size
get_node("background_loader").show()
# print()
# print( "change_level: " )
# if p_old_scene:
# print( "from "+p_old_scene.name )
# print( "to "+str(p_next_scene_path) )
# if p_parent_next_scene:
# print( " on "+ str(p_parent_next_scene.name) )
# print()
self.current_start_position = p_start_position
if not load_scene( p_next_scene_path ):
show_error()
return
parent_scene = p_parent_next_scene
old_scene = p_old_scene
set_process(true)
if old_scene:
@ -146,6 +142,7 @@ func _input( event ):
func update_progress():
var progress = (float(loader.get_stage()) / loader.get_stage_count()) * progress_texture.max_value
progress_texture.value = progress
@ -182,3 +179,7 @@ func _on_logout_button_pressed():
self.change_level( "login", "res://login_scene/login_scene.tscn", null, current_map )
get_tree().paused = false
########
func _on_GUI_logout_button_pressed():
pass # replace with function body

View file

@ -2,7 +2,7 @@
[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://scenes/GUI/GUI.tscn" type="PackedScene" id=3]
[ext_resource path="res://gui_scene/GUI/GUI.tscn" type="PackedScene" id=3]
[node name="global" type="Node"]

96
gui_scene/GUI/GUI.gd Normal file
View file

@ -0,0 +1,96 @@
extends MarginContainer
signal logout_button_pressed
func _ready():
# pause()
self.connect( "logout_button_pressed", global, "_on_logout_button_pressed" )
func _on_Home_setting_pressed():
$Home.hide()
$Settings.show()
$Help.hide()
func _on_Settings_return_pressed():
$Home.show()
$Settings.hide()
$Help.show()
func _on_Home_play_pressed():
if not get_tree().paused:
pause()
else:
play()
func _input(event):
if event.is_action_pressed("ui_test"):
print( "Event: ui_test" )
if event.is_action_pressed("ui_quit"):
get_tree().quit()
if event.is_action_pressed("ui_reload"):
if not $Settings.visible:
get_tree().reload_current_scene()
if event.is_action_pressed("ui_pause") and not event.is_echo():
if not $Settings.visible:
if not get_tree().paused:
pause()
else:
play()
# ----------------------------------
# Capturing/Freeing the cursor
if Input.is_action_just_pressed("ui_free_cursor"):
if Input.get_mouse_mode() == Input.MOUSE_MODE_VISIBLE:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
else:
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
# ----------------------------------
if Input.is_action_just_pressed("ui_hide_all"):
self.visible = not self.visible
if Input.is_action_just_pressed("ui_hide_hud"):
$HUD.visible = not $HUD.visible
# Si on est en mode "deplacement", on desative le focus sur l'interface
# afin de ne pas naviguer dedans en même temps que l'on agit en jeu.
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
recursive_release_focus( self )
func recursive_release_focus( control ):
if control is Control:
if len(control.get_children()) > 0:
for child in control.get_children():
recursive_release_focus( child )
control.release_focus()
func pause():
get_tree().paused = true
show_menu()
func play():
get_tree().paused = false
hide_menu()
func show_menu():
$Home.show()
$Settings.hide()
$HUD.modulate.a = 0.5
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
func hide_menu():
$Settings.hide()
$Home.hide()
$Help.show()
$HUD.modulate.a = 1.0
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
func _on_Settings_font_changed( value ):
$HUD.get_theme().default_font.size = value
func _on_login_menu_login_button_pressed():
$login_menu.hide()
$character_selection_menu.show()
func _on_Home_logout_pressed():
emit_signal( "logout_button_pressed" )

84
gui_scene/GUI/GUI.tscn Normal file
View file

@ -0,0 +1,84 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://gui_scene/GUI/GUI.gd" type="Script" id=1]
[ext_resource path="res://gui_scene/GUI/HUD/HUD.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/GUI/fonts/ryzom.ttf" type="DynamicFontData" id=3]
[ext_resource path="res://gui_scene/GUI/Home/Home.tscn" type="PackedScene" id=4]
[ext_resource path="res://gui_scene/GUI/Settings/Settings.tscn" type="PackedScene" id=5]
[ext_resource path="res://gui_scene/GUI/Help/Help.tscn" type="PackedScene" id=6]
[sub_resource type="DynamicFont" id=1]
size = 14
use_mipmaps = false
use_filter = false
font_data = ExtResource( 3 )
_sections_unfolded = [ "Font", "Settings" ]
[sub_resource type="Theme" id=2]
default_font = SubResource( 1 )
[node name="GUI" type="MarginContainer"]
pause_mode = 2
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
custom_constants/margin_right = 0
custom_constants/margin_top = 0
custom_constants/margin_left = 0
custom_constants/margin_bottom = 0
script = ExtResource( 1 )
_sections_unfolded = [ "Margin", "Mouse", "Pause", "Size Flags", "Theme", "custom_constants" ]
[node name="HUD" parent="." index="0" instance=ExtResource( 2 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1024.0
margin_bottom = 600.0
theme = SubResource( 2 )
[node name="Home" parent="." index="1" instance=ExtResource( 4 )]
visible = false
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1024.0
margin_bottom = 600.0
_sections_unfolded = [ "Mouse", "Size Flags", "Visibility", "custom_constants" ]
[node name="Settings" parent="." index="2" instance=ExtResource( 5 )]
visible = false
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1024.0
margin_bottom = 600.0
_sections_unfolded = [ "Mouse", "Size Flags", "Theme", "custom_constants" ]
[node name="Help" parent="." index="3" instance=ExtResource( 6 )]
margin_right = 256.0
margin_bottom = 256.0
_sections_unfolded = [ "Margin", "Mouse", "Size Flags", "custom_constants" ]
[connection signal="logout_pressed" from="Home" to="." method="_on_Home_logout_pressed"]
[connection signal="play_pressed" from="Home" to="." method="_on_Home_play_pressed"]
[connection signal="setting_pressed" from="Home" to="." method="_on_Home_setting_pressed"]
[connection signal="font_changed" from="Settings" to="." method="_on_Settings_font_changed"]
[connection signal="return_pressed" from="Settings" to="." method="_on_Settings_return_pressed"]

30
gui_scene/GUI/HUD/HUD.gd Normal file
View file

@ -0,0 +1,30 @@
extends MarginContainer
var HUD_config_file = "user://hud.cfg"
func _ready():
var config_file = ConfigFile.new()
var err = config_file.load( HUD_config_file )
if err:
print("Error code when loading config file: ", err)
else:
for child in get_node("Windows" ).get_children():
child.load_from_file( config_file )
func _input( event ):
if event.is_action_pressed( "ui_music_controls" ):
$Windows/Music.visible = not $Windows/Music.visible
func _on_SaveHUD_pressed():
var config_file = ConfigFile.new()
var err = config_file.load( HUD_config_file )
if err:
print("Error code when loading config file: ", err)
for child in get_node("Windows" ).get_children():
child.save_to_file( config_file )
config_file.save( HUD_config_file )

735
gui_scene/GUI/HUD/HUD.tscn Normal file
View file

@ -0,0 +1,735 @@
[gd_scene load_steps=12 format=2]
[ext_resource path="res://gui_scene/GUI/HUD/HUD.gd" type="Script" id=1]
[ext_resource path="res://gui_scene/GUI/HUD/Windows.gd" type="Script" id=2]
[ext_resource path="res://addons/ui_window/ui_window.gd" type="Script" id=3]
[ext_resource path="res://addons/ui_window/icon.png" type="Texture" id=4]
[ext_resource path="res://assets/GUI/images/background_test.png" type="Texture" id=5]
[ext_resource path="res://gui_scene/GUI/HUD/chat_lines.gd" type="Script" id=6]
[ext_resource path="res://gui_scene/GUI/HUD/rich_text_label.gd" type="Script" id=7]
[ext_resource path="res://gui_scene/GUI/MusicControls/MusicControls.tscn" type="PackedScene" id=8]
[ext_resource path="res://gui_scene/GUI/HUD/oubli.gd" type="Script" id=9]
[ext_resource path="res://gui_scene/GUI/HUD/trauma.gd" type="Script" id=10]
[ext_resource path="res://gui_scene/GUI/HUD/douleur.gd" type="Script" id=11]
[node name="HUD" type="MarginContainer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
custom_constants/margin_right = 0
custom_constants/margin_top = 0
custom_constants/margin_left = 0
custom_constants/margin_bottom = 0
script = ExtResource( 1 )
_sections_unfolded = [ "Margin", "Mouse", "Pause", "Rect", "Size Flags", "Theme", "Visibility", "custom_constants" ]
[node name="overlay_oubli" type="Panel" parent="." index="0"]
modulate = Color( 0, 0, 0, 0 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1024.0
margin_bottom = 600.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
_sections_unfolded = [ "Mouse", "Visibility" ]
[node name="overlay_douleur" type="Panel" parent="." index="1"]
modulate = Color( 1, 0, 0, 0 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1024.0
margin_bottom = 600.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
_sections_unfolded = [ "Mouse", "Visibility" ]
[node name="Windows" type="ReferenceRect" parent="." index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1024.0
margin_bottom = 600.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource( 2 )
_sections_unfolded = [ "Mouse", "Pause", "Size Flags", "Theme", "Visibility", "custom_styles" ]
[node name="ui_window" type="MarginContainer" parent="Windows" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 759.0
margin_top = 89.0
margin_right = 997.0
margin_bottom = 228.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
script = ExtResource( 3 )
_sections_unfolded = [ "Theme", "Visibility", "custom_constants" ]
__meta__ = {
"_editor_icon": ExtResource( 4 )
}
is_movable = true
is_resizable = true
is_borderless = false
has_footer = true
title = "Test window plugin"
content_color = Color( 1, 1, 1, 1 )
background_color = Color( 0.808594, 0.808594, 0.808594, 1 )
background_texture = null
min_size = Vector2( 128, 128 )
content_margin = Rect2( 8, 8, 8, 8 )
[node name="chat" type="MarginContainer" parent="Windows" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 20.0
margin_top = 435.0
margin_right = 258.0
margin_bottom = 574.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
script = ExtResource( 3 )
_sections_unfolded = [ "Pause", "custom_constants" ]
__meta__ = {
"_edit_group_": true,
"_editor_icon": ExtResource( 4 )
}
is_movable = true
is_resizable = true
is_borderless = true
has_footer = true
title = "Test Chat"
content_color = Color( 1, 1, 1, 1 )
background_color = Color( 1, 1, 1, 1 )
background_texture = ExtResource( 5 )
min_size = Vector2( 128, 128 )
content_margin = Rect2( 8, 8, 8, 8 )
[node name="chat_lines" type="VBoxContainer" parent="Windows/chat" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 8.0
margin_right = 238.0
margin_bottom = 139.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 0
script = ExtResource( 6 )
_sections_unfolded = [ "Size Flags" ]
[node name="label" type="Label" parent="Windows/chat/chat_lines" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 230.0
margin_bottom = 31.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_colors/font_color = Color( 0.164063, 0.31427, 1, 1 )
text = "MDJ: Bienvenue sur Khanat, rêvez bien !"
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "custom_colors" ]
[node name="rich_text_label" type="RichTextLabel" parent="Windows/chat/chat_lines" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 35.0
margin_right = 230.0
margin_bottom = 35.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = true
focus_mode = 2
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
bbcode_enabled = true
bbcode_text = "Ceci est un test en [color=red]couleur[/color]."
visible_characters = -1
percent_visible = 1.0
meta_underlined = true
tab_size = 4
text = "Ceci est un test en couleur."
scroll_active = false
scroll_following = false
selection_enabled = true
override_selected_font_color = false
script = ExtResource( 7 )
_sections_unfolded = [ "BBCode", "Mouse", "Size Flags", "custom_constants" ]
[node name="rich_text_label2" type="RichTextLabel" parent="Windows/chat/chat_lines" index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 39.0
margin_right = 230.0
margin_bottom = 39.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = true
focus_mode = 2
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
bbcode_enabled = true
bbcode_text = "Ceci est un test en [url=\"test@test.io\"]ligne[/url]."
visible_characters = -1
percent_visible = 1.0
meta_underlined = true
tab_size = 4
text = "Ceci est un test en ligne."
scroll_active = false
scroll_following = false
selection_enabled = true
override_selected_font_color = false
script = ExtResource( 7 )
_sections_unfolded = [ "BBCode", "Mouse", "Size Flags" ]
[node name="footer_line_edit" type="LineEdit" parent="Windows/chat" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 8.0
margin_top = 115.0
margin_right = 238.0
margin_bottom = 139.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 1
size_flags_horizontal = 3
size_flags_vertical = 10
focus_mode = 2
context_menu_enabled = true
placeholder_alpha = 0.6
caret_blink = true
caret_blink_speed = 0.65
caret_position = 0
_sections_unfolded = [ "Caret", "Placeholder", "Size Flags" ]
[node name="chat2" type="MarginContainer" parent="Windows" index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 311.0
margin_top = 431.0
margin_right = 549.0
margin_bottom = 570.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
script = ExtResource( 3 )
_sections_unfolded = [ "Pause", "custom_constants" ]
__meta__ = {
"_edit_group_": true,
"_editor_icon": ExtResource( 4 )
}
is_movable = true
is_resizable = true
is_borderless = false
has_footer = true
title = "Test Chat"
content_color = Color( 1, 1, 1, 1 )
background_color = Color( 1, 1, 1, 1 )
background_texture = null
min_size = Vector2( 128, 128 )
content_margin = Rect2( 8, 8, 8, 8 )
[node name="chat_lines" type="VBoxContainer" parent="Windows/chat2" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 8.0
margin_right = 238.0
margin_bottom = 139.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 0
script = ExtResource( 6 )
_sections_unfolded = [ "Size Flags" ]
[node name="label" type="Label" parent="Windows/chat2/chat_lines" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 230.0
margin_bottom = 31.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_colors/font_color = Color( 0.164063, 0.31427, 1, 1 )
text = "MDJ: Bienvenue sur Khanat, rêvez bien !"
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "custom_colors" ]
[node name="rich_text_label" type="RichTextLabel" parent="Windows/chat2/chat_lines" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 35.0
margin_right = 230.0
margin_bottom = 35.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = true
focus_mode = 2
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
bbcode_enabled = true
bbcode_text = "Ceci est un test en [color=red]couleur[/color]."
visible_characters = -1
percent_visible = 1.0
meta_underlined = true
tab_size = 4
text = "Ceci est un test en couleur."
scroll_active = false
scroll_following = false
selection_enabled = true
override_selected_font_color = false
script = ExtResource( 7 )
_sections_unfolded = [ "BBCode", "Mouse", "Size Flags", "custom_constants" ]
[node name="rich_text_label2" type="RichTextLabel" parent="Windows/chat2/chat_lines" index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 39.0
margin_right = 230.0
margin_bottom = 39.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = true
focus_mode = 2
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
bbcode_enabled = true
bbcode_text = "Ceci est un test en [url=\"test@test.io\"]ligne[/url]."
visible_characters = -1
percent_visible = 1.0
meta_underlined = true
tab_size = 4
text = "Ceci est un test en ligne."
scroll_active = false
scroll_following = false
selection_enabled = true
override_selected_font_color = false
script = ExtResource( 7 )
_sections_unfolded = [ "BBCode", "Mouse", "Size Flags" ]
[node name="footer_line_edit" type="LineEdit" parent="Windows/chat2" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 8.0
margin_top = 115.0
margin_right = 238.0
margin_bottom = 139.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 1
size_flags_horizontal = 3
size_flags_vertical = 10
focus_mode = 2
context_menu_enabled = true
placeholder_alpha = 0.6
caret_blink = true
caret_blink_speed = 0.65
caret_position = 0
_sections_unfolded = [ "Caret", "Placeholder", "Size Flags" ]
[node name="music" type="MarginContainer" parent="Windows" index="3"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 8.0
margin_bottom = 40.0
rect_min_size = Vector2( 256, 64 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
script = ExtResource( 3 )
_sections_unfolded = [ "Rect" ]
__meta__ = {
"_editor_icon": ExtResource( 4 )
}
is_movable = true
is_resizable = true
is_borderless = true
has_footer = true
title = "Musique"
content_color = Color( 1, 1, 1, 1 )
background_color = Color( 1, 1, 1, 1 )
background_texture = null
min_size = Vector2( 128, 164 )
content_margin = Rect2( 8, 8, 8, 8 )
[node name="Music" parent="Windows/music" index="0" instance=ExtResource( 8 )]
margin_left = 8.0
margin_bottom = 66.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Music" parent="." index="3" instance=ExtResource( 8 )]
margin_left = 942.0
margin_right = 1024.0
margin_bottom = 66.0
size_flags_horizontal = 8
size_flags_vertical = 2
[node name="Jauges" type="VBoxContainer" parent="." index="4"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 420.0
margin_top = 544.0
margin_right = 603.0
margin_bottom = 600.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 6
size_flags_vertical = 10
alignment = 0
_sections_unfolded = [ "Size Flags", "Theme", "custom_constants" ]
[node name="oubli" type="HBoxContainer" parent="Jauges" index="0"]
modulate = Color( 1, 1, 1, 0 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 167.0
margin_bottom = 16.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 0
size_flags_vertical = 9
alignment = 0
script = ExtResource( 9 )
_sections_unfolded = [ "Size Flags", "Visibility", "custom_constants" ]
[node name="ProgressBar" type="ProgressBar" parent="Jauges/oubli" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 128.0
margin_bottom = 16.0
rect_min_size = Vector2( 128, 8 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 0
min_value = 0.0
max_value = 100.0
step = 1.0
page = 0.0
value = 0.0
exp_edit = false
rounded = false
percent_visible = false
_sections_unfolded = [ "Material", "Percent", "Rect", "Size Flags", "custom_fonts" ]
[node name="Label" type="Label" parent="Jauges/oubli" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 132.0
margin_top = 1.0
margin_right = 167.0
margin_bottom = 15.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Oubli"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="trauma" type="HBoxContainer" parent="Jauges" index="1"]
modulate = Color( 1, 1, 1, 0 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 20.0
margin_right = 179.0
margin_bottom = 36.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 0
size_flags_vertical = 9
alignment = 0
script = ExtResource( 10 )
_sections_unfolded = [ "Size Flags", "Visibility" ]
[node name="ProgressBar" type="ProgressBar" parent="Jauges/trauma" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 128.0
margin_bottom = 16.0
rect_min_size = Vector2( 128, 8 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 0
min_value = 0.0
max_value = 100.0
step = 1.0
page = 0.0
value = 0.0
exp_edit = false
rounded = false
percent_visible = false
_sections_unfolded = [ "Percent", "Rect", "Size Flags" ]
[node name="Label" type="Label" parent="Jauges/trauma" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 132.0
margin_top = 1.0
margin_right = 179.0
margin_bottom = 15.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Trauma"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="douleur" type="HBoxContainer" parent="Jauges" index="2"]
modulate = Color( 1, 1, 1, 0 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 40.0
margin_right = 183.0
margin_bottom = 56.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 0
size_flags_vertical = 9
alignment = 0
script = ExtResource( 11 )
_sections_unfolded = [ "Size Flags", "Visibility" ]
[node name="ProgressBar" type="ProgressBar" parent="Jauges/douleur" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 128.0
margin_bottom = 16.0
rect_min_size = Vector2( 128, 8 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 0
min_value = 0.0
max_value = 100.0
step = 1.0
page = 0.0
value = 0.0
exp_edit = false
rounded = false
percent_visible = false
_sections_unfolded = [ "Percent", "Rect", "Size Flags" ]
[node name="Label" type="Label" parent="Jauges/douleur" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 132.0
margin_top = 1.0
margin_right = 183.0
margin_bottom = 15.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Douleur"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="SaveHUD" type="Button" parent="." index="5"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 799.0
margin_top = 580.0
margin_right = 1024.0
margin_bottom = 600.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 10
size_flags_vertical = 10
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Save HUD windows layout in file."
flat = false
align = 1
_sections_unfolded = [ "Size Flags" ]
[connection signal="gui_input" from="Windows/chat/footer_line_edit" to="Windows/chat/chat_lines" method="_on_footer_line_edit_gui_input"]
[connection signal="gui_input" from="Windows/chat2/footer_line_edit" to="Windows/chat2/chat_lines" method="_on_footer_line_edit_gui_input"]
[connection signal="value_changed" from="Jauges/oubli/ProgressBar" to="Jauges/oubli" method="_on_ProgressBar_value_changed"]
[connection signal="value_changed" from="Jauges/trauma/ProgressBar" to="Jauges/trauma" method="_on_ProgressBar_value_changed"]
[connection signal="value_changed" from="Jauges/douleur/ProgressBar" to="Jauges/douleur" method="_on_ProgressBar_value_changed"]
[connection signal="pressed" from="SaveHUD" to="." method="_on_SaveHUD_pressed"]

View file

@ -0,0 +1,164 @@
extends MarginContainer
export(bool) var is_movable = true
export(bool) var is_resizable = true
export(bool) var is_borderless = false
signal window_clicked( window )
var current_rect_size = Vector2( 0, 0 )
var current_rect_position = Vector2( -1, -1 )
var is_resizing = false
var is_moving = false
func add_child(node):
$VBoxContainer/Content/scroll_container/v_box_container.add_child(node)
prints(self.get_name()+" just fathered", node.get_name())
func set_mouse_pass_to_children( node ):
for child in node.get_children():
set_mouse_pass_to_children( child )
if node is Control:
node.mouse_filter = MOUSE_FILTER_PASS
func _ready():
current_rect_size = self.rect_min_size
if is_borderless:
$Background.region_rect = Rect2( 3, 28+3, 512-6, 512-28-6 )
$VBoxContainer/Header/HBoxContainer/Close.visible = false
$VBoxContainer/Header/HBoxContainer/Open.visible = false
$VBoxContainer/Header/HBoxContainer/Quit.visible = false
$VBoxContainer/Header/HBoxContainer/Label.visible = false
# else:
# $Background.region_rect = Rect2( 0, 0, 512, 512 )
# $VBoxContainer/Header/HBoxContainer/Close.visible = true
# $VBoxContainer/Header/HBoxContainer/Open.visible = false
# $VBoxContainer/Header/HBoxContainer/Quit.visible = true
# $VBoxContainer/Header/HBoxContainer/Label.visible = true
if not is_resizable:
$VBoxContainer/Footer/HBoxContainer/Resize.visible = false
set_mouse_pass_to_children( self )
func _on_Window_mouse_entered():
print("mouse_entered")
func _on_Window_focus_entered():
print("focus_entered")
func _on_Quit_pressed():
self.visible = false
func get_content():
return $VBoxContainer/Content
func close():
if not is_borderless:
$VBoxContainer/Header/HBoxContainer/Close.visible = false
$VBoxContainer/Header/HBoxContainer/Open.visible = true
$VBoxContainer/Content.visible = false
$VBoxContainer/Footer.visible = false
current_rect_size = self.rect_size
self.rect_size = Vector2( 0, 0 )
else:
$VBoxContainer/Header/HBoxContainer/Close.visible = false
$VBoxContainer/Header/HBoxContainer/Open.visible = false
$VBoxContainer/Content.visible = false
$VBoxContainer/Footer.visible = false
current_rect_size = self.rect_size
self.rect_size = Vector2( 0, 0 )
func _on_Close_pressed():
close()
func open():
if not is_borderless:
$VBoxContainer/Header/HBoxContainer/Close.visible = true
$VBoxContainer/Header/HBoxContainer/Open.visible = false
$VBoxContainer/Content.visible = true
$VBoxContainer/Footer.visible = true
self.rect_size = current_rect_size
else:
$VBoxContainer/Header/HBoxContainer/Close.visible = false
$VBoxContainer/Header/HBoxContainer/Open.visible = false
$VBoxContainer/Content.visible = true
$VBoxContainer/Footer.visible = true
self.rect_size = current_rect_size
func _on_Open_pressed():
open()
func _on_Resize_pressed():
is_resizing = true
func _input( event ):
if is_resizable:
if is_resizing and event is InputEventMouseButton and not event.pressed:
is_resizing = false
if event is InputEventMouseMotion and is_resizing:
var delta = event.relative
self.rect_size += delta
func check_if_clicked( event ):
if not is_moving and event is InputEventMouseButton and event.is_pressed() and not event.is_echo() and event.button_index == 1 :
emit_signal( "window_clicked", self )
func _on_Header_gui_input( event ):
check_if_clicked( event )
if is_movable:
if is_moving and event is InputEventMouseButton and not event.pressed:
is_moving = false
elif not is_moving and event is InputEventMouseButton and event.pressed:
is_moving = true
if event is InputEventMouseMotion and is_moving:
var delta = event.relative
self.rect_position += delta
func load_from_file( config_file ):
if config_file.has_section( self.name ):
self.rect_position = config_file.get_value( self.name, "position" )
self.rect_size = config_file.get_value( self.name, "size" )
self.is_borderless = config_file.get_value( self.name, "borderless" )
current_rect_position = self.rect_position
current_rect_size = self.rect_size
if config_file.get_value( self.name, "opened" ):
open()
else:
close()
func save_to_file( config_file ):
var is_open = $VBoxContainer/Content.visible
config_file.set_value(self.name, "position", self.rect_position)
if not is_open:
config_file.set_value(self.name, "size", current_rect_size)
else:
config_file.set_value(self.name, "size", self.rect_size)
if is_open:
config_file.set_value(self.name, "opened", true)
else:
config_file.set_value(self.name, "opened", false)
config_file.set_value(self.name, "borderless", is_borderless)
func _on_window_gui_input( event ):
check_if_clicked( event )

View file

@ -0,0 +1,14 @@
extends ReferenceRect
func _ready():
for child in self.get_children():
child.connect( "window_clicked", self, "_on_window_clicked" )
func _on_window_clicked( window ):
var index = 0
for child in self.get_children():
self.move_child(child, index)
index += 1
self.move_child(window, index)

View file

@ -0,0 +1,27 @@
extends VBoxContainer
var line_edit_path = "../../../../footer_box/footer/footer_line_edit"
var new_line_added = false
func _process(delta):
if self.new_line_added:
var content_scroll = get_node( "../.." )
content_scroll.scroll_vertical = 2*self.rect_size.y
self.new_line_added = false
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 = ""
self.new_line_added = true

View file

@ -0,0 +1,9 @@
extends HBoxContainer
func _process(delta):
self.get_node( "ProgressBar" ).value = character.douleur
func _on_ProgressBar_value_changed(value):
self.modulate.a = clamp(value/50, 0.4, 1 )
get_node( "../../overlay_douleur" ).modulate.a = self.modulate.a/2

View file

@ -0,0 +1,9 @@
extends HBoxContainer
func _process(delta):
self.get_node( "ProgressBar" ).value = character.oubli
func _on_ProgressBar_value_changed(value):
self.modulate.a = clamp(value/50, 20/255, 1 )
get_node( "../../overlay_oubli" ).modulate.a = self.modulate.a/2

View file

@ -0,0 +1,4 @@
extends RichTextLabel
func _process(delta):
self.rect_min_size.y = global.font_size + global.font_size/2

View file

@ -0,0 +1,7 @@
extends HBoxContainer
func _process(delta):
self.get_node( "ProgressBar" ).value = character.trauma
func _on_ProgressBar_value_changed(value):
self.modulate = Color( 1.0, 1.0, 1.0, clamp(value/50, 20/255, 1 ) )

14
gui_scene/GUI/Help/FPS.gd Normal file
View file

@ -0,0 +1,14 @@
extends Label
# class member variables go here, for example:
# var a = 2
# var b = "textvar"
const TIMER_DELTA = 1
onready var timer = TIMER_DELTA
func _process(delta):
if timer >= TIMER_DELTA:
self.set_text("FPS: " + str(int( 60/delta )) )
timer = 0
else:
timer += delta

View file

@ -0,0 +1,42 @@
extends MarginContainer
# class member variables go here, for example:
# var a = 2
# var b = "textvar"
const ACTION_LIST = [ "ui_debug_window", "ui_music_controls", "hide_char", "ui_hide_all", "move_up", "move_down", "move_left", "move_right", "fly_up", "fly_down","game_flashlight", "ui_pause", "ui_reload", "ui_free_cursor", "ui_quit", "test_change_map_1", "test_change_map_2", "test_change_map_3" ]
const ACTION_TEXT = [ "show/hide debug", "show/hide music", "Hide/show character", "hide/show UI", "move up", "move down", "move left", "move right", "fly up", "fly down", "on/off flashlight", "pause/play", "reload the scene", "free/capture mouse cursor", "quit", "test scene", "test grid map", "main test scene" ]
func _ready():
_on_Refresh_pressed()
func _on_Refresh_pressed():
var index = 0
for action_name in ACTION_LIST:
var event_index = 0
for event in InputMap.get_action_list( action_name ):
if event is InputEventKey:
if get_node( "ScrollContainer/MarginContainer/VBoxContainer" ).has_node( action_name+str(event_index) ):
get_node( "ScrollContainer/MarginContainer/VBoxContainer" ).remove_child( get_node( "ScrollContainer/MarginContainer/VBoxContainer" ).get_node( action_name+str(event_index) ) )
var label = Label.new()
label.name = action_name+str(event_index)
label.text = ACTION_TEXT[ index ] + ": " + OS.get_scancode_string( event.get_scancode_with_modifiers() )
$ScrollContainer/MarginContainer/VBoxContainer.add_child( label )
label.set_owner( $ScrollContainer/MarginContainer/VBoxContainer )
elif event is InputEventJoypadButton:
if get_node( "ScrollContainer/MarginContainer/VBoxContainer" ).has_node( action_name+str(event_index) ):
get_node( "ScrollContainer/MarginContainer/VBoxContainer" ).remove_child( get_node( "ScrollContainer/MarginContainer/VBoxContainer" ).get_node( action_name+str(event_index) ) )
var label = Label.new()
label.name = action_name+str(event_index)
label.text = ACTION_TEXT[ index ] + ": " + Input.get_joy_button_string( event.button_index )
$ScrollContainer/MarginContainer/VBoxContainer.add_child( label )
label.set_owner( $ScrollContainer/MarginContainer/VBoxContainer )
event_index += 1
index += 1
func _input( event ):
if event.is_action_pressed( "ui_debug_window" ):
self.visible = not self.visible

View file

@ -0,0 +1,203 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://gui_scene/GUI/Help/Help.gd" type="Script" id=1]
[ext_resource path="res://gui_scene/GUI/Help/FPS.gd" type="Script" id=2]
[sub_resource type="Gradient" id=1]
offsets = PoolRealArray( 0, 1 )
colors = PoolColorArray( 0, 0, 0, 0.784314, 0, 0, 0, 0.784314 )
[sub_resource type="GradientTexture" id=2]
flags = 4
gradient = SubResource( 1 )
width = 2048
[node name="Help" type="MarginContainer" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 40.0
margin_bottom = 40.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 2
size_flags_vertical = 2
custom_constants/margin_right = 0
custom_constants/margin_top = 0
custom_constants/margin_left = 0
custom_constants/margin_bottom = 0
script = ExtResource( 1 )
_sections_unfolded = [ "Margin", "Size Flags", "custom_constants" ]
[node name="Background" type="NinePatchRect" parent="." index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 256.0
margin_bottom = 256.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
texture = SubResource( 2 )
_sections_unfolded = [ "Anchor", "Margin", "Size Flags", "Theme" ]
[node name="ScrollContainer" type="ScrollContainer" parent="." index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 256.0
margin_bottom = 256.0
rect_min_size = Vector2( 256, 256 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = true
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 3
scroll_horizontal_enabled = true
scroll_horizontal = 0
scroll_vertical_enabled = true
scroll_vertical = 0
scroll_deadzone = 0
_sections_unfolded = [ "Rect", "Size Flags" ]
[node name="MarginContainer" type="MarginContainer" parent="ScrollContainer" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 85.0
margin_bottom = 82.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
custom_constants/margin_right = 4
custom_constants/margin_top = 4
custom_constants/margin_left = 4
custom_constants/margin_bottom = 4
_sections_unfolded = [ "Anchor", "Margin", "custom_constants" ]
[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer/MarginContainer" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 4.0
margin_top = 4.0
margin_right = 81.0
margin_bottom = 78.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
_sections_unfolded = [ "Size Flags" ]
[node name="Title" type="Label" parent="ScrollContainer/MarginContainer/VBoxContainer" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 77.0
margin_bottom = 14.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Debug:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="FPS" type="Label" parent="ScrollContainer/MarginContainer/VBoxContainer" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 18.0
margin_right = 77.0
margin_bottom = 32.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "FPS:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
script = ExtResource( 2 )
[node name="DefaultKey" type="Label" parent="ScrollContainer/MarginContainer/VBoxContainer" index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 36.0
margin_right = 77.0
margin_bottom = 50.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "key binding:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Refresh" type="Button" parent="ScrollContainer/MarginContainer/VBoxContainer" index="3"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 54.0
margin_right = 77.0
margin_bottom = 74.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "refresh"
flat = false
align = 1
[connection signal="pressed" from="ScrollContainer/MarginContainer/VBoxContainer/Refresh" to="." method="_on_Refresh_pressed"]

View file

@ -0,0 +1,17 @@
extends MarginContainer
signal play_pressed
signal setting_pressed
signal logout_pressed
func _on_PlayButton_pressed():
emit_signal("play_pressed" )
func _on_SettingsButton_pressed():
emit_signal("setting_pressed" )
func _on_QuitButton_pressed():
get_tree().quit()
func _on_LogoutButton_pressed():
emit_signal("logout_pressed" )

View file

@ -0,0 +1,328 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://gui_scene/GUI/Home/Home.gd" type="Script" id=1]
[ext_resource path="res://assets/GUI/fonts/ryzom.ttf" type="DynamicFontData" id=2]
[sub_resource type="DynamicFont" id=1]
size = 18
use_mipmaps = false
use_filter = false
extra_spacing_top = 8
extra_spacing_bottom = 8
font_data = ExtResource( 2 )
_sections_unfolded = [ "Extra Spacing", "Font", "Resource", "Settings" ]
[sub_resource type="Theme" id=2]
default_font = SubResource( 1 )
_sections_unfolded = [ "Resource" ]
[sub_resource type="DynamicFont" id=3]
size = 64
use_mipmaps = false
use_filter = false
font_data = ExtResource( 2 )
_sections_unfolded = [ "Font", "Resource", "Settings" ]
[sub_resource type="Gradient" id=4]
offsets = PoolRealArray( 0, 1 )
colors = PoolColorArray( 0, 0, 0, 0.784314, 0, 0, 0, 0.784314 )
[sub_resource type="GradientTexture" id=5]
flags = 4
gradient = SubResource( 4 )
width = 2048
[sub_resource type="DynamicFont" id=6]
size = 18
use_mipmaps = false
use_filter = false
font_data = ExtResource( 2 )
_sections_unfolded = [ "Font", "Settings" ]
[node name="Home" type="MarginContainer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/margin_right = 0
custom_constants/margin_top = 0
custom_constants/margin_left = 0
custom_constants/margin_bottom = 0
script = ExtResource( 1 )
_sections_unfolded = [ "Size Flags", "Visibility", "custom_constants" ]
[node name="Menu" type="VBoxContainer" parent="." index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1024.0
margin_bottom = 600.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
theme = SubResource( 2 )
alignment = 0
_sections_unfolded = [ "Grow Direction", "Mouse", "Rect", "Theme", "custom_constants" ]
[node name="Title" type="Label" parent="Menu" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1024.0
margin_bottom = 103.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 3
custom_fonts/font = SubResource( 3 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
custom_constants/shadow_offset_x = 4
custom_constants/shadow_offset_y = 4
text = "KHANAT"
align = 1
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Size Flags", "Theme", "custom_colors", "custom_constants", "custom_fonts", "custom_styles" ]
[node name="Buttons" type="MarginContainer" parent="Menu" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 470.0
margin_top = 107.0
margin_right = 554.0
margin_bottom = 493.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 4
size_flags_vertical = 1
custom_constants/margin_right = 0
custom_constants/margin_top = 42
custom_constants/margin_left = 0
custom_constants/margin_bottom = 42
_sections_unfolded = [ "Size Flags", "Theme", "custom_constants" ]
[node name="VBoxContainer" type="VBoxContainer" parent="Menu/Buttons" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 42.0
margin_right = 84.0
margin_bottom = 344.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
custom_constants/separation = 42
alignment = 1
_sections_unfolded = [ "Margin", "Theme", "custom_constants" ]
[node name="PlayButton" type="Button" parent="Menu/Buttons/VBoxContainer" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 84.0
margin_bottom = 44.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
hint_tooltip = "Test tooltip."
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Play"
flat = false
align = 1
_sections_unfolded = [ "Hint", "Theme", "custom_fonts" ]
[node name="SettingsButton" type="Button" parent="Menu/Buttons/VBoxContainer" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 86.0
margin_right = 84.0
margin_bottom = 130.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Settings"
flat = false
align = 1
_sections_unfolded = [ "Anchor", "Rect", "custom_fonts" ]
[node name="LogoutButton" type="Button" parent="Menu/Buttons/VBoxContainer" index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 172.0
margin_right = 84.0
margin_bottom = 216.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Logout"
flat = false
align = 1
_sections_unfolded = [ "Focus", "Mouse" ]
[node name="QuitButton" type="Button" parent="Menu/Buttons/VBoxContainer" index="3"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 258.0
margin_right = 84.0
margin_bottom = 302.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Quit"
flat = false
align = 1
_sections_unfolded = [ "Mouse" ]
[node name="Container" type="MarginContainer" parent="Menu" index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 558.0
margin_right = 1024.0
margin_bottom = 600.0
rect_min_size = Vector2( 0, 42 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 5
size_flags_vertical = 10
custom_constants/margin_right = 0
custom_constants/margin_top = 0
custom_constants/margin_left = 0
custom_constants/margin_bottom = 0
_sections_unfolded = [ "Rect", "Size Flags", "custom_constants" ]
[node name="NinePatchRect" type="NinePatchRect" parent="Menu/Container" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1024.0
margin_bottom = 42.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 11
texture = SubResource( 5 )
_sections_unfolded = [ "Size Flags", "Visibility" ]
[node name="Footer" type="Label" parent="Menu/Container" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 429.0
margin_top = 10.0
margin_right = 594.0
margin_bottom = 32.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 4
size_flags_vertical = 4
custom_fonts/font = SubResource( 6 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_colors/font_color_shadow = Color( 0.617188, 0.617188, 0.617188, 1 )
text = "Powered by Godot"
align = 1
valign = 2
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Size Flags", "custom_colors", "custom_constants", "custom_fonts" ]
[connection signal="pressed" from="Menu/Buttons/VBoxContainer/PlayButton" to="." method="_on_PlayButton_pressed"]
[connection signal="pressed" from="Menu/Buttons/VBoxContainer/SettingsButton" to="." method="_on_SettingsButton_pressed"]
[connection signal="pressed" from="Menu/Buttons/VBoxContainer/LogoutButton" to="." method="_on_LogoutButton_pressed"]
[connection signal="pressed" from="Menu/Buttons/VBoxContainer/QuitButton" to="." method="_on_QuitButton_pressed"]

View file

@ -0,0 +1,62 @@
extends VBoxContainer
var songs_list = []
var current_song = ""
var current_position = 0.0
var popup
func _ready():
for song in $Songs.get_children():
songs_list.append( song.name )
if $Songs.get_child_count() > 0:
current_song = songs_list[0]
popup = $SongsSelector.get_popup()
for song in songs_list:
popup.add_item( song )
get_node( "Songs" ).get_node( song ).connect( "finished", self, "_on_song_finished" )
$SongsSelector.text = current_song
func set_play():
if get_node( "Songs" ).get_node( current_song ):
get_node( "Songs" ).get_node( current_song ).play( current_position )
$Buttons/Pause.text = "Pause"
$Title.text = "Musiques (Played):"
func set_pause():
if get_node( "Songs" ).get_node( current_song ):
current_position = get_node( "Songs" ).get_node( current_song ).get_playback_position()
get_node( "Songs" ).get_node( current_song ).stop()
else:
current_position = 0.0
$Buttons/Pause.text = "Play"
$Title.text = "Musiques (Paused):"
func set_stop():
if get_node( "Songs" ).get_node( current_song ):
get_node( "Songs" ).get_node( current_song ).stop()
current_position = 0.0
$Buttons/Pause.pressed = false
$Buttons/Pause.text = "Play"
$Title.text = "Musiques (Stopped):"
func _on_Pause_toggled(button_pressed):
if button_pressed:
set_play()
else:
set_pause()
func _on_Stop_pressed():
set_stop()
func _on_SongsSelector_item_selected(ID):
var new_song = popup.get_item_text(ID)
if not current_song == new_song:
set_stop()
current_song = popup.get_item_text(ID)
func _on_song_finished():
print("test")
set_stop()

View file

@ -0,0 +1,201 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://gui_scene/GUI/MusicControls/Music.gd" type="Script" id=1]
[ext_resource path="res://assets/test/musiques/pre-mix_khanat_main_theme_2018-07-23.ogg" type="AudioStream" id=2]
[ext_resource path="res://assets/test/musiques/Sangakanat (short instrumental theme).ogg" type="AudioStream" id=3]
[ext_resource path="res://assets/test/musiques/pre-mix_Le_concours_de_tartes_aux_klums.ogg" type="AudioStream" id=4]
[node name="Music" type="VBoxContainer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 256.0
margin_bottom = 86.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
script = ExtResource( 1 )
_sections_unfolded = [ "Mouse", "Rect", "Size Flags" ]
[node name="Songs" type="Container" parent="." index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 256.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
_sections_unfolded = [ "Mouse" ]
[node name="pre-mix_khanat_main_theme" type="AudioStreamPlayer" parent="Songs" index="0"]
pause_mode = 1
stream = ExtResource( 2 )
volume_db = 0.0
pitch_scale = 1.0
autoplay = false
mix_target = 0
bus = "Master"
_sections_unfolded = [ "Pause" ]
[node name="Sangakanat" type="AudioStreamPlayer" parent="Songs" index="1"]
pause_mode = 1
stream = ExtResource( 3 )
volume_db = 0.0
pitch_scale = 1.0
autoplay = false
mix_target = 0
bus = "Master"
_sections_unfolded = [ "Pause" ]
[node name="pre-mix_Le_concours_de_tartes_aux_klums" type="AudioStreamPlayer" parent="Songs" index="2"]
stream = ExtResource( 4 )
volume_db = 0.0
pitch_scale = 1.0
autoplay = false
mix_target = 0
bus = "Master"
[node name="Title" type="Label" parent="." index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 4.0
margin_right = 256.0
margin_bottom = 18.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Musique:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="SongsSelector" type="OptionButton" parent="." index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 22.0
margin_right = 256.0
margin_bottom = 42.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 1
toggle_mode = false
action_mode = 0
enabled_focus_mode = 2
shortcut = null
group = null
flat = false
align = 0
items = [ ]
selected = -1
_sections_unfolded = [ "Grow Direction", "Margin", "Mouse", "Rect", "Size Flags" ]
[node name="Buttons" type="HBoxContainer" parent="." index="3"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 46.0
margin_right = 256.0
margin_bottom = 66.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
_sections_unfolded = [ "Mouse", "Rect" ]
[node name="Pause" type="Button" parent="Buttons" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 126.0
margin_bottom = 20.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 1
custom_colors/font_color_disabled = Color( 0.496055, 0.413039, 0.660156, 1 )
custom_colors/font_color = Color( 0.494118, 0.411765, 0.658824, 1 )
custom_colors/font_color_hover = Color( 0.863051, 0.203209, 1, 1 )
custom_colors/font_color_pressed = Color( 0.673295, 0.508021, 1, 1 )
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
group = null
text = "Play"
flat = false
align = 1
_sections_unfolded = [ "Size Flags", "custom_colors", "custom_constants", "custom_fonts", "custom_styles" ]
[node name="Stop" type="Button" parent="Buttons" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 130.0
margin_right = 256.0
margin_bottom = 20.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 1
custom_colors/font_color_disabled = Color( 0.496055, 0.413039, 0.660156, 1 )
custom_colors/font_color = Color( 0.494118, 0.411765, 0.658824, 1 )
custom_colors/font_color_hover = Color( 0.863051, 0.203209, 1, 1 )
custom_colors/font_color_pressed = Color( 0.673295, 0.508021, 1, 1 )
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Stop"
flat = false
align = 1
_sections_unfolded = [ "Size Flags", "custom_colors", "custom_constants", "custom_fonts", "custom_styles" ]
[connection signal="item_selected" from="SongsSelector" to="." method="_on_SongsSelector_item_selected"]
[connection signal="toggled" from="Buttons/Pause" to="." method="_on_Pause_toggled"]
[connection signal="pressed" from="Buttons/Stop" to="." method="_on_Stop_pressed"]

View file

@ -0,0 +1,13 @@
extends MenuButton
var popup
func _ready():
popup = get_popup()
popup.add_item("item a")
popup.add_item("item b")
popup.add_item("item c")
# popup.connect("item_pressed", self, "_on_item_pressed")
func _on_item_pressed(ID):
self.text = popup.get_item_text(ID)

View file

@ -0,0 +1,86 @@
extends Container
signal return_pressed
signal font_changed( value )
func _ready():
$Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Fullscreen/CheckBox.pressed = ProjectSettings.get_setting( "display/window/size/fullscreen" )
$Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Borderless/CheckBox.pressed = ProjectSettings.get_setting( "display/window/size/borderless" )
$Menus/TabContainer/Display/ScrollContainer/VBoxContainer/Resizable/CheckBox.pressed = ProjectSettings.get_setting( "display/window/size/resizable" )
$Menus/TabContainer/Display/ScrollContainer/VBoxContainer/CurrentScreen/SpinBox.value = OS.current_screen
load_settings()
func _on_font_size_bar_value_changed(value):
$Menus/TabContainer/Test/ScrollContainer/VBoxContainer/font_size/font_size_value.text = str( value )
$Menus.get_theme().default_font.size = value
emit_signal( "font_changed", value )
func load_settings():
var config_file = ConfigFile.new()
var err = config_file.load( "user://settings.cfg" )
if err == ERR_CANT_OPEN or err == ERR_FILE_NOT_FOUND:
# On suppose que le fichier n'existe pas encore, donc on le crée.
config_file.set_value( "theme", "font_size", 14 )
config_file.save( "user://settings.cfg" )
elif not err == OK:
print("Error code when loading config file: ", err)
global.font_size = config_file.get_value( "theme", "font_size" )
if $Menus.get_theme():
$Menus.get_theme().default_font.size = global.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( global.font_size )
func _on_ReturnButton_pressed():
var config_file = ConfigFile.new()
var err = config_file.load( "user://settings.cfg" )
if err:
print("Error code when loading config file: ", err)
config_file.set_value("theme", "font_size", $Menus.get_theme().default_font.size)
config_file.save( "user://settings.cfg" )
emit_signal( "return_pressed" )
func _on_Title_text_changed(new_text):
# ----------------------------------
# Changing windows title
var new_title = "Khanat"
new_text = new_text.strip_edges()
if not new_text == "":
new_title = new_text
new_title += " (" + String(OS.get_window_size().x) + "x" + String(OS.get_window_size().y) + ")"
OS.set_window_title( new_title )
# ----------------------------------
func _on_Fullscreen_toggled(button_pressed):
if ProjectSettings.has_setting( "display/window/size/fullscreen" ):
ProjectSettings.set_setting("display/window/size/fullscreen", button_pressed)
OS.window_fullscreen = ProjectSettings.get_setting("display/window/size/fullscreen")
func _on_Borderless_toggled(button_pressed):
if ProjectSettings.has_setting( "display/window/size/borderless" ):
ProjectSettings.set_setting("display/window/size/borderless", button_pressed)
OS.window_borderless = ProjectSettings.get_setting("display/window/size/borderless")
func _on_Resizable_toggled(button_pressed):
if ProjectSettings.has_setting( "display/window/size/resizable" ):
ProjectSettings.set_setting("display/window/size/resizable", button_pressed)
OS.window_resizable = ProjectSettings.get_setting("display/window/size/resizable")
# La fonction existe dans la doc mais le moteur lui ne la reconnait pas,
# soit il y a une subtilité quelquepart soit la doc n'est pas à jour.
func _on_AlwaysOnTop_toggled(button_pressed):
# OS.set_window_always_on_top( button_pressed )
pass
func _on_SpinBox_value_changed(value):
OS.current_screen = value

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,19 @@
extends HBoxContainer
signal font_changed
func _ready():
$font_size_value.text = str( get_node ( "../font_size_bar" ).value )
#func _process(delta):
# # Called every frame. Delta is time since last frame.
# # Update game logic here.
# pass
func _on_font_size_bar_value_changed(value):
$font_size_value.text = str( value )
var menus_node = get_node( "../../../../../" )
global.font_size = value
menus_node.get_theme().default_font.size = value
emit_signal( "font_changed" )

View file

@ -0,0 +1,35 @@
extends Control
var character_mesh = null
var name_input = null
onready var error_label = $v_box_container/h_box_container/margin_container/margin_container/v_box_container/error_label
signal valid_button_pressed
signal return_button_pressed
func _ready():
character_mesh = $v_box_container/h_box_container/center_container/character_creation_scene/mesh_instance
name_input = $v_box_container/h_box_container/margin_container/margin_container/v_box_container/name_box/line_edit
func _on_h_scroll_bar_value_changed(value):
if value == 1:
global.character_sex = 1
character_mesh.get_surface_material(0).albedo_color = Color( 1.0, 0.25, 0.25, 1.0 )
else:
global.character_sex = 0
character_mesh.get_surface_material(0).albedo_color = Color( 0.0, 0.0, 1.0, 1.0 )
func _on_valid_button_pressed():
if not name_input.text or name_input.text == "":
error_label.text = "You need to choose a character's name."
return
global.character_name = name_input.text
global.character_color = character_mesh.get_surface_material(0).albedo_color
emit_signal( "valid_button_pressed" )
func _on_return_button_pressed():
get_node( "../character_selection_menu/viewport/character_preview" ).show()
# get_node( "v_box_container/h_box_container/center_container/character_creation_scene").hide()
emit_signal( "return_button_pressed" )

View file

@ -0,0 +1,582 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://assets/GUI/fonts/ryzom.ttf" type="DynamicFontData" id=1]
[ext_resource path="res://gui_scene/GUI/character_creation/character_creation_menu.gd" type="Script" id=2]
[ext_resource path="res://login_scene/character_preview.tscn" type="PackedScene" id=3]
[sub_resource type="DynamicFont" id=1]
size = 14
use_mipmaps = false
use_filter = false
font_data = ExtResource( 1 )
_sections_unfolded = [ "Extra Spacing", "Font", "Settings" ]
[sub_resource type="Theme" id=2]
default_font = SubResource( 1 )
[sub_resource type="Gradient" id=3]
offsets = PoolRealArray( 0 )
colors = PoolColorArray( 0, 0, 0, 1 )
[sub_resource type="GradientTexture" id=4]
flags = 4
gradient = SubResource( 3 )
width = 2048
[sub_resource type="DynamicFont" id=5]
size = 18
use_mipmaps = false
use_filter = true
font_data = ExtResource( 1 )
_sections_unfolded = [ "Extra Spacing", "Font", "Settings" ]
[sub_resource type="ViewportTexture" id=6]
resource_local_to_scene = true
flags = 0
viewport_path = NodePath("v_box_container/h_box_container/center_container/viewport")
[node name="character_creation_menu" type="Control"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
theme = SubResource( 2 )
script = ExtResource( 2 )
_sections_unfolded = [ "Theme" ]
[node name="v_box_container" type="VBoxContainer" parent="." index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
[node name="header" type="CenterContainer" parent="v_box_container" index="0"]
editor/display_folded = true
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1024.0
margin_bottom = 17.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 1
use_top_left = false
_sections_unfolded = [ "Size Flags" ]
[node name="label" type="Label" parent="v_box_container/header" index="0"]
modulate = Color( 1, 1, 1, 0.458549 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 486.0
margin_right = 537.0
margin_bottom = 17.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "header"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Visibility" ]
[node name="h_box_container" type="HBoxContainer" parent="v_box_container" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 21.0
margin_right = 1024.0
margin_bottom = 579.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 0
_sections_unfolded = [ "Size Flags" ]
[node name="margin_container" type="MarginContainer" parent="v_box_container/h_box_container" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 199.0
margin_right = 510.0
margin_bottom = 359.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 6
custom_constants/margin_right = 8
custom_constants/margin_top = 8
custom_constants/margin_left = 8
custom_constants/margin_bottom = 8
_sections_unfolded = [ "Material", "Size Flags", "custom_constants" ]
[node name="nine_patch_rect" type="NinePatchRect" parent="v_box_container/h_box_container/margin_container" index="0"]
modulate = Color( 1, 1, 1, 0.752941 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 8.0
margin_top = 8.0
margin_right = 502.0
margin_bottom = 152.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
texture = SubResource( 4 )
_sections_unfolded = [ "Material", "Size Flags", "Visibility" ]
[node name="margin_container" type="MarginContainer" parent="v_box_container/h_box_container/margin_container" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 8.0
margin_top = 8.0
margin_right = 502.0
margin_bottom = 152.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
custom_constants/margin_right = 8
custom_constants/margin_top = 8
custom_constants/margin_left = 8
custom_constants/margin_bottom = 8
_sections_unfolded = [ "custom_constants" ]
[node name="v_box_container" type="VBoxContainer" parent="v_box_container/h_box_container/margin_container/margin_container" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 8.0
margin_top = 8.0
margin_right = 486.0
margin_bottom = 136.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 7
size_flags_vertical = 6
alignment = 0
_sections_unfolded = [ "Size Flags", "Theme", "custom_constants" ]
[node name="name_box" type="HBoxContainer" parent="v_box_container/h_box_container/margin_container/margin_container/v_box_container" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 478.0
margin_bottom = 27.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
[node name="label" type="Label" parent="v_box_container/h_box_container/margin_container/margin_container/v_box_container/name_box" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 5.0
margin_right = 237.0
margin_bottom = 22.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 4
text = "Nom: "
align = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Size Flags" ]
[node name="line_edit" type="LineEdit" parent="v_box_container/h_box_container/margin_container/margin_container/v_box_container/name_box" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 241.0
margin_right = 478.0
margin_bottom = 27.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 1
size_flags_horizontal = 3
size_flags_vertical = 1
text = "player"
focus_mode = 2
context_menu_enabled = true
placeholder_text = "Enter the character's name here."
placeholder_alpha = 0.6
caret_blink = false
caret_blink_speed = 0.65
caret_position = 0
_sections_unfolded = [ "Placeholder", "Size Flags" ]
[node name="sexe_box" type="HBoxContainer" parent="v_box_container/h_box_container/margin_container/margin_container/v_box_container" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 31.0
margin_right = 478.0
margin_bottom = 48.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
[node name="label" type="Label" parent="v_box_container/h_box_container/margin_container/margin_container/v_box_container/sexe_box" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 237.0
margin_bottom = 17.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 4
text = "Sexe: "
align = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Size Flags" ]
[node name="h_box_container" type="HBoxContainer" parent="v_box_container/h_box_container/margin_container/margin_container/v_box_container/sexe_box" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 241.0
margin_right = 478.0
margin_bottom = 17.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 1
alignment = 0
_sections_unfolded = [ "Size Flags" ]
[node name="M" type="Label" parent="v_box_container/h_box_container/margin_container/margin_container/v_box_container/sexe_box/h_box_container" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 12.0
margin_bottom = 17.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "M"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="h_scroll_bar" type="HScrollBar" parent="v_box_container/h_box_container/margin_container/margin_container/v_box_container/sexe_box/h_box_container" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 16.0
margin_right = 225.0
margin_bottom = 12.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 0
min_value = 0.0
max_value = 1.0
step = 1.0
page = 0.0
value = 1.0
exp_edit = false
rounded = false
custom_step = -1.0
_sections_unfolded = [ "Size Flags", "custom_icons" ]
[node name="F" type="Label" parent="v_box_container/h_box_container/margin_container/margin_container/v_box_container/sexe_box/h_box_container" index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 229.0
margin_right = 237.0
margin_bottom = 17.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "F"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="error_label" type="Label" parent="v_box_container/h_box_container/margin_container/margin_container/v_box_container" index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 52.0
margin_right = 478.0
margin_bottom = 74.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 5 )
custom_colors/font_color = Color( 1, 0, 0, 1 )
align = 1
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "custom_colors", "custom_fonts", "custom_styles" ]
[node name="valid_button" type="Button" parent="v_box_container/h_box_container/margin_container/margin_container/v_box_container" index="3"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 78.0
margin_right = 478.0
margin_bottom = 101.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Valider"
flat = false
align = 1
[node name="return_button" type="Button" parent="v_box_container/h_box_container/margin_container/margin_container/v_box_container" index="4"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 105.0
margin_right = 478.0
margin_bottom = 128.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Retour"
flat = false
align = 1
[node name="center_container" type="CenterContainer" parent="v_box_container/h_box_container" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 514.0
margin_right = 1024.0
margin_bottom = 558.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 1
use_top_left = false
_sections_unfolded = [ "Size Flags", "Visibility" ]
[node name="viewport" type="Viewport" parent="v_box_container/h_box_container/center_container" index="0"]
arvr = false
size = Vector2( 256, 256 )
own_world = false
world = null
transparent_bg = true
msaa = 0
hdr = true
disable_3d = false
usage = 2
debug_draw = 0
render_target_v_flip = true
render_target_clear_mode = 0
render_target_update_mode = 2
audio_listener_enable_2d = false
audio_listener_enable_3d = false
physics_object_picking = false
gui_disable_input = false
gui_snap_controls_to_pixels = true
shadow_atlas_size = 0
shadow_atlas_quad_0 = 2
shadow_atlas_quad_1 = 2
shadow_atlas_quad_2 = 3
shadow_atlas_quad_3 = 4
_sections_unfolded = [ "Render Target", "Rendering" ]
[node name="character_preview" parent="v_box_container/h_box_container/center_container/viewport" index="0" instance=ExtResource( 3 )]
[node name="nine_patch_rect" type="NinePatchRect" parent="v_box_container/h_box_container/center_container" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 255.0
margin_top = 279.0
margin_right = 255.0
margin_bottom = 279.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
texture = SubResource( 6 )
_sections_unfolded = [ "Rect", "Size Flags" ]
[node name="footer" type="CenterContainer" parent="v_box_container" index="2"]
editor/display_folded = true
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 583.0
margin_right = 1024.0
margin_bottom = 600.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 9
use_top_left = false
_sections_unfolded = [ "Size Flags" ]
[node name="label" type="Label" parent="v_box_container/footer" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 490.0
margin_right = 533.0
margin_bottom = 17.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "footer"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[connection signal="value_changed" from="v_box_container/h_box_container/margin_container/margin_container/v_box_container/sexe_box/h_box_container/h_scroll_bar" to="." method="_on_h_scroll_bar_value_changed"]
[connection signal="pressed" from="v_box_container/h_box_container/margin_container/margin_container/v_box_container/valid_button" to="." method="_on_valid_button_pressed"]
[connection signal="pressed" from="v_box_container/h_box_container/margin_container/margin_container/v_box_container/return_button" to="." method="_on_return_button_pressed"]

View file

@ -0,0 +1,99 @@
[gd_scene load_steps=3 format=2]
[sub_resource type="SphereMesh" id=1]
custom_aabb = AABB( 0, 0, 0, 0, 0, 0 )
radius = 1.0
height = 2.0
radial_segments = 64
rings = 32
is_hemisphere = false
[sub_resource type="SpatialMaterial" id=2]
render_priority = 0
flags_transparent = false
flags_unshaded = false
flags_vertex_lighting = false
flags_no_depth_test = false
flags_use_point_size = false
flags_world_triplanar = false
flags_fixed_size = false
flags_albedo_tex_force_srgb = false
vertex_color_use_as_albedo = false
vertex_color_is_srgb = false
params_diffuse_mode = 0
params_specular_mode = 0
params_blend_mode = 0
params_cull_mode = 0
params_depth_draw_mode = 0
params_line_width = 1.0
params_point_size = 1.0
params_billboard_mode = 0
params_grow = false
params_use_alpha_scissor = false
albedo_color = Color( 1, 0.364706, 0.364706, 1 )
metallic = 0.0
metallic_specular = 0.5
metallic_texture_channel = 0
roughness = 0.0
roughness_texture_channel = 0
emission_enabled = false
normal_enabled = false
rim_enabled = false
clearcoat_enabled = false
anisotropy_enabled = false
ao_enabled = false
depth_enabled = false
subsurf_scatter_enabled = false
transmission_enabled = false
refraction_enabled = false
detail_enabled = false
uv1_scale = Vector3( 1, 1, 1 )
uv1_offset = Vector3( 0, 0, 0 )
uv1_triplanar = false
uv1_triplanar_sharpness = 1.0
uv2_scale = Vector3( 1, 1, 1 )
uv2_offset = Vector3( 0, 0, 0 )
uv2_triplanar = false
uv2_triplanar_sharpness = 1.0
proximity_fade_enable = false
distance_fade_enable = false
_sections_unfolded = [ "Albedo" ]
[node name="character_creation_scene" type="Spatial"]
[node name="camera" type="Camera" parent="." index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -3.46509, 3.17379, 5.93324 )
keep_aspect = 1
cull_mask = 1048575
environment = null
h_offset = 0.0
v_offset = 0.0
doppler_tracking = 0
projection = 0
current = false
fov = 70.0
size = 1.0
near = 0.05
far = 100.0
[node name="mesh_instance" type="MeshInstance" parent="." index="1"]
transform = Transform( 1, 0, 0, 0, -4.37114e-008, 1, 0, -1, -4.37114e-008, 0, 2.95691, 0 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 1 )
skeleton = NodePath("..")
material/0 = SubResource( 2 )
_sections_unfolded = [ "Transform", "material" ]

View file

@ -0,0 +1,6 @@
extends Control
signal login_button_pressed
func _on_login_button_pressed():
emit_signal( "login_button_pressed" )

View file

@ -0,0 +1,342 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://gui_scene/GUI/login/login_menu.gd" type="Script" id=1]
[ext_resource path="res://assets/GUI/images/new_launcher_bg_0-1.png" type="Texture" id=2]
[ext_resource path="res://gui_scene/GUI/login/quit_button.gd" type="Script" id=3]
[sub_resource type="CanvasItemMaterial" id=1]
render_priority = 0
blend_mode = 0
light_mode = 0
[sub_resource type="Gradient" id=2]
offsets = PoolRealArray( 0, 0.5, 1 )
colors = PoolColorArray( 0.417969, 0.417969, 0.417969, 1, 0, 0, 0, 1, 0.415686, 0.415686, 0.415686, 1 )
[sub_resource type="GradientTexture" id=3]
flags = 4
gradient = SubResource( 2 )
width = 2048
[node name="login_menu" type="Control"]
material = SubResource( 1 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
script = ExtResource( 1 )
_sections_unfolded = [ "Material", "Theme", "Visibility", "custom_styles" ]
[node name="texture_rect" type="TextureRect" parent="." index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
texture = ExtResource( 2 )
expand = true
stretch_mode = 7
_sections_unfolded = [ "Visibility" ]
[node name="center_container" type="CenterContainer" parent="." index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
use_top_left = false
[node name="bacground_control" type="NinePatchRect" parent="center_container" index="0"]
modulate = Color( 1, 1, 1, 0.501961 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 338.0
margin_top = 126.0
margin_right = 686.0
margin_bottom = 474.0
rect_min_size = Vector2( 348, 348 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 3
texture = SubResource( 3 )
_sections_unfolded = [ "Patch Margin", "Rect", "Size Flags", "Theme", "Visibility", "custom_styles" ]
[node name="v_box_container" type="VBoxContainer" parent="center_container" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 384.0
margin_top = 170.0
margin_right = 640.0
margin_bottom = 429.0
rect_min_size = Vector2( 256, 256 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 24
alignment = 0
_sections_unfolded = [ "Focus", "Rect", "Size Flags", "custom_constants" ]
[node name="login_box" type="HBoxContainer" parent="center_container/v_box_container" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 256.0
margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
[node name="login_label" type="Label" parent="center_container/v_box_container/login_box" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 5.0
margin_right = 92.0
margin_bottom = 19.0
rect_min_size = Vector2( 92, 0 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Utilisateur:"
align = 2
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Rect", "Size Flags" ]
[node name="login_input" type="LineEdit" parent="center_container/v_box_container/login_box" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 96.0
margin_right = 256.0
margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 1
size_flags_horizontal = 3
size_flags_vertical = 1
focus_mode = 2
context_menu_enabled = true
placeholder_text = "Enter your id here."
placeholder_alpha = 0.6
caret_blink = true
caret_blink_speed = 0.65
caret_position = 0
_sections_unfolded = [ "Caret", "Placeholder", "Rect", "Size Flags" ]
[node name="password_box" type="HBoxContainer" parent="center_container/v_box_container" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 48.0
margin_right = 256.0
margin_bottom = 72.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
[node name="password_label" type="Label" parent="center_container/v_box_container/password_box" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 5.0
margin_right = 94.0
margin_bottom = 19.0
rect_min_size = Vector2( 92, 0 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Mot de passe: "
align = 2
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Rect", "Size Flags" ]
[node name="password_input" type="LineEdit" parent="center_container/v_box_container/password_box" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 98.0
margin_right = 256.0
margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 1
size_flags_horizontal = 3
size_flags_vertical = 1
secret = true
focus_mode = 2
context_menu_enabled = true
placeholder_text = "Enter your password here."
placeholder_alpha = 0.6
caret_blink = true
caret_blink_speed = 0.65
caret_position = 0
_sections_unfolded = [ "Caret", "Placeholder", "Rect", "Size Flags" ]
[node name="login_button" type="Button" parent="center_container/v_box_container" index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 96.0
margin_right = 256.0
margin_bottom = 116.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Connexion"
flat = false
align = 1
_sections_unfolded = [ "Rect" ]
[node name="register_button" type="Button" parent="center_container/v_box_container" index="3"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 140.0
margin_right = 256.0
margin_bottom = 160.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Créer un compte"
flat = false
align = 1
[node name="quit_button" type="Button" parent="center_container/v_box_container" index="4"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 184.0
margin_right = 256.0
margin_bottom = 204.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Quitter"
flat = false
align = 1
script = ExtResource( 3 )
[node name="error_label" type="Label" parent="center_container/v_box_container" index="5"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 228.0
margin_right = 256.0
margin_bottom = 259.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Ceci n'est qu'une maquette, cliquer sur connexion pour passer a la suite."
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[connection signal="pressed" from="center_container/v_box_container/login_button" to="." method="_on_login_button_pressed"]
[connection signal="pressed" from="center_container/v_box_container/quit_button" to="center_container/v_box_container/quit_button" method="_on_quit_button_pressed"]

View file

@ -0,0 +1,4 @@
extends Button
func _on_quit_button_pressed():
get_tree().quit()

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://scenes/Game/Character/Character.tscn" type="PackedScene" id=1]
[ext_resource path="res://game_scene/Game/Character/Character.tscn" type="PackedScene" id=1]
[node name="character_preview" type="Spatial"]

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=15 format=2]
[ext_resource path="res://login_scene/character_selection_menu.gd" type="Script" id=1]
[ext_resource path="res://scenes/Game/Character/Character.tscn" type="PackedScene" id=2]
[ext_resource path="res://game_scene/Game/Character/Character.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/GUI/images/new_launcher_bg_0-1.png" type="Texture" id=3]
[ext_resource path="res://login_scene/character_slots.tscn" type="PackedScene" id=4]
[ext_resource path="res://login_scene/character_creation_box.tscn" type="PackedScene" id=5]
@ -174,8 +174,8 @@ anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 8.0
margin_top = 8.0
margin_right = 1090.0
margin_bottom = 1068.0
margin_right = 1016.0
margin_bottom = 592.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
@ -187,8 +187,8 @@ _sections_unfolded = [ "Mouse", "Size Flags", "custom_constants" ]
[node name="character_slots" parent="margin_container/character_box" index="0" instance=ExtResource( 4 )]
margin_top = 520.0
margin_bottom = 540.0
margin_top = 282.0
margin_bottom = 302.0
size_flags_vertical = 6
custom_constants/separation = 8
_sections_unfolded = [ "Size Flags", "custom_constants" ]
@ -206,8 +206,11 @@ size_flags_vertical = 7
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 58.0
margin_right = 1008.0
margin_bottom = 584.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
@ -224,8 +227,8 @@ anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 453.0
margin_right = 629.0
margin_left = 387.0
margin_right = 563.0
margin_bottom = 32.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
@ -368,8 +371,8 @@ anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 36.0
margin_right = 1082.0
margin_bottom = 1060.0
margin_right = 950.0
margin_bottom = 584.0
rect_min_size = Vector2( 512, 512 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false

View file

@ -2,7 +2,7 @@
[ext_resource path="res://login_scene/login_scene.gd" type="Script" id=1]
[ext_resource path="res://login_scene/character_selection_menu.tscn" type="PackedScene" id=2]
[ext_resource path="res://scenes/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"]

View file

@ -18,7 +18,7 @@ config/icon="res://icon.png"
[autoload]
global="*res://global.tscn"
character="*res://scenes/Game/Character/Character.tscn"
character="*res://game_scene/Game/Character/Character.tscn"
[display]

View file

@ -7,7 +7,8 @@
[ext_resource path="res://test_scene/kit_test/kit_test_2way.tscn" type="PackedScene" id=5]
[ext_resource path="res://test_scene/kit_test/kit_test_1way.tscn" type="PackedScene" id=6]
[ext_resource path="res://scenes/GUI/GUI.tscn" type="PackedScene" id=7]
[ext_resource path="res://scenes/Game/portail/portail.tscn" type="PackedScene" id=8]
[ext_resource path="res://game_scene/Game/portail/portail.tscn" type="PackedScene" id=8]
[node name="test_scene" type="Node"]