From dd2ade1de0058e09c9b8fce17569a4a7c0c0f6ed Mon Sep 17 00:00:00 2001 From: osquallo Date: Sun, 22 Mar 2020 18:57:23 +0100 Subject: [PATCH] EDIT meilleur gestion de la douleur/oubli/trauma en concordance avec le wiki et changement des sliders du menu debug par des boutons. --- .../interfaces/debug_window/debug_window.gd | 25 +++--- .../interfaces/debug_window/debug_window.tscn | 82 ++++++++----------- scenes/decors/terrains/test/test_level.tscn | 30 +++++++ scenes/game/game.gd | 22 ++--- scenes/game/game.tscn | 23 ++---- scenes/interfaces/game_menu/game_ui.gd | 2 +- scenes/interfaces/game_menu/game_ui.tscn | 17 ++-- scenes/interfaces/windows/window.gd | 6 +- 8 files changed, 108 insertions(+), 99 deletions(-) create mode 100644 scenes/decors/terrains/test/test_level.tscn diff --git a/assets/interfaces/debug_window/debug_window.gd b/assets/interfaces/debug_window/debug_window.gd index 1b8f2f9..d877512 100644 --- a/assets/interfaces/debug_window/debug_window.gd +++ b/assets/interfaces/debug_window/debug_window.gd @@ -2,9 +2,10 @@ extends WindowDialog signal time_of_day_changed( value ) signal mist_level_changed( value ) -signal oubli_changed( value ) -signal douleur_changed( value ) -signal trauma_changed( value ) +signal oubli_minus_pressed +signal oubli_plus_pressed +signal douleur_minus_pressed +signal douleur_plus_pressed func _on_time_of_day_value_changed(value): emit_signal( "time_of_day_changed", value ) @@ -14,19 +15,17 @@ func _on_mist_level_value_changed(value): emit_signal( "mist_level_changed", value ) -func _on_oubli_value_changed(value): - emit_signal( "oubli_changed", value ) +func _on_oubli_minus_pressed(): + emit_signal( "oubli_minus_pressed" ) -func _on_douleur_value_changed(value): - emit_signal( "douleur_changed", value ) +func _on_oubli_plus_pressed(): + emit_signal( "oubli_plus_pressed" ) -func _on_trauma_value_changed(value): - emit_signal( "trauma_changed", value ) +func _on_douleur_minus_pressed(): + emit_signal( "douleur_minus_pressed" ) -func update_fears( oubli, douleur, trauma ): - $v_box_container/fears_box/oubli/value.value = oubli - $v_box_container/fears_box/douleur/value.value = douleur - $v_box_container/fears_box/trauma/value.value = trauma +func _on_douleur_plus_pressed(): + emit_signal( "douleur_plus_pressed" ) diff --git a/assets/interfaces/debug_window/debug_window.tscn b/assets/interfaces/debug_window/debug_window.tscn index 967fc22..ecd8b0b 100644 --- a/assets/interfaces/debug_window/debug_window.tscn +++ b/assets/interfaces/debug_window/debug_window.tscn @@ -95,71 +95,59 @@ text = "Fears:" [node name="fears_box" type="VBoxContainer" parent="v_box_container"] margin_top = 94.0 margin_right = 256.0 -margin_bottom = 150.0 +margin_bottom = 138.0 [node name="oubli" type="HBoxContainer" parent="v_box_container/fears_box"] margin_right = 256.0 -margin_bottom = 16.0 +margin_bottom = 20.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 +margin_left = 160.0 +margin_top = 3.0 +margin_right = 195.0 +margin_bottom = 17.0 size_flags_horizontal = 10 text = "Oubli" -[node name="value" type="HSlider" parent="v_box_container/fears_box/oubli"] -margin_left = 130.0 +[node name="minus" type="Button" parent="v_box_container/fears_box/oubli"] +margin_left = 199.0 +margin_right = 224.0 +margin_bottom = 20.0 +text = "-1" + +[node name="plus" type="Button" parent="v_box_container/fears_box/oubli"] +margin_left = 228.0 margin_right = 256.0 -margin_bottom = 16.0 -size_flags_horizontal = 3 -max_value = 100.0 -step = 0.1 +margin_bottom = 20.0 +text = "+1" [node name="douleur" type="HBoxContainer" parent="v_box_container/fears_box"] -margin_top = 20.0 +margin_top = 24.0 margin_right = 256.0 -margin_bottom = 36.0 +margin_bottom = 44.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 +margin_left = 144.0 +margin_top = 3.0 +margin_right = 195.0 +margin_bottom = 17.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="minus" type="Button" parent="v_box_container/fears_box/douleur"] +margin_left = 199.0 +margin_right = 224.0 +margin_bottom = 20.0 +text = "-1" -[node name="trauma" type="HBoxContainer" parent="v_box_container/fears_box"] -margin_top = 40.0 +[node name="plus" type="Button" parent="v_box_container/fears_box/douleur"] +margin_left = 228.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 +margin_bottom = 20.0 +text = "+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/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"] +[connection signal="pressed" from="v_box_container/fears_box/oubli/minus" to="." method="_on_oubli_minus_pressed"] +[connection signal="pressed" from="v_box_container/fears_box/oubli/plus" to="." method="_on_oubli_plus_pressed"] +[connection signal="pressed" from="v_box_container/fears_box/douleur/minus" to="." method="_on_douleur_minus_pressed"] +[connection signal="pressed" from="v_box_container/fears_box/douleur/plus" to="." method="_on_douleur_plus_pressed"] diff --git a/scenes/decors/terrains/test/test_level.tscn b/scenes/decors/terrains/test/test_level.tscn new file mode 100644 index 0000000..9b2166f --- /dev/null +++ b/scenes/decors/terrains/test/test_level.tscn @@ -0,0 +1,30 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://scenes/decors/terrains/dunes/dunes.tscn" type="PackedScene" id=1] +[ext_resource path="res://scenes/decors/vegets/tree_001.tscn" type="PackedScene" id=2] + +[node name="test_level" type="Spatial"] +transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0 ) + +[node name="dunes" parent="." instance=ExtResource( 1 )] + +[node name="tree_001" parent="." instance=ExtResource( 2 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.95473, 0, 1.44227 ) + +[node name="tree_006" parent="." instance=ExtResource( 2 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -5.71715, 0, -3.36606 ) + +[node name="tree_007" parent="." instance=ExtResource( 2 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.64162, 0, -6.91156 ) + +[node name="tree_002" parent="." instance=ExtResource( 2 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -5.50864, 0, 4.49157 ) + +[node name="tree_003" parent="." instance=ExtResource( 2 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.73244, -0.0038662, -7.54963 ) + +[node name="tree_004" parent="." instance=ExtResource( 2 )] +transform = Transform( 1, 0, 0, 0, 0.999688, 0.0249731, 0, -0.0249731, 0.999688, 7.26702, -0.568749, -9.67012 ) + +[node name="tree_005" parent="." instance=ExtResource( 2 )] +transform = Transform( 1, 0, 0, 0, 0.999688, 0.0249731, 0, -0.0249731, 0.999688, 7.26702, -0.568749, 9.23473 ) diff --git a/scenes/game/game.gd b/scenes/game/game.gd index 6eaf4d9..f9b7ded 100644 --- a/scenes/game/game.gd +++ b/scenes/game/game.gd @@ -44,20 +44,16 @@ func _on_debug_window_time_of_day_changed(value): func _on_debug_window_mist_level_changed(value): $mist_fx.get_surface_material( 0 ).set_shader_param( "mist_level", value ) +func _on_debug_window_douleur_minus_pressed(): + $game_ui.change_douleur( -1 ) -func _on_debug_window_douleur_changed(value): - $game_ui.set_douleur( value ) - self.update_debug_fears() +func _on_debug_window_douleur_plus_pressed(): + $game_ui.change_douleur( 1 ) -func _on_debug_window_oubli_changed(value): - $game_ui.set_oubli( value ) - self.update_debug_fears() -func _on_debug_window_trauma_changed(value): - $game_ui.set_trauma( value ) - self.update_debug_fears() +func _on_debug_window_oubli_minus_pressed(): + $game_ui.change_oubli( -1 ) -func update_debug_fears(): - $debug_window.update_fears( $game_ui/stats_window/oubli.value, $game_ui/stats_window/douleur.value, $game_ui/stats_window/trauma.value ) - - + +func _on_debug_window_oubli_plus_pressed(): + $game_ui.change_oubli( 1 ) diff --git a/scenes/game/game.tscn b/scenes/game/game.tscn index bbea0fe..bf6e032 100644 --- a/scenes/game/game.tscn +++ b/scenes/game/game.tscn @@ -1,9 +1,7 @@ -[gd_scene load_steps=21 format=2] +[gd_scene load_steps=20 format=2] [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/game/game.gd" type="Script" id=3] -[ext_resource path="res://scenes/decors/vegets/tree_001.tscn" type="PackedScene" id=4] [ext_resource path="res://assets/sky/sky.shader" type="Shader" id=5] [ext_resource path="res://scenes/game/sky.gd" type="Script" id=6] [ext_resource path="res://assets/mist/mist.shader" type="Shader" id=7] @@ -11,6 +9,7 @@ [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://scenes/interfaces/game_menu/game_ui.tscn" type="PackedScene" id=11] +[ext_resource path="res://scenes/decors/terrains/test/test_level.tscn" type="PackedScene" id=12] [sub_resource type="OpenSimplexNoise" id=1] period = 8.0 @@ -25,8 +24,8 @@ noise = SubResource( 1 ) [sub_resource type="ShaderMaterial" id=3] resource_local_to_scene = true shader = ExtResource( 5 ) -shader_param/iTime = 84.4711 -shader_param/iFrame = 4977 +shader_param/iTime = 4.40622 +shader_param/iFrame = 250 shader_param/COVERAGE = 0.5 shader_param/THICKNESS = 25.0 shader_param/ABSORPTION = 1.031 @@ -105,11 +104,7 @@ environment = SubResource( 7 ) [node name="level" type="Spatial" parent="."] -[node name="dunes" parent="level" instance=ExtResource( 2 )] -transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0 ) - -[node name="tree_001" parent="level" instance=ExtResource( 4 )] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -11.2768, 8, 13.9512 ) +[node name="test_level" parent="level" instance=ExtResource( 12 )] [node name="creatures" type="Spatial" parent="."] @@ -125,15 +120,15 @@ material/0 = SubResource( 9 ) [node name="game_ui" parent="." instance=ExtResource( 11 )] [node name="debug_window" parent="." instance=ExtResource( 8 )] -visible = true margin_left = 972.873 margin_top = 52.3552 margin_right = -51.1268 margin_bottom = -411.645 theme = ExtResource( 9 ) custom_icons/close = ExtResource( 10 ) -[connection signal="douleur_changed" from="debug_window" to="." method="_on_debug_window_douleur_changed"] +[connection signal="douleur_minus_pressed" from="debug_window" to="." method="_on_debug_window_douleur_minus_pressed"] +[connection signal="douleur_plus_pressed" from="debug_window" to="." method="_on_debug_window_douleur_plus_pressed"] [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="oubli_minus_pressed" from="debug_window" to="." method="_on_debug_window_oubli_minus_pressed"] +[connection signal="oubli_plus_pressed" from="debug_window" to="." method="_on_debug_window_oubli_plus_pressed"] [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"] diff --git a/scenes/interfaces/game_menu/game_ui.gd b/scenes/interfaces/game_menu/game_ui.gd index cbbafe7..0ced3de 100644 --- a/scenes/interfaces/game_menu/game_ui.gd +++ b/scenes/interfaces/game_menu/game_ui.gd @@ -24,7 +24,7 @@ func set_douleur( value ): $stats_window/oubli.value -= delta/2 func set_oubli( value ): var delta = value - $stats_window/oubli.value - $stats_window/oubli.value = value + $stats_window/oubli.value = value if delta > 0.0: $stats_window/douleur.value -= delta/2 func set_trauma( value ): diff --git a/scenes/interfaces/game_menu/game_ui.tscn b/scenes/interfaces/game_menu/game_ui.tscn index e2c6060..243086e 100644 --- a/scenes/interfaces/game_menu/game_ui.tscn +++ b/scenes/interfaces/game_menu/game_ui.tscn @@ -30,12 +30,12 @@ __meta__ = { [node name="douleur" type="TextureProgress" parent="stats_window"] margin_right = 126.0 margin_bottom = 126.0 -max_value = 100.0 -step = 0.1 +max_value = 18.0 +step = 0.5 texture_progress = ExtResource( 3 ) fill_mode = 4 tint_progress = Color( 1, 0, 0, 1 ) -radial_fill_degrees = 112.0 +radial_fill_degrees = 135.0 __meta__ = { "_edit_use_anchors_": false } @@ -43,12 +43,12 @@ __meta__ = { [node name="oubli" type="TextureProgress" parent="stats_window"] margin_right = 126.0 margin_bottom = 126.0 -max_value = 100.0 -step = 0.1 +max_value = 18.0 +step = 0.5 texture_progress = ExtResource( 3 ) fill_mode = 5 tint_progress = Color( 0, 1, 0, 1 ) -radial_fill_degrees = 112.0 +radial_fill_degrees = 135.0 __meta__ = { "_edit_use_anchors_": false } @@ -56,12 +56,13 @@ __meta__ = { [node name="trauma" type="TextureProgress" parent="stats_window"] margin_right = 126.0 margin_bottom = 126.0 -step = 0.1 +max_value = 6.0 +step = 0.5 texture_progress = ExtResource( 3 ) fill_mode = 8 tint_progress = Color( 0, 0, 1, 1 ) radial_initial_angle = 180.0 -radial_fill_degrees = 135.0 +radial_fill_degrees = 90.0 __meta__ = { "_edit_use_anchors_": false } diff --git a/scenes/interfaces/windows/window.gd b/scenes/interfaces/windows/window.gd index de097f4..f3b2b2c 100644 --- a/scenes/interfaces/windows/window.gd +++ b/scenes/interfaces/windows/window.gd @@ -17,13 +17,13 @@ func update_trauma(): $trauma.value = ($oubli.value+$douleur.value)/2 func _on_douleur_value_changed(value): - $douleur.self_modulate.a = (value / 100.0) * (value / 100.0) + $douleur.self_modulate.a = (value / 18.0) * (value / 18.0) self.update_trauma() func _on_oubli_value_changed(value): - $oubli.self_modulate.a = (value / 100.0) * (value / 100.0) + $oubli.self_modulate.a = (value / 18.0) * (value / 18.0) self.update_trauma() func _on_trauma_value_changed(value): - $trauma.self_modulate.a = (value / 100.0) * (value / 100.0) + $trauma.self_modulate.a = (value / 6.0) * (value / 6.0)