From 2e54648ee6c4239c49a1620462b565fc4dcf4fe1 Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Sat, 16 Nov 2024 10:19:38 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8D=EF=B8=8F[Update]=20Model=20:=20Ove?= =?UTF-8?q?rlay=E3=81=AE=E8=B5=B7=E5=8B=95=E3=82=BF=E3=82=A4=E3=83=9F?= =?UTF-8?q?=E3=83=B3=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/models/overlay/overlay.py | 7 ++++++- src-python/webui_controller.py | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src-python/models/overlay/overlay.py b/src-python/models/overlay/overlay.py index b61213e3..b1ce865c 100644 --- a/src-python/models/overlay/overlay.py +++ b/src-python/models/overlay/overlay.py @@ -71,6 +71,7 @@ class Overlay: self.system = None self.overlay = None self.handle = None + self.init_process = False self.initialized = False self.loop = True self.thread_overlay = None @@ -109,6 +110,7 @@ class Overlay: size ) self.initialized = True + self.init_process = False except Exception as e: printLog("error:Could not initialise OpenVR", e) @@ -243,12 +245,15 @@ class Overlay: time.sleep(sleepTime) def main(self): + while self.checkSteamvrRunning() is False: + time.sleep(10) self.init() if self.initialized is True: self.mainloop() def startOverlay(self): - if self.checkSteamvrRunning() and self.initialized is False: + if self.initialized is False and self.init_process is False: + self.init_process = True self.thread_overlay = Thread(target=self.main) self.thread_overlay.daemon = True self.thread_overlay.start() diff --git a/src-python/webui_controller.py b/src-python/webui_controller.py index b73a5e45..3c83b626 100644 --- a/src-python/webui_controller.py +++ b/src-python/webui_controller.py @@ -1354,8 +1354,6 @@ class Controller: def setEnableTranscriptionSend(self, *args, **kwargs) -> dict: self.startThreadingTranscriptionSendMessage() config.ENABLE_TRANSCRIPTION_SEND = True - if config.OVERLAY_LARGE_LOG is True: - model.startOverlay() return {"status":200, "result":config.ENABLE_TRANSCRIPTION_SEND} def setDisableTranscriptionSend(self, *args, **kwargs) -> dict: @@ -1365,8 +1363,6 @@ class Controller: def setEnableTranscriptionReceive(self, *args, **kwargs) -> dict: self.startThreadingTranscriptionReceiveMessage() - if (config.OVERLAY_SMALL_LOG is True or config.OVERLAY_LARGE_LOG is True): - model.startOverlay() config.ENABLE_TRANSCRIPTION_RECEIVE = True return {"status":200, "result":config.ENABLE_TRANSCRIPTION_RECEIVE} @@ -1763,6 +1759,10 @@ class Controller: if config.AUTO_SPEAKER_SELECT is True: self.setEnableAutoSpeakerSelect() + printLog("Init Overlay") + if (config.OVERLAY_SMALL_LOG is True or config.OVERLAY_LARGE_LOG is True): + model.startOverlay() + self.updateConfigSettings() printLog("End Initialization")