Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
127
scripts/backround_scenes_scripts/Podval.gd
Normal file
127
scripts/backround_scenes_scripts/Podval.gd
Normal file
|
@ -0,0 +1,127 @@
|
|||
extends Node2D
|
||||
|
||||
var isWindowOpen:bool
|
||||
var isLightOn:bool
|
||||
var isWaterOn:bool
|
||||
var path:String
|
||||
|
||||
var sfxStarted:bool = false;
|
||||
|
||||
func _ready():
|
||||
if not get_tree().root.has_node("Root"):
|
||||
return ;
|
||||
|
||||
GallerySingleton.AddBackground("Podval")
|
||||
|
||||
if Dialogic.get_variable("ItIsDay") == "true":
|
||||
$ForScale / Polygon2D.modulate = Color(0.48, 0.48, 0.48)
|
||||
else :
|
||||
$ForScale / Polygon2D.modulate = Color(0.08, 0.08, 0.08)
|
||||
$ForScale / Rain.visible = true
|
||||
|
||||
if Dialogic.get_variable("TimelineSave") == "Timeline_140_main":
|
||||
var sfxPath = "res://resources/audio/sfx/rain_podval.ogg"
|
||||
get_tree().root.get_node("Root").SetSFXforBGM(sfxPath)
|
||||
sfxStarted = true;
|
||||
|
||||
$Cat.Init(2, 3);
|
||||
$Cat.position = Vector2(1580, 310);
|
||||
$Cat.Scale(0.35);
|
||||
|
||||
if int(Dialogic.get_variable("LightsOn")) == 1:
|
||||
isLightOn = true
|
||||
else :
|
||||
isLightOn = false
|
||||
if int(Dialogic.get_variable("WindowOpen")) == 1:
|
||||
isWindowOpen = true
|
||||
else :
|
||||
isWindowOpen = false
|
||||
if int(Dialogic.get_variable("WaterOn")) == 1:
|
||||
isWaterOn = true
|
||||
else :
|
||||
isWaterOn = false
|
||||
SetSceneState()
|
||||
|
||||
var dialogicNode = get_parent().get_parent().get_node("Game").get_child(0).get_child(0)
|
||||
dialogicNode.connect("dialogic_signal", self, "_podval_listener")
|
||||
|
||||
func SetSceneState():
|
||||
if ( not isLightOn and isWaterOn and not isWindowOpen):
|
||||
path = "res://resources/graphics/backgrounds/podval/dark_water_closed.webp"
|
||||
elif ( not isLightOn and isWaterOn and isWindowOpen):
|
||||
path = "res://resources/graphics/backgrounds/podval/dark_water_open.webp"
|
||||
elif ( not isLightOn and not isWaterOn and not isWindowOpen):
|
||||
path = "res://resources/graphics/backgrounds/podval/dark_nowater_closed.webp"
|
||||
elif ( not isLightOn and not isWaterOn and isWindowOpen):
|
||||
path = "res://resources/graphics/backgrounds/podval/dark_nowater_open.webp"
|
||||
elif (isLightOn and not isWaterOn and not isWindowOpen):
|
||||
path = "res://resources/graphics/backgrounds/podval/light_nowater_closed.webp"
|
||||
elif (isLightOn and isWaterOn and not isWindowOpen):
|
||||
path = "res://resources/graphics/backgrounds/podval/light_water_closed.webp"
|
||||
elif (isLightOn and not isWaterOn and isWindowOpen):
|
||||
path = "res://resources/graphics/backgrounds/podval/light_nowater_open.webp"
|
||||
elif (isLightOn and isWaterOn and isWindowOpen):
|
||||
path = "res://resources/graphics/backgrounds/podval/light_water_open.webp"
|
||||
|
||||
$Sprite.texture = load(path)
|
||||
|
||||
if isWindowOpen:
|
||||
$Sprite / PowerPanel.visible = true
|
||||
if isLightOn:
|
||||
$Sprite / PowerPanel.texture = load("res://resources/graphics/backgrounds/podval/elec_light.webp")
|
||||
else :
|
||||
$Sprite / PowerPanel.texture = load("res://resources/graphics/backgrounds/podval/elec_dark.webp")
|
||||
|
||||
func _podval_listener(string):
|
||||
match string:
|
||||
"lights_on":
|
||||
Dialogic.set_variable("LightsOn", 1)
|
||||
isLightOn = true
|
||||
"lights_off":
|
||||
Dialogic.set_variable("LightsOn", 0)
|
||||
"water_on":
|
||||
Dialogic.set_variable("WaterOn", 1)
|
||||
isWaterOn = true
|
||||
"water_off":
|
||||
Dialogic.set_variable("WaterOn", 0)
|
||||
isWaterOn = false
|
||||
"window_open":
|
||||
Dialogic.set_variable("WindowOpen", 1)
|
||||
isWindowOpen = true
|
||||
"window_close":
|
||||
Dialogic.set_variable("WindowOpen", 0)
|
||||
isWindowOpen = false
|
||||
"add_gray":
|
||||
$removable / Gray.visible = Dialogic.get_variable("Is_Gray_Dead") == "0";
|
||||
"remove_gray":
|
||||
$removable / Gray.visible = false;
|
||||
SetSceneState()
|
||||
|
||||
func _exit_tree():
|
||||
if sfxStarted:
|
||||
get_tree().root.get_node("Root").StopSFX();
|
||||
|
||||
func InitForGallery()->Array:
|
||||
scale = Vector2(0.5, 0.5)
|
||||
|
||||
isLightOn = false;
|
||||
isWaterOn = false;
|
||||
isWindowOpen = false;
|
||||
SetSceneState();
|
||||
$Cat.visible = false;
|
||||
|
||||
return ["ui_gallery_light", "ui_gallery_water", "ui_gallery_window"];
|
||||
|
||||
func SetToggleSettings(button):
|
||||
var text = button.text;
|
||||
var state = button.pressed;
|
||||
|
||||
if text == tr("ui_gallery_light"):
|
||||
isLightOn = state
|
||||
elif text == tr("ui_gallery_water"):
|
||||
isWaterOn = state;
|
||||
elif text == tr("ui_gallery_window"):
|
||||
isWindowOpen = state;
|
||||
|
||||
SetSceneState();
|
||||
$Cat.visible = false;
|
Loading…
Add table
Add a link
Reference in a new issue