1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Debug/FeedIsTopic.gd
T
fallingshrimp cd07aabcda feat(Debug): 添加FeedIsTypeTopic调试组件并更新蛋糕资源
添加用于调试的FeedIsTypeTopic场景和脚本,支持按主题筛选Feed
更新蛋糕资源的主题和字段配置
2025-09-06 10:06:39 +08:00

30 lines
649 B
GDScript

@tool
extends HBoxContainer
@export var targetTopics: Array[FeedName.Topic] = []
@export var clickToRefresh: bool = false
var lastState: bool = false
func _ready():
rebuild()
func _physics_process(_delta):
if clickToRefresh != lastState:
lastState = clickToRefresh
rebuild()
func rebuild():
for i in get_children():
i.queue_free()
var files = DirTool.listdir("res://components/Feeds/")
for file in files:
var passed: bool = false
var feed = load(file).instantiate() as Feed
for targetTopic in targetTopics:
var haveThis = feed.topic == targetTopic
passed = haveThis
if passed:
break
if passed:
add_child(feed)