Merchant inventory is working!

This commit is contained in:
Yohann D'ANELLO
2020-12-07 21:13:55 +01:00
parent 8540a8f354
commit b24cc1877f
6 changed files with 15 additions and 13 deletions

View File

@ -59,7 +59,7 @@ class DisplayManager:
def refresh(self) -> None:
if self.game.state == GameMode.PLAY \
or self.game.state == GameMode.INVENTORY \
or self.game.state == GameMode.STORE :
or self.game.state == GameMode.STORE:
# The map pad has already the good size
self.mapdisplay.refresh(0, 0, self.rows * 4 // 5,
self.mapdisplay.pack.tile_width

View File

@ -112,7 +112,7 @@ class MainMenuDisplay(Display):
class InventoryDisplay(MenuDisplay):
message : str
def update_pad(self) -> None:
self.addstr(self.pad, 0, (self.width - len(message)) // 2, message,
self.addstr(self.pad, 0, (self.width - len(self.message)) // 2, self.message,
curses.A_BOLD | curses.A_ITALIC)
for i, item in enumerate(self.menu.values):
rep = self.pack[item.name.upper()]

View File

@ -59,6 +59,7 @@ TexturePack.ASCII_PACK = TexturePack(
MERCHANT='M',
SUNFLOWER='I',
BODY_SNATCH_POTION='S',
SWORD='\u2020',
)
TexturePack.SQUIRREL_PACK = TexturePack(
@ -81,4 +82,5 @@ TexturePack.SQUIRREL_PACK = TexturePack(
MERCHANT='🦜',
SUNFLOWER='🌻',
BODY_SNATCH_POTION='🔀',
SWORD='🗡️',
)