ADD debut de systeme de jauges de douleur/oubli/trauma.

This commit is contained in:
osquallo 2020-03-22 17:04:01 +01:00
parent 29d3e7e548
commit c57248f2ab
17 changed files with 264 additions and 11 deletions

View file

@ -2,7 +2,9 @@ extends WindowDialog
signal time_of_day_changed( value ) signal time_of_day_changed( value )
signal mist_level_changed( value ) signal mist_level_changed( value )
signal oubli_changed( value )
signal douleur_changed( value )
signal trauma_changed( value )
func _on_time_of_day_value_changed(value): func _on_time_of_day_value_changed(value):
emit_signal( "time_of_day_changed", value ) emit_signal( "time_of_day_changed", value )
@ -10,3 +12,15 @@ func _on_time_of_day_value_changed(value):
func _on_mist_level_value_changed(value): func _on_mist_level_value_changed(value):
emit_signal( "mist_level_changed", value ) emit_signal( "mist_level_changed", value )
func _on_oubli_value_changed(value):
emit_signal( "oubli_changed", value )
func _on_douleur_value_changed(value):
emit_signal( "douleur_changed", value )
func _on_trauma_value_changed(value):
emit_signal( "trauma_changed", value )

View file

@ -19,6 +19,7 @@ __meta__ = {
[node name="v_box_container" type="VBoxContainer" parent="."] [node name="v_box_container" type="VBoxContainer" parent="."]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
mouse_filter = 2
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
@ -84,5 +85,81 @@ margin_bottom = 16.0
size_flags_horizontal = 3 size_flags_horizontal = 3
max_value = 1.0 max_value = 1.0
step = 0.1 step = 0.1
[node name="fears_label" type="Label" parent="v_box_container"]
margin_top = 76.0
margin_right = 256.0
margin_bottom = 90.0
text = "Fears:"
[node name="fears_box" type="VBoxContainer" parent="v_box_container"]
margin_top = 94.0
margin_right = 256.0
margin_bottom = 150.0
[node name="oubli" type="HBoxContainer" parent="v_box_container/fears_box"]
margin_right = 256.0
margin_bottom = 16.0
[node name="label" type="Label" parent="v_box_container/fears_box/oubli"]
margin_left = 91.0
margin_top = 1.0
margin_right = 126.0
margin_bottom = 15.0
size_flags_horizontal = 10
text = "Oubli"
[node name="value" type="HSlider" parent="v_box_container/fears_box/oubli"]
margin_left = 130.0
margin_right = 256.0
margin_bottom = 16.0
size_flags_horizontal = 3
max_value = 100.0
step = 0.1
[node name="douleur" type="HBoxContainer" parent="v_box_container/fears_box"]
margin_top = 20.0
margin_right = 256.0
margin_bottom = 36.0
[node name="label" type="Label" parent="v_box_container/fears_box/douleur"]
margin_left = 75.0
margin_top = 1.0
margin_right = 126.0
margin_bottom = 15.0
size_flags_horizontal = 10
text = "Douleur"
[node name="value" type="HSlider" parent="v_box_container/fears_box/douleur"]
margin_left = 130.0
margin_right = 256.0
margin_bottom = 16.0
size_flags_horizontal = 3
max_value = 100.0
step = 0.1
[node name="trauma" type="HBoxContainer" parent="v_box_container/fears_box"]
margin_top = 40.0
margin_right = 256.0
margin_bottom = 56.0
[node name="label" type="Label" parent="v_box_container/fears_box/trauma"]
margin_left = 79.0
margin_top = 1.0
margin_right = 126.0
margin_bottom = 15.0
size_flags_horizontal = 10
text = "Trauma"
[node name="value" type="HSlider" parent="v_box_container/fears_box/trauma"]
margin_left = 130.0
margin_right = 256.0
margin_bottom = 16.0
size_flags_horizontal = 3
max_value = 100.0
step = 0.1
[connection signal="value_changed" from="v_box_container/sky_box/time_of_day/value" to="." method="_on_time_of_day_value_changed"] [connection signal="value_changed" from="v_box_container/sky_box/time_of_day/value" to="." method="_on_time_of_day_value_changed"]
[connection signal="value_changed" from="v_box_container/mist_box/mist_level/value" to="." method="_on_mist_level_value_changed"] [connection signal="value_changed" from="v_box_container/mist_box/mist_level/value" to="." method="_on_mist_level_value_changed"]
[connection signal="value_changed" from="v_box_container/fears_box/oubli/value" to="." method="_on_oubli_value_changed"]
[connection signal="value_changed" from="v_box_container/fears_box/douleur/value" to="." method="_on_douleur_value_changed"]
[connection signal="value_changed" from="v_box_container/fears_box/trauma/value" to="." method="_on_trauma_value_changed"]

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

View file

@ -0,0 +1,18 @@
[gd_resource type="Theme" load_steps=3 format=2]
[ext_resource path="res://assets/interfaces/windows/blank_pixel.png" type="Texture" id=1]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.6, 0.6, 0.6, 0 )
expand_margin_top = 8.0
[resource]
WindowDialog/colors/title_color = Color( 0, 0, 0, 1 )
WindowDialog/constants/close_h_ofs = 18
WindowDialog/constants/close_v_ofs = 18
WindowDialog/constants/scaleborder_size = 4
WindowDialog/constants/title_height = 24
WindowDialog/fonts/title_font = null
WindowDialog/icons/close = ExtResource( 1 )
WindowDialog/icons/close_highlight = ExtResource( 1 )
WindowDialog/styles/panel = SubResource( 1 )

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

