Skip to content

Commit

Permalink
bugfix - add program_dir integration to map_item.py script
Browse files Browse the repository at this point in the history
  • Loading branch information
OcelotWalrus committed Jan 6, 2024
1 parent 3aca999 commit 2661efd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/map_item.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import colors
import yaml
import appdirs
from colorama import Fore, Back, Style, deinit, init
from colors import *

# initialize colorama
init()


def print_map(player, map, zone):
player_x = player["x"]
player_y = player["y"]
Expand Down Expand Up @@ -51,10 +53,11 @@ def print_map(player, map, zone):
print("╝")

def get_zone_color(zone_type):
program_dir = str(appdirs.user_config_dir(appname='Bane-Of-Wargs'))
global zone_color
zone_color = COLOR_BLACK
try:
with open('schemas/zones_colors.yaml', 'r') as f:
with open(program_dir + '/game/schemas/zones_colors.yaml', 'r') as f:
zones_colors = yaml.safe_load(f)
zone_code = zones_colors[str(zone_type)]
if zone_code == 0:
Expand Down

0 comments on commit 2661efd

Please sign in to comment.