Skip to content

Commit

Permalink
refactor(main): use GAME_DIR_PATH in runner
Browse files Browse the repository at this point in the history
  • Loading branch information
parsariyahi committed Dec 11, 2023
1 parent 47c38d5 commit dd41243
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion progature/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from progature.engine.core.game.manager import GameManager
from progature.gui import main_window, game_window, chapter_window, level_window, quest_window
from progature.settings.config import GAME_DIR_PATH

if __name__ == "__main__":

Expand All @@ -23,7 +24,8 @@
if values["_GAMES_"]:
game = values["_GAMES_"][0]
if game:
manager = GameManager(game.file_name)
path = Path(GAME_DIR_PATH) / game.file_name
manager = GameManager(path)
game_window(manager)
else:
pg.popup_error("Please select a chapter")
Expand Down
3 changes: 2 additions & 1 deletion progature/utils/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from progature.engine.core.game.loader import GameLoader
from progature.engine.components import Game
from progature.engine.structures import Pot
from progature.settings.config import GAME_DIR_PATH


def load_all_games() -> Pot[Game]:
path = Path("progature/db/games").glob("*.json")
path = Path(GAME_DIR_PATH).glob("*.json")
game_files = [file for file in path if file.is_file()]
game_lsit = []

Expand Down

0 comments on commit dd41243

Please sign in to comment.