Merge branch 'overlay_reversion' into develop

# Conflicts:
#	model.py
This commit is contained in:
misyaguziya
2024-05-08 11:07:22 +09:00
3 changed files with 254 additions and 311 deletions

View File

@@ -27,10 +27,10 @@ def callbackFilepathConfigFile():
def callbackQuitVrct():
setMainWindowGeometry()
# def callbackEnableEasterEgg():
# config.IS_EASTER_EGG_ENABLED = True
# config.OVERLAY_UI_TYPE = "sakura"
# view.printToTextbox_enableEasterEgg()
def callbackEnableEasterEgg():
config.IS_EASTER_EGG_ENABLED = True
config.OVERLAY_UI_TYPE = "sakura"
view.printToTextbox_enableEasterEgg()
def setMainWindowGeometry():
PRE_SCALING_INT = strPctToInt(view.getPreUiScaling())
@@ -161,14 +161,12 @@ def receiveSpeakerMessage(message):
xsoverlay_message = messageFormatter("RECEIVED", translation, message)
model.notificationXSOverlay(xsoverlay_message)
# if model.overlay.initialized is False:
# model.startOverlay()
# else:
# if config.ENABLE_OVERLAY_SMALL_LOG is True:
# overlay_image = model.createOverlayImageShort(message, translation)
# model.updateOverlay(overlay_image)
# # overlay_image = model.createOverlayImageLong("receive", message, translation)
# # model.updateOverlay(overlay_image)
if config.ENABLE_OVERLAY_SMALL_LOG is True:
if model.overlay.initialized is True:
overlay_image = model.createOverlayImageShort(message, translation)
model.updateOverlay(overlay_image)
# overlay_image = model.createOverlayImageLong("receive", message, translation)
# model.updateOverlay(overlay_image)
# ------------Speaker2Chatbox------------
if config.ENABLE_SPEAKER2CHATBOX is True:
@@ -427,6 +425,12 @@ def callbackToggleTranscriptionReceive(is_turned_on):
stopThreadingTranscriptionReceiveMessage()
view.changeTranscriptionDisplayStatus("SPEAKER_OFF")
if config.ENABLE_TRANSCRIPTION_RECEIVE is True and config.ENABLE_OVERLAY_SMALL_LOG is True:
if model.overlay.initialized is False and model.overlay.checkSteamvrRunning() is True:
model.startOverlay()
elif config.ENABLE_TRANSCRIPTION_RECEIVE is False:
pass
def callbackToggleForeground(is_turned_on):
config.ENABLE_FOREGROUND = is_turned_on
if config.ENABLE_FOREGROUND is True:
@@ -858,44 +862,44 @@ def callbackSetWhisperWeightType(value):
config.SELECTED_TRANSCRIPTION_ENGINE = "Google"
view.showRestartButtonIfRequired()
# # VR Tab
# def callbackSetOverlaySettings(value, set_type:str):
# print("callbackSetOverlaySettings", value, set_type)
# pre_settings = config.OVERLAY_SETTINGS
# pre_settings[set_type] = value
# config.OVERLAY_SETTINGS = pre_settings
# match (set_type):
# case "opacity":
# model.updateOverlayImageOpacity()
# case "ui_scaling":
# model.updateOverlayImageUiScaling()
# VR Tab
def callbackSetOverlaySettings(value, set_type:str):
print("callbackSetOverlaySettings", value, set_type)
pre_settings = config.OVERLAY_SETTINGS
pre_settings[set_type] = value
config.OVERLAY_SETTINGS = pre_settings
match (set_type):
case "opacity":
model.updateOverlayImageOpacity()
case "ui_scaling":
model.updateOverlayImageUiScaling()
# def callbackSetEnableOverlaySmallLog(value):
# print("callbackSetEnableOverlaySmallLog", value)
# config.ENABLE_OVERLAY_SMALL_LOG = value
def callbackSetEnableOverlaySmallLog(value):
print("callbackSetEnableOverlaySmallLog", value)
config.ENABLE_OVERLAY_SMALL_LOG = value
# if config.ENABLE_OVERLAY_SMALL_LOG is True:
# pass
# else:
# if model.overlay.initialized is True:
# model.clearOverlayImage()
if config.ENABLE_OVERLAY_SMALL_LOG is True and config.ENABLE_TRANSCRIPTION_RECEIVE is True:
if model.overlay.initialized is False and model.overlay.checkSteamvrRunning() is True:
model.startOverlay()
elif config.ENABLE_OVERLAY_SMALL_LOG is False:
pass
# def callbackSetOverlaySmallLogSettings(value, set_type:str):
# print("callbackSetOverlaySmallLogSettings", value, set_type)
# pre_settings = config.OVERLAY_SMALL_LOG_SETTINGS
# pre_settings[set_type] = value
# config.OVERLAY_SMALL_LOG_SETTINGS = pre_settings
# match (set_type):
# case "x_pos":
# model.updateOverlayPosition()
# case "y_pos":
# model.updateOverlayPosition()
# case "depth":
# model.updateOverlayPosition()
# case "display_duration":
# model.updateOverlayTimes()
# case "fadeout_duration":
# model.updateOverlayTimes()
def callbackSetOverlaySmallLogSettings(value, set_type:str):
print("callbackSetOverlaySmallLogSettings", value, set_type)
pre_settings = config.OVERLAY_SMALL_LOG_SETTINGS
pre_settings[set_type] = value
config.OVERLAY_SMALL_LOG_SETTINGS = pre_settings
match (set_type):
case "x_pos":
model.updateOverlayPosition()
case "y_pos":
model.updateOverlayPosition()
case "depth":
model.updateOverlayPosition()
case "display_duration":
model.updateOverlayTimes()
case "fadeout_duration":
model.updateOverlayTimes()
# Others Tab
def callbackSetEnableAutoClearMessageBox(value):
@@ -1062,7 +1066,7 @@ def createMainWindow(splash):
# set UI and callback
view.register(
common_registers={
# "callback_enable_easter_egg": callbackEnableEasterEgg,
"callback_enable_easter_egg": callbackEnableEasterEgg,
"callback_update_software": callbackUpdateSoftware,
"callback_restart_software": callbackRestartSoftware,
@@ -1150,10 +1154,10 @@ def createMainWindow(splash):
"callback_set_use_whisper_feature": callbackSetUserWhisperFeature,
"callback_set_whisper_weight_type": callbackSetWhisperWeightType,
# # VR Tab
# "callback_set_overlay_settings": callbackSetOverlaySettings,
# "callback_set_enable_overlay_small_log": callbackSetEnableOverlaySmallLog,
# "callback_set_overlay_small_log_settings": callbackSetOverlaySmallLogSettings,
# VR Tab
"callback_set_overlay_settings": callbackSetOverlaySettings,
"callback_set_enable_overlay_small_log": callbackSetEnableOverlaySmallLog,
"callback_set_overlay_small_log_settings": callbackSetOverlaySmallLogSettings,
# Others Tab
"callback_set_enable_auto_clear_chatbox": callbackSetEnableAutoClearMessageBox,