41 lines
1.1 KiB
GDScript
41 lines
1.1 KiB
GDScript
extends Node2D
|
|
|
|
func _ready():
|
|
if not get_tree().root.has_node("Root"):
|
|
return ;
|
|
|
|
if Dialogic.get_variable("1_Death_Knife") == "Black":
|
|
GallerySingleton.AddImage("Black_Death_1");
|
|
elif Dialogic.get_variable("1_Death_Knife") == "Green":
|
|
GallerySingleton.AddImage("Green_Death_1");
|
|
|
|
var dialogicNode = get_parent().get_parent().get_node("Game").get_child(0).get_child(0)
|
|
dialogicNode.connect("dialogic_signal", self, "_lights_on_listener")
|
|
|
|
if Dialogic.get_variable("ItIsDay") == "false":
|
|
var sfxPath = "res://resources/audio/sfx/Rain Loop.ogg"
|
|
get_tree().root.get_node("Root").SetSFXforBGM(sfxPath)
|
|
else :
|
|
get_tree().root.get_node("Root").StopSFX();
|
|
|
|
func _lights_on_listener(string):
|
|
match string:
|
|
"lights_on":
|
|
TurnLightsOn()
|
|
|
|
func TurnLightsOn():
|
|
$TurnOn.visible = true;
|
|
$TurnOff.visible = false;
|
|
|
|
func InitForGallery()->Array:
|
|
scale = Vector2(0.75, 0.75)
|
|
|
|
return ["ui_lights_on", "ui_lights_off"];
|
|
|
|
func SetSettings(setting):
|
|
if setting == tr("ui_lights_on"):
|
|
$TurnOn.visible = true;
|
|
$TurnOff.visible = false;
|
|
else :
|
|
$TurnOn.visible = false;
|
|
$TurnOff.visible = true;
|