diff options
Diffstat (limited to 'internal/game/cmd_shop.go')
| -rw-r--r-- | internal/game/cmd_shop.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/internal/game/cmd_shop.go b/internal/game/cmd_shop.go index c6b7831..f0e18fe 100644 --- a/internal/game/cmd_shop.go +++ b/internal/game/cmd_shop.go @@ -138,7 +138,7 @@ func (g *Game) showShopBrowse(sess *net.Session) { sellStr = fmt.Sprintf("%d cr", si.SellPrice) } t.Rows = append(t.Rows, []string{ - g.colorize(sess, "item", itemName), + g.itemColorize(sess, def, itemName), g.colorize(sess, "credits_pickup", buyStr), g.colorize(sess, "credits_pickup", sellStr), }) @@ -182,7 +182,7 @@ func (g *Game) doShopBuy(sess *net.Session, input string, qty int, all bool) { if len(matches) > 1 { sess.WriteLine("That's ambiguous, which one?") for _, m := range matches { - sess.WriteLine(fmt.Sprintf(" - %s", g.colorize(sess, "item", m.name))) + sess.WriteLine(fmt.Sprintf(" - %s", g.itemColorize(sess, m.def, m.name))) } return } @@ -325,8 +325,9 @@ func (g *Game) doShopSell(sess *net.Session, input string, qty int, all bool) { if len(matches) > 1 { sess.WriteLine("That's ambiguous, which one?") - for _, m := range uniqueItemNames(matches) { - sess.WriteLine(fmt.Sprintf(" - %s", g.colorize(sess, "item", m))) + for _, m := range matches { + def, _ := g.ItemStore.Load(m.ID) + sess.WriteLine(fmt.Sprintf(" - %s", g.itemColorize(sess, def, m.Name))) } return } @@ -348,7 +349,7 @@ func (g *Game) doShopSell(sess *net.Session, input string, qty int, all bool) { if def != nil { displayName = def.Name } - sess.WriteLine(fmt.Sprintf("The shop doesn't want to buy %s.", g.colorize(sess, "item", displayName))) + sess.WriteLine(fmt.Sprintf("The shop doesn't want to buy %s.", g.itemColorize(sess, def, displayName))) return } |
