diff options
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 } |
