1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(Debug): 添加FeedIsTypeTopic调试组件并更新蛋糕资源

添加用于调试的FeedIsTypeTopic场景和脚本,支持按主题筛选Feed
更新蛋糕资源的主题和字段配置
This commit is contained in:
2025-09-06 10:06:39 +08:00
parent 101649d7e0
commit cd07aabcda
3 changed files with 40 additions and 3 deletions
+8
View File
@@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://5fbadcha65g4"]
[ext_resource type="Script" path="res://scripts/Debug/FeedIsTopic.gd" id="1_2hikw"]
[node name="Debug" type="HBoxContainer"]
theme_override_constants/separation = 0
script = ExtResource("1_2hikw")
targetTopics = Array[int]([6])
+3 -3
View File
@@ -7,9 +7,9 @@
avatarTexture = ExtResource("2_ijk6h")
displayName = "生日蛋糕"
quality = 2
topic = 4
fields = Array[int]([4, 1])
fieldValues = Array[float]([0.03, 0.04])
topic = 6
fields = Array[int]([16])
fieldValues = Array[float]([1.0])
costs = Array[int]([0, 1])
costCounts = Array[int]([300, 200])
+29
View File
@@ -0,0 +1,29 @@
@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)