View file

@ -97,6 +97,11 @@ music_manager={
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":77,"unicode":0,"echo":false,"script":null) "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":77,"unicode":0,"echo":false,"script":null)
] ]
} }
debug_window={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":73,"unicode":0,"echo":false,"script":null)
]
}
[khanat] [khanat]

View file

@ -15,6 +15,7 @@ class Creature:
class Ra extends Creature: class Ra extends Creature:
var sex = Creature.Sex.F var sex = Creature.Sex.F
var female_boobs = 0.0 var female_boobs = 0.0
@ -25,6 +26,10 @@ class Ra extends Creature:
var color = Color( 1.0, 1.0, 1.0 ) var color = Color( 1.0, 1.0, 1.0 )
var douleur = 0.0
var trauma = 0.0
var oubli = 0.0
func _init( p_pseudonym = "Créature" ): func _init( p_pseudonym = "Créature" ):
self.type = "ra" self.type = "ra"
self.pseudonym = p_pseudonym self.pseudonym = p_pseudonym

View file

@ -43,3 +43,15 @@ func _on_debug_window_time_of_day_changed(value):
func _on_debug_window_mist_level_changed(value): func _on_debug_window_mist_level_changed(value):
$mist_fx.get_surface_material( 0 ).set_shader_param( "mist_level", value ) $mist_fx.get_surface_material( 0 ).set_shader_param( "mist_level", value )
func _on_debug_window_douleur_changed(value):
$game_ui.set_douleur( value )
func _on_debug_window_oubli_changed(value):
$game_ui.set_oubli( value )
func _on_debug_window_trauma_changed(value):
$game_ui.set_trauma( value )

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=20 format=2] [gd_scene load_steps=21 format=2]
[ext_resource path="res://scenes/player/player.tscn" type="PackedScene" id=1] [ext_resource path="res://scenes/player/player.tscn" type="PackedScene" id=1]
[ext_resource path="res://scenes/decors/terrains/dunes/dunes.tscn" type="PackedScene" id=2] [ext_resource path="res://scenes/decors/terrains/dunes/dunes.tscn" type="PackedScene" id=2]
@ -10,6 +10,7 @@
[ext_resource path="res://assets/interfaces/debug_window/debug_window.tscn" type="PackedScene" id=8] [ext_resource path="res://assets/interfaces/debug_window/debug_window.tscn" type="PackedScene" id=8]
[ext_resource path="res://assets/interfaces/themes/khanat_theme.theme" type="Theme" id=9] [ext_resource path="res://assets/interfaces/themes/khanat_theme.theme" type="Theme" id=9]
[ext_resource path="res://assets/interfaces/buttons/close_icon.png" type="Texture" id=10] [ext_resource path="res://assets/interfaces/buttons/close_icon.png" type="Texture" id=10]
[ext_resource path="res://scenes/interfaces/game_menu/game_ui.tscn" type="PackedScene" id=11]
[sub_resource type="OpenSimplexNoise" id=1] [sub_resource type="OpenSimplexNoise" id=1]
period = 8.0 period = 8.0
@ -24,8 +25,8 @@ noise = SubResource( 1 )
[sub_resource type="ShaderMaterial" id=3] [sub_resource type="ShaderMaterial" id=3]
resource_local_to_scene = true resource_local_to_scene = true
shader = ExtResource( 5 ) shader = ExtResource( 5 )
shader_param/iTime = 3252.08 shader_param/iTime = 10.7628
shader_param/iFrame = 118130 shader_param/iFrame = 609
shader_param/COVERAGE = 0.5 shader_param/COVERAGE = 0.5
shader_param/THICKNESS = 25.0 shader_param/THICKNESS = 25.0
shader_param/ABSORPTION = 1.031 shader_param/ABSORPTION = 1.031
@ -121,9 +122,18 @@ extra_cull_margin = 16384.0
mesh = SubResource( 8 ) mesh = SubResource( 8 )
material/0 = SubResource( 9 ) material/0 = SubResource( 9 )
[node name="game_ui" parent="." instance=ExtResource( 11 )]
[node name="debug_window" parent="." instance=ExtResource( 8 )] [node name="debug_window" parent="." instance=ExtResource( 8 )]
visible = true visible = true
margin_left = 972.873
margin_top = 52.3552
margin_right = -51.1268
margin_bottom = -411.645
theme = ExtResource( 9 ) theme = ExtResource( 9 )
custom_icons/close = ExtResource( 10 ) custom_icons/close = ExtResource( 10 )
[connection signal="douleur_changed" from="debug_window" to="." method="_on_debug_window_douleur_changed"]
[connection signal="mist_level_changed" from="debug_window" to="." method="_on_debug_window_mist_level_changed"] [connection signal="mist_level_changed" from="debug_window" to="." method="_on_debug_window_mist_level_changed"]
[connection signal="oubli_changed" from="debug_window" to="." method="_on_debug_window_oubli_changed"]
[connection signal="time_of_day_changed" from="debug_window" to="." method="_on_debug_window_time_of_day_changed"] [connection signal="time_of_day_changed" from="debug_window" to="." method="_on_debug_window_time_of_day_changed"]
[connection signal="trauma_changed" from="debug_window" to="." method="_on_debug_window_trauma_changed"]

