Commit
·
83cff4c
1
Parent(s):
80b534d
update plants info
Browse files- app.py +24 -4
- plants.csv +38 -0
app.py
CHANGED
@@ -26,11 +26,19 @@ PLANTS_LABLES = {
|
|
26 |
"kelp": "Kelp",
|
27 |
"mandrake": "Mandrake",
|
28 |
"chinese_chomping_cabbage": "Chinese Chomping Cabbage",
|
|
|
29 |
"peony": "Peony",
|
30 |
"begonia": "Begonia",
|
31 |
"mayflower": "Mayflower",
|
32 |
"hydrangea": "Hydrangea",
|
|
|
33 |
"daffodil": "Daffodil",
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
|
36 |
INTERFACE_TEXTS = {
|
@@ -148,7 +156,12 @@ def calculator(*args):
|
|
148 |
return "No solution found.\n"
|
149 |
|
150 |
|
151 |
-
|
|
|
|
|
|
|
|
|
|
|
152 |
gr.Markdown(
|
153 |
"""<center><font size=8>HP-Magic-Awakened Herbologist Toolkit👾</center>"""
|
154 |
)
|
@@ -170,7 +183,7 @@ with gr.Blocks() as demo:
|
|
170 |
info="Gabby's Gold Budget:", # "葭碧の金币预算:",
|
171 |
value=0,
|
172 |
minimum=0,
|
173 |
-
maximum=
|
174 |
step=100,
|
175 |
)
|
176 |
|
@@ -194,17 +207,24 @@ with gr.Blocks() as demo:
|
|
194 |
# Add a row for the plant inventory inputs
|
195 |
with gr.Row():
|
196 |
inventory = {}
|
|
|
|
|
197 |
for _, row in df.iterrows():
|
|
|
|
|
198 |
inventory[f"{row['species']}_{row['tier']}"] = gr.Number(
|
199 |
-
# label=f"{
|
200 |
label=PLANTS_LABLES[row["species"]],
|
201 |
info=PLANTS_TIERS[row["tier"]],
|
202 |
value=0,
|
|
|
203 |
minimum=0,
|
204 |
maximum=500,
|
205 |
step=10,
|
206 |
-
visible=
|
|
|
207 |
)
|
|
|
208 |
|
209 |
# Add a row for the Clear and Calculate buttons
|
210 |
with gr.Row():
|
|
|
26 |
"kelp": "Kelp",
|
27 |
"mandrake": "Mandrake",
|
28 |
"chinese_chomping_cabbage": "Chinese Chomping Cabbage",
|
29 |
+
"dragons_breath_macroalgae": "Dragon's Breath Macroalgae",
|
30 |
"peony": "Peony",
|
31 |
"begonia": "Begonia",
|
32 |
"mayflower": "Mayflower",
|
33 |
"hydrangea": "Hydrangea",
|
34 |
+
"ludwigia_glandulosa": "Ludwigia Glandulosa",
|
35 |
"daffodil": "Daffodil",
|
36 |
+
"water_hyacinth": "Water Hyacinth",
|
37 |
+
"lily_of_the_valley": "Lily of the Valley",
|
38 |
+
"mosaic_flower": "Mosaic Flower",
|
39 |
+
"sunflower": "Sunflower",
|
40 |
+
"mimbulus_mimbletonia": "Mimbulus Mimbletonia",
|
41 |
+
"water_lily": "Water Lily",
|
42 |
}
|
43 |
|
44 |
INTERFACE_TEXTS = {
|
|
|
156 |
return "No solution found.\n"
|
157 |
|
158 |
|
159 |
+
# 高亮每种植物的最高品质
|
160 |
+
css = """
|
161 |
+
.firstbox {background-color: #fafad2}
|
162 |
+
"""
|
163 |
+
|
164 |
+
with gr.Blocks(css=css) as demo:
|
165 |
gr.Markdown(
|
166 |
"""<center><font size=8>HP-Magic-Awakened Herbologist Toolkit👾</center>"""
|
167 |
)
|
|
|
183 |
info="Gabby's Gold Budget:", # "葭碧の金币预算:",
|
184 |
value=0,
|
185 |
minimum=0,
|
186 |
+
maximum=20000,
|
187 |
step=100,
|
188 |
)
|
189 |
|
|
|
207 |
# Add a row for the plant inventory inputs
|
208 |
with gr.Row():
|
209 |
inventory = {}
|
210 |
+
species_set = set()
|
211 |
+
species_count = 0
|
212 |
for _, row in df.iterrows():
|
213 |
+
if is_gold := row["gold"] != 0:
|
214 |
+
species_set.add(row["species"])
|
215 |
inventory[f"{row['species']}_{row['tier']}"] = gr.Number(
|
216 |
+
# label=f"{PLANTS_I18N[row['species']]}_{PLANTS_TIERS[row['tier']]}",
|
217 |
label=PLANTS_LABLES[row["species"]],
|
218 |
info=PLANTS_TIERS[row["tier"]],
|
219 |
value=0,
|
220 |
+
precision=0,
|
221 |
minimum=0,
|
222 |
maximum=500,
|
223 |
step=10,
|
224 |
+
visible=is_gold,
|
225 |
+
elem_classes=("firstbox" if len(species_set) > species_count else None),
|
226 |
)
|
227 |
+
species_count = len(species_set)
|
228 |
|
229 |
# Add a row for the Clear and Calculate buttons
|
230 |
with gr.Row():
|
plants.csv
CHANGED
@@ -48,6 +48,13 @@ gold,gems,species,tier
|
|
48 |
40,0,chinese_chomping_cabbage,flourishing
|
49 |
36,0,chinese_chomping_cabbage,hardy
|
50 |
1,0,chinese_chomping_cabbage,feeble
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
0,3,peony,radiant_rarecolor
|
52 |
0,2,peony,radiant
|
53 |
64,0,peony,flourishing_rarecolor
|
@@ -69,9 +76,40 @@ gold,gems,species,tier
|
|
69 |
150,0,hydrangea,flourishing
|
70 |
135,0,hydrangea,hardy
|
71 |
1,0,hydrangea,feeble
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
0,3,daffodil,radiant_rarecolor
|
73 |
0,2,daffodil,radiant
|
74 |
55,0,daffodil,flourishing_rarecolor
|
75 |
50,0,daffodil,flourishing
|
76 |
45,0,daffodil,hardy
|
77 |
1,0,daffodil,feeble
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
40,0,chinese_chomping_cabbage,flourishing
|
49 |
36,0,chinese_chomping_cabbage,hardy
|
50 |
1,0,chinese_chomping_cabbage,feeble
|
51 |
+
0,4,dragons_breath_macroalgae,radiant_rarecolor
|
52 |
+
0,3,dragons_breath_macroalgae,radiant
|
53 |
+
0,3,dragons_breath_macroalgae,flourishing_rarecolor
|
54 |
+
0,2,dragons_breath_macroalgae,flourishing
|
55 |
+
0,2,dragons_breath_macroalgae,hardy_rarecolor
|
56 |
+
0,1,dragons_breath_macroalgae,hardy
|
57 |
+
1,0,dragons_breath_macroalgae,feeble
|
58 |
0,3,peony,radiant_rarecolor
|
59 |
0,2,peony,radiant
|
60 |
64,0,peony,flourishing_rarecolor
|
|
|
76 |
150,0,hydrangea,flourishing
|
77 |
135,0,hydrangea,hardy
|
78 |
1,0,hydrangea,feeble
|
79 |
+
132,0,ludwigia_glandulosa,radiant_rarecolor
|
80 |
+
120,0,ludwigia_glandulosa,radiant
|
81 |
+
108,0,ludwigia_glandulosa,flourishing_rarecolor
|
82 |
+
98,0,ludwigia_glandulosa,flourishing
|
83 |
+
86,0,ludwigia_glandulosa,hardy_rarecolor
|
84 |
+
78,0,ludwigia_glandulosa,hardy
|
85 |
+
1,0,ludwigia_glandulosa,feeble
|
86 |
0,3,daffodil,radiant_rarecolor
|
87 |
0,2,daffodil,radiant
|
88 |
55,0,daffodil,flourishing_rarecolor
|
89 |
50,0,daffodil,flourishing
|
90 |
45,0,daffodil,hardy
|
91 |
1,0,daffodil,feeble
|
92 |
+
72,0,water_hyacinth,radiant_rarecolor
|
93 |
+
65,0,water_hyacinth,radiant
|
94 |
+
58,0,water_hyacinth,flourishing_rarecolor
|
95 |
+
52,0,water_hyacinth,flourishing
|
96 |
+
46,0,water_hyacinth,hardy_rarecolor
|
97 |
+
41,0,water_hyacinth,hardy
|
98 |
+
1,0,water_hyacinth,feeble
|
99 |
+
46,0,lily_of_the_valley,flourishing
|
100 |
+
42,0,lily_of_the_valley,hardy
|
101 |
+
1,0,lily_of_the_valley,feeble
|
102 |
+
88,0,mosaic_flower,radiant_rarecolor
|
103 |
+
80,0,mosaic_flower,radiant
|
104 |
+
72,0,mosaic_flower,flourishing_rarecolor
|
105 |
+
65,0,mosaic_flower,flourishing
|
106 |
+
58,0,mosaic_flower,hardy_rarecolor
|
107 |
+
52,0,mosaic_flower,hardy
|
108 |
+
1,0,mosaic_flower,feeble
|
109 |
+
299,0,water_lily,radiant_rarecolor
|
110 |
+
271,0,water_lily,radiant
|
111 |
+
244,0,water_lily,flourishing_rarecolor
|
112 |
+
221,0,water_lily,flourishing
|
113 |
+
219,0,water_lily,hardy_rarecolor
|
114 |
+
199,0,water_lily,hardy
|
115 |
+
1,0,water_lily,feeble
|