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:
@@ -15,4 +15,4 @@ costCounts = Array[int]([100, 55])
|
||||
texture = ExtResource("2_2mlfi")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]香蕉[/b]"
|
||||
displayName = "香蕉"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[node name="Cake" instance=ExtResource("1_f2mv8")]
|
||||
avatarTexture = ExtResource("2_ijk6h")
|
||||
displayName = "生日蛋糕"
|
||||
quality = 2
|
||||
fields = Array[int]([4, 8, 15])
|
||||
fieldValues = Array[float]([0.06, 0.075, 1.0])
|
||||
costs = Array[int]([1])
|
||||
@@ -15,4 +16,4 @@ costCounts = Array[int]([125])
|
||||
texture = ExtResource("2_ijk6h")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]生日蛋糕[/b]"
|
||||
displayName = "生日蛋糕"
|
||||
|
||||
@@ -15,4 +15,4 @@ costCounts = Array[int]([125])
|
||||
texture = ExtResource("2_qojf3")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]烘焙松糕[/b]"
|
||||
displayName = "烘焙松糕"
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
[node name="Dango" instance=ExtResource("1_mwo1u")]
|
||||
avatarTexture = ExtResource("2_ckr7l")
|
||||
displayName = "团子"
|
||||
quality = 4
|
||||
fields = Array[int]([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17])
|
||||
fieldValues = Array[float]([20.0, 0.21, 0.1, 0.33, 0.08, 0.15, 0.1, -5.0, 0.25, 4.0, 0.12, 0.15, 0.18, 0.6, 0.15, 2.0, 2.0, 35.0])
|
||||
fieldValues = Array[float]([80.0, 0.21, 0.1, 0.33, 0.08, 0.15, 0.1, -5.0, 0.25, 4.0, 0.12, 0.15, 0.18, 0.6, 0.15, 2.0, 2.0, 35.0])
|
||||
costs = Array[int]([0, 1])
|
||||
costCounts = Array[int]([5000, 6750])
|
||||
|
||||
@@ -15,4 +16,5 @@ costCounts = Array[int]([5000, 6750])
|
||||
texture = ExtResource("2_ckr7l")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]团子[/b]"
|
||||
displayName = "团子"
|
||||
quality = 4
|
||||
|
||||
@@ -6,10 +6,14 @@
|
||||
[node name="Donut" instance=ExtResource("1_7gqm6")]
|
||||
avatarTexture = ExtResource("2_bv6j5")
|
||||
displayName = "甜甜圈"
|
||||
quality = 2
|
||||
fields = Array[int]([9, 7, 16])
|
||||
fieldValues = Array[float]([1.0, -3.0, 1.0])
|
||||
costs = Array[int]([0, 1])
|
||||
costCounts = Array[int]([300, 100])
|
||||
|
||||
[node name="avatar" parent="container/info" index="0"]
|
||||
texture = ExtResource("2_bv6j5")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]甜甜圈[/b]"
|
||||
displayName = "甜甜圈"
|
||||
|
||||
@@ -15,4 +15,4 @@ costCounts = Array[int]([150, 200])
|
||||
texture = ExtResource("2_6i6sp")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]水果拼盘[/b]"
|
||||
displayName = "水果拼盘"
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
[node name="FruitSalad" instance=ExtResource("1_mvycn")]
|
||||
avatarTexture = ExtResource("2_2oxe7")
|
||||
displayName = "水果沙拉"
|
||||
quality = 0
|
||||
fields = Array[int]([1])
|
||||
fieldValues = Array[float]([0.13])
|
||||
fieldValues = Array[float]([0.05])
|
||||
costs = Array[int]([1])
|
||||
costCounts = Array[int]([200])
|
||||
costCounts = Array[int]([350])
|
||||
|
||||
[node name="avatar" parent="container/info" index="0"]
|
||||
texture = ExtResource("2_2oxe7")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]水果沙拉[/b]"
|
||||
displayName = "水果沙拉"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[node name="LuckyCookie" instance=ExtResource("1_v7ebs")]
|
||||
avatarTexture = ExtResource("2_or0st")
|
||||
displayName = "幸运签语饼"
|
||||
quality = 2
|
||||
fields = Array[int]([14, 4, 6])
|
||||
fieldValues = Array[float]([0.1, 0.07, 0.12])
|
||||
costs = Array[int]([0, 1, 2])
|
||||
@@ -15,4 +16,4 @@ costCounts = Array[int]([200, 75, 1])
|
||||
texture = ExtResource("2_or0st")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]幸运签语饼[/b]"
|
||||
displayName = "幸运签语饼"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[node name="Milk" instance=ExtResource("1_y8pe8")]
|
||||
avatarTexture = ExtResource("2_15plv")
|
||||
displayName = "牛奶"
|
||||
quality = 2
|
||||
fields = Array[int]([13, 11, 7])
|
||||
fieldValues = Array[float]([0.4, 0.24])
|
||||
costs = Array[int]([0, 1])
|
||||
@@ -15,4 +16,4 @@ costCounts = Array[int]([355, 200])
|
||||
texture = ExtResource("2_15plv")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]牛奶[/b]"
|
||||
displayName = "牛奶"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[node name="Orange" instance=ExtResource("1_w5eks")]
|
||||
avatarTexture = ExtResource("2_l6jnq")
|
||||
displayName = "橘子"
|
||||
quality = 3
|
||||
fields = Array[int]([10, 3])
|
||||
fieldValues = Array[float]([0.1, 0.1])
|
||||
costs = Array[int]([1])
|
||||
@@ -15,4 +16,4 @@ costCounts = Array[int]([275])
|
||||
texture = ExtResource("2_l6jnq")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]橘子[/b]"
|
||||
displayName = "橘子"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[node name="Puffs" instance=ExtResource("1_1jl1i")]
|
||||
avatarTexture = ExtResource("2_p35iw")
|
||||
displayName = "奶酪泡芙"
|
||||
quality = 3
|
||||
fields = Array[int]([10, 5, 13])
|
||||
fieldValues = Array[float]([0.06, 0.12, 0.3])
|
||||
costs = Array[int]([0, 1])
|
||||
@@ -15,4 +16,4 @@ costCounts = Array[int]([250, 100])
|
||||
texture = ExtResource("2_p35iw")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]奶酪泡芙[/b]"
|
||||
displayName = "奶酪泡芙"
|
||||
|
||||
@@ -15,4 +15,4 @@ costCounts = Array[int]([100, 50])
|
||||
texture = ExtResource("2_o2o56")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]草莓果酱[/b]"
|
||||
displayName = "草莓果酱"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[node name="Strawberry" instance=ExtResource("1_wr2cd")]
|
||||
avatarTexture = ExtResource("2_82amy")
|
||||
displayName = "草莓"
|
||||
quality = 2
|
||||
fields = Array[int]([14])
|
||||
fieldValues = Array[float]([0.25])
|
||||
costs = Array[int]([1])
|
||||
@@ -15,4 +16,4 @@ costCounts = Array[int]([375])
|
||||
texture = ExtResource("2_82amy")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]草莓[/b]"
|
||||
displayName = "草莓"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[node name="Taco" instance=ExtResource("1_iixnt")]
|
||||
avatarTexture = ExtResource("2_eed3c")
|
||||
displayName = "塔克"
|
||||
quality = 2
|
||||
fields = Array[int]([13])
|
||||
fieldValues = Array[float]([0.75])
|
||||
costs = Array[int]([1])
|
||||
@@ -15,4 +16,5 @@ costCounts = Array[int]([225])
|
||||
texture = ExtResource("2_eed3c")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]塔克[/b]"
|
||||
displayName = "塔克"
|
||||
quality = 2
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[node name="WaterBottle" instance=ExtResource("1_vfxjq")]
|
||||
avatarTexture = ExtResource("2_gsfud")
|
||||
displayName = "水杯"
|
||||
quality = 3
|
||||
fields = Array[int]([3])
|
||||
fieldValues = Array[float]([0.25])
|
||||
costs = Array[int]([1])
|
||||
@@ -15,4 +16,4 @@ costCounts = Array[int]([300])
|
||||
texture = ExtResource("2_gsfud")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]一杯水[/b]"
|
||||
displayName = "水杯"
|
||||
|
||||
@@ -15,4 +15,4 @@ costCounts = Array[int]([100, 125])
|
||||
texture = ExtResource("2_j4m35")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]西瓜[/b]"
|
||||
displayName = "西瓜"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[node name="Xigua-Half" instance=ExtResource("1_bbid3")]
|
||||
avatarTexture = ExtResource("2_htt7g")
|
||||
displayName = "一片西瓜"
|
||||
quality = 0
|
||||
fields = Array[int]([0])
|
||||
fieldValues = Array[float]([5.0])
|
||||
costs = Array[int]([0])
|
||||
@@ -15,4 +16,4 @@ costCounts = Array[int]([50])
|
||||
texture = ExtResource("2_htt7g")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]一片西瓜[/b]"
|
||||
displayName = "一片西瓜"
|
||||
|
||||
@@ -15,4 +15,4 @@ costCounts = Array[int]([200, 125])
|
||||
texture = ExtResource("2_bea7w")
|
||||
|
||||
[node name="name" parent="container/info" index="1"]
|
||||
text = "[b]蜂蜜果酱[/b]"
|
||||
displayName = "蜂蜜果酱"
|
||||
|
||||
+25
-10
@@ -1,24 +1,39 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bt370a1djjg5p"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bt370a1djjg5p"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Statemachine/FeedName.gd" id="1_wfxme"]
|
||||
[ext_resource type="Theme" uid="uid://bje5cd08dyok7" path="res://themes/bigTextAndBold.tres" id="2_k71he"]
|
||||
|
||||
[node name="FeedName" type="CenterContainer"]
|
||||
offset_right = 107.0
|
||||
offset_bottom = 19.0
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_sby55"]
|
||||
font_size = 12
|
||||
font_color = Color(1, 0.442751, 0, 1)
|
||||
|
||||
[node name="FeedName" type="HBoxContainer"]
|
||||
offset_right = 205.0
|
||||
offset_bottom = 25.0
|
||||
alignment = 1
|
||||
script = ExtResource("1_wfxme")
|
||||
quality = 0
|
||||
colorStore = {
|
||||
quality = 4
|
||||
qualityColorMap = {
|
||||
0: Color(0.5, 0.5, 0.5, 1),
|
||||
1: Color(1, 1, 1, 1),
|
||||
2: Color(0, 0.609284, 1, 1),
|
||||
3: Color(0.561523, 0, 1, 1),
|
||||
4: Color(1, 0.866475, 0, 1)
|
||||
2: Color(0, 0.493446, 1, 1),
|
||||
3: Color(0.507763, 0, 1, 1),
|
||||
4: Color(1, 0.442751, 0, 1)
|
||||
}
|
||||
metadata/_edit_horizontal_guides_ = [25.0]
|
||||
|
||||
[node name="quality" type="Label" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
text = "[传说]"
|
||||
label_settings = SubResource("LabelSettings_sby55")
|
||||
|
||||
[node name="label" type="RichTextLabel" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_k71he")
|
||||
bbcode_enabled = true
|
||||
text = "[b][color=#808080]未命名饲料[/color][/b]"
|
||||
text = "[b]未命名饲料[/b]"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user