1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +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"
+23
View File
@@ -0,0 +1,23 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="78.0933609008789" height="76.47245788574219" viewBox="0.10490679740905762 -0.11825206875801086 78.0933609008789 76.47245788574219" version="1.1" xml:space="preserve">
<g>
<title>Slice 1</title>
<desc>Created with Sketch.</desc>
<g id="Page-1" stroke="none" fill-rule="evenodd">
<g id="Group-3">
<path d="M 74.7206 64.9463 C 69.7478 59.3734 61.4313 56.0296 58.5162 49.5136 C 54.9152 41.3685 57.3159 34.5953 59.1163 26.8789 C 60.0595 22.7635 57.4873 19.1625 55.5154 18.3909 C 60.5739 12.475 59.4593 5.616 56.4585 2.7009 L 51.057 5.0158 C 50.1139 9.1312 49.428 15.2186 49.3423 16.6761 C 32.8807 18.7338 29.6226 43.8549 36.2244 56.7155 C 41.6259 67.1755 53.5434 75.0634 70.1765 74.7204 C 76.6925 74.4632 80.8079 71.7196 74.7206 64.9463 Z " id="Path" fill="#272525" stroke-width="1"/>
<path d="M 54.2293 4.1584 C 55.9441 5.1873 57.916 7.5879 57.7445 9.5599 C 57.3159 10.0743 53.1147 18.8196 54.5723 19.5912 C 58.259 21.4774 52.7718 35.7956 54.8295 44.9695 C 57.6588 57.6586 68.6332 60.488 73.0058 67.6899 C 75.4065 71.6339 71.0339 72.6627 69.7478 72.6627 C 49.771 72.3198 41.7974 61.5168 38.5393 54.8293 C 34.2525 46.0841 36.9103 35.2812 40.597 26.7931 C 41.3687 25.0784 43.3406 21.9061 44.7124 20.62 C 46.9416 18.7338 47.456 18.5623 50.3711 18.3051 C 50.7998 18.2194 54.2293 4.1584 54.2293 4.1584 Z " id="ID0.006342989392578602" fill="#FFF63B" stroke-width="1"/>
<path d="M 50.7998 21.3059 C 50.9713 20.7058 51.8287 20.963 51.6572 21.4774 C 46.4272 38.8821 48.6564 55.258 60.5739 63.8317 C 63.0603 65.6322 68.033 67.7757 69.1476 68.2044 C 70.348 68.633 69.4048 69.3189 68.2903 68.976 C 67.2614 68.633 66.404 68.2901 64.8608 67.6042 C 52.0001 61.774 41.1972 52.2572 50.7998 21.3059 Z " id="ID0.5267163878306746" fill="#272525" stroke-width="1"/>
</g>
<g id="Group-2">
<path d="M 55.8583 0.386 C 54.0578 0.1288 48.1419 11.6176 47.1988 13.6753 C 30.9087 10.2458 18.9055 32.709 20.5345 46.9415 C 21.9063 58.516 30.3085 69.8334 45.9985 74.9776 C 52.2573 77.0353 57.1444 75.835 53.8864 67.4327 C 51.1428 60.5737 44.541 54.6578 44.198 47.6274 C 43.7693 38.7964 48.3992 33.2235 52.8575 26.5359 C 55.2582 22.935 54.0578 18.5623 52.3431 17.2763 C 63.4032 12.7322 60.8311 1.0719 55.8583 0.386 Z " id="Path" fill="#272525" stroke-width="1"/>
<path d="M 56.287 3.4725 C 58.1732 4.3299 59.545 6.2161 57.6588 9.7314 C 56.4585 11.9606 49.9424 16.9333 51.057 18.1337 C 53.8864 21.1345 43.5979 32.7948 42.2261 42.0544 C 40.4256 54.915 49.6852 61.1739 51.2285 69.3189 C 52.0859 73.7773 47.6275 73.3486 46.4272 72.9199 C 27.8222 66.0609 24.1354 53.286 23.4495 45.9126 C 22.5922 36.2243 28.851 27.0504 35.3671 20.1914 C 36.6531 18.8196 39.6539 16.4189 41.4544 15.733 C 44.198 14.6184 44.1123 12.9037 46.9416 13.6753 C 47.3703 13.8468 56.287 3.4725 56.287 3.4725 Z " id="ID0.19106093607842922" fill="#FFF63B" stroke-width="1"/>
<path d="M 46.9416 18.5623 C 47.3703 18.0479 48.0562 18.5623 47.7133 18.991 C 36.5674 33.6521 32.8807 49.6851 40.94 61.774 C 42.6547 64.3462 46.5129 67.9471 47.456 68.633 C 48.3992 69.4047 46.9416 70.5193 46.0842 69.8334 C 45.2269 69.1475 43.9408 68.2044 42.8262 67.0898 C 32.7949 57.23 26.879 44.4551 46.9416 18.5623 Z " id="ID0.6718006273731589" fill="#272525" stroke-width="1"/>
</g>
<g id="Group">
<path d="M 57.5731 1.4148 C 56.0298 0.386 45.2269 7.9309 43.4264 9.3027 C 30.7372 -1.0715 9.1314 13.4181 3.5584 26.7074 C -0.9856 37.5103 -1.3286 50.2852 10.0745 61.8598 C 14.6186 66.4896 21.7348 68.633 22.9351 59.7163 C 23.8782 52.4287 22.0777 44.8838 25.1643 38.4534 C 29.1082 30.3941 34.8526 27.0504 42.0546 23.0207 C 45.6556 21.0487 46.8559 17.1048 46.2557 15.0471 C 57.8303 15.733 61.6027 4.2442 57.5731 1.4148 Z " id="Path" fill="#272525" stroke-width="1"/>
<path d="M 56.3727 4.4157 C 56.8014 6.3019 56.2013 9.3027 54.4865 10.5888 C 52.9432 11.7033 47.7133 13.8468 44.7124 14.104 C 45.7413 18.0479 30.823 24.6497 25.0786 32.1946 C 17.1907 42.6546 22.2492 52.4287 19.5914 60.3165 C 18.1338 64.6034 14.4471 62.2885 13.5897 61.2596 C 0.5576 46.8557 3.5584 33.8236 6.5593 27.0504 C 10.5032 18.1337 20.6202 12.8179 29.6226 9.7314 C 31.4231 9.1312 35.2813 8.3596 37.1675 8.5311 C 40.1684 8.7883 40.6828 9.1312 42.7405 11.0174 C 43.1692 11.3604 56.0298 2.7866 56.3727 4.4157 Z " id="ID0.7287357193417847" fill="#FFF63B" stroke-width="1"/>
<path d="M 40.6828 13.5038 C 41.2829 13.2466 41.6259 14.0183 41.1972 14.1897 C 24.2212 22.0776 12.9896 34.5953 14.2756 48.9134 C 14.5328 51.9142 16.1619 56.8013 16.6763 57.9159 C 17.1907 59.0304 15.9046 58.859 15.5617 57.8301 C 15.133 56.8013 14.7901 56.0296 14.3614 54.4864 C 10.246 41.3685 10.3317 27.3076 40.6828 13.5038 Z " id="ID0.7101516453549266" fill="#272525" stroke-width="1"/>
</g>
</g>
</g>
</svg><!--rotationCenter:39:38-->

