Changed the behaviour of DisplayManager to match previous commit and fixed tests and bootstrap accordingly

This commit is contained in:
nicomarg
2020-11-11 23:56:08 +01:00
parent b0292c05b2
commit 92ab9ae075
3 changed files with 9 additions and 2 deletions

View File

@ -5,6 +5,7 @@ from dungeonbattle.display.menudisplay import MenuDisplay, MainMenuDisplay
from dungeonbattle.display.texturepack import TexturePack
from typing import Any
from dungeonbattle.game import Game, GameMode
from dungeonbattle.enums import DisplayAction
class DisplayManager:
@ -23,6 +24,12 @@ class DisplayManager:
self.update_game_components()
self.settingsmenudisplay.update_menu(self.game.settings_menu)
def handle_display_action(self, action:DisplayAction) -> None:
if action == DisplayAction.REFRESH:
self.refresh()
elif action == DisplayAction.UPDATE:
self.update_game_components()
def update_game_components(self) -> None:
for d in self.displays:
d.pack = TexturePack.get_pack(self.game.settings.TEXTURE_PACK)