Crafting queue menu

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-27 15:45:15 +00:00
parent 77fa8ad3e6
commit 4abf165857
5 changed files with 115 additions and 2 deletions

13
app.py
View file

@ -373,6 +373,19 @@ class Handler(BaseHTTPRequestHandler):
if path == "/api/queue/remove":
index = body.get("index")
return game.queue_remove(player, index) if isinstance(index, int) else "Not in the queue"
if path == "/api/queue/move":
index, to = body.get("index"), body.get("to")
return game.queue_move(player, index, to) if isinstance(index, int) and isinstance(to, int) else "Not in the queue"
if path == "/api/queue/set":
index, qty = body.get("index"), body.get("qty")
if not isinstance(index, int) or not isinstance(qty, int):
return "Bad quantity"
return game.queue_set(player, index, qty)
if path == "/api/queue/clear":
player["queue"] = []
return None
if path == "/api/queue/skip":
return game.skip_make(world, player, now)
if path == "/api/join":
return game.join_fight(world, player, str(body.get("id")), now)
if path == "/api/press":