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

Refactor feed components and UI interactions

- Updated various feed components (Cake, Cupcake, Dango, Donut, FruitPlatter, FruitSalad, Milk, Orange, RedJam, Strawberry, Taco, WaterBottle, Xigua-Full, Xigua-Half, YellowJam) to correct names, textures, and display names.
- Modified MakeFeed scene to improve feed selection and display logic, including the addition of skip functionality.
- Enhanced UIState and EntityBase scripts to manage feed counts and selections more effectively.
- Introduced DirTool for directory operations and improved file loading mechanisms.
- Adjusted TickTool for frame-based operations.
This commit is contained in:
2025-08-27 16:33:21 +08:00
parent a3ae7ae887
commit 9e396eef3d
24 changed files with 164 additions and 162 deletions
+3 -4
View File
@@ -1,7 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://dl34e70hpckp0"] [gd_scene load_steps=3 format=3 uid="uid://dl34e70hpckp0"]
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_f2mv8"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_f2mv8"]
[ext_resource type="Texture2D" uid="uid://b7vxserbhskol" path="res://resources/feeds/banana.svg" id="2_1wmlm"]
[ext_resource type="Texture2D" uid="uid://bfioxi3ehf4kv" path="res://resources/feeds/cake-a.svg" id="2_ijk6h"] [ext_resource type="Texture2D" uid="uid://bfioxi3ehf4kv" path="res://resources/feeds/cake-a.svg" id="2_ijk6h"]
[node name="Cake" instance=ExtResource("1_f2mv8")] [node name="Cake" instance=ExtResource("1_f2mv8")]
@@ -13,7 +12,7 @@ costs = Array[int]([1])
costCounts = Array[int]([70]) costCounts = Array[int]([70])
[node name="avatar" parent="container/info" index="0"] [node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_1wmlm") texture = ExtResource("2_ijk6h")
[node name="name" parent="container/info" index="1"] [node name="name" parent="container/info" index="1"]
text = "[b]香蕉[/b]" text = "[b]生日蛋糕[/b]"
+4 -5
View File
@@ -1,10 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://u58mo875ipgg"] [gd_scene load_steps=3 format=3 uid="uid://u58mo875ipgg"]
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_x5oju"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_x5oju"]
[ext_resource type="Texture2D" uid="uid://d3rkwlf75hvva" path="res://resources/feeds/jar-b.svg" id="2_jjjxx"]
[ext_resource type="Texture2D" uid="uid://tp2scdjwalro" path="res://resources/feeds/muffin-a.svg" id="2_qojf3"] [ext_resource type="Texture2D" uid="uid://tp2scdjwalro" path="res://resources/feeds/muffin-a.svg" id="2_qojf3"]
[node name="FruitSalad" instance=ExtResource("1_x5oju")] [node name="Cupcake" instance=ExtResource("1_x5oju")]
avatarTexture = ExtResource("2_qojf3") avatarTexture = ExtResource("2_qojf3")
displayName = "烘焙松糕" displayName = "烘焙松糕"
fields = Array[int]([12, 2]) fields = Array[int]([12, 2])
@@ -13,7 +12,7 @@ costs = Array[int]([0])
costCounts = Array[int]([125]) costCounts = Array[int]([125])
[node name="avatar" parent="container/info" index="0"] [node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_jjjxx") texture = ExtResource("2_qojf3")
[node name="name" parent="container/info" index="1"] [node name="name" parent="container/info" index="1"]
text = "[b]蜂蜜果酱[/b]" text = "[b]烘焙松糕[/b]"
+3 -3
View File
@@ -3,11 +3,11 @@
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_mwo1u"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_mwo1u"]
[ext_resource type="Texture2D" uid="uid://bvkjvgxabqyvg" path="res://resources/feeds/dango.svg" id="2_ckr7l"] [ext_resource type="Texture2D" uid="uid://bvkjvgxabqyvg" path="res://resources/feeds/dango.svg" id="2_ckr7l"]
[node name="FruitSalad" instance=ExtResource("1_mwo1u")] [node name="Dango" instance=ExtResource("1_mwo1u")]
avatarTexture = ExtResource("2_ckr7l") avatarTexture = ExtResource("2_ckr7l")
displayName = "团子" displayName = "团子"
fields = Array[int]([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]) fields = Array[int]([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16])
fieldValues = Array[float]([10.0, 0.1, 0.15, 0.12, 0.04, 0.1, 0.075, 5.0, 0.15, 3.0, 0.07, 0.15, 0.1, 0.4, 0.2]) fieldValues = Array[float]([10.0, 0.1, 0.15, 0.12, 0.04, 0.1, 0.075, 5.0, 0.15, 3.0, 0.07, 0.15, 0.1, 0.4, 0.2, 2.0, 2.0])
costs = Array[int]([0, 1]) costs = Array[int]([0, 1])
costCounts = Array[int]([2000, 1500]) costCounts = Array[int]([2000, 1500])
+2 -6
View File
@@ -1,8 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://bbmjur6cjmffo"] [gd_scene load_steps=3 format=3 uid="uid://bbmjur6cjmffo"]
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_7gqm6"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_7gqm6"]
[ext_resource type="Texture2D" uid="uid://bxqax0anr5a45" path="res://resources/feeds/donut.svg" id="2_bv6j5"] [ext_resource type="Texture2D" uid="uid://bxqax0anr5a45" path="res://resources/feeds/donut.svg" id="2_bv6j5"]
[ext_resource type="Texture2D" uid="uid://d3op67s1hysla" path="res://resources/feeds/cheesy puffs.png" id="2_q5fyh"]
[node name="Donut" instance=ExtResource("1_7gqm6")] [node name="Donut" instance=ExtResource("1_7gqm6")]
avatarTexture = ExtResource("2_bv6j5") avatarTexture = ExtResource("2_bv6j5")
@@ -12,8 +11,5 @@ fieldValues = Array[float]([1.0, -3.0])
costs = Array[int]([0]) costs = Array[int]([0])
costCounts = Array[int]([100]) costCounts = Array[int]([100])
[node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_q5fyh")
[node name="name" parent="container/info" index="1"] [node name="name" parent="container/info" index="1"]
text = "[b]奶酪泡芙[/b]" text = "[b]甜甜圈[/b]"
+3 -4
View File
@@ -1,8 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://b45fcafxjacch"] [gd_scene load_steps=3 format=3 uid="uid://b45fcafxjacch"]
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_rejfg"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_rejfg"]
[ext_resource type="Texture2D" uid="uid://b7g4nciiimp1t" path="res://resources/feeds/fruit platter.png" id="2_6i6sp"] [ext_resource type="Texture2D" uid="uid://b7g4nciiimp1t" path="res://resources/feeds/fruit platter.png" id="2_6i6sp"]
[ext_resource type="Texture2D" uid="uid://b8uh5md8o4ihf" path="res://resources/feeds/fortune cookie.png" id="2_n0rfa"]
[node name="FruitPlatter" instance=ExtResource("1_rejfg")] [node name="FruitPlatter" instance=ExtResource("1_rejfg")]
avatarTexture = ExtResource("2_6i6sp") avatarTexture = ExtResource("2_6i6sp")
@@ -13,7 +12,7 @@ costs = Array[int]([0, 1])
costCounts = Array[int]([150, 200]) costCounts = Array[int]([150, 200])
[node name="avatar" parent="container/info" index="0"] [node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_n0rfa") texture = ExtResource("2_6i6sp")
[node name="name" parent="container/info" index="1"] [node name="name" parent="container/info" index="1"]
text = "[b]幸运签语饼[/b]" text = "[b]水果拼盘[/b]"
+1 -1
View File
@@ -15,4 +15,4 @@ costCounts = Array[int]([200])
texture = ExtResource("2_2oxe7") texture = ExtResource("2_2oxe7")
[node name="name" parent="container/info" index="1"] [node name="name" parent="container/info" index="1"]
text = "[b]水果拼盘[/b]" text = "[b]水果沙拉[/b]"
+5 -6
View File
@@ -1,19 +1,18 @@
[gd_scene load_steps=4 format=3 uid="uid://cx5o43i2untlo"] [gd_scene load_steps=3 format=3 uid="uid://cx5o43i2untlo"]
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_y8pe8"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_y8pe8"]
[ext_resource type="Texture2D" uid="uid://d3rkwlf75hvva" path="res://resources/feeds/jar-b.svg" id="2_5p5xn"]
[ext_resource type="Texture2D" uid="uid://dhvv8isqodfd5" path="res://resources/feeds/milk-a.svg" id="2_15plv"] [ext_resource type="Texture2D" uid="uid://dhvv8isqodfd5" path="res://resources/feeds/milk-a.svg" id="2_15plv"]
[node name="FruitSalad" instance=ExtResource("1_y8pe8")] [node name="Milk" instance=ExtResource("1_y8pe8")]
avatarTexture = ExtResource("2_15plv") avatarTexture = ExtResource("2_15plv")
displayName = "牛奶" displayName = "牛奶"
fields = Array[int]([13, 11]) fields = Array[int]([13, 11, 7])
fieldValues = Array[float]([0.4, 0.24]) fieldValues = Array[float]([0.4, 0.24])
costs = Array[int]([0, 1]) costs = Array[int]([0, 1])
costCounts = Array[int]([355, 200]) costCounts = Array[int]([355, 200])
[node name="avatar" parent="container/info" index="0"] [node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_5p5xn") texture = ExtResource("2_15plv")
[node name="name" parent="container/info" index="1"] [node name="name" parent="container/info" index="1"]
text = "[b]蜂蜜果酱[/b]" text = "[b]牛奶[/b]"
+4 -5
View File
@@ -1,10 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://byfn3ruhh0fid"] [gd_scene load_steps=3 format=3 uid="uid://byfn3ruhh0fid"]
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_w5eks"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_w5eks"]
[ext_resource type="Texture2D" uid="uid://d3rkwlf75hvva" path="res://resources/feeds/jar-b.svg" id="2_0xfoo"]
[ext_resource type="Texture2D" uid="uid://5xp54g568jbb" path="res://resources/feeds/orange2-b.svg" id="2_l6jnq"] [ext_resource type="Texture2D" uid="uid://5xp54g568jbb" path="res://resources/feeds/orange2-b.svg" id="2_l6jnq"]
[node name="FruitSalad" instance=ExtResource("1_w5eks")] [node name="Orange" instance=ExtResource("1_w5eks")]
avatarTexture = ExtResource("2_l6jnq") avatarTexture = ExtResource("2_l6jnq")
displayName = "橘子" displayName = "橘子"
fields = Array[int]([10, 3]) fields = Array[int]([10, 3])
@@ -13,7 +12,7 @@ costs = Array[int]([1])
costCounts = Array[int]([275]) costCounts = Array[int]([275])
[node name="avatar" parent="container/info" index="0"] [node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_0xfoo") texture = ExtResource("2_l6jnq")
[node name="name" parent="container/info" index="1"] [node name="name" parent="container/info" index="1"]
text = "[b]蜂蜜果酱[/b]" text = "[b]橘子[/b]"
+4 -5
View File
@@ -1,10 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://dhyjvrmcql6ay"] [gd_scene load_steps=3 format=3 uid="uid://dhyjvrmcql6ay"]
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_a74ax"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_a74ax"]
[ext_resource type="Texture2D" uid="uid://wa3p5atf521t" path="res://resources/feeds/jar-a.svg" id="2_o2o56"] [ext_resource type="Texture2D" uid="uid://wa3p5atf521t" path="res://resources/feeds/jar-a.svg" id="2_o2o56"]
[ext_resource type="Texture2D" uid="uid://doyq5mp7wvv7s" path="res://resources/feeds/glass water-a.svg" id="2_q67vo"]
[node name="FruitSalad" instance=ExtResource("1_a74ax")] [node name="RedJam" instance=ExtResource("1_a74ax")]
avatarTexture = ExtResource("2_o2o56") avatarTexture = ExtResource("2_o2o56")
displayName = "草莓果酱" displayName = "草莓果酱"
fields = Array[int]([3, 1]) fields = Array[int]([3, 1])
@@ -13,7 +12,7 @@ costs = Array[int]([0, 1])
costCounts = Array[int]([100, 50]) costCounts = Array[int]([100, 50])
[node name="avatar" parent="container/info" index="0"] [node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_q67vo") texture = ExtResource("2_o2o56")
[node name="name" parent="container/info" index="1"] [node name="name" parent="container/info" index="1"]
text = "[b]一杯水[/b]" text = "[b]草莓果酱[/b]"
+1 -1
View File
@@ -3,7 +3,7 @@
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_wr2cd"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_wr2cd"]
[ext_resource type="Texture2D" uid="uid://cbyfpwrg2e3ns" path="res://resources/feeds/strawberry-a.svg" id="2_82amy"] [ext_resource type="Texture2D" uid="uid://cbyfpwrg2e3ns" path="res://resources/feeds/strawberry-a.svg" id="2_82amy"]
[node name="FruitSalad" instance=ExtResource("1_wr2cd")] [node name="Strawberry" instance=ExtResource("1_wr2cd")]
avatarTexture = ExtResource("2_82amy") avatarTexture = ExtResource("2_82amy")
displayName = "草莓" displayName = "草莓"
fields = Array[int]([14]) fields = Array[int]([14])
+4 -5
View File
@@ -1,10 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://c52nrkruwwhyd"] [gd_scene load_steps=3 format=3 uid="uid://c52nrkruwwhyd"]
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_iixnt"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_iixnt"]
[ext_resource type="Texture2D" uid="uid://pvcwt58hsg5i" path="res://resources/feeds/Taco.svg" id="2_eed3c"] [ext_resource type="Texture2D" uid="uid://pvcwt58hsg5i" path="res://resources/feeds/Taco.svg" id="2_eed3c"]
[ext_resource type="Texture2D" uid="uid://cbyfpwrg2e3ns" path="res://resources/feeds/strawberry-a.svg" id="2_kd8ai"]
[node name="FruitSalad" instance=ExtResource("1_iixnt")] [node name="Taco" instance=ExtResource("1_iixnt")]
avatarTexture = ExtResource("2_eed3c") avatarTexture = ExtResource("2_eed3c")
displayName = "塔克" displayName = "塔克"
fields = Array[int]([13]) fields = Array[int]([13])
@@ -13,7 +12,7 @@ costs = Array[int]([1])
costCounts = Array[int]([225]) costCounts = Array[int]([225])
[node name="avatar" parent="container/info" index="0"] [node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_kd8ai") texture = ExtResource("2_eed3c")
[node name="name" parent="container/info" index="1"] [node name="name" parent="container/info" index="1"]
text = "[b]草莓[/b]" text = "[b]塔克[/b]"
+1 -1
View File
@@ -3,7 +3,7 @@
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_vfxjq"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_vfxjq"]
[ext_resource type="Texture2D" uid="uid://doyq5mp7wvv7s" path="res://resources/feeds/glass water-a.svg" id="2_gsfud"] [ext_resource type="Texture2D" uid="uid://doyq5mp7wvv7s" path="res://resources/feeds/glass water-a.svg" id="2_gsfud"]
[node name="FruitSalad" instance=ExtResource("1_vfxjq")] [node name="WaterBottle" instance=ExtResource("1_vfxjq")]
avatarTexture = ExtResource("2_gsfud") avatarTexture = ExtResource("2_gsfud")
displayName = "一杯水" displayName = "一杯水"
fields = Array[int]([3]) fields = Array[int]([3])
+4 -5
View File
@@ -1,10 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://dmdfxv7p8d061"] [gd_scene load_steps=3 format=3 uid="uid://dmdfxv7p8d061"]
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_sw8vc"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_sw8vc"]
[ext_resource type="Texture2D" uid="uid://d3rkwlf75hvva" path="res://resources/feeds/jar-b.svg" id="2_e5g35"]
[ext_resource type="Texture2D" uid="uid://ddxq46crf8s0b" path="res://resources/feeds/watermelon-a.svg" id="2_j4m35"] [ext_resource type="Texture2D" uid="uid://ddxq46crf8s0b" path="res://resources/feeds/watermelon-a.svg" id="2_j4m35"]
[node name="FruitSalad" instance=ExtResource("1_sw8vc")] [node name="Xigua-Full" instance=ExtResource("1_sw8vc")]
avatarTexture = ExtResource("2_j4m35") avatarTexture = ExtResource("2_j4m35")
displayName = "西瓜" displayName = "西瓜"
fields = Array[int]([2, 0]) fields = Array[int]([2, 0])
@@ -13,7 +12,7 @@ costs = Array[int]([0, 1])
costCounts = Array[int]([100, 125]) costCounts = Array[int]([100, 125])
[node name="avatar" parent="container/info" index="0"] [node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_e5g35") texture = ExtResource("2_j4m35")
[node name="name" parent="container/info" index="1"] [node name="name" parent="container/info" index="1"]
text = "[b]蜂蜜果酱[/b]" text = "[b]西瓜[/b]"
+4 -5
View File
@@ -1,10 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://ub2joo082noq"] [gd_scene load_steps=3 format=3 uid="uid://ub2joo082noq"]
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_bbid3"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_bbid3"]
[ext_resource type="Texture2D" uid="uid://m2q78i18f1do" path="res://resources/feeds/watermelon-c.svg" id="2_htt7g"] [ext_resource type="Texture2D" uid="uid://m2q78i18f1do" path="res://resources/feeds/watermelon-c.svg" id="2_htt7g"]
[ext_resource type="Texture2D" uid="uid://ddxq46crf8s0b" path="res://resources/feeds/watermelon-a.svg" id="2_nwypg"]
[node name="FruitSalad" instance=ExtResource("1_bbid3")] [node name="Xigua-Half" instance=ExtResource("1_bbid3")]
avatarTexture = ExtResource("2_htt7g") avatarTexture = ExtResource("2_htt7g")
displayName = "一片西瓜" displayName = "一片西瓜"
fields = Array[int]([0]) fields = Array[int]([0])
@@ -13,7 +12,7 @@ costs = Array[int]([0])
costCounts = Array[int]([50]) costCounts = Array[int]([50])
[node name="avatar" parent="container/info" index="0"] [node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_nwypg") texture = ExtResource("2_htt7g")
[node name="name" parent="container/info" index="1"] [node name="name" parent="container/info" index="1"]
text = "[b]西瓜[/b]" text = "[b]一片西瓜[/b]"
+4 -5
View File
@@ -1,10 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://cuggrw1eiwlox"] [gd_scene load_steps=3 format=3 uid="uid://cuggrw1eiwlox"]
[ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_evi6p"] [ext_resource type="PackedScene" uid="uid://bykwevnv7keeh" path="res://components/Abstracts/FeedCardBase.tscn" id="1_evi6p"]
[ext_resource type="Texture2D" uid="uid://d3rkwlf75hvva" path="res://resources/feeds/jar-b.svg" id="2_bea7w"] [ext_resource type="Texture2D" uid="uid://d3rkwlf75hvva" path="res://resources/feeds/jar-b.svg" id="2_bea7w"]
[ext_resource type="Texture2D" uid="uid://wa3p5atf521t" path="res://resources/feeds/jar-a.svg" id="2_hqcck"]
[node name="FruitSalad" instance=ExtResource("1_evi6p")] [node name="YellowJam" instance=ExtResource("1_evi6p")]
avatarTexture = ExtResource("2_bea7w") avatarTexture = ExtResource("2_bea7w")
displayName = "蜂蜜果酱" displayName = "蜂蜜果酱"
fields = Array[int]([3, 1]) fields = Array[int]([3, 1])
@@ -13,7 +12,7 @@ costs = Array[int]([0, 1])
costCounts = Array[int]([200, 125]) costCounts = Array[int]([200, 125])
[node name="avatar" parent="container/info" index="0"] [node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_hqcck") texture = ExtResource("2_bea7w")
[node name="name" parent="container/info" index="1"] [node name="name" parent="container/info" index="1"]
text = "[b]草莓果酱[/b]" text = "[b]蜂蜜果酱[/b]"
@@ -1,25 +1,8 @@
[gd_scene load_steps=21 format=3 uid="uid://1n28ji5sl6bx"] [gd_scene load_steps=4 format=3 uid="uid://1n28ji5sl6bx"]
[ext_resource type="PackedScene" uid="uid://d3qojeqa3difn" path="res://components/Abstracts/FullscreenPanelBase.tscn" id="1_1wmro"] [ext_resource type="PackedScene" uid="uid://d3qojeqa3difn" path="res://components/Abstracts/FullscreenPanelBase.tscn" id="1_1wmro"]
[ext_resource type="Script" path="res://scripts/Contents/Panels/MakeFeed.gd" id="2_pr610"] [ext_resource type="Script" path="res://scripts/Contents/Panels/MakeFeed.gd" id="2_pr610"]
[ext_resource type="PackedScene" uid="uid://btisbc7ehj4fo" path="res://components/Feeds/Banana.tscn" id="3_f2lyw"] [ext_resource type="Theme" uid="uid://dhvs6urgf6jr5" path="res://themes/main.tres" id="3_q1rym"]
[ext_resource type="PackedScene" uid="uid://dl34e70hpckp0" path="res://components/Feeds/Cake.tscn" id="4_lykfv"]
[ext_resource type="PackedScene" uid="uid://u58mo875ipgg" path="res://components/Feeds/Cupcake.tscn" id="5_mxuyf"]
[ext_resource type="PackedScene" uid="uid://dvl7u4jkugkhk" path="res://components/Feeds/Puffs.tscn" id="5_qnkr0"]
[ext_resource type="PackedScene" uid="uid://b3aymxd848400" path="res://components/Feeds/Dango.tscn" id="6_5d328"]
[ext_resource type="PackedScene" uid="uid://bbmjur6cjmffo" path="res://components/Feeds/Donut.tscn" id="7_g48y4"]
[ext_resource type="PackedScene" uid="uid://b45fcafxjacch" path="res://components/Feeds/FruitPlatter.tscn" id="8_iymw5"]
[ext_resource type="PackedScene" uid="uid://d3oh03276434b" path="res://components/Feeds/FruitSalad.tscn" id="9_crw8u"]
[ext_resource type="PackedScene" uid="uid://cuxon4is2qqyp" path="res://components/Feeds/LuckyCookie.tscn" id="10_cgxof"]
[ext_resource type="PackedScene" uid="uid://cx5o43i2untlo" path="res://components/Feeds/Milk.tscn" id="11_h7ihy"]
[ext_resource type="PackedScene" uid="uid://byfn3ruhh0fid" path="res://components/Feeds/Orange.tscn" id="12_f7je7"]
[ext_resource type="PackedScene" uid="uid://dhyjvrmcql6ay" path="res://components/Feeds/RedJam.tscn" id="14_42njn"]
[ext_resource type="PackedScene" uid="uid://cjcefxdt72d0k" path="res://components/Feeds/Strawberry.tscn" id="15_x5tul"]
[ext_resource type="PackedScene" uid="uid://c52nrkruwwhyd" path="res://components/Feeds/Taco.tscn" id="16_ixrhm"]
[ext_resource type="PackedScene" uid="uid://droytqrm4swm1" path="res://components/Feeds/WaterBottle.tscn" id="17_ws3t4"]
[ext_resource type="PackedScene" uid="uid://dmdfxv7p8d061" path="res://components/Feeds/Xigua-Full.tscn" id="18_7ync6"]
[ext_resource type="PackedScene" uid="uid://ub2joo082noq" path="res://components/Feeds/Xigua-Half.tscn" id="19_ti1ni"]
[ext_resource type="PackedScene" uid="uid://cuggrw1eiwlox" path="res://components/Feeds/YellowJam.tscn" id="20_tf31w"]
[node name="MakeFeed" instance=ExtResource("1_1wmro")] [node name="MakeFeed" instance=ExtResource("1_1wmro")]
script = ExtResource("2_pr610") script = ExtResource("2_pr610")
@@ -44,25 +27,45 @@ autowrap_mode = 0
layout_mode = 2 layout_mode = 2
alignment = 1 alignment = 1
[node name="select" type="RichTextLabel" parent="content/wrapper/tips/tip" index="0"] [node name="before" type="RichTextLabel" parent="content/wrapper/tips/tip" index="0"]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 4 size_flags_horizontal = 4
size_flags_vertical = 4 size_flags_vertical = 4
bbcode_enabled = true bbcode_enabled = true
text = "可选择" text = "在第"
fit_content = true fit_content = true
autowrap_mode = 0 autowrap_mode = 0
[node name="count" type="RichTextLabel" parent="content/wrapper/tips/tip" index="1"] [node name="wave" type="RichTextLabel" parent="content/wrapper/tips/tip" index="1"]
unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 4 size_flags_horizontal = 4
size_flags_vertical = 4 size_flags_vertical = 4
bbcode_enabled = true bbcode_enabled = true
text = "1" text = "0"
fit_content = true fit_content = true
autowrap_mode = 0 autowrap_mode = 0
[node name="feed" type="RichTextLabel" parent="content/wrapper/tips/tip" index="2"] [node name="select" type="RichTextLabel" parent="content/wrapper/tips/tip" index="2"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
bbcode_enabled = true
text = "波开始前可选择"
fit_content = true
autowrap_mode = 0
[node name="count" type="RichTextLabel" parent="content/wrapper/tips/tip" index="3"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
bbcode_enabled = true
text = "0"
fit_content = true
autowrap_mode = 0
[node name="feed" type="RichTextLabel" parent="content/wrapper/tips/tip" index="4"]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 4 size_flags_horizontal = 4
size_flags_vertical = 4 size_flags_vertical = 4
@@ -71,65 +74,20 @@ text = "项增益"
fit_content = true fit_content = true
autowrap_mode = 0 autowrap_mode = 0
[node name="skipBtn" type="Button" parent="content/wrapper/tips/tip" index="5"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
theme = ExtResource("3_q1rym")
text = "跳过"
[node name="feedcards" type="HBoxContainer" parent="content/wrapper" index="1"] [node name="feedcards" type="HBoxContainer" parent="content/wrapper" index="1"]
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
theme_override_constants/separation = 30 theme_override_constants/separation = 30
alignment = 1 alignment = 1
[node name="avaliableFeeds" type="Node" parent="content/wrapper" index="2"] [node name="avaliableFeeds" type="Node2D" parent="content/wrapper" index="2"]
unique_name_in_owner = true unique_name_in_owner = true
[node name="Banana" parent="content/wrapper/avaliableFeeds" index="0" instance=ExtResource("3_f2lyw")]
visible = false
[node name="Cake" parent="content/wrapper/avaliableFeeds" index="1" instance=ExtResource("4_lykfv")]
visible = false
[node name="FruitSalad" parent="content/wrapper/avaliableFeeds" index="2" instance=ExtResource("5_mxuyf")]
visible = false
[node name="FruitSalad2" parent="content/wrapper/avaliableFeeds" index="3" instance=ExtResource("6_5d328")]
visible = false
[node name="Donut" parent="content/wrapper/avaliableFeeds" index="4" instance=ExtResource("7_g48y4")]
visible = false
[node name="FruitPlatter" parent="content/wrapper/avaliableFeeds" index="5" instance=ExtResource("8_iymw5")]
visible = false
[node name="FruitSalad3" parent="content/wrapper/avaliableFeeds" index="6" instance=ExtResource("9_crw8u")]
visible = false
[node name="LuckyCookie" parent="content/wrapper/avaliableFeeds" index="7" instance=ExtResource("10_cgxof")]
visible = false
[node name="FruitSalad4" parent="content/wrapper/avaliableFeeds" index="8" instance=ExtResource("11_h7ihy")]
visible = false
[node name="FruitSalad5" parent="content/wrapper/avaliableFeeds" index="9" instance=ExtResource("12_f7je7")]
visible = false
[node name="Puffs" parent="content/wrapper/avaliableFeeds" index="10" instance=ExtResource("5_qnkr0")]
visible = false
[node name="FruitSalad6" parent="content/wrapper/avaliableFeeds" index="11" instance=ExtResource("14_42njn")]
visible = false
[node name="FruitSalad7" parent="content/wrapper/avaliableFeeds" index="12" instance=ExtResource("15_x5tul")]
visible = false
[node name="FruitSalad8" parent="content/wrapper/avaliableFeeds" index="13" instance=ExtResource("16_ixrhm")]
visible = false
[node name="FruitSalad9" parent="content/wrapper/avaliableFeeds" index="14" instance=ExtResource("17_ws3t4")]
visible = false
[node name="FruitSalad10" parent="content/wrapper/avaliableFeeds" index="15" instance=ExtResource("18_7ync6")]
visible = false
[node name="FruitSalad11" parent="content/wrapper/avaliableFeeds" index="16" instance=ExtResource("19_ti1ni")]
visible = false
[node name="FruitSalad12" parent="content/wrapper/avaliableFeeds" index="17" instance=ExtResource("20_tf31w")]
visible = false visible = false
+1 -1
View File
@@ -4,7 +4,7 @@
[ext_resource type="Texture2D" uid="uid://bks8jmctleina" path="res://resources/items/baseball.svg" id="2_4hl42"] [ext_resource type="Texture2D" uid="uid://bks8jmctleina" path="res://resources/items/baseball.svg" id="2_4hl42"]
[sub_resource type="CircleShape2D" id="CircleShape2D_7lt1c"] [sub_resource type="CircleShape2D" id="CircleShape2D_7lt1c"]
radius = 7.0 radius = 2.0
[node name="ItemDropped" type="RigidBody2D"] [node name="ItemDropped" type="RigidBody2D"]
script = ExtResource("1_v2djl") script = ExtResource("1_v2djl")
+38 -13
View File
@@ -1,26 +1,51 @@
@tool @tool
extends FullscreenPanelBase extends FullscreenPanelBase
@onready var avaliableFeeds: Node = $"%avaliableFeeds" var selectedCount: int = 0
@onready var avaliableFeeds: Node2D = $"%avaliableFeeds"
@onready var feedCards: HBoxContainer = $"%feedcards" @onready var feedCards: HBoxContainer = $"%feedcards"
@onready var waveLabel: RichTextLabel = $"%wave"
@onready var countLabel: RichTextLabel = $"%count"
@onready var skipBtn: Button = $"%skipBtn"
func _ready():
skipBtn.pressed.connect(
func():
finish()
)
for file in DirTool.listdir("res://components/Feeds/"):
var i = load(file).instantiate() as Feed
i.selected.connect(
func(applied: bool):
if applied:
selectedCount += 1
updateValue()
if selectedCount >= UIState.player.fields[FieldStore.Entity.FEED_COUNT_CAN_MADE]:
finish()
)
avaliableFeeds.add_child(i)
func beforeOpen(): func beforeOpen():
selectedCount = 0
afterClose()
updateValue()
var feeds: Array[Feed] = [] var feeds: Array[Feed] = []
for i in avaliableFeeds.get_children(): for i in avaliableFeeds.get_children():
feeds.append(i) feeds.append(i)
var allHad = false feeds.shuffle()
while not allHad: for i in range(UIState.player.fields[FieldStore.Entity.FEED_COUNT_SHOW]):
afterClose() var feed = feeds[i] as Feed
feeds.shuffle() avaliableFeeds.remove_child(feed)
for i in range(3): feedCards.add_child(feed)
var feed = feeds[i] as Feed
feed.show()
avaliableFeeds.remove_child(feed)
feedCards.add_child(feed)
if feed.allHad(UIState.player):
allHad = true
func afterClose(): func afterClose():
for i in feedCards.get_children(): for i in feedCards.get_children():
i.hide()
feedCards.remove_child(i) feedCards.remove_child(i)
avaliableFeeds.add_child(i) avaliableFeeds.add_child(i)
func updateValue():
waveLabel.text = str(Wave.current + 1)
countLabel.text = str(UIState.player.fields[FieldStore.Entity.FEED_COUNT_CAN_MADE] - selectedCount)
func finish():
Wave.next()
UIState.closeCurrentPanel()
+3 -1
View File
@@ -16,7 +16,9 @@ var fields = {
FieldStore.Entity.PENARATION_RESISTANCE: 0, FieldStore.Entity.PENARATION_RESISTANCE: 0,
FieldStore.Entity.PRICE_REDUCTION: 0, FieldStore.Entity.PRICE_REDUCTION: 0,
FieldStore.Entity.EXTRA_BULLET_COUNT: 0, FieldStore.Entity.EXTRA_BULLET_COUNT: 0,
FieldStore.Entity.DROP_APPLE_RATE: 0 FieldStore.Entity.DROP_APPLE_RATE: 0,
FieldStore.Entity.FEED_COUNT_SHOW: 3,
FieldStore.Entity.FEED_COUNT_CAN_MADE: 1
} }
var inventory = { var inventory = {
ItemStore.ItemType.BASEBALL: 100, ItemStore.ItemType.BASEBALL: 100,
+2
View File
@@ -37,3 +37,5 @@ static func setPanel(targetName: String = ""):
panel.showPanel() panel.showPanel()
else: else:
panel.hidePanel() panel.hidePanel()
static func closeCurrentPanel():
setPanel()
+5 -4
View File
@@ -2,6 +2,8 @@
extends PanelContainer extends PanelContainer
class_name Feed class_name Feed
signal selected(applied: bool)
@export var avatarTexture: Texture2D = preload("res://icon.svg") @export var avatarTexture: Texture2D = preload("res://icon.svg")
@export var displayName: String = "未命名饲料" @export var displayName: String = "未命名饲料"
@export var fields: Array[FieldStore.Entity] = [] @export var fields: Array[FieldStore.Entity] = []
@@ -18,10 +20,7 @@ class_name Feed
func _ready(): func _ready():
selectButton.pressed.connect( selectButton.pressed.connect(
func(): func():
if apply(UIState.player): apply(UIState.player)
UIState.setPanel()
queue_free()
Wave.next()
) )
avatarRect.texture = avatarTexture avatarRect.texture = avatarTexture
nameLabel.text = "[b]" + displayName + "[/b]" nameLabel.text = "[b]" + displayName + "[/b]"
@@ -70,6 +69,8 @@ func apply(entity: EntityBase):
var applier = FieldStore.entityApplier.get(field, null) var applier = FieldStore.entityApplier.get(field, null)
if !applier or applier.call(entity, value): if !applier or applier.call(entity, value):
entity.fields[field] += value entity.fields[field] += value
hide()
selected.emit(allHave)
return allHave return allHave
func multipiler() -> float: func multipiler() -> float:
if is_instance_valid(UIState.player): if is_instance_valid(UIState.player):
+16
View File
@@ -0,0 +1,16 @@
class_name DirTool
static func listdir(path: String) -> Array[String]:
var files: Array[String] = []
var dir = DirAccess.open(path)
if dir:
dir.list_dir_begin()
var file_name = dir.get_next()
while file_name != "":
if file_name != "." and file_name != "..":
files.append(path + file_name)
file_name = dir.get_next()
dir.list_dir_end()
return files
else:
return []
+12 -3
View File
@@ -21,7 +21,9 @@ enum Entity {
PENARATION_RESISTANCE, PENARATION_RESISTANCE,
PRICE_REDUCTION, PRICE_REDUCTION,
EXTRA_BULLET_COUNT, EXTRA_BULLET_COUNT,
DROP_APPLE_RATE DROP_APPLE_RATE,
FEED_COUNT_SHOW,
FEED_COUNT_CAN_MADE
} }
static var entityMap = { static var entityMap = {
Entity.MAX_HEALTH: "最大生命值", Entity.MAX_HEALTH: "最大生命值",
@@ -38,7 +40,9 @@ static var entityMap = {
Entity.PENARATION_RESISTANCE: "穿透抗性", Entity.PENARATION_RESISTANCE: "穿透抗性",
Entity.PRICE_REDUCTION: "饲料降价", Entity.PRICE_REDUCTION: "饲料降价",
Entity.EXTRA_BULLET_COUNT: "额外子弹", Entity.EXTRA_BULLET_COUNT: "额外子弹",
Entity.DROP_APPLE_RATE: "苹果掉落率" Entity.DROP_APPLE_RATE: "苹果掉落率",
Entity.FEED_COUNT_SHOW: "可选饲料数量",
Entity.FEED_COUNT_CAN_MADE: "可制作饲料数量"
} }
static var entityMapType = { static var entityMapType = {
Entity.MAX_HEALTH: DataType.VALUE, Entity.MAX_HEALTH: DataType.VALUE,
@@ -55,7 +59,9 @@ static var entityMapType = {
Entity.PENARATION_RESISTANCE: DataType.PERCENT, Entity.PENARATION_RESISTANCE: DataType.PERCENT,
Entity.PRICE_REDUCTION: DataType.PERCENT, Entity.PRICE_REDUCTION: DataType.PERCENT,
Entity.EXTRA_BULLET_COUNT: DataType.VALUE, Entity.EXTRA_BULLET_COUNT: DataType.VALUE,
Entity.DROP_APPLE_RATE: DataType.PERCENT Entity.DROP_APPLE_RATE: DataType.PERCENT,
Entity.FEED_COUNT_SHOW: DataType.VALUE,
Entity.FEED_COUNT_CAN_MADE: DataType.VALUE
} }
static var entityApplier = { static var entityApplier = {
Entity.MAX_HEALTH: func(entity, value): Entity.MAX_HEALTH: func(entity, value):
@@ -64,6 +70,9 @@ static var entityApplier = {
Entity.EXTRA_APPLE_MAX: func(entity, value): Entity.EXTRA_APPLE_MAX: func(entity, value):
entity.inventoryMax[ItemStore.ItemType.APPLE] += value entity.inventoryMax[ItemStore.ItemType.APPLE] += value
, ,
Entity.EXTRA_BULLET_COUNT: func(entity, value):
entity.fields[Entity.OFFSET_SHOOT] += value * 5
,
} }
enum Bullet { enum Bullet {
+4 -1
View File
@@ -1,4 +1,7 @@
class_name TickTool class_name TickTool
static func millseconds(ms: int): static func millseconds(ms: int):
return await WorldManager.tree.create_timer(ms / 1000.0).timeout return await WorldManager.tree.create_timer(ms / 1000.0).timeout
static func frame(count: int = 1):
for i in range(count):
await WorldManager.tree.physics_frame