1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-06 03:37:13 +08:00

Add UI components for Feed and Item displays, including SVG resources

- Introduced FeedCard and FieldShow scenes with corresponding GDScript files for managing feed and item display.
- Added SVG resources for banana and baseball items.
- Updated ItemStore to include mappings for item types and names in Chinese.
- Enhanced FieldShow and ItemShow scripts to dynamically update UI elements based on exported properties.
- Implemented a new Feed class for structured feed data handling.
This commit is contained in:
2025-08-26 18:09:04 +08:00
parent 96b26f01be
commit 4a66374e24
14 changed files with 325 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
[gd_scene load_steps=4 format=3 uid="uid://b4cwipt17nh7g"]
[ext_resource type="Script" path="res://scripts/Structs/Feed.gd" id="1_2ea75"]
[ext_resource type="Texture2D" uid="uid://b7vxserbhskol" path="res://resources/feeds/banana.svg" id="1_jonms"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n2ewr"]
content_margin_left = 30.0
content_margin_top = 20.0
content_margin_right = 30.0
content_margin_bottom = 20.0
bg_color = Color(0, 0, 0, 0.5)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0, 0, 0, 0.75)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[node name="FeedCard" type="PanelContainer"]
offset_right = 200.0
offset_bottom = 300.0
theme_override_styles/panel = SubResource("StyleBoxFlat_n2ewr")
script = ExtResource("1_2ea75")
[node name="container" type="VBoxContainer" parent="."]
layout_mode = 2
theme_override_constants/separation = 20
[node name="info" type="VBoxContainer" parent="container"]
layout_mode = 2
theme_override_constants/separation = 10
[node name="avatar" type="TextureRect" parent="container/info"]
custom_minimum_size = Vector2(75, 75)
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 0
texture = ExtResource("1_jonms")
[node name="name" type="Label" parent="container/info"]
layout_mode = 2
size_flags_horizontal = 4
text = "香蕉"
[node name="fields" type="VBoxContainer" parent="container"]
layout_mode = 2
[node name="costs" type="GridContainer" parent="container"]
layout_mode = 2
theme_override_constants/h_separation = 10
theme_override_constants/v_separation = 10
columns = 2
+18
View File
@@ -0,0 +1,18 @@
[gd_scene load_steps=2 format=3 uid="uid://cw5ip3rw4r3pp"]
[ext_resource type="Script" path="res://scripts/Statemachine/FieldShow.gd" id="1_gwocj"]
[node name="FieldShow" type="HBoxContainer"]
script = ExtResource("1_gwocj")
value = "0"
[node name="name" type="Label" parent="."]
unique_name_in_owner = true
layout_mode = 2
text = "最大生命值"
[node name="value" type="Label" parent="."]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 10
text = "0"
+22
View File
@@ -0,0 +1,22 @@
[gd_scene load_steps=3 format=3 uid="uid://bbm8l3hr4ihar"]
[ext_resource type="Script" path="res://scripts/Statemachine/ItemShow.gd" id="1_2dhsb"]
[ext_resource type="Texture2D" uid="uid://bks8jmctleina" path="res://resources/items/baseball.svg" id="1_hyowb"]
[node name="ItemShow" type="HBoxContainer"]
script = ExtResource("1_2dhsb")
[node name="avatar" type="TextureRect" parent="."]
unique_name_in_owner = true
custom_minimum_size = Vector2(20, 20)
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 4
texture = ExtResource("1_hyowb")
expand_mode = 1
[node name="count" type="Label" parent="."]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 10
text = "0"