2020-03-22 16:04:01 +00:00
|
|
|
extends Control
|
|
|
|
|
|
|
|
|
2020-03-22 16:31:06 +00:00
|
|
|
func change_douleur( value ):
|
2020-03-22 19:12:52 +00:00
|
|
|
$stats_window.get_content_child( "douleur" ).value += value
|
2020-03-22 16:31:06 +00:00
|
|
|
if value > 0.0:
|
2020-03-22 19:12:52 +00:00
|
|
|
$stats_window.get_content_child( "oubli" ).value -= value/2
|
2020-03-22 16:31:06 +00:00
|
|
|
|
|
|
|
func change_oubli( value ):
|
2020-03-22 19:12:52 +00:00
|
|
|
$stats_window.get_content_child( "oubli" ).value += value
|
2020-03-22 16:31:06 +00:00
|
|
|
if value > 0.0:
|
2020-03-22 19:12:52 +00:00
|
|
|
$stats_window.get_content_child( "douleur" ).value -= value/2
|
2020-03-22 16:31:06 +00:00
|
|
|
|
|
|
|
func change_trauma( value ):
|
2020-03-22 19:12:52 +00:00
|
|
|
$stats_window.get_content_child( "trauma" ).value += value
|
2020-03-22 16:31:06 +00:00
|
|
|
|
2020-03-22 16:04:01 +00:00
|
|
|
func set_douleur( value ):
|
2020-03-22 19:12:52 +00:00
|
|
|
var delta = value - $stats_window.get_content_child( "douleur" ).value
|
|
|
|
$stats_window.get_content_child( "douleur" ).value = value
|
2020-03-22 16:31:06 +00:00
|
|
|
if delta > 0.0:
|
2020-03-22 19:12:52 +00:00
|
|
|
$stats_window.get_content_child( "oubli" ).value -= delta/2
|
2020-03-22 16:04:01 +00:00
|
|
|
func set_oubli( value ):
|
2020-03-22 19:12:52 +00:00
|
|
|
var delta = value - $stats_window.get_content_child( "oubli" ).value
|
|
|
|
$stats_window.get_content_child( "oubli" ).value = value
|
2020-03-22 16:31:06 +00:00
|
|
|
if delta > 0.0:
|
2020-03-22 19:12:52 +00:00
|
|
|
$stats_window.get_content_child( "douleur" ).value -= delta/2
|
2020-03-22 16:04:01 +00:00
|
|
|
func set_trauma( value ):
|
2020-03-22 19:12:52 +00:00
|
|
|
$stats_window.get_content_child( "trauma" ).value = value
|
|
|
|
|
|
|
|
|
|
|
|
func update_trauma():
|
|
|
|
$stats_window.get_content_child( "trauma" ).value = ($stats_window.get_content_child( "oubli" ).value+$stats_window.get_content_child( "douleur" ).value)/2
|
|
|
|
|
|
|
|
func _on_douleur_value_changed(value):
|
|
|
|
$stats_window.get_content_child( "douleur" ).self_modulate.a = (value / 18.0) * (value / 18.0)
|
|
|
|
self.update_trauma()
|
|
|
|
|
|
|
|
func _on_oubli_value_changed(value):
|
|
|
|
$stats_window.get_content_child( "oubli" ).self_modulate.a = (value / 18.0) * (value / 18.0)
|
|
|
|
self.update_trauma()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_trauma_value_changed(value):
|
|
|
|
$stats_window.get_content_child( "trauma" ).self_modulate.a = (value / 6.0) * (value / 6.0)
|
|
|
|
|