View file

@ -0,0 +1,12 @@
extends Control
func _ready():
$stats_window.popup()
func set_douleur( value ):
$stats_window/douleur.value = value
func set_oubli( value ):
$stats_window/oubli.value = value
func set_trauma( value ):
$stats_window/trauma.value = value

View file

@ -0,0 +1,70 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://assets/interfaces/themes/transparent_window.tres" type="Theme" id=1]
[ext_resource path="res://scenes/interfaces/game_menu/game_ui.gd" type="Script" id=2]
[ext_resource path="res://assets/interfaces/jauges/jauge_ring_white.png" type="Texture" id=3]
[ext_resource path="res://scenes/interfaces/windows/window.gd" type="Script" id=4]
[node name="game_ui" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="stats_window" type="WindowDialog" parent="."]
visible = true
rect_min_size = Vector2( 128, 128 )
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource( 1 )
custom_constants/close_v_ofs = 0
popup_exclusive = true
script = ExtResource( 4 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="douleur" type="TextureProgress" parent="stats_window"]
margin_right = 126.0
margin_bottom = 126.0
max_value = 100.0
step = 0.1
texture_progress = ExtResource( 3 )
fill_mode = 4
tint_progress = Color( 1, 0, 0, 1 )
radial_fill_degrees = 112.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="oubli" type="TextureProgress" parent="stats_window"]
margin_right = 126.0
margin_bottom = 126.0
step = 0.1
texture_progress = ExtResource( 3 )
fill_mode = 5
tint_progress = Color( 0, 1, 0, 1 )
radial_fill_degrees = 112.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="trauma" type="TextureProgress" parent="stats_window"]
margin_right = 126.0
margin_bottom = 126.0
step = 0.1
texture_progress = ExtResource( 3 )
fill_mode = 8
tint_progress = Color( 0, 0, 1, 1 )
radial_initial_angle = 180.0
radial_fill_degrees = 135.0
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="gui_input" from="stats_window" to="stats_window" method="_on_stats_window_gui_input"]
[connection signal="value_changed" from="stats_window/douleur" to="stats_window" method="_on_douleur_value_changed"]
[connection signal="value_changed" from="stats_window/oubli" to="stats_window" method="_on_oubli_value_changed"]
[connection signal="value_changed" from="stats_window/trauma" to="stats_window" method="_on_trauma_value_changed"]

