From 9a4ceca74b0f06528ac2dd85dff4f192845c0ee7 Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Sat, 14 Feb 2026 21:14:03 -0500 Subject: [PATCH] Fix prompt command to show correct active template --- src/mudlib/commands/prompt.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/mudlib/commands/prompt.py b/src/mudlib/commands/prompt.py index d5e224b..93ba3e5 100644 --- a/src/mudlib/commands/prompt.py +++ b/src/mudlib/commands/prompt.py @@ -1,7 +1,7 @@ """Prompt customization command.""" from mudlib.player import Player -from mudlib.prompt import DEFAULT_TEMPLATES +from mudlib.prompt import ADMIN_TEMPLATES, DEFAULT_TEMPLATES async def cmd_prompt(player: Player, args: str) -> None: @@ -15,9 +15,17 @@ async def cmd_prompt(player: Player, args: str) -> None: if not args: # Show current template and available variables - current = player.prompt_template or DEFAULT_TEMPLATES.get( - player.mode, "{stamina_gauge} {pl} > " - ) + if player.prompt_template: + current = player.prompt_template + elif player.paint_mode: + current = DEFAULT_TEMPLATES["paint"] + elif player.is_admin: + current = ADMIN_TEMPLATES.get( + player.mode, + DEFAULT_TEMPLATES.get(player.mode, "{stamina_gauge} {pl} > "), + ) + else: + current = DEFAULT_TEMPLATES.get(player.mode, "{stamina_gauge} {pl} > ") msg = f"Current prompt: {current}\r\n\r\n" msg += "Available variables:\r\n" msg += " stamina_pct - stamina percentage (0-100)\r\n"