After

Width:  |  Height:  |  Size: 4.8 KiB

+37
View File
@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b7vxserbhskol"
path="res://.godot/imported/banana.svg-4e9a5958a2d683095b10d4c718bca679.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/feeds/banana.svg"
dest_files=["res://.godot/imported/banana.svg-4e9a5958a2d683095b10d4c718bca679.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
+35
View File
@@ -0,0 +1,35 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="57" height="57" viewBox="-0.5 -0.5 57 57" version="1.1" xml:space="preserve">
<defs/>
<g>
<title>Slice 1</title>
<desc>Created with Sketch.</desc>
<g id="Page-1" stroke="none" fill-rule="evenodd">
<g id="baseball-[baseball,sports,ball,alex-eben-meyer]" fill-rule="nonzero">
<g id="Group-3">
<path d="M28,0 C35.7,0 42.7,3.1 47.8,8.2 C52.9,13.3 56,20.3 56,28 C56,35.7 52.9,42.7 47.8,47.8 C42.7,52.9 35.7,56 28,56 C20.3,56 13.3,52.9 8.2,47.8 C3.1,42.7 0,35.7 0,28 C0,20.3 3.1,13.3 8.2,8.2 C13.3,3.1 20.3,0 28,0 Z" id="Oval" fill="#FAF0E6" stroke-width="1"/>
<path d="M56,28.1 C56,21.8 53.9,16 50.3,11.4 C47.1,13.7 40.4,19.7 37,30.4 C37,30.4 33,42.4 38.9,53.8 C49.1,49.4 56,39.6 56,28.1 Z" id="Shape" fill="#F0E6D2" stroke-width="1"/>
</g>
<g id="Group-2">
<polyline id="Shape_1_" points="12.9 5.3 13.7 0.9 14.4 1.1 13.9 4.6 17.6 4.7 17.6 5.5 12.9 5.3" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,32,10)"/>
<polyline id="Shape_2_" points="9 10.6 8.8 6.1 9.6 6 9.9 9.6 13.5 8.9 13.6 9.7 9 10.6" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,32,10)"/>
<polyline id="Shape_3_" points="6.5 16.2 5 12 5.9 11.8 7 15.1 10.3 13.9 10.5 14.6 6.5 16.2" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,32,10)"/>
<polyline id="Shape_4_" points="3.6 28.5 1 25 1.6 24.5 3.7 27.4 6.5 25.1 7 25.7 3.6 28.5" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,32,10)"/>
<polyline id="Shape_5_" points="3.8 35.4 0.6 32.2 1.3 31.6 3.7 34.1 6.1 31.6 6.8 32.2 3.8 35.4" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,32,10)"/>
<polyline id="Shape_6_" points="5.5 41.4 1.8 38.9 2.2 38.3 5.2 40.2 7 37.2 7.8 37.6 5.5 41.4" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,32,10)"/>
<polyline id="Shape_7_" points="4.6 22 2.8 18.1 3.6 17.7 5 20.9 8.2 19.3 8.5 20 4.6 22" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,32,10)"/>
<path d="M 50.2 11 C 46.5 13.2 43.4 16.3 41.2 19.9 C 35.3 29.4 32.7 43.7 38.5 54.1 C 38.7 54 39.1 53.9 39.3 53.8 C 34.9 45.8 34.4 32.6 41.9 20.4 C 44.1 16.8 47.1 13.9 50.7 11.8 C 50.5 11.4 50.3 11.3 50.2 11 Z " id="Shape_8_" stroke-width="1" fill="#F01446"/>
</g>
<g id="Group">
<polyline id="Shape_9_" points="6.6 39.1 5.9 43.5 5.1 43.4 5.6 39.9 2.1 39.8 2.2 39 6.6 39.1" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,5,2)"/>
<polyline id="Shape_10_" points="10.2 34 10.5 38.4 9.7 38.4 9.5 35 6 35.6 5.9 34.8 10.2 34" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,5,2)"/>
<polyline id="Shape_11_" points="12.7 28.4 14 32.5 13.2 32.7 12.2 29.5 9.1 30.7 8.7 30 12.7 28.4" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,5,2)"/>
<polyline id="Shape_12_" points="15.3 16.3 17.8 19.7 17.2 20.2 15.2 17.4 12.7 19.6 12.2 19 15.3 16.3" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,5,2)"/>
<polyline id="Shape_13_" points="15.2 9.5 18.1 12.6 17.6 13.1 15.2 10.6 13 13.1 12.3 12.6 15.2 9.5" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,5,2)"/>
<polyline id="Shape_14_" points="13.6 3.5 17.1 5.9 16.7 6.6 13.8 4.7 12.1 7.5 11.5 7.1 13.6 3.5" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,5,2)"/>
<polyline id="Shape_15_" points="14.4 22.7 16.1 26.6 15.4 26.9 14 23.7 11 25.4 10.7 24.7 14.4 22.7" stroke-width="1" fill="#F01446" transform="matrix(1,0,0,1,5,2)"/>
<path d="M 14.4 36.2 C 12.4 39.9 9.3 42.9 5.7 45 C 5.9 45.2 6 45.5 6.2 45.6 C 9.9 43.4 12.9 40.3 15 36.6 C 20.6 27.1 23.1 12.6 17.3 2.4 C 17.1 2.5 16.8 2.6 16.5 2.7 C 21 10.6 21.7 24 14.4 36.2 Z " id="Shape_16_" stroke-width="1" fill="#F01446"/>
</g>
</g>
</g>
</g>
</svg><!--rotationCenter:28:28-->

