diff options
| author | historia <[not public]> | 2026-06-15 00:03:55 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-15 00:03:55 -0400 |
| commit | b6fdde0aa6fcefd735e7c550aaa7fca879023f1c (patch) | |
| tree | 924be72a906522d60512213cdbaba1f55e694bd3 /internal/game/cmd_look.go | |
| parent | eb37418b933d7bd996658209e867ea3f3e3806ec (diff) | |
| download | thehouseoficarus-b6fdde0aa6fcefd735e7c550aaa7fca879023f1c.tar.gz | |
feat: unicode option, fixed up options and tables
Diffstat (limited to 'internal/game/cmd_look.go')
| -rw-r--r-- | internal/game/cmd_look.go | 27 |
1 files changed, 15 insertions, 12 deletions
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 } |
