🎨 Improved structure / added debug info

This commit is contained in:
GeoffreyCoulaud
2023-05-28 22:19:43 +02:00
parent e7fa20e4d4
commit aeab1de4a9
2 changed files with 19 additions and 6 deletions

View File

@@ -84,12 +84,7 @@ class CartridgesApplication(Adw.Application):
shared.store = Store()
shared.store.add_manager(DisplayManager())
# Load games from disk
if shared.games_dir.exists():
for game_file in shared.games_dir.iterdir():
data = json.load(game_file.open())
game = Game(data, allow_side_effects=False)
shared.store.add_game(game)
self.load_games_from_disk()
# Add rest of the managers for game imports
shared.store.add_manager(SteamAPIManager())
@@ -135,6 +130,13 @@ class CartridgesApplication(Adw.Application):
self.win.present()
def load_games_from_disk(self):
if shared.games_dir.exists():
for game_file in shared.games_dir.iterdir():
data = json.load(game_file.open())
game = Game(data, allow_side_effects=False)
shared.store.add_game(game)
def on_about_action(self, *_args):
about = Adw.AboutWindow(
transient_for=self.win,