2021-01-21 15:08:59 +01:00
|
|
|
extends TextureRect
|
|
|
|
|
|
|
|
export var active = true setget _set_active
|
|
|
|
export var sparkling = true setget _set_sparkling
|
2021-02-18 16:44:04 +01:00
|
|
|
export var impossible = false setget _set_impossible
|
2021-01-21 15:08:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
func _ready():
|
|
|
|
_set_sparkling(sparkling)
|
|
|
|
|
|
|
|
func _set_active(new_active):
|
|
|
|
active = new_active
|
|
|
|
if active:
|
2021-02-18 16:44:04 +01:00
|
|
|
self.self_modulate = Color(1, 1, 1)
|
2021-01-21 15:08:59 +01:00
|
|
|
else:
|
2021-02-18 16:44:04 +01:00
|
|
|
self.self_modulate = Color(0.2, 0.2, 0.2)
|
2021-01-21 15:08:59 +01:00
|
|
|
sparkling = false
|
|
|
|
|
|
|
|
func _set_sparkling(new_sparkling):
|
|
|
|
sparkling = new_sparkling
|
|
|
|
if $Particles2D:
|
|
|
|
$Particles2D.emitting = sparkling
|
2021-02-18 16:44:04 +01:00
|
|
|
|
|
|
|
func _set_impossible(new_impossible):
|
|
|
|
impossible = new_impossible
|
|
|
|
$Nope.visible = impossible
|