78 lines
1.5 KiB
GDScript
78 lines
1.5 KiB
GDScript
extends "res://scripts/Investigations/InvestigationBase.gd"
|
|
|
|
var descriptions:Array;
|
|
|
|
var variables = [
|
|
"Garage",
|
|
"Office",
|
|
"Kamin",
|
|
"Room",
|
|
"Smoking",
|
|
"Kitchen",
|
|
"Stairs",
|
|
"Lighthouse",
|
|
"Cliff",
|
|
"Parking",
|
|
"Pristan",
|
|
"Podval",
|
|
"Prichal",
|
|
"Restaurant",
|
|
"Tropa"
|
|
];
|
|
|
|
func _ready():
|
|
cluesToFind = 99;
|
|
|
|
|
|
func InitClues():
|
|
descriptions = [
|
|
"garage",
|
|
"office",
|
|
"kamin",
|
|
"room",
|
|
"smoking",
|
|
"kitchen",
|
|
"stairs",
|
|
"lighthouse",
|
|
"cliff",
|
|
"parking",
|
|
"pristan",
|
|
"podval",
|
|
"prichal",
|
|
"restaurant",
|
|
"tropa",
|
|
"exit"
|
|
];
|
|
|
|
|
|
cluesFound = [];
|
|
|
|
for i in $Clues.get_children().size():
|
|
var clue = $Clues.get_child(i) as TextureButton;
|
|
clue.connect("button_up", self, "onButtonPressed", [clue, i])
|
|
clue.connect("mouse_entered", self, "onButtonHoverOn", [clue]);
|
|
clue.connect("mouse_exited", self, "onButtonHoverOff", [clue]);
|
|
|
|
ShowImages();
|
|
|
|
func ShowImages():
|
|
var dict = ProgressAchievementsSingleton.CreateEpilogMinigameImages();
|
|
|
|
for i in dict:
|
|
var eName = i["name"].to_lower();
|
|
var node:TextureButton = get_node(str("Clues/", eName));
|
|
node.visible = true;
|
|
|
|
if i.has("location"):
|
|
node.rect_position = i["location"] / 2;
|
|
|
|
if i["status"] == false:
|
|
var index = $Clues.get_children().find(node);
|
|
if index != - 1:
|
|
descriptions[index] = "closed";
|
|
|
|
func onButtonPressed(control, index):
|
|
if CheckHover():
|
|
onButtonHoverOff(control)
|
|
var code = descriptions[index];
|
|
EndInvestigationLoop(code);
|