EDIT amelioration des jauges de trauma/oublis/douleur.

This commit is contained in:
osquallo 2020-03-22 17:31:06 +01:00
parent c57248f2ab
commit d33896b009
6 changed files with 42 additions and 6 deletions

View file

@ -24,3 +24,9 @@ func _on_douleur_value_changed(value):
func _on_trauma_value_changed(value): func _on_trauma_value_changed(value):
emit_signal( "trauma_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

View file

@ -47,11 +47,17 @@ func _on_debug_window_mist_level_changed(value):
func _on_debug_window_douleur_changed(value): func _on_debug_window_douleur_changed(value):
$game_ui.set_douleur( value ) $game_ui.set_douleur( value )
self.update_debug_fears()
func _on_debug_window_oubli_changed(value): func _on_debug_window_oubli_changed(value):
$game_ui.set_oubli( value ) $game_ui.set_oubli( value )
self.update_debug_fears()
func _on_debug_window_trauma_changed(value): func _on_debug_window_trauma_changed(value):
$game_ui.set_trauma( 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 )

View file

@ -25,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 = 10.7628 shader_param/iTime = 84.4711
shader_param/iFrame = 609 shader_param/iFrame = 4977
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

View file

@ -4,9 +4,28 @@ extends Control
func _ready(): func _ready():
$stats_window.popup() $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 ): func set_douleur( value ):
var delta = value - $stats_window/douleur.value
$stats_window/douleur.value = value $stats_window/douleur.value = value
if delta > 0.0:
$stats_window/oubli.value -= delta/2
func set_oubli( value ): 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 ): func set_trauma( value ):
$stats_window/trauma.value = value $stats_window/trauma.value = value

View file

@ -43,6 +43,7 @@ __meta__ = {
[node name="oubli" type="TextureProgress" parent="stats_window"] [node name="oubli" type="TextureProgress" parent="stats_window"]
margin_right = 126.0 margin_right = 126.0
margin_bottom = 126.0 margin_bottom = 126.0
max_value = 100.0
step = 0.1 step = 0.1
texture_progress = ExtResource( 3 ) texture_progress = ExtResource( 3 )
fill_mode = 5 fill_mode = 5

View file

@ -13,12 +13,16 @@ func _on_stats_window_gui_input(event):
self.set_position( self.get_position() - delta ) self.set_position( self.get_position() - delta )
func update_trauma():
$trauma.value = ($oubli.value+$douleur.value)/2
func _on_douleur_value_changed(value): func _on_douleur_value_changed(value):
$douleur.self_modulate.a = (value / 100.0) * (value / 100.0) $douleur.self_modulate.a = (value / 100.0) * (value / 100.0)
self.update_trauma()
func _on_oubli_value_changed(value): func _on_oubli_value_changed(value):
$oubli.self_modulate.a = (value / 100.0) * (value / 100.0) $oubli.self_modulate.a = (value / 100.0) * (value / 100.0)
self.update_trauma()
func _on_trauma_value_changed(value): func _on_trauma_value_changed(value):