Javier-Jimenez99 commited on
Commit
e584cde
·
1 Parent(s): e23350c

Eliminar el nombre de la API forzado en la interfaz de Gradio y agregar nuevos tipos de mapa en la función insert_map

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. tools/obr.py +3 -2
app.py CHANGED
@@ -73,7 +73,7 @@ demo = gr.TabbedInterface(
73
  game_state,
74
  gr.Textbox(label="Tab ID"),
75
  gr.JSON(),
76
- api_name="game_state"
77
  ),
78
  gr.Interface(
79
  move_item,
 
73
  game_state,
74
  gr.Textbox(label="Tab ID"),
75
  gr.JSON(),
76
+ api_name=False # Removed because it is forced
77
  ),
78
  gr.Interface(
79
  move_item,
tools/obr.py CHANGED
@@ -18,6 +18,8 @@ ASSETS_NAMES = {
18
  "GOBLIN": "goblin.png",
19
  "GOLEM": "rockGolem.png",
20
  "FOREST": "battleMap.jpg",
 
 
21
  }
22
 
23
  def execute_action(tab_id, action, params={}):
@@ -227,13 +229,12 @@ def insert_map(tab_id:str, map_type:str="FOREST") -> dict:
227
 
228
  Args:
229
  tab_id (str): The ID of the tab where the map will be inserted.
230
- map_type (str): The type of the map to insert. It can be only "FOREST".
231
 
232
  Returns:
233
  dict: A dictionary containing the game state.
234
  """
235
  map_type = map_type.upper()
236
- map_type = "FOREST"
237
  asset_url = f"{os.getenv('ASSETS_URL')}/{ASSETS_NAMES[map_type]}"
238
  params = {
239
  "mapUrl": asset_url,
 
18
  "GOBLIN": "goblin.png",
19
  "GOLEM": "rockGolem.png",
20
  "FOREST": "battleMap.jpg",
21
+ "VILLAGE": "villageMap.jpg",
22
+ "LONELY_CABIN": "lonelyCabin.jpg",
23
  }
24
 
25
  def execute_action(tab_id, action, params={}):
 
229
 
230
  Args:
231
  tab_id (str): The ID of the tab where the map will be inserted.
232
+ map_type (str): The type of the map to insert. It can be: "FOREST" | "VILLAGE" | "LONELY_CABIN".
233
 
234
  Returns:
235
  dict: A dictionary containing the game state.
236
  """
237
  map_type = map_type.upper()
 
238
  asset_url = f"{os.getenv('ASSETS_URL')}/{ASSETS_NAMES[map_type]}"
239
  params = {
240
  "mapUrl": asset_url,