-
Notifications
You must be signed in to change notification settings - Fork 0
/
info2.gd
34 lines (28 loc) · 1.01 KB
/
info2.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
extends TextureRect
onready var r_template = preload("res://Icons/Recipe.tscn")
onready var text_temp = preload("res://UI/text.tscn")
func _ready():
pass
# yield(get_tree().create_timer(1.5), "timeout")
# fill_all_recipes()
func fill_all_recipes():
$ScrollContainer/VBoxContainer.delete_children()
for r in PlayerData.recipes_accses:
for i in r:
if i in PlayerData.global.gear_stored and r.find(i) != len(r) - 1:
var recipe = r_template.instance()
#print(str(r[0].name))
recipe.set_recipe(r)
$ScrollContainer/VBoxContainer.add_child(recipe)
break
func find_recipes(i):
$ScrollContainer/VBoxContainer.delete_children()
for r in PlayerData.recipes_accses:
if i in r and r.find(i) != len(r) - 1:
var recipe = r_template.instance()
recipe.set_recipe(r)
$ScrollContainer/VBoxContainer.add_child(recipe)
if ($ScrollContainer/VBoxContainer.get_child_count() == 0):
var t = text_temp.instance()
t.text = "There are no Recipes with this item"
$ScrollContainer/VBoxContainer.add_child(t)