After

Width:  |  Height:  |  Size: 3.9 KiB

+37
View File
@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bks8jmctleina"
path="res://.godot/imported/baseball.svg-1901705de42f4cc5a44a1e5f8046c228.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/items/baseball.svg"
dest_files=["res://.godot/imported/baseball.svg-1901705de42f4cc5a44a1e5f8046c228.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
+18
View File
@@ -0,0 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="46.3714714050293" height="46.397254943847656" viewBox="0.005429744720458984 -0.10458087921142578 46.3714714050293 46.397254943847656" version="1.1" xml:space="preserve">
<!-- Generator: Sketch 52.4 (67378) - http://www.bohemiancoding.com/sketch -->
<g>
<title>Slice 1</title>
<desc>Created with Sketch.</desc>
<g id="Page-1" stroke="none" fill-rule="evenodd">
<g id="basketball-[sports,basketball,alex-eben-meyer]">
<path d="M45.8574648,23.1360563 C45.8846538,13.3683614 39.6539895,4.68084279 30.3934296,1.57429566 C21.1328697,-1.53225146 10.9236157,1.64033263 5.05483732,9.44840822 C-0.813941103,17.2564838 -1.02330531,27.9452781 4.53521127,35.9771831 C7.82,42.015493 13.6056338,44.9957746 19.8512676,45.5335211 C26.0303958,46.4528578 32.3146456,44.7762762 37.2146479,40.9011268 C37.5969014,40.6419718 37.9726761,40.3698592 38.335493,40.0912676 C40.4134082,38.5367279 42.0338268,36.4507748 43.0261972,34.0529577 C44.8779518,30.7119673 45.852078,26.9558971 45.8574648,23.1360563 Z" id="Shape" fill="#E6781E" stroke-width="1"/>
<g id="Group">
<path d="M23.868169,0.505352113 L23.2202817,0.505352113 C23.1230986,13.8194366 23.0064789,30.3664789 23.1295775,45.7926761 L23.2073239,45.7926761 L23.7774648,45.7926761 C23.6543662,30.3535211 23.7709859,13.8194366 23.868169,0.505352113 Z" id="Shape" stroke-width="1" fill="#824600"/>
<path d="M0.596056338,22.3261972 C0.596056338,22.5529577 0.596056338,22.7797183 0.596056338,23.0129577 L45.8769014,23.0129577 C45.8769014,22.7797183 45.8769014,22.5464789 45.8769014,22.3197183 L0.596056338,22.3261972 Z" id="Shape" stroke-width="1" fill="#824600"/>
<path d="M32.2388732,14.1369014 C33.0678257,10.8081213 34.7543188,7.75456349 37.1304225,5.28028169 C36.955493,5.14422535 36.7740845,5.00169014 36.5926761,4.87211268 C34.1801721,7.41629412 32.4661572,10.5408005 31.6169014,13.9425352 C29.3039437,22.591831 30.6126761,34.195493 37.26,40.888169 C37.4543662,40.7585915 37.6357746,40.6160563 37.823662,40.48 C32.6794366,35.2709859 29.3039437,25.1315493 32.2388732,14.1369014 Z" id="Shape" stroke-width="1" fill="#824600"/>
<path d="M14.9014085,30.3340845 C16.2875264,25.1949269 16.445105,19.8017434 15.3614085,14.5904225 C14.5798336,10.8503822 12.8836511,7.36230095 10.424507,4.43802817 L9.88028169,4.82676056 C12.3017267,7.67541516 13.9701687,11.0858087 14.7329577,14.7459155 C17.1625352,26.0580282 13.4371831,35.7439437 8.09859155,40.5642254 C8.26704225,40.7283568 8.44197183,40.8838498 8.62338028,41.0307042 C11.5129577,38.4650704 13.6639437,34.8239437 14.9014085,30.3340845 Z" id="Shape" stroke-width="1" fill="#824600"/>
</g>
</g>
</g>
</g>
</svg><!--rotationCenter:23:23-->

After

Width:  |  Height:  |  Size: 2.7 KiB

+37
View File
@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://i42hs74gw5q5"
path="res://.godot/imported/basketball.svg-841211645b0b095ba7071de154659e69.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/items/basketball.svg"
dest_files=["res://.godot/imported/basketball.svg-841211645b0b095ba7071de154659e69.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
+12
View File
@@ -0,0 +1,12 @@
@tool
extends HBoxContainer
@export var field: FieldStore.Entity = FieldStore.Entity.MAX_HEALTH
@export var value: String = ""
@onready var nameLabel: Label = $"%name"
@onready var valueLabel: Label = $"%value"
func _process(_delta):
nameLabel.text = FieldStore.entityMap[field]
valueLabel.text = value
+12
View File
@@ -0,0 +1,12 @@
@tool
extends HBoxContainer
@export var type: ItemStore.ItemType = ItemStore.ItemType.BASEBALL
@export var count: int = 0
@onready var avatarTexture: TextureRect = $"%avatar"
@onready var countLabel: Label = $"%count"
func _process(_delta):
avatarTexture.texture = load("res://resources/items/%s.svg" % ItemStore.idMap[type])
countLabel.text = str(count)
+3
View File
@@ -0,0 +1,3 @@
@tool
extends PanelContainer
class_name Feed
+1
View File
@@ -1,3 +1,4 @@
@tool
class_name FieldStore
enum Entity {
+15
View File
@@ -0,0 +1,15 @@
@tool
class_name ItemStore
enum ItemType {
BASEBALL,
BASKETBALL
}
static var nameMap = {
ItemType.BASEBALL: "棒球",
ItemType.BASKETBALL: "篮球"
}
static var idMap = {
ItemType.BASEBALL: "baseball",
ItemType.BASKETBALL: "basketball"
}