Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
158
scripts/backround_scenes_scripts/Garaj.gd
Normal file
158
scripts/backround_scenes_scripts/Garaj.gd
Normal file
|
@ -0,0 +1,158 @@
|
|||
extends Node2D
|
||||
|
||||
var isDay:bool
|
||||
var isLightOn:bool
|
||||
var isDoorOpen:bool
|
||||
var isCarVisible:bool
|
||||
const fadeTime = 1.5
|
||||
|
||||
func _ready():
|
||||
if not get_tree().root.has_node("Root"):
|
||||
return ;
|
||||
|
||||
GallerySingleton.AddBackground("Garaj");
|
||||
|
||||
isDay = Dialogic.get_variable("ItIsDay") == "true";
|
||||
isLightOn = Dialogic.get_variable("GarajLightOn") == "1";
|
||||
isDoorOpen = Dialogic.get_variable("DoorOpen") == "1";
|
||||
isCarVisible = Dialogic.get_variable("Car") == "1";
|
||||
|
||||
if Dialogic.get_variable("ItIsDay") == "true":
|
||||
$Cat.Init(2, 5);
|
||||
$Cat.position = Vector2(1550, 790);
|
||||
|
||||
get_tree().root.get_node("Root").StopSFX();
|
||||
else :
|
||||
$Cat.visible = false;
|
||||
$rain.visible = true;
|
||||
|
||||
var sfxPath = "res://resources/audio/sfx/Rain Loop.ogg";
|
||||
get_tree().root.get_node("Root").SetSFXforBGM(sfxPath);
|
||||
|
||||
SetSceneState()
|
||||
|
||||
var dialogicNode = get_parent().get_parent().get_node("Game").get_child(0).get_child(0)
|
||||
dialogicNode.connect("dialogic_signal", self, "_lightsdoor_listener")
|
||||
|
||||
func _lightsdoor_listener(string):
|
||||
match string:
|
||||
"lights_on":
|
||||
Dialogic.set_variable("GarajLightOn", 1)
|
||||
isLightOn = true
|
||||
SetSceneState()
|
||||
"lights_off":
|
||||
Dialogic.set_variable("GarajLightOn", 0)
|
||||
isLightOn = false
|
||||
SetSceneState()
|
||||
"door_open":
|
||||
Dialogic.set_variable("DoorOpen", 1)
|
||||
isDoorOpen = true
|
||||
SetSceneState()
|
||||
"door_close":
|
||||
Dialogic.set_variable("DoorOpen", 0)
|
||||
isDoorOpen = false
|
||||
SetSceneState()
|
||||
"car_off":
|
||||
Dialogic.set_variable("Car", 0)
|
||||
$Tween.interpolate_property($Car, "modulate", Color(1, 1, 1, 1), Color(1, 1, 1, 0), fadeTime, Tween.TRANS_LINEAR, 0)
|
||||
$Tween.start()
|
||||
"add_henry":
|
||||
$removable / Yellow.visible = Dialogic.get_variable("Is_Yellow_Dead") == "0";
|
||||
"remove_henry":
|
||||
$removable / Yellow.visible = false;
|
||||
|
||||
func SetSceneState():
|
||||
var path = "";
|
||||
if not isDoorOpen:
|
||||
if isDay:
|
||||
path = "res://resources/graphics/backgrounds/garaj/Garage4K-4.webp";
|
||||
|
||||
else :
|
||||
path = "res://resources/graphics/backgrounds/garaj/Garage4K-3.webp";
|
||||
|
||||
else :
|
||||
if isDay:
|
||||
if isLightOn and isDoorOpen and isCarVisible:
|
||||
path = "res://resources/graphics/backgrounds/garaj/Garage4K-2.webp";
|
||||
|
||||
elif not isLightOn and isDoorOpen and isCarVisible:
|
||||
|
||||
path = "res://resources/graphics/backgrounds/garaj/Garage4K-LightsOff.webp";
|
||||
else :
|
||||
path = "res://resources/graphics/backgrounds/garaj/NoCar3.webp";
|
||||
|
||||
else :
|
||||
if isLightOn and isDoorOpen and isCarVisible:
|
||||
path = "res://resources/graphics/backgrounds/garaj/Garage4K-1.webp";
|
||||
|
||||
elif not isLightOn and isDoorOpen and isCarVisible:
|
||||
|
||||
path = "res://resources/graphics/backgrounds/garaj/NoCar1.webp"
|
||||
$Car.visible = true
|
||||
|
||||
elif isLightOn and isDoorOpen and not isCarVisible:
|
||||
path = "res://resources/graphics/backgrounds/garaj/NoCar2.webp";
|
||||
|
||||
else :
|
||||
path = "res://resources/graphics/backgrounds/garaj/NoCar1.webp";
|
||||
|
||||
|
||||
$Garage.texture = load(path);
|
||||
|
||||
func InitForGallery()->Array:
|
||||
scale = Vector2(0.5, 0.5)
|
||||
|
||||
isDay = false;
|
||||
isLightOn = false;
|
||||
isDoorOpen = false;
|
||||
isCarVisible = false;
|
||||
$Cat.visible = false;
|
||||
|
||||
SetGalleryState();
|
||||
|
||||
return ["ui_day", "ui_gallery_light", "ui_gallery_door", "ui_gallery_car"];
|
||||
|
||||
func SetToggleSettings(button):
|
||||
$Car.visible = false;
|
||||
|
||||
var text = button.text;
|
||||
var state = button.pressed;
|
||||
if text == tr("ui_day"):
|
||||
isDay = state
|
||||
elif text == tr("ui_gallery_light"):
|
||||
isLightOn = state
|
||||
elif text == tr("ui_gallery_door"):
|
||||
isDoorOpen = state;
|
||||
elif text == tr("ui_gallery_car"):
|
||||
isCarVisible = state;
|
||||
|
||||
SetGalleryState();
|
||||
|
||||
func SetGalleryState():
|
||||
var path = "";
|
||||
if not isDoorOpen:
|
||||
if isDay:
|
||||
path = "res://resources/graphics/backgrounds/garaj/Garage4K-4.webp";
|
||||
else :
|
||||
path = "res://resources/graphics/backgrounds/garaj/Garage4K-3.webp";
|
||||
else :
|
||||
if isDay:
|
||||
if isLightOn and isDoorOpen and isCarVisible:
|
||||
path = "res://resources/graphics/backgrounds/garaj/Garage4K-2.webp";
|
||||
elif not isLightOn and isDoorOpen and isCarVisible:
|
||||
path = "res://resources/graphics/backgrounds/garaj/Garage4K-LightsOff.webp";
|
||||
else :
|
||||
path = "res://resources/graphics/backgrounds/garaj/NoCar3.webp";
|
||||
else :
|
||||
if isLightOn and isDoorOpen and isCarVisible:
|
||||
path = "res://resources/graphics/backgrounds/garaj/Garage4K-1.webp";
|
||||
elif not isLightOn and isDoorOpen and isCarVisible:
|
||||
path = "res://resources/graphics/backgrounds/garaj/NoCar1.webp"
|
||||
$Car.visible = true
|
||||
elif isLightOn and isDoorOpen and not isCarVisible:
|
||||
path = "res://resources/graphics/backgrounds/garaj/NoCar2.webp";
|
||||
else :
|
||||
path = "res://resources/graphics/backgrounds/garaj/NoCar1.webp";
|
||||
|
||||
$Garage.texture = load(path);
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue