👍[Update] OSCの有効性のエラーログの表示を起動時のみに変更
This commit is contained in:
20
config.py
20
config.py
@@ -379,15 +379,6 @@ class Config:
|
|||||||
self._ENABLE_NOTICE_XSOVERLAY = value
|
self._ENABLE_NOTICE_XSOVERLAY = value
|
||||||
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
|
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
|
||||||
|
|
||||||
@property
|
|
||||||
def ENABLE_OSC(self):
|
|
||||||
return self._ENABLE_OSC
|
|
||||||
|
|
||||||
@ENABLE_OSC.setter
|
|
||||||
def ENABLE_OSC(self, value):
|
|
||||||
if type(value) is bool:
|
|
||||||
self._ENABLE_OSC = value
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ENABLE_SEND_MESSAGE_TO_VRC(self):
|
def ENABLE_SEND_MESSAGE_TO_VRC(self):
|
||||||
return self._ENABLE_SEND_MESSAGE_TO_VRC
|
return self._ENABLE_SEND_MESSAGE_TO_VRC
|
||||||
@@ -408,6 +399,15 @@ class Config:
|
|||||||
self._STARTUP_OSC_ENABLED_CHECK = value
|
self._STARTUP_OSC_ENABLED_CHECK = value
|
||||||
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
|
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def IS_VALID_OSC(self):
|
||||||
|
return self._IS_VALID_OSC
|
||||||
|
|
||||||
|
@IS_VALID_OSC.setter
|
||||||
|
def IS_VALID_OSC(self, value):
|
||||||
|
if type(value) is bool:
|
||||||
|
self._IS_VALID_OSC = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def UPDATE_FLAG(self):
|
def UPDATE_FLAG(self):
|
||||||
return self._UPDATE_FLAG
|
return self._UPDATE_FLAG
|
||||||
@@ -526,9 +526,9 @@ class Config:
|
|||||||
self._MESSAGE_FORMAT = "[message]([translation])"
|
self._MESSAGE_FORMAT = "[message]([translation])"
|
||||||
self._ENABLE_AUTO_CLEAR_MESSAGE_BOX = True
|
self._ENABLE_AUTO_CLEAR_MESSAGE_BOX = True
|
||||||
self._ENABLE_NOTICE_XSOVERLAY = False
|
self._ENABLE_NOTICE_XSOVERLAY = False
|
||||||
self._ENABLE_OSC = False
|
|
||||||
self._ENABLE_SEND_MESSAGE_TO_VRC = True
|
self._ENABLE_SEND_MESSAGE_TO_VRC = True
|
||||||
self._STARTUP_OSC_ENABLED_CHECK = True
|
self._STARTUP_OSC_ENABLED_CHECK = True
|
||||||
|
self._IS_VALID_OSC = False
|
||||||
self._UPDATE_FLAG = False
|
self._UPDATE_FLAG = False
|
||||||
self._GITHUB_URL = "https://api.github.com/repos/misyaguziya/VRCT/releases/latest"
|
self._GITHUB_URL = "https://api.github.com/repos/misyaguziya/VRCT/releases/latest"
|
||||||
# self._BREAK_KEYSYM_LIST = [
|
# self._BREAK_KEYSYM_LIST = [
|
||||||
|
|||||||
20
main.py
20
main.py
@@ -25,16 +25,13 @@ def sendMicMessage(message):
|
|||||||
translation = ""
|
translation = ""
|
||||||
|
|
||||||
if config.ENABLE_TRANSCRIPTION_SEND is True:
|
if config.ENABLE_TRANSCRIPTION_SEND is True:
|
||||||
if config.ENABLE_OSC is True:
|
if config.ENABLE_SEND_MESSAGE_TO_VRC is True:
|
||||||
if len(translation) > 0:
|
if len(translation) > 0:
|
||||||
osc_message = config.MESSAGE_FORMAT.replace("[message]", message)
|
osc_message = config.MESSAGE_FORMAT.replace("[message]", message)
|
||||||
osc_message = osc_message.replace("[translation]", translation)
|
osc_message = osc_message.replace("[translation]", translation)
|
||||||
else:
|
else:
|
||||||
osc_message = message
|
osc_message = message
|
||||||
model.oscSendMessage(osc_message)
|
model.oscSendMessage(osc_message)
|
||||||
else:
|
|
||||||
if config.STARTUP_OSC_ENABLED_CHECK is True:
|
|
||||||
view.printToTextbox_OSCError()
|
|
||||||
|
|
||||||
view.printToTextbox_SentMessage(message, translation)
|
view.printToTextbox_SentMessage(message, translation)
|
||||||
if config.ENABLE_LOGGER is True:
|
if config.ENABLE_LOGGER is True:
|
||||||
@@ -124,16 +121,13 @@ def sendChatMessage(message):
|
|||||||
translation = ""
|
translation = ""
|
||||||
|
|
||||||
# send OSC message
|
# send OSC message
|
||||||
if config.ENABLE_OSC is True:
|
if config.ENABLE_SEND_MESSAGE_TO_VRC is True:
|
||||||
if len(translation) > 0:
|
if len(translation) > 0:
|
||||||
osc_message = config.MESSAGE_FORMAT.replace("[message]", message)
|
osc_message = config.MESSAGE_FORMAT.replace("[message]", message)
|
||||||
osc_message = osc_message.replace("[translation]", translation)
|
osc_message = osc_message.replace("[translation]", translation)
|
||||||
else:
|
else:
|
||||||
osc_message = message
|
osc_message = message
|
||||||
model.oscSendMessage(osc_message)
|
model.oscSendMessage(osc_message)
|
||||||
else:
|
|
||||||
if config.STARTUP_OSC_ENABLED_CHECK is True:
|
|
||||||
view.printToTextbox_OSCError()
|
|
||||||
|
|
||||||
# update textbox message log
|
# update textbox message log
|
||||||
view.printToTextbox_SentMessage(message, translation)
|
view.printToTextbox_SentMessage(message, translation)
|
||||||
@@ -197,8 +191,8 @@ def callbackSelectedLanguagePresetTab(selected_tab_no):
|
|||||||
def callbackSetAuthKeys(keys):
|
def callbackSetAuthKeys(keys):
|
||||||
config.AUTH_KEYS = keys
|
config.AUTH_KEYS = keys
|
||||||
|
|
||||||
def callbackChangeStatusOSC(value):
|
def callbackChangeStatusIsValidOSC(value):
|
||||||
config.ENABLE_OSC = value
|
config.IS_VALID_OSC = value
|
||||||
|
|
||||||
def callbackChangeStatusSoftwareUpdated(value):
|
def callbackChangeStatusSoftwareUpdated(value):
|
||||||
config.UPDATE_FLAG = value
|
config.UPDATE_FLAG = value
|
||||||
@@ -554,7 +548,11 @@ if model.authenticationTranslator(callbackSetAuthKeys) is False:
|
|||||||
model.addKeywords()
|
model.addKeywords()
|
||||||
|
|
||||||
# check OSC started
|
# check OSC started
|
||||||
model.checkOSCStarted(callbackChangeStatusOSC)
|
if config.STARTUP_OSC_ENABLED_CHECK is True:
|
||||||
|
model.checkOSCStarted(callbackChangeStatusIsValidOSC)
|
||||||
|
sleep(2)
|
||||||
|
if config.IS_VALID_OSC is False:
|
||||||
|
view.printToTextbox_OSCError()
|
||||||
|
|
||||||
# check Software Updated
|
# check Software Updated
|
||||||
model.checkSoftwareUpdated(callbackChangeStatusSoftwareUpdated)
|
model.checkSoftwareUpdated(callbackChangeStatusSoftwareUpdated)
|
||||||
|
|||||||
2
model.py
2
model.py
@@ -180,7 +180,7 @@ class Model:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def checkOSCStarted(fnc):
|
def checkOSCStarted(fnc):
|
||||||
def checkOscReceive(address, osc_arguments):
|
def checkOscReceive(address, osc_arguments):
|
||||||
if config.ENABLE_OSC is False:
|
if config.IS_VALID_OSC is False:
|
||||||
fnc(True)
|
fnc(True)
|
||||||
|
|
||||||
# start receive osc
|
# start receive osc
|
||||||
|
|||||||
Reference in New Issue
Block a user