Merge branch 'startup_osc_enabled_check' into UI_2.0

This commit is contained in:
Sakamoto Shiina
2023-09-17 08:37:05 +09:00
4 changed files with 32 additions and 23 deletions

View File

@@ -389,13 +389,14 @@ class Config:
self._ENABLE_OSC = value self._ENABLE_OSC = value
@property @property
def ENABLE_OSC_ERROR_LOG(self): def STARTUP_OSC_ENABLED_CHECK(self):
return self._ENABLE_OSC_ERROR_LOG return self._STARTUP_OSC_ENABLED_CHECK
@ENABLE_OSC_ERROR_LOG.setter @STARTUP_OSC_ENABLED_CHECK.setter
def ENABLE_OSC_ERROR_LOG(self, value): def STARTUP_OSC_ENABLED_CHECK(self, value):
if type(value) is bool: if type(value) is bool:
self._ENABLE_OSC_ERROR_LOG = value self._STARTUP_OSC_ENABLED_CHECK = value
saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value)
@property @property
def UPDATE_FLAG(self): def UPDATE_FLAG(self):
@@ -516,7 +517,7 @@ class Config:
self._ENABLE_AUTO_CLEAR_MESSAGE_BOX = False self._ENABLE_AUTO_CLEAR_MESSAGE_BOX = False
self._ENABLE_NOTICE_XSOVERLAY = False self._ENABLE_NOTICE_XSOVERLAY = False
self._ENABLE_OSC = False self._ENABLE_OSC = False
self._ENABLE_OSC_ERROR_LOG = True self._STARTUP_OSC_ENABLED_CHECK = True
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 = [

View File

@@ -32,7 +32,7 @@ def sendMicMessage(message):
osc_message = message osc_message = message
model.oscSendMessage(osc_message) model.oscSendMessage(osc_message)
else: else:
if config.ENABLE_OSC_ERROR_LOG is True: if config.STARTUP_OSC_ENABLED_CHECK is True:
view.printToTextbox_OSCError() view.printToTextbox_OSCError()
view.printToTextbox_SentMessage(message, translation) view.printToTextbox_SentMessage(message, translation)
@@ -131,7 +131,7 @@ def sendChatMessage(message):
osc_message = message osc_message = message
model.oscSendMessage(osc_message) model.oscSendMessage(osc_message)
else: else:
if config.ENABLE_OSC_ERROR_LOG is True: if config.STARTUP_OSC_ENABLED_CHECK is True:
view.printToTextbox_OSCError() view.printToTextbox_OSCError()
# update textbox message log # update textbox message log
@@ -516,6 +516,9 @@ def callbackSetMessageFormat(value):
if len(value) > 0: if len(value) > 0:
config.MESSAGE_FORMAT = value config.MESSAGE_FORMAT = value
def callbackSetStartupOscEnabledCheck(value):
print("callbackSetStartupOscEnabledCheck", value)
config.STARTUP_OSC_ENABLED_CHECK = value
# Advanced Settings Tab # Advanced Settings Tab
def callbackSetOscIpAddress(value): def callbackSetOscIpAddress(value):
@@ -622,6 +625,8 @@ view.register(
"callback_set_enable_auto_export_message_logs": callbackSetEnableAutoExportMessageLogs, "callback_set_enable_auto_export_message_logs": callbackSetEnableAutoExportMessageLogs,
"callback_set_message_format": callbackSetMessageFormat, "callback_set_message_format": callbackSetMessageFormat,
"callback_set_startup_osc_enabled_check": callbackSetStartupOscEnabledCheck,
# Advanced Settings Tab # Advanced Settings Tab
"callback_set_osc_ip_address": callbackSetOscIpAddress, "callback_set_osc_ip_address": callbackSetOscIpAddress,
"callback_set_osc_port": callbackSetOscPort, "callback_set_osc_port": callbackSetOscPort,

12
view.py
View File

@@ -251,10 +251,10 @@ class View():
CALLBACK_SET_ENABLE_OSC=None, CALLBACK_SET_ENABLE_OSC=None,
VAR_ENABLE_OSC=BooleanVar(value=config.ENABLE_OSC), VAR_ENABLE_OSC=BooleanVar(value=config.ENABLE_OSC),
VAR_LABEL_ENABLE_OSC_ERROR_LOG=StringVar(value="Ignore The OSC Error Message"), VAR_LABEL_STARTUP_OSC_ENABLED_CHECK=StringVar(value="Check If OSC Is Enabled At Startup"),
VAR_DESC_ENABLE_OSC_ERROR_LOG=StringVar(value="Remember to turn on OSC yourself when you want to use it and send messages to VRChat."), VAR_DESC_STARTUP_OSC_ENABLED_CHECK=StringVar(value="Every time VRCT is started up, your character in VRChat moves forward ever so slightly. If your character is seated, they might even stand up. Unfortunately, this is the only method we've found to check if OSC is enabled at startup... Sorry about that. (Remember to turn on OSC yourself when you want to send messages to VRChat.)"),
CALLBACK_SET_ENABLE_OSC_ERROR_LOG=None, CALLBACK_SET_STARTUP_OSC_ENABLED_CHECK=None,
VAR_ENABLE_OSC_ERROR_LOG=BooleanVar(value=config.ENABLE_OSC_ERROR_LOG), VAR_STARTUP_OSC_ENABLED_CHECK=BooleanVar(value=config.STARTUP_OSC_ENABLED_CHECK),
@@ -377,6 +377,8 @@ class View():
self.view_variable.CALLBACK_SET_ENABLE_AUTO_EXPORT_MESSAGE_LOGS = config_window_registers.get("callback_set_enable_auto_export_message_logs", None) self.view_variable.CALLBACK_SET_ENABLE_AUTO_EXPORT_MESSAGE_LOGS = config_window_registers.get("callback_set_enable_auto_export_message_logs", None)
self.view_variable.CALLBACK_SET_MESSAGE_FORMAT = config_window_registers.get("callback_set_message_format", None) self.view_variable.CALLBACK_SET_MESSAGE_FORMAT = config_window_registers.get("callback_set_message_format", None)
self.view_variable.CALLBACK_SET_STARTUP_OSC_ENABLED_CHECK = config_window_registers.get("callback_set_startup_osc_enabled_check", None)
# Advanced Settings Tab # Advanced Settings Tab
self.view_variable.CALLBACK_SET_OSC_IP_ADDRESS = config_window_registers.get("callback_set_osc_ip_address", None) self.view_variable.CALLBACK_SET_OSC_IP_ADDRESS = config_window_registers.get("callback_set_osc_ip_address", None)
self.view_variable.CALLBACK_SET_OSC_PORT = config_window_registers.get("callback_set_osc_port", None) self.view_variable.CALLBACK_SET_OSC_PORT = config_window_registers.get("callback_set_osc_port", None)
@@ -462,7 +464,7 @@ class View():
self._printToTextbox_Info("Auth Key is incorrect or Usage limit reached") self._printToTextbox_Info("Auth Key is incorrect or Usage limit reached")
def printToTextbox_OSCError(self): def printToTextbox_OSCError(self):
self._printToTextbox_Info("OSC is not enabled, please enable OSC and rejoin") self._printToTextbox_Info("OSC is not enabled, please enable OSC and rejoin. or turn off the \"Send Message To VRChat\" setting")
def printToTextbox_DetectedByWordFilter(self, detected_message): def printToTextbox_DetectedByWordFilter(self, detected_message):
self._printToTextbox_Info(f"Detect WordFilter :{detected_message}") self._printToTextbox_Info(f"Detect WordFilter :{detected_message}")

View File

@@ -21,8 +21,8 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v
def checkbox_enable_osc_callback(checkbox_box_widget): def checkbox_enable_osc_callback(checkbox_box_widget):
callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_OSC, checkbox_box_widget.get()) callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_OSC, checkbox_box_widget.get())
def checkbox_enable_osc_error_log_callback(checkbox_box_widget): def checkbox_startup_osc_enabled_check_callback(checkbox_box_widget):
callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_OSC_ERROR_LOG, checkbox_box_widget.get()) callFunctionIfCallable(view_variable.CALLBACK_SET_STARTUP_OSC_ENABLED_CHECK, checkbox_box_widget.get())
def entry_message_format_callback(value): def entry_message_format_callback(value):
callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY, value) callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY, value)
@@ -89,13 +89,14 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v
config_window.sb__enable_osc.grid(row=row) config_window.sb__enable_osc.grid(row=row)
row+=1 row+=1
config_window.sb__enable_osc_error_log = createSettingBoxCheckbox( config_window.sb__startup_osc_enabled_check = createSettingBoxCheckbox(
parent_widget=setting_box_wrapper, parent_widget=setting_box_wrapper,
for_var_label_text=view_variable.VAR_LABEL_ENABLE_OSC_ERROR_LOG, for_var_label_text=view_variable.VAR_LABEL_STARTUP_OSC_ENABLED_CHECK,
for_var_desc_text=view_variable.VAR_DESC_ENABLE_OSC_ERROR_LOG, for_var_desc_text=view_variable.VAR_DESC_STARTUP_OSC_ENABLED_CHECK,
checkbox_attr_name="sb__checkbox_enable_osc_error_log", checkbox_attr_name="sb__checkbox_startup_osc_enabled_check",
command=lambda: checkbox_enable_osc_error_log_callback(config_window.sb__checkbox_enable_osc_error_log), command=lambda: checkbox_startup_osc_enabled_check_callback(config_window.sb__checkbox_startup_osc_enabled_check),
variable=view_variable.VAR_ENABLE_OSC_ERROR_LOG, variable=view_variable.VAR_STARTUP_OSC_ENABLED_CHECK,
) )
config_window.sb__enable_osc_error_log.grid(row=row) config_window.sb__startup_osc_enabled_check.grid(row=row)
row+=1 row+=1