FAbrowser/scripts/SubEntry.gd
2024-07-22 11:06:25 -04:00

34 lines
851 B
GDScript

extends PanelContainer
class_name SubEntry
export var SubData:Dictionary
var ImageData:PoolByteArray
var downloaded_panel = preload("res://theme_panels/downloaded.tres")
var user:String
func _ready():
rect_min_size = Vector2(Global.sub_size,Global.sub_size+64)
$"%img".url = SubData.get("thumb","")
var vbox = $V
$"%title".text = SubData.get("title","")
$"%title".hint_tooltip = SubData.get("title","")
user = SubData.get("user","")
$"%user".text = "By: " + user
if int(name) in History.data:
downloaded()
# PUT CHECK IF USER IN FOLLOW LIST, MAKE USER TEXT GREEN HERE
if Settings.settings.Watches.has(user):
$"%user".modulate = Color.green
func _open_in_browser():
OS.shell_open(SubData.get("url",""))
func _on_Icon_pressed():
pass # Replace with function body.
func downloaded():
set("custom_styles/panel",downloaded_panel)