From 7a8aa701d2355dc5835e53a410f0fd549f6d567a Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Sun, 17 Sep 2023 08:34:19 +0900 Subject: [PATCH] =?UTF-8?q?[Update]=20=E5=A4=89=E6=95=B0=E5=90=8D=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=A8=E3=81=9D=E3=82=8C=E3=81=AB=E5=90=88=E3=82=8F?= =?UTF-8?q?=E3=81=9B=E3=81=A6UI=E3=81=AE=E6=96=87=E8=A8=80=E8=AA=BF?= =?UTF-8?q?=E6=95=B4=20ENABLE=5FOSC=5FERROR=5FLOG=20->=20STARTUP=5FOSC=5FE?= =?UTF-8?q?NABLED=5FCHECK=20VRCT=E8=B5=B7=E5=8B=95=E6=99=82=E3=81=ABOSC?= =?UTF-8?q?=E3=81=8C=E6=9C=89=E5=8A=B9=E3=81=8B=E3=81=A9=E3=81=86=E3=81=8B?= =?UTF-8?q?=E3=81=AE=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=82=A2=E3=82=AF?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E3=81=99=E3=82=8B=E3=81=8B?= =?UTF-8?q?=E3=81=A9=E3=81=86=E3=81=8B=E3=81=A8=E3=81=84=E3=81=86=E6=84=8F?= =?UTF-8?q?=E5=91=B3=E3=81=AB=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 13 ++++++------ main.py | 9 ++++++-- view.py | 12 ++++++----- .../createSettingBox_Others.py | 21 ++++++++++--------- 4 files changed, 32 insertions(+), 23 deletions(-) diff --git a/config.py b/config.py index 3c30c647..8055a675 100644 --- a/config.py +++ b/config.py @@ -389,13 +389,14 @@ class Config: self._ENABLE_OSC = value @property - def ENABLE_OSC_ERROR_LOG(self): - return self._ENABLE_OSC_ERROR_LOG + def STARTUP_OSC_ENABLED_CHECK(self): + return self._STARTUP_OSC_ENABLED_CHECK - @ENABLE_OSC_ERROR_LOG.setter - def ENABLE_OSC_ERROR_LOG(self, value): + @STARTUP_OSC_ENABLED_CHECK.setter + def STARTUP_OSC_ENABLED_CHECK(self, value): 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 def UPDATE_FLAG(self): @@ -516,7 +517,7 @@ class Config: self._ENABLE_AUTO_CLEAR_MESSAGE_BOX = False self._ENABLE_NOTICE_XSOVERLAY = False self._ENABLE_OSC = False - self._ENABLE_OSC_ERROR_LOG = True + self._STARTUP_OSC_ENABLED_CHECK = True self._UPDATE_FLAG = False self._GITHUB_URL = "https://api.github.com/repos/misyaguziya/VRCT/releases/latest" # self._BREAK_KEYSYM_LIST = [ diff --git a/main.py b/main.py index 1a5eca28..ddcf1468 100644 --- a/main.py +++ b/main.py @@ -32,7 +32,7 @@ def sendMicMessage(message): osc_message = message model.oscSendMessage(osc_message) else: - if config.ENABLE_OSC_ERROR_LOG is True: + if config.STARTUP_OSC_ENABLED_CHECK is True: view.printToTextbox_OSCError() view.printToTextbox_SentMessage(message, translation) @@ -131,7 +131,7 @@ def sendChatMessage(message): osc_message = message model.oscSendMessage(osc_message) else: - if config.ENABLE_OSC_ERROR_LOG is True: + if config.STARTUP_OSC_ENABLED_CHECK is True: view.printToTextbox_OSCError() # update textbox message log @@ -516,6 +516,9 @@ def callbackSetMessageFormat(value): if len(value) > 0: config.MESSAGE_FORMAT = value +def callbackSetStartupOscEnabledCheck(value): + print("callbackSetStartupOscEnabledCheck", value) + config.STARTUP_OSC_ENABLED_CHECK = value # Advanced Settings Tab def callbackSetOscIpAddress(value): @@ -622,6 +625,8 @@ view.register( "callback_set_enable_auto_export_message_logs": callbackSetEnableAutoExportMessageLogs, "callback_set_message_format": callbackSetMessageFormat, + "callback_set_startup_osc_enabled_check": callbackSetStartupOscEnabledCheck, + # Advanced Settings Tab "callback_set_osc_ip_address": callbackSetOscIpAddress, "callback_set_osc_port": callbackSetOscPort, diff --git a/view.py b/view.py index 5fa0b13f..9c69c50c 100644 --- a/view.py +++ b/view.py @@ -251,10 +251,10 @@ class View(): CALLBACK_SET_ENABLE_OSC=None, VAR_ENABLE_OSC=BooleanVar(value=config.ENABLE_OSC), - VAR_LABEL_ENABLE_OSC_ERROR_LOG=StringVar(value="Ignore The OSC Error Message"), - 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."), - CALLBACK_SET_ENABLE_OSC_ERROR_LOG=None, - VAR_ENABLE_OSC_ERROR_LOG=BooleanVar(value=config.ENABLE_OSC_ERROR_LOG), + VAR_LABEL_STARTUP_OSC_ENABLED_CHECK=StringVar(value="Check If OSC Is Enabled At Startup"), + 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_STARTUP_OSC_ENABLED_CHECK=None, + 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_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 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) @@ -462,7 +464,7 @@ class View(): self._printToTextbox_Info("Auth Key is incorrect or Usage limit reached") 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): self._printToTextbox_Info(f"Detect WordFilter :{detected_message}") diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py index ad39496b..2c257f64 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py @@ -21,8 +21,8 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v def checkbox_enable_osc_callback(checkbox_box_widget): callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_OSC, checkbox_box_widget.get()) - def checkbox_enable_osc_error_log_callback(checkbox_box_widget): - callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_OSC_ERROR_LOG, checkbox_box_widget.get()) + def checkbox_startup_osc_enabled_check_callback(checkbox_box_widget): + callFunctionIfCallable(view_variable.CALLBACK_SET_STARTUP_OSC_ENABLED_CHECK, checkbox_box_widget.get()) def entry_message_format_callback(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) row+=1 - config_window.sb__enable_osc_error_log = createSettingBoxCheckbox( + config_window.sb__startup_osc_enabled_check = createSettingBoxCheckbox( parent_widget=setting_box_wrapper, - for_var_label_text=view_variable.VAR_LABEL_ENABLE_OSC_ERROR_LOG, - for_var_desc_text=view_variable.VAR_DESC_ENABLE_OSC_ERROR_LOG, - checkbox_attr_name="sb__checkbox_enable_osc_error_log", - command=lambda: checkbox_enable_osc_error_log_callback(config_window.sb__checkbox_enable_osc_error_log), - variable=view_variable.VAR_ENABLE_OSC_ERROR_LOG, + for_var_label_text=view_variable.VAR_LABEL_STARTUP_OSC_ENABLED_CHECK, + for_var_desc_text=view_variable.VAR_DESC_STARTUP_OSC_ENABLED_CHECK, + checkbox_attr_name="sb__checkbox_startup_osc_enabled_check", + command=lambda: checkbox_startup_osc_enabled_check_callback(config_window.sb__checkbox_startup_osc_enabled_check), + variable=view_variable.VAR_STARTUP_OSC_ENABLED_CHECK, ) - config_window.sb__enable_osc_error_log.grid(row=row) - row+=1 \ No newline at end of file + config_window.sb__startup_osc_enabled_check.grid(row=row) + row+=1 +