View file

@ -0,0 +1,25 @@
extends WindowDialog
var old_mouse_position = Vector2( 0, 0 )
func _on_stats_window_gui_input(event):
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT and Input.is_mouse_button_pressed( BUTTON_LEFT ):
self.old_mouse_position = event.position
if event is InputEventMouseMotion and Input.is_mouse_button_pressed( BUTTON_LEFT ):
var delta = self.old_mouse_position - event.position
self.set_position( self.get_position() - delta )
func _on_douleur_value_changed(value):
$douleur.self_modulate.a = (value / 100.0) * (value / 100.0)
func _on_oubli_value_changed(value):
$oubli.self_modulate.a = (value / 100.0) * (value / 100.0)
func _on_trauma_value_changed(value):
$trauma.self_modulate.a = (value / 100.0) * (value / 100.0)

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=6 format=2]
[ext_resource path="res://scenes/interfaces/main_menu/main_menu.tscn" type="PackedScene" id=1] [ext_resource path="res://scenes/interfaces/main_menu/main_menu.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/interfaces/new_launcher_bg_0-1.png" type="Texture" id=2] [ext_resource path="res://assets/interfaces/loading_screen/khanat_sound_cover_hover.png" type="Texture" id=2]
[ext_resource path="res://scenes/main/main.gd" type="Script" id=3] [ext_resource path="res://scenes/main/main.gd" type="Script" id=3]
[ext_resource path="res://assets/interfaces/Login-Khanat-background-loading.png" type="Texture" id=4] [ext_resource path="res://assets/interfaces/loading_screen/khanat_sound_cover_bg.png" type="Texture" id=4]
[ext_resource path="res://assets/interfaces/loading_screen/khanat_sound_cover_progress.png" type="Texture" id=5]
[node name="main" type="Spatial"] [node name="main" type="Spatial"]
script = ExtResource( 3 ) script = ExtResource( 3 )
@ -14,10 +15,14 @@ script = ExtResource( 3 )
[node name="loading_screen" type="TextureProgress" parent="."] [node name="loading_screen" type="TextureProgress" parent="."]
visible = false visible = false
margin_right = 1280.0 anchor_right = 1.0
margin_bottom = 720.0 anchor_bottom = 1.0
texture_under = ExtResource( 2 ) margin_bottom = 6.10352e-05
texture_progress = ExtResource( 4 ) step = 0.1
texture_under = ExtResource( 4 )
texture_over = ExtResource( 2 )
texture_progress = ExtResource( 5 )
fill_mode = 6
nine_patch_stretch = true nine_patch_stretch = true
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false