1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

feat(角色卡片): 添加新角色卡片资源并优化显示逻辑

添加猞猁、牧羊犬和氰化氢的角色卡片资源
优化卡片选中状态的动画显示逻辑
调整卡片样式和主题配置
移除冗余的panel节点引用
This commit is contained in:
2026-05-04 20:32:07 +08:00
parent 492373a48e
commit 4d1f68cac1
14 changed files with 194 additions and 37 deletions
+14 -15
View File
@@ -7,7 +7,9 @@ content_margin_left = 20.0
content_margin_top = 20.0
content_margin_right = 20.0
content_margin_bottom = 20.0
bg_color = Color(0, 0, 0, 0.70000005)
bg_color = Color(0, 0, 0, 0.8)
border_width_top = 10
border_width_bottom = 10
border_color = Color(1, 1, 1, 1)
border_blend = true
corner_radius_top_left = 15
@@ -180,22 +182,19 @@ _data = {
&"show": SubResource("Animation_fnmic")
}
[node name="CharacterCardBase" type="CenterContainer" unique_id=282163900]
[node name="panel" type="PanelContainer" unique_id=1046363300]
modulate = Color(1, 1, 1, 0.5)
offset_right = 226.0
offset_bottom = 212.0
scale = Vector2(0.7, 0.7)
theme_override_styles/panel = SubResource("StyleBoxFlat_5td0u")
script = ExtResource("1_dt83t")
[node name="panel" type="PanelContainer" parent="." unique_id=1046363300]
unique_name_in_owner = true
modulate = Color(1, 1, 1, 0.5)
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_5td0u")
[node name="wrapper" type="VBoxContainer" parent="panel" unique_id=2023039659]
[node name="wrapper" type="VBoxContainer" parent="." unique_id=2023039659]
layout_mode = 2
theme_override_constants/separation = 10
[node name="avatarTexture" type="TextureRect" parent="panel/wrapper" unique_id=1334645594]
[node name="avatarTexture" type="TextureRect" parent="wrapper" unique_id=1334645594]
unique_name_in_owner = true
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
@@ -204,27 +203,27 @@ size_flags_vertical = 4
expand_mode = 1
stretch_mode = 5
[node name="infoContainer" type="VBoxContainer" parent="panel/wrapper" unique_id=143242635]
[node name="infoContainer" type="VBoxContainer" parent="wrapper" unique_id=143242635]
layout_mode = 2
[node name="nameLabel" type="Label" parent="panel/wrapper/infoContainer" unique_id=516147781]
[node name="nameLabel" type="Label" parent="wrapper/infoContainer" unique_id=516147781]
unique_name_in_owner = true
layout_mode = 2
text = "Unknown Character"
label_settings = SubResource("LabelSettings_dt83t")
horizontal_alignment = 1
[node name="descriptionLabel" type="Label" parent="panel/wrapper/infoContainer" unique_id=808054282]
[node name="descriptionLabel" type="Label" parent="wrapper/infoContainer" unique_id=808054282]
unique_name_in_owner = true
custom_minimum_size = Vector2(100, 10)
layout_mode = 2
label_settings = SubResource("LabelSettings_myhk0")
autowrap_mode = 3
[node name="fields" type="VBoxContainer" parent="panel/wrapper" unique_id=437152370]
[node name="fields" type="VBoxContainer" parent="wrapper" unique_id=437152370]
unique_name_in_owner = true
layout_mode = 2
[node name="animator" type="AnimationPlayer" parent="panel" unique_id=1012843997]
[node name="animator" type="AnimationPlayer" parent="." unique_id=1012843997]
unique_name_in_owner = true
libraries/ = SubResource("AnimationLibrary_xuke2")
+19 -2
View File
@@ -1,16 +1,33 @@
[gd_scene format=3 uid="uid://dfww6e0mpyjk4"]
[ext_resource type="PackedScene" uid="uid://m8a4nay1pmmg" path="res://components/Abstracts/CharacterCardBase.tscn" id="1_robpf"]
[ext_resource type="Texture2D" uid="uid://2xmrkvyrcqq1" path="res://resources/characterCards/hcn.png" id="2_1yfsg"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_82b7n"]
content_margin_left = 20.0
content_margin_top = 20.0
content_margin_right = 20.0
content_margin_bottom = 20.0
bg_color = Color(0, 0, 0, 0.8)
border_color = Color(1, 1, 1, 1)
border_blend = true
corner_radius_top_left = 15
corner_radius_bottom_right = 15
corner_detail = 1
[node name="HCN" unique_id=1046363300 instance=ExtResource("1_robpf")]
theme_override_styles/panel = SubResource("StyleBoxFlat_82b7n")
displayName = "氰化氢"
avatar = ExtResource("2_1yfsg")
description = "苦杏仁气息的致命剧毒物质,暗藏致命威能。触碰即引凶险,微量便可颠覆生机,是隐忍又致命的诡秘造物。"
fields = Array[int]([18, 27])
fieldValues = Array[float]([5.0, 1.0])
clickToRebuild = true
[node name="avatarTexture" parent="wrapper" parent_id_path=PackedInt32Array(2023039659) index="0" unique_id=1334645594]
texture = ExtResource("2_1yfsg")
[node name="nameLabel" parent="wrapper/infoContainer" parent_id_path=PackedInt32Array(143242635) index="0" unique_id=516147781]
text = "氰化氢"
[node name="descriptionLabel" parent="wrapper/infoContainer" parent_id_path=PackedInt32Array(143242635) index="1" unique_id=808054282]
text = "微带苦杏仁气息的致命剧毒物质,静谧却暗藏致命威能。触碰即引凶险,微量便可颠覆生机,是隐忍又致命的诡秘造物。"
text = "苦杏仁气息的致命剧毒物质,暗藏致命威能。触碰即引凶险,微量便可颠覆生机,是隐忍又致命的诡秘造物。"
+8 -2
View File
@@ -1,8 +1,9 @@
[gd_scene format=3 uid="uid://cygvim0mv4ssa"]
[ext_resource type="PackedScene" uid="uid://m8a4nay1pmmg" path="res://components/Abstracts/CharacterCardBase.tscn" id="1_xa4jc"]
[ext_resource type="Texture2D" uid="uid://b1ogllqvamcun" path="res://resources/characterCards/lynx.png" id="2_1s675"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_xa4jc"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wckn2"]
content_margin_left = 20.0
content_margin_top = 20.0
content_margin_right = 20.0
@@ -15,11 +16,16 @@ corner_radius_bottom_right = 15
corner_detail = 1
[node name="Lynx" unique_id=1046363300 instance=ExtResource("1_xa4jc")]
theme_override_styles/panel = SubResource("StyleBoxFlat_xa4jc")
theme_override_styles/panel = SubResource("StyleBoxFlat_wckn2")
displayName = "猞猁"
avatar = ExtResource("2_1s675")
description = "栖于寒域密林,生性冷傲孤高。诡秘警觉过人,向来独来独往。身负隐秘过往,不问世俗纷争,只以孤影独行世间。"
fields = Array[int]([3, 4, 10])
fieldValues = Array[float]([0.15, 0.06, -0.25])
clickToRebuild = true
[node name="avatarTexture" parent="wrapper" parent_id_path=PackedInt32Array(2023039659) index="0" unique_id=1334645594]
texture = ExtResource("2_1s675")
[node name="nameLabel" parent="wrapper/infoContainer" parent_id_path=PackedInt32Array(143242635) index="0" unique_id=516147781]
text = "猞猁"
+8 -2
View File
@@ -1,8 +1,9 @@
[gd_scene format=3 uid="uid://bglwhggnbxxax"]
[ext_resource type="PackedScene" uid="uid://m8a4nay1pmmg" path="res://components/Abstracts/CharacterCardBase.tscn" id="1_wq25g"]
[ext_resource type="Texture2D" uid="uid://dhu4i24hfhxvn" path="res://resources/characterCards/muyang-dog.png" id="2_fi2nw"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wq25g"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_orlvy"]
content_margin_left = 20.0
content_margin_top = 20.0
content_margin_right = 20.0
@@ -14,11 +15,16 @@ corner_radius_bottom_right = 15
corner_detail = 1
[node name="MuyangDog" unique_id=1046363300 instance=ExtResource("1_wq25g")]
theme_override_styles/panel = SubResource("StyleBoxFlat_wq25g")
theme_override_styles/panel = SubResource("StyleBoxFlat_orlvy")
displayName = "牧羊犬"
avatar = ExtResource("2_fi2nw")
description = "恪守守护之责,性情沉稳忠诚。常年驻守边境旷野,坚守一方安宁,甘愿以身挡险,永远守护同伴与故土,恪守使命不离不弃。"
fields = Array[int]([0, 8, 3])
fieldValues = Array[float]([50.0, 0.15, -0.2])
clickToRebuild = true
[node name="avatarTexture" parent="wrapper" parent_id_path=PackedInt32Array(2023039659) index="0" unique_id=1334645594]
texture = ExtResource("2_fi2nw")
[node name="nameLabel" parent="wrapper/infoContainer" parent_id_path=PackedInt32Array(143242635) index="0" unique_id=516147781]
text = "牧羊犬"
@@ -16,6 +16,22 @@ shader_parameter/prog = 0.5000000074506
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_4ekdw"]
content_margin_left = 60.0
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4ekdw"]
content_margin_left = 30.0
content_margin_top = 30.0
content_margin_right = 30.0
content_margin_bottom = 30.0
bg_color = Color(0, 0, 0, 0.70000005)
border_width_left = 10
border_width_right = 10
border_color = Color(1, 1, 1, 1)
border_blend = true
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
corner_detail = 1
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_sdsu8"]
content_margin_right = 60.0
@@ -181,7 +197,7 @@ theme_override_constants/separation = 30
[node name="character" type="PanelContainer" parent="content/wrapper/layout/outGameWrapper/layout" index="0" unique_id=1828402109]
layout_mode = 2
theme_override_styles/panel = ExtResource("7_kl3ko")
theme_override_styles/panel = SubResource("StyleBoxFlat_4ekdw")
[node name="container" type="VBoxContainer" parent="content/wrapper/layout/outGameWrapper/layout/character" index="0" unique_id=1167478166]
layout_mode = 2
Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://2xmrkvyrcqq1"
path="res://.godot/imported/hcn.png-c27fe878ce57f16ec0714a09f8662903.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/characterCards/hcn.png"
dest_files=["res://.godot/imported/hcn.png-c27fe878ce57f16ec0714a09f8662903.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b1ogllqvamcun"
path="res://.godot/imported/lynx.png-0ad864fef53fe9b6c7e72f50bca44f0a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/characterCards/lynx.png"
dest_files=["res://.godot/imported/lynx.png-0ad864fef53fe9b6c7e72f50bca44f0a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dhu4i24hfhxvn"
path="res://.godot/imported/muyang-dog.png-faa1da78f374818f4f65cd75128b936f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/characterCards/muyang-dog.png"
dest_files=["res://.godot/imported/muyang-dog.png-faa1da78f374818f4f65cd75128b936f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
+4
View File
@@ -210,3 +210,7 @@ func rebuildInfo():
getCurrentSelectedCharacter().animator.play("show")
)
charactersBox.add_child(card)
if selectedCharacter == card.name:
card.animator.play("show")
else:
card.animator.play("hide")
+2 -3
View File
@@ -12,7 +12,6 @@ signal select()
@export var clickToRebuild: bool = false
@export var borderOpacity: float = 0
@onready var panel: PanelContainer = $%panel
@onready var avatarTexture: TextureRect = $%avatarTexture
@onready var nameLebel: Label = $%nameLabel
@onready var descriptionLabel: Label = $%descriptionLabel
@@ -20,10 +19,10 @@ signal select()
@onready var animator: AnimationPlayer = $%animator
var watcher: Watcher = Watcher.new(false)
@onready var panelStyleBox: StyleBoxFlat = panel.get_theme_stylebox("panel").duplicate()
@onready var panelStyleBox: StyleBoxFlat = get_theme_stylebox("panel").duplicate()
func _ready():
panel.add_theme_stylebox_override("panel", panelStyleBox)
add_theme_stylebox_override("panel", panelStyleBox)
watcher.changed.connect(rebuildInfo)
gui_input.connect(
func(event):
+2 -12
View File
@@ -10,12 +10,8 @@ content_margin_left = 20.0
content_margin_top = 5.0
content_margin_right = 20.0
content_margin_bottom = 5.0
bg_color = Color(1, 0, 0, 0.2)
border_width_left = 5
border_width_top = 4
border_width_right = 5
border_width_bottom = 4
border_color = Color(1, 0, 0, 1)
bg_color = Color(0, 0, 0, 0.5)
border_color = Color(1, 1, 1, 1)
border_blend = true
corner_radius_top_left = 1000
corner_radius_top_right = 1000
@@ -133,12 +129,6 @@ corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[resource]
Button/colors/font_color = Color(1, 1, 1, 1)
Button/colors/font_disabled_color = Color(1, 1, 1, 1)
Button/colors/font_focus_color = Color(0.95, 0.95, 0.95, 1)
Button/colors/font_hover_color = Color(1, 1, 1, 1)
Button/colors/font_hover_pressed_color = Color(1, 1, 1, 1)
Button/colors/font_pressed_color = Color(1, 1, 1, 1)
Button/font_sizes/font_size = 14
Button/styles/disabled = SubResource("StyleBoxFlat_78ekx")
Button/styles/hover = SubResource("StyleBoxFlat_1id7b")