-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathContact.gd
50 lines (44 loc) · 1.21 KB
/
Contact.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
extends TextureRect
var fallback = preload("res://Img/avatar-default-symbolic.svg")
var title = ""
var pImage = ""
var imgfile = File.new()
var block = Image.new()
var texblock = ""
var the_img
var highlight = false
#var loadAnimDone = false
var OpenSeed
var Thicket
# warning-ignore:unused_signal
signal refresh()
# Called when the node enters the scene tree for the first time.
func _ready():
OpenSeed = get_node("/root/OpenSeed")
Thicket = get_node("/root/Thicket")
OpenSeed.openSeedRequest("get_image",[pImage,"low"])
OpenSeed.connect("imagestored",self,"_on_Contact_refresh")
func set_box(image):
var imagehash = "No_Image_found"
if imagehash != "No_Image_found":
var fromStore = OpenSeed.get_from_image_store(imagehash)
if !fromStore:
the_img = OpenSeed.set_image(imagehash)
else:
the_img = fromStore
if the_img:
self.set_texture(the_img)
else:
self.set_texture(fallback)
func _on_Contact_refresh(data):
if data[1] != "No_Image_found" and data[0] == pImage:
#var texbox = TextureRect.new()
var fromStore = OpenSeed.get_from_image_store(data[1])
if !fromStore:
the_img = fallback
else:
the_img = fromStore
if the_img:
self.set_texture(the_img)
else:
self.set_texture(fallback)