diff --git a/squirrelbattle/display/menudisplay.py b/squirrelbattle/display/menudisplay.py index 1099f5b..64d69b7 100644 --- a/squirrelbattle/display/menudisplay.py +++ b/squirrelbattle/display/menudisplay.py @@ -275,7 +275,7 @@ class ChestInventoryDisplay(MenuDisplay): def trueheight(self) -> int: return 2 + super().trueheight - def handle_click(self, y: int, x: int, game: Game) -> None: + def handle_click(self, y: int, x: int, attr: int, game: Game) -> None: """ We can select a menu item with the mouse. """ diff --git a/squirrelbattle/tests/game_test.py b/squirrelbattle/tests/game_test.py index 0901067..11dd376 100644 --- a/squirrelbattle/tests/game_test.py +++ b/squirrelbattle/tests/game_test.py @@ -897,10 +897,11 @@ class TestGame(unittest.TestCase): # The second item is not a heart chest.inventory[1] = sword = Sword() - # Take the second item by clicking on it + # Take the second item item = self.game.chest_menu.validate() self.assertIn(item, chest.inventory) - self.game.display_actions(DisplayActions.MOUSE, 7, 25) + self.game.display_actions(DisplayActions.MOUSE, 7, 25, + curses.BUTTON1_CLICKED) self.assertIn(item, self.game.player.inventory) self.assertNotIn(item, chest.inventory)