29 lines
936 B
GDScript
29 lines
936 B
GDScript
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 update_trauma():
|
|
$trauma.value = ($oubli.value+$douleur.value)/2
|
|
|
|
func _on_douleur_value_changed(value):
|
|
$douleur.self_modulate.a = (value / 18.0) * (value / 18.0)
|
|
self.update_trauma()
|
|
|
|
func _on_oubli_value_changed(value):
|
|
$oubli.self_modulate.a = (value / 18.0) * (value / 18.0)
|
|
self.update_trauma()
|
|
|
|
|
|
func _on_trauma_value_changed(value):
|
|
$trauma.self_modulate.a = (value / 6.0) * (value / 6.0)
|