mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-07-01 15:52:30 +08:00
feat(Debug): 添加FeedIsTypeTopic调试组件并更新蛋糕资源
添加用于调试的FeedIsTypeTopic场景和脚本,支持按主题筛选Feed 更新蛋糕资源的主题和字段配置
This commit is contained in:
@@ -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])
|
||||||
@@ -7,9 +7,9 @@
|
|||||||
avatarTexture = ExtResource("2_ijk6h")
|
avatarTexture = ExtResource("2_ijk6h")
|
||||||
displayName = "生日蛋糕"
|
displayName = "生日蛋糕"
|
||||||
quality = 2
|
quality = 2
|
||||||
topic = 4
|
topic = 6
|
||||||
fields = Array[int]([4, 1])
|
fields = Array[int]([16])
|
||||||
fieldValues = Array[float]([0.03, 0.04])
|
fieldValues = Array[float]([1.0])
|
||||||
costs = Array[int]([0, 1])
|
costs = Array[int]([0, 1])
|
||||||
costCounts = Array[int]([300, 200])
|
costCounts = Array[int]([300, 200])
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
Reference in New Issue
Block a user