From d33896b009de0fccc5efa61d918c0d0ee7d21c2d Mon Sep 17 00:00:00 2001 From: osquallo Date: Sun, 22 Mar 2020 17:31:06 +0100 Subject: [PATCH] EDIT amelioration des jauges de trauma/oublis/douleur. --- .../interfaces/debug_window/debug_window.gd | 6 ++++++ scenes/game/game.gd | 10 +++++++-- scenes/game/game.tscn | 4 ++-- scenes/interfaces/game_menu/game_ui.gd | 21 ++++++++++++++++++- scenes/interfaces/game_menu/game_ui.tscn | 1 + scenes/interfaces/windows/window.gd | 6 +++++- 6 files changed, 42 insertions(+), 6 deletions(-) diff --git a/assets/interfaces/debug_window/debug_window.gd b/assets/interfaces/debug_window/debug_window.gd index 8fb93e3..1b8f2f9 100644 --- a/assets/interfaces/debug_window/debug_window.gd +++ b/assets/interfaces/debug_window/debug_window.gd @@ -24,3 +24,9 @@ func _on_douleur_value_changed(value): func _on_trauma_value_changed(value): emit_signal( "trauma_changed", value ) + + +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 diff --git a/scenes/game/game.gd b/scenes/game/game.gd index 3e9cf60..6eaf4d9 100644 --- a/scenes/game/game.gd +++ b/scenes/game/game.gd @@ -47,11 +47,17 @@ func _on_debug_window_mist_level_changed(value): func _on_debug_window_douleur_changed(value): $game_ui.set_douleur( value ) - + self.update_debug_fears() 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 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 ) + + diff --git a/scenes/game/game.tscn b/scenes/game/game.tscn index f7bf394..bbea0fe 100644 --- a/scenes/game/game.tscn +++ b/scenes/game/game.tscn @@ -25,8 +25,8 @@ noise = SubResource( 1 ) [sub_resource type="ShaderMaterial" id=3] resource_local_to_scene = true shader = ExtResource( 5 ) -shader_param/iTime = 10.7628 -shader_param/iFrame = 609 +shader_param/iTime = 84.4711 +shader_param/iFrame = 4977 shader_param/COVERAGE = 0.5 shader_param/THICKNESS = 25.0 shader_param/ABSORPTION = 1.031 diff --git a/scenes/interfaces/game_menu/game_ui.gd b/scenes/interfaces/game_menu/game_ui.gd index 9e206a3..cbbafe7 100644 --- a/scenes/interfaces/game_menu/game_ui.gd +++ b/scenes/interfaces/game_menu/game_ui.gd @@ -4,9 +4,28 @@ extends Control func _ready(): $stats_window.popup() +func change_douleur( value ): + $stats_window/douleur.value += value + if value > 0.0: + $stats_window/oubli.value -= value/2 + +func change_oubli( value ): + $stats_window/oubli.value += value + if value > 0.0: + $stats_window/douleur.value -= value/2 + +func change_trauma( value ): + $stats_window/trauma.value += value + func set_douleur( value ): + var delta = value - $stats_window/douleur.value $stats_window/douleur.value = value + if delta > 0.0: + $stats_window/oubli.value -= delta/2 func set_oubli( value ): - $stats_window/oubli.value = value + var delta = value - $stats_window/oubli.value + $stats_window/oubli.value = value + if delta > 0.0: + $stats_window/douleur.value -= delta/2 func set_trauma( value ): $stats_window/trauma.value = value diff --git a/scenes/interfaces/game_menu/game_ui.tscn b/scenes/interfaces/game_menu/game_ui.tscn index 4d6bdc1..e2c6060 100644 --- a/scenes/interfaces/game_menu/game_ui.tscn +++ b/scenes/interfaces/game_menu/game_ui.tscn @@ -43,6 +43,7 @@ __meta__ = { [node name="oubli" 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 = 5 diff --git a/scenes/interfaces/windows/window.gd b/scenes/interfaces/windows/window.gd index 37eeb30..de097f4 100644 --- a/scenes/interfaces/windows/window.gd +++ b/scenes/interfaces/windows/window.gd @@ -13,12 +13,16 @@ func _on_stats_window_gui_input(event): self.set_position( self.get_position() - delta ) +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) - + self.update_trauma() func _on_oubli_value_changed(value): $oubli.self_modulate.a = (value / 100.0) * (value / 100.0) + self.update_trauma() func _on_trauma_value_changed(value):