byte-vortex commited on
Commit
930ecbb
·
verified ·
1 Parent(s): 68735b1

Deploy Myco from CI

Browse files
Files changed (1) hide show
  1. ui/renderers.py +6 -21
ui/renderers.py CHANGED
@@ -6,8 +6,6 @@ from html import escape
6
 
7
  from game.progression import AREA_UNLOCKS, current_area, next_area, unlocked_areas
8
  from game.state import CollectionState, EMPTY_DEX, MushroomState
9
- from game.progression import AREA_UNLOCKS, current_area, next_area, unlocked_areas
10
- from game.state import CollectionState, EMPTY_DEX
11
  from models.mushroom import Mushroom
12
 
13
 
@@ -128,28 +126,9 @@ def dex_markdown(collection: CollectionState | None) -> str:
128
  return "\n".join(rows)
129
 
130
 
131
- def _safe_collection(collection: CollectionState | None) -> CollectionState:
132
- """Return a list-like collection even before Gradio initializes state."""
133
- return list(collection or [])
134
-
135
-
136
  def progress_markdown(collection: CollectionState | None) -> str:
137
  """Render collection goals and area unlock progress."""
138
  count = len(_safe_collection(collection))
139
- def dex_markdown(collection: CollectionState) -> str:
140
- """Render collected mushrooms as a compact MycoDex."""
141
- if not collection:
142
- return EMPTY_DEX
143
-
144
- rows = ["### 📖 MycoDex", ""]
145
- for entry in collection:
146
- rows.append(f"* 🍄 **{entry['name']}** — {entry['rarity']} — found near {entry['habitat']}")
147
- return "\n".join(rows)
148
-
149
-
150
- def progress_markdown(collection: CollectionState) -> str:
151
- """Render collection goals and area unlock progress."""
152
- count = len(collection)
153
  active_area = current_area(count)
154
  upcoming_area = next_area(count)
155
  unlocked_names = ", ".join(area.name for area in unlocked_areas(count))
@@ -168,3 +147,9 @@ def progress_markdown(collection: CollectionState) -> str:
168
  rows.append(f"**All goals visible:** You have reached **{AREA_UNLOCKS[-1].name}**.")
169
 
170
  return "\n\n".join(rows)
 
 
 
 
 
 
 
6
 
7
  from game.progression import AREA_UNLOCKS, current_area, next_area, unlocked_areas
8
  from game.state import CollectionState, EMPTY_DEX, MushroomState
 
 
9
  from models.mushroom import Mushroom
10
 
11
 
 
126
  return "\n".join(rows)
127
 
128
 
 
 
 
 
 
129
  def progress_markdown(collection: CollectionState | None) -> str:
130
  """Render collection goals and area unlock progress."""
131
  count = len(_safe_collection(collection))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  active_area = current_area(count)
133
  upcoming_area = next_area(count)
134
  unlocked_names = ", ".join(area.name for area in unlocked_areas(count))
 
147
  rows.append(f"**All goals visible:** You have reached **{AREA_UNLOCKS[-1].name}**.")
148
 
149
  return "\n\n".join(rows)
150
+
151
+
152
+ def _safe_collection(collection: CollectionState | None) -> CollectionState:
153
+ """Return a list-like collection even before Gradio initializes state."""
154
+ return list(collection or [])
155
+