1import os 2 3# import pygame 4from fsbc.user import get_home_dir, get_documents_dir 5from fsbc.system import windows 6from fsbc.util import memoize 7 8 9@memoize 10def get_fullscreen_size(): 11 # pygame.display.init() 12 # display_info = pygame.display.Info() 13 # size = (display_info.current_w, display_info.current_h) 14 # print("fullscreen size:", size) 15 # return size 16 pass 17 18 19class Settings(object): 20 cache_dir_path = None 21 games_dir_path = None 22 profile_dir_path = None 23 # use_fullscreen = False 24 25 if windows: 26 # fullscreen_menu = False 27 window_decorations = False 28 else: 29 # fullscreen_menu = True 30 window_decorations = True 31 32 fullscreen_menu = True 33 fullscreen_game = True 34 # windowed_size = (640, 480) 35 windowed_size = None # Maximized 36 fullscreen_size = get_fullscreen_size() 37 fullscreen_pos = 0, 0 38 39 @classmethod 40 def get_games_path(cls): 41 path = [] 42 if cls.games_dir_path: 43 path.extend(cls.games_dir_path) 44 elif windows: 45 path.append( 46 os.path.join(get_documents_dir(), "Games (Ku Game System)") 47 ) 48 else: 49 path.append(os.path.join(get_home_dir(), "Games")) 50 return path 51 52 @classmethod 53 def get_resources_dir(cls): 54 path = os.path.join(cls.get_games_path()[0], "Resources") 55 return path 56 57 @classmethod 58 def get_config_dir(cls): 59 pass 60 61 @classmethod 62 def get_profile_dir(cls): 63 if cls.profile_dir_path: 64 return cls.profile_dir_path 65 elif windows: 66 return os.path.join( 67 get_documents_dir(), "Gamer Profile (Ku Game System)" 68 ) 69 else: 70 return os.path.join( 71 get_home_dir(), "Gamer Profile (Ku Game System)" 72 ) 73