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

refactor(UI): 统一饲料名称显示并添加品质标签

将饲料名称从富文本格式改为统一使用displayName字段
添加品质标签显示并调整UI布局为水平排列
更新相关场景文件和脚本以支持新的显示方式
This commit is contained in:
2025-08-28 09:14:39 +08:00
parent c4b59a5b3f
commit e7ffd6bce2
20 changed files with 71 additions and 34 deletions
+8 -3
View File
@@ -1,5 +1,5 @@
@tool
extends CenterContainer
extends HBoxContainer
class_name FeedName
enum Quality {
@@ -34,9 +34,14 @@ enum Quality {
Quality.LEGENDARY: 1
}
@onready var label: RichTextLabel = $"%label"
@onready var qualityLabel: Label = $"%quality"
@onready var nameLabel: RichTextLabel = $"%label"
func _ready():
qualityLabel.label_settings = qualityLabel.label_settings.duplicate()
func _physics_process(_delta):
label.text = "[b][color=%s]%s[/color][/b]" % ["#" + color().to_html(false), displayName]
qualityLabel.text = "[%s]" % qualityNameMap[quality]
qualityLabel.label_settings.font_color = color()
nameLabel.text = "[b]%s[/b]" % displayName
func color():
return qualityColorMap[quality] as Color