Skip to content

Commit

Permalink
Merge pull request #18 from Ben-Ryder/saved-path-error
Browse files Browse the repository at this point in the history
Fixing #3 and #8 in a more thorough way.
  • Loading branch information
ben-ryder authored Aug 30, 2021
2 parents 198c7b8 + 050fc6c commit e1b1229
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 8 additions & 8 deletions paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
dataPath = os.getcwd() + os.sep + "data" + os.sep
assetPath = os.getcwd() + os.sep + "assets" + os.sep

gamePath = dataPath + os.sep + "saved" + os.sep
mapPath = dataPath + os.sep + "maps" + os.sep
gamePath = dataPath + "saved" + os.sep
mapPath = dataPath + "maps" + os.sep

fontPath = assetPath + os.sep + "fonts" + os.sep
fontPath = assetPath + "fonts" + os.sep
imagePath = assetPath + "images" + os.sep

tilePath = imagePath + os.sep + "tiles" + os.sep
unitPath = imagePath + os.sep + "units" + os.sep
tilePath = imagePath + "tiles" + os.sep
unitPath = imagePath + "units" + os.sep

uiPath = imagePath + os.sep + "UI" + os.sep # general, throughout sections.
uiMenuPath = imagePath + os.sep + "menu" + os.sep
uiGamePath = imagePath + os.sep + "game" + os.sep
uiPath = imagePath + "UI" + os.sep # general, throughout sections.
uiMenuPath = imagePath + "menu" + os.sep
uiGamePath = imagePath + "game" + os.sep


3 changes: 3 additions & 0 deletions project/menus/loadgame.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ def __init__(self, control, origin):
self.origin = origin
self.max_amount = 6 # split into lists of amount (pages of so many games)

# Create game save directory if it doesn't exist.
os.makedirs(paths.gamePath, exist_ok=True)

# Load Game Names From Directory
self.games = sorted([file for file in os.listdir(paths.gamePath)])
try:
Expand Down

0 comments on commit e1b1229

Please sign in to comment.