Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
135
scripts/backround_scenes_scripts/Vzriv2.gd
Normal file
135
scripts/backround_scenes_scripts/Vzriv2.gd
Normal file
|
@ -0,0 +1,135 @@
|
|||
extends Node2D
|
||||
|
||||
var folder;
|
||||
const zoomingTime = 2.5
|
||||
|
||||
|
||||
func _ready():
|
||||
var cameraPosition = Dialogic.get_variable("cameraPosition")
|
||||
|
||||
if cameraPosition == "vzriv_zoomed":
|
||||
self.position = Vector2( - 1300, - 150)
|
||||
self.scale = Vector2(1.7, 1.7)
|
||||
|
||||
if not get_tree().root.has_node("Root"):
|
||||
return ;
|
||||
|
||||
GallerySingleton.AddImage("Vzriv2")
|
||||
|
||||
var dialogicNode = get_parent().get_parent().get_node("Game").get_child(0).get_child(0)
|
||||
dialogicNode.connect("dialogic_signal", self, "_emotes_listener")
|
||||
|
||||
if Dialogic.get_variable("5_Wounded_Fire") == "" or Dialogic.get_variable("5_Wounded_Fire") == "none":
|
||||
OS.alert("5_Wounded_Fire ПУСТОЕ!!!");
|
||||
return ;
|
||||
|
||||
folder = Dialogic.get_variable("5_Wounded_Fire");
|
||||
var path = str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Character.webp");
|
||||
|
||||
$Character.texture = load(path);
|
||||
|
||||
var emoteNumber = int(Dialogic.get_variable("Vzriv2emote"))
|
||||
var emote1 = str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Emote2.webp");
|
||||
match emoteNumber:
|
||||
1:
|
||||
emote1 = str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Emote2.webp");
|
||||
2:
|
||||
emote1 = str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Emote1.webp");
|
||||
3:
|
||||
emote1 = str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Emote3.webp");
|
||||
|
||||
$Emote.texture = load(emote1)
|
||||
|
||||
GallerySingleton.AddImage(str("Vzriv2_", folder));
|
||||
|
||||
func _emotes_listener(value):
|
||||
var path = "";
|
||||
match value:
|
||||
"emote1":
|
||||
path = str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Emote2.webp");
|
||||
Dialogic.set_variable("Vzriv2emote", 1)
|
||||
$Emote.texture = load(path)
|
||||
"emote2":
|
||||
path = str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Emote1.webp");
|
||||
Dialogic.set_variable("Vzriv2emote", 2)
|
||||
$Emote.texture = load(path)
|
||||
"emote3":
|
||||
path = str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Emote3.webp");
|
||||
Dialogic.set_variable("Vzriv2emote", 3)
|
||||
$Emote.texture = load(path)
|
||||
"zoom_out":
|
||||
Dialogic.set_variable("cameraPosition", "1")
|
||||
$Tween.remove_all()
|
||||
$Tween.interpolate_property(self, "scale", self.scale, Vector2(1.0, 1.0), zoomingTime, Tween.TRANS_LINEAR, 0)
|
||||
$Tween.interpolate_property(self, "position", self.position, Vector2(0, 0), zoomingTime, Tween.TRANS_LINEAR, 0)
|
||||
$Tween.start()
|
||||
|
||||
|
||||
|
||||
func InitForGallery()->Array:
|
||||
scale = Vector2(0.5, 0.5)
|
||||
|
||||
var amount = 0;
|
||||
var only = "";
|
||||
var names = ["Vzriv2_Gray", "Vzriv2_White", "Vzriv2_Red", "Vzriv2_Blue_M"];
|
||||
var res = [];
|
||||
|
||||
for i in names:
|
||||
var unlocked = GallerySingleton.HaveImage(i);
|
||||
if unlocked:
|
||||
match i:
|
||||
"Vzriv2_Gray":
|
||||
res.push_back("ui_name_gray");
|
||||
"Vzriv2_White":
|
||||
res.push_back("ui_name_white");
|
||||
"Vzriv2_Red":
|
||||
res.push_back("ui_name_red");
|
||||
"Vzriv2_Blue_M":
|
||||
res.push_back("ui_name_blue_m");
|
||||
amount += 1;
|
||||
only = i;
|
||||
|
||||
if amount == 1:
|
||||
folder = "";
|
||||
match only:
|
||||
"Vzriv2_Gray":
|
||||
folder = "Gray";
|
||||
"Vzriv2_White":
|
||||
folder = "White";
|
||||
"Vzriv2_Red":
|
||||
folder = "Red";
|
||||
"Vzriv2_Blue_M":
|
||||
folder = "Blue_M";
|
||||
$Character.texture = load(str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Character.webp"));
|
||||
$Emote.texture = load(str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Emote1.webp"));
|
||||
return ["ui_emote_1", "ui_emote_2", "ui_emote_3"];
|
||||
else :
|
||||
var firstCharacter = tr(res[0]);
|
||||
SetSettings(firstCharacter);
|
||||
|
||||
res.append_array(["ui_emote_1", "ui_emote_2", "ui_emote_3"]);
|
||||
return res;
|
||||
|
||||
func SetSettings(setting):
|
||||
if setting == tr("ui_emote_1"):
|
||||
$Emote.texture = load(str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Emote2.webp"));
|
||||
return
|
||||
elif setting == tr("ui_emote_2"):
|
||||
$Emote.texture = load(str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Emote1.webp"));
|
||||
return
|
||||
elif setting == tr("ui_emote_3"):
|
||||
$Emote.texture = load(str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Emote3.webp"));
|
||||
return
|
||||
|
||||
folder = "";
|
||||
if setting == tr("ui_name_blue_m"):
|
||||
folder = "Blue_M";
|
||||
elif setting == tr("ui_name_gray"):
|
||||
folder = "Gray";
|
||||
elif setting == tr("ui_name_red"):
|
||||
folder = "Red";
|
||||
else :
|
||||
folder = "White";
|
||||
|
||||
$Character.texture = load(str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Character.webp"));
|
||||
$Emote.texture = load(str("res://resources/graphics/backgrounds/vzriv2/", folder, "/Emote1.webp"));
|
Loading…
Add table
Add a link
Reference in a new issue