Skip to content

Commit b423b92

Browse files
authored
Update game_manager.py
1 parent a078195 commit b423b92

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

source-code/game_manager.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,20 @@
33
import shutil
44
import logging
55
from config_manager import ConfigManager
6-
76
class GameManager:
87
def __init__(self, proton_manager):
98
self.proton_manager = proton_manager
109
self.config_manager = ConfigManager()
11-
1210
def add_game(self, game):
1311
games = self.config_manager.load_games()
1412
games.append(game)
1513
self.config_manager.save_games(games)
1614
logging.info(f"Added game: {game['name']}")
17-
1815
def remove_game(self, name):
1916
games = self.config_manager.load_games()
2017
games = [g for g in games if g['name'] != name]
2118
self.config_manager.save_games(games)
2219
logging.info(f"Removed game: {name}")
23-
2420
def launch_game(self, game, gamescope=False):
2521
runner = game['runner']
2622
exe = game['exe']
@@ -109,13 +105,13 @@ def launch_game(self, game, gamescope=False):
109105
cmd.extend(['steam', '-applaunch', app_id] + launch_options)
110106
else:
111107
raise Exception("Steam or Flatpak not installed. Please install Steam (e.g., flatpak install flathub com.valvesoftware.Steam).")
112-
else: # Proton
108+
else: # Proton
113109
proton_bin = self.proton_manager.get_proton_path(runner)
114110
if not os.path.exists(proton_bin):
115111
raise Exception(f"Proton binary not found for {runner}")
116112
# Set up Steam environment for Proton
117113
steam_dir = os.path.expanduser('~/.local/share/Steam')
118-
os.makedirs(os.path.join(steam_dir, 'steamapps/compatdata'), exist_ok=True) # Ensure Steam structure
114+
os.makedirs(os.path.join(steam_dir, 'steamapps/compatdata'), exist_ok=True) # Ensure Steam structure
119115
env['STEAM_COMPAT_CLIENT_INSTALL_PATH'] = steam_dir
120116
env['STEAM_COMPAT_DATA_PATH'] = prefix
121117
env['STEAM_RUNTIME'] = os.path.join(steam_dir, 'ubuntu12_32/steam-runtime')

0 commit comments

Comments
 (0)