I am sure I had fixed this once already, must have forgotten to copy over the code. Make Windows not rely on the DoomTTS.ps1 script.

This commit is contained in:
Storm Dragon 2025-01-11 15:37:58 -05:00
parent 9dd3d49174
commit fc53c8be24

View File

@ -1659,20 +1659,37 @@ class DoomLauncher(QMainWindow):
try:
if platform.system() == "Windows":
configFile = Path.cwd() / 'TobyConfig.ini'
# For Windows, pipe directly to PowerShell running DoomTTS.ps1
# For Windows, use unbuffered stdout for accessible_output2
cmdLine = [gzdoomPath, "-stdout", "-config", str(configFile),
"-iwad", iwadPath, "-file"] + gameFiles
if gameFlags:
cmdLine.extend(gameFlags)
fullCmd = " ".join(cmdLine) + " | powershell -ExecutionPolicy Bypass -File DoomTTS.ps1"
# Use CREATE_NO_WINDOW flag to prevent console window
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
startupinfo.wShowWindow = subprocess.SW_HIDE
process = subprocess.Popen(
fullCmd,
cmdLine,
cwd=str(self.gamePath),
shell=True
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
bufsize=1,
text=True,
env=dict(os.environ, PYTHONUNBUFFERED="1"),
startupinfo=startupinfo
)
# Monitor thread only for Windows
# Start speech processing thread for Windows
speechThread = threading.Thread(
target=self.speechHandler.speak_thread,
args=(process,),
daemon=True
)
speechThread.start()
# Monitor thread
monitorThread = threading.Thread(
target=self.monitor_game_process,
args=(process,),