From feb80b7dde200d4121cd9f9c583a08f9869c5588 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 29 Jun 2026 17:19:40 -0400 Subject: feat: incardinal directions (nw, ne, sw, se). probably janky in ways I haven't yet discovered. --- internal/game/render_prompt.go | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'internal/game/render_prompt.go') diff --git a/internal/game/render_prompt.go b/internal/game/render_prompt.go index b992c8c..68f1a9a 100644 --- a/internal/game/render_prompt.go +++ b/internal/game/render_prompt.go @@ -59,7 +59,7 @@ func (g *Game) expandPromptVars(sess *net.Session, text string) string { if !ok { continue } - letter := strings.ToUpper(string(dir)[:1]) + letter := exitPromptLetter(dir) allExits += letter if exitDef.Condition != nil && !g.checkCondition(sess, exitDef.Condition) { continue @@ -114,3 +114,31 @@ func xpToLevel(p *player.Player, sk player.SkillName) int { nextLevelXP := player.XPForLevel(currentLevel + 1) return nextLevelXP - currentXP } + +// Cardinal exits get uppercase single letters; intercardinal exits get lowercase +// two-letter strings. This visual distinction helps players scan the prompt at a glance. +func exitPromptLetter(dir world.ExitDir) string { + switch dir { + case world.North: + return "N" + case world.South: + return "S" + case world.East: + return "E" + case world.West: + return "W" + case world.Northeast: + return "ne" + case world.Northwest: + return "nw" + case world.Southeast: + return "se" + case world.Southwest: + return "sw" + case world.Up: + return "U" + case world.Down: + return "D" + } + return "?" +} -- cgit v1.2.3