Completed another major overhaul - hopefully
This commit is contained in:
parent
ac050d6627
commit
6b6cacbecd
2 changed files with 13 additions and 16 deletions
|
|
@ -23,7 +23,7 @@ import pygame
|
|||
shutdown_event = threading.Event()
|
||||
|
||||
# ========================= CONFIG =========================
|
||||
DEBUG = False # Set True to enable debug overrides
|
||||
DEBUG = True # Set True to enable debug overrides
|
||||
|
||||
# Default paths (used if not in debug mode)
|
||||
DEFAULT_WIN_GAME_EXE = r"./qgame.dll"
|
||||
|
|
@ -621,11 +621,11 @@ def game_launch(gameargs):
|
|||
pygame.mixer.init()
|
||||
|
||||
# Start playlist watcher thread
|
||||
playlist_thread = threading.Thread(target=playlist_watcher,args=(playlist_path,), daemon=False)
|
||||
playlist_thread = threading.Thread(target=playlist_watcher,args=(playlist_path,))
|
||||
playlist_thread.start()
|
||||
|
||||
# Start track watcher thread
|
||||
watcher_thread = threading.Thread(target=track_watcher, daemon=False)
|
||||
watcher_thread = threading.Thread(target=track_watcher)
|
||||
watcher_thread.start()
|
||||
|
||||
chosen_mod = None
|
||||
|
|
@ -646,11 +646,11 @@ def game_launch(gameargs):
|
|||
master_fd = None
|
||||
|
||||
# Start monitoring in background thread
|
||||
monitor_thread = threading.Thread(target=monitor_game, args=(pty_proc,), daemon=False)
|
||||
monitor_thread = threading.Thread(target=monitor_game, args=(pty_proc,))
|
||||
monitor_thread.start()
|
||||
|
||||
else:
|
||||
os.environ['TERM'] = 'xterm'
|
||||
os.environ['TERM'] = 'xterm' # I can't believe this fixed tty console output in linux
|
||||
master_fd, slave_fd = pty.openpty()
|
||||
|
||||
pty_proc = subprocess.Popen(
|
||||
|
|
@ -664,7 +664,7 @@ def game_launch(gameargs):
|
|||
os.close(slave_fd)
|
||||
|
||||
# Start monitoring in background thread
|
||||
monitor_thread = threading.Thread(target=monitor_game_pty, args=(master_fd,), daemon=False)
|
||||
monitor_thread = threading.Thread(target=monitor_game_pty, args=(master_fd,))
|
||||
monitor_thread.start()
|
||||
|
||||
# Monitor the game output
|
||||
|
|
@ -677,10 +677,7 @@ def game_launch(gameargs):
|
|||
|
||||
# Small sleep to prevent busy waiting
|
||||
time.sleep(0.1)
|
||||
# if os.name == "nt":
|
||||
# monitor_game(pty_proc)
|
||||
# else:
|
||||
# monitor_game_pty(master_fd)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("Exiting...")
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue