Fix GameTooltip blocking issue and translate Found string

This commit is contained in:
Joan
2026-02-06 11:23:32 +01:00
parent 173d6c9117
commit 539377e63d
17 changed files with 700 additions and 222 deletions

View File

@@ -442,7 +442,7 @@ async def get_current_location(request: Request, current_user: dict = Depends(ge
"id": action.id,
"name": action.label,
"stamina_cost": action.stamina_cost,
"description": f"Costs {action.stamina_cost} stamina",
"description": get_game_message('costs_stamina', locale, cost=action.stamina_cost),
"on_cooldown": is_on_cooldown,
"cooldown_remaining": remaining_cooldown
})
@@ -1053,7 +1053,7 @@ async def interact(
"instance_id": interact_req.interactable_id,
"action_id": interact_req.action_id,
"cooldown_remaining": cooldown_remaining,
"message": f"{current_user['name']} used {get_locale_string(action_display, locale)} on {get_locale_string(interactable_name, locale)}"
"message": get_game_message('interactable_cooldown', locale, user=current_user, interactable=get_locale_string(interactable_name, locale), action=get_locale_string(action_display, locale)),
},
"timestamp": datetime.utcnow().isoformat()
}

View File

@@ -88,10 +88,12 @@ GAME_MESSAGES = {
# Interaction
'not_enough_stamina': {'en': "Not enough stamina. Need {cost}, have {current}.", 'es': "No tienes suficiente stamina. Necesitas {cost}, tienes {current}."},
'costs_stamina': {'en': "Costs {cost} stamina", 'es': "Cuesta {cost} de aguante"},
'cooldown_wait': {'en': "This action is still on cooldown. Wait {seconds} seconds.", 'es': "Esta acción está en enfriamiento. Espera {seconds} segundos."},
'object_not_found': {'en': "Object not found", 'es': "Objeto no encontrado"},
'action_not_found': {'en': "Action not found", 'es': "Acción no encontrada"},
'action_no_outcomes': {'en': "Action has no defined outcomes", 'es': "La acción no tiene resultados definidos"},
'interactable_cooldown': {'en': "{user} used {action} on {interactable}", 'es': "{user} usó {action} en {interactable}"},
# Item Usage
'item_used': {'en': "Used {name}", 'es': "Usado {name}"},