From b6fdde0aa6fcefd735e7c550aaa7fca879023f1c Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 15 Jun 2026 00:03:55 -0400 Subject: feat: unicode option, fixed up options and tables --- internal/game/cmd_look.go | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'internal/game/cmd_look.go') diff --git a/internal/game/cmd_look.go b/internal/game/cmd_look.go index 3b81f80..7efb65a 100644 --- a/internal/game/cmd_look.go +++ b/internal/game/cmd_look.go @@ -25,20 +25,23 @@ func (g *Game) doLook(sess *net.Session) { room.Name, ) - mapWidth := p.OptionInt("max_room_description_width") - if mapWidth <= 0 { - mapWidth = 70 + descWidth := p.OptionInt("room_desc_width") + if descWidth <= 0 { + descWidth = 70 } - if p.OptionBool("tinymap") && mapWidth > 0 { - descLines := wrapText(room.Description, mapWidth) - mapLines := buildTinyMap(g, p.RoomID) + descLines := wrapText(room.Description, descWidth) + wroteDesc := false + if p.OptionString("tiny_map") != "off" { + mapLines := buildTinyMap(g, p.RoomID, mapGlyphsForPlayer(p.OptionBool("unicode"))) if len(mapLines) == 7 { g.writeLookSideBySide(sess, p, descLines, mapLines) - } else { - sess.WriteLine(room.Description) + wroteDesc = true + } + } + if !wroteDesc { + for _, line := range descLines { + sess.WriteLine(line) } - } else { - sess.WriteLine(room.Description) } mobs := g.MobStore.MobsInRoom(p.RoomID) @@ -574,8 +577,8 @@ func (g *Game) writeLookSideBySide(sess *net.Session, p *player.Player, descLine if len(mapLines) > total { total = len(mapLines) } - leftMap := p.OptionBool("left_tinymap") - mapWidth := p.OptionInt("max_room_description_width") + leftMap := p.OptionString("tiny_map") == "left" + mapWidth := p.OptionInt("room_desc_width") if mapWidth <= 0 { mapWidth = 70 } -- cgit v1.2.3