diff --git a/config.py b/config.py index 64b7c31c..393d723c 100644 --- a/config.py +++ b/config.py @@ -736,58 +736,58 @@ class Config: self._ENABLE_NOTICE_XSOVERLAY = value saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) - # @property - # @json_serializable('OVERLAY_SETTINGS') - # def OVERLAY_SETTINGS(self): - # return self._OVERLAY_SETTINGS + @property + @json_serializable('OVERLAY_SETTINGS') + def OVERLAY_SETTINGS(self): + return self._OVERLAY_SETTINGS - # @OVERLAY_SETTINGS.setter - # def OVERLAY_SETTINGS(self, value): - # if isinstance(value, dict) and set(value.keys()) == set(self.OVERLAY_SETTINGS.keys()): - # for key, value in value.items(): - # if isinstance(value, float): - # self._OVERLAY_SETTINGS[key] = value - # saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, self.OVERLAY_SETTINGS) + @OVERLAY_SETTINGS.setter + def OVERLAY_SETTINGS(self, value): + if isinstance(value, dict) and set(value.keys()) == set(self.OVERLAY_SETTINGS.keys()): + for key, value in value.items(): + if isinstance(value, float): + self._OVERLAY_SETTINGS[key] = value + saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, self.OVERLAY_SETTINGS) - # @property - # @json_serializable('ENABLE_OVERLAY_SMALL_LOG') - # def ENABLE_OVERLAY_SMALL_LOG(self): - # return self._ENABLE_OVERLAY_SMALL_LOG + @property + @json_serializable('ENABLE_OVERLAY_SMALL_LOG') + def ENABLE_OVERLAY_SMALL_LOG(self): + return self._ENABLE_OVERLAY_SMALL_LOG - # @ENABLE_OVERLAY_SMALL_LOG.setter - # def ENABLE_OVERLAY_SMALL_LOG(self, value): - # if isinstance(value, bool): - # self._ENABLE_OVERLAY_SMALL_LOG = value - # saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) + @ENABLE_OVERLAY_SMALL_LOG.setter + def ENABLE_OVERLAY_SMALL_LOG(self, value): + if isinstance(value, bool): + self._ENABLE_OVERLAY_SMALL_LOG = value + saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) - # @property - # @json_serializable('OVERLAY_SMALL_LOG_SETTINGS') - # def OVERLAY_SMALL_LOG_SETTINGS(self): - # return self._OVERLAY_SMALL_LOG_SETTINGS + @property + @json_serializable('OVERLAY_SMALL_LOG_SETTINGS') + def OVERLAY_SMALL_LOG_SETTINGS(self): + return self._OVERLAY_SMALL_LOG_SETTINGS - # @OVERLAY_SMALL_LOG_SETTINGS.setter - # def OVERLAY_SMALL_LOG_SETTINGS(self, value): - # if isinstance(value, dict) and set(value.keys()) == set(self.OVERLAY_SMALL_LOG_SETTINGS.keys()): - # for key, value in value.items(): - # match (key): - # case "x_pos" | "y_pos" | "depth": - # if isinstance(value, float): - # self._OVERLAY_SMALL_LOG_SETTINGS[key] = value - # case "display_duration" | "fadeout_duration": - # if isinstance(value, int): - # self._OVERLAY_SMALL_LOG_SETTINGS[key] = value - # saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, self.OVERLAY_SMALL_LOG_SETTINGS) + @OVERLAY_SMALL_LOG_SETTINGS.setter + def OVERLAY_SMALL_LOG_SETTINGS(self, value): + if isinstance(value, dict) and set(value.keys()) == set(self.OVERLAY_SMALL_LOG_SETTINGS.keys()): + for key, value in value.items(): + match (key): + case "x_pos" | "y_pos" | "depth": + if isinstance(value, float): + self._OVERLAY_SMALL_LOG_SETTINGS[key] = value + case "display_duration" | "fadeout_duration": + if isinstance(value, int): + self._OVERLAY_SMALL_LOG_SETTINGS[key] = value + saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, self.OVERLAY_SMALL_LOG_SETTINGS) - # @property - # @json_serializable('OVERLAY_UI_TYPE') - # def OVERLAY_UI_TYPE(self): - # return self._OVERLAY_UI_TYPE + @property + @json_serializable('OVERLAY_UI_TYPE') + def OVERLAY_UI_TYPE(self): + return self._OVERLAY_UI_TYPE - # @OVERLAY_UI_TYPE.setter - # def OVERLAY_UI_TYPE(self, value): - # if isinstance(value, str): - # self._OVERLAY_UI_TYPE = value - # saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) + @OVERLAY_UI_TYPE.setter + def OVERLAY_UI_TYPE(self, value): + if isinstance(value, str): + self._OVERLAY_UI_TYPE = value + saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) @property @json_serializable('ENABLE_SEND_MESSAGE_TO_VRC') @@ -1054,19 +1054,19 @@ class Config: self._ENABLE_SEND_ONLY_TRANSLATED_MESSAGES = False self._SEND_MESSAGE_BUTTON_TYPE = "show" self._ENABLE_NOTICE_XSOVERLAY = False - # self._OVERLAY_SETTINGS = { - # "opacity": 1.0, - # "ui_scaling": 1.0, - # } - # self._ENABLE_OVERLAY_SMALL_LOG = False - # self._OVERLAY_SMALL_LOG_SETTINGS = { - # "x_pos": 0.0, - # "y_pos": -0.41, - # "depth": 1.0, - # "display_duration": 5, - # "fadeout_duration": 2, - # } - # self._OVERLAY_UI_TYPE = "default" + self._OVERLAY_SETTINGS = { + "opacity": 1.0, + "ui_scaling": 1.0, + } + self._ENABLE_OVERLAY_SMALL_LOG = False + self._OVERLAY_SMALL_LOG_SETTINGS = { + "x_pos": 0.0, + "y_pos": -0.41, + "depth": 1.0, + "display_duration": 5, + "fadeout_duration": 2, + } + self._OVERLAY_UI_TYPE = "default" self._ENABLE_SEND_MESSAGE_TO_VRC = True self._ENABLE_SEND_RECEIVED_MESSAGE_TO_VRC = False # Speaker2Chatbox self._ENABLE_SPEAKER2CHATBOX_PASS = "000000000" diff --git a/view.py b/view.py index c76a90ae..e222da60 100644 --- a/view.py +++ b/view.py @@ -140,57 +140,57 @@ class View(): # Overlay Settings - # VAR_OVERLAY_SETTINGS=StringVar(value="Overlay Settings"), - # CALLBACK_SET_OPEN_OVERLAY_SETTINGS_WINDOW=self._openVrSettingsWindow, - # VAR_TO_DEFAULT_OVERLAY_SETTINGS=StringVar(value=i18n.t("overlay_settings.restore_default_settings")), - # CALLBACK_SET_TO_DEFAULT_OVERLAY_SETTINGS=self._toDefaultOverlaySettings, + VAR_OVERLAY_SETTINGS=StringVar(value="Overlay Settings"), + CALLBACK_SET_OPEN_OVERLAY_SETTINGS_WINDOW=self._openVrSettingsWindow, + VAR_TO_DEFAULT_OVERLAY_SETTINGS=StringVar(value=i18n.t("overlay_settings.restore_default_settings")), + CALLBACK_SET_TO_DEFAULT_OVERLAY_SETTINGS=self._toDefaultOverlaySettings, - # VAR_LABEL_OVERLAY_OPACITY=StringVar(value=i18n.t("overlay_settings.opacity")), - # SLIDER_RANGE_OVERLAY_OPACITY=(0.1, 1.0), - # NUMBER_OF_STEPS_OVERLAY_OPACITY=18, - # VAR_OVERLAY_OPACITY=DoubleVar(value=config.OVERLAY_SETTINGS["opacity"]), - # VAR_CURRENT_VALUE_OVERLAY_OPACITY=StringVar(value=floatToPctStr(config.OVERLAY_SETTINGS["opacity"])), + VAR_LABEL_OVERLAY_OPACITY=StringVar(value=i18n.t("overlay_settings.opacity")), + SLIDER_RANGE_OVERLAY_OPACITY=(0.1, 1.0), + NUMBER_OF_STEPS_OVERLAY_OPACITY=18, + VAR_OVERLAY_OPACITY=DoubleVar(value=config.OVERLAY_SETTINGS["opacity"]), + VAR_CURRENT_VALUE_OVERLAY_OPACITY=StringVar(value=floatToPctStr(config.OVERLAY_SETTINGS["opacity"])), - # VAR_LABEL_OVERLAY_UI_SCALING=StringVar(value=i18n.t("overlay_settings.ui_scaling")), - # SLIDER_RANGE_OVERLAY_UI_SCALING=(0.4, 2.0), - # NUMBER_OF_STEPS_OVERLAY_UI_SCALING=16, - # VAR_OVERLAY_UI_SCALING=DoubleVar(value=config.OVERLAY_SETTINGS["ui_scaling"]), - # VAR_CURRENT_VALUE_OVERLAY_UI_SCALING=StringVar(value=floatToPctStr(config.OVERLAY_SETTINGS["ui_scaling"])), + VAR_LABEL_OVERLAY_UI_SCALING=StringVar(value=i18n.t("overlay_settings.ui_scaling")), + SLIDER_RANGE_OVERLAY_UI_SCALING=(0.4, 2.0), + NUMBER_OF_STEPS_OVERLAY_UI_SCALING=16, + VAR_OVERLAY_UI_SCALING=DoubleVar(value=config.OVERLAY_SETTINGS["ui_scaling"]), + VAR_CURRENT_VALUE_OVERLAY_UI_SCALING=StringVar(value=floatToPctStr(config.OVERLAY_SETTINGS["ui_scaling"])), - # # CALLBACK_SET_OVERLAY_SMALL_LOG_SETTINGS=None, + CALLBACK_SET_OVERLAY_SMALL_LOG_SETTINGS=None, - # VAR_LABEL_OVERLAY_SMALL_LOG_X_POS=StringVar(value=i18n.t("overlay_settings.x_position")), - # SLIDER_RANGE_OVERLAY_SMALL_LOG_X_POS=(-0.5, 0.5), - # NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_X_POS=100, - # VAR_OVERLAY_SMALL_LOG_X_POS=DoubleVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["x_pos"]), - # VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_X_POS=StringVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["x_pos"]), + VAR_LABEL_OVERLAY_SMALL_LOG_X_POS=StringVar(value=i18n.t("overlay_settings.x_position")), + SLIDER_RANGE_OVERLAY_SMALL_LOG_X_POS=(-0.5, 0.5), + NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_X_POS=100, + VAR_OVERLAY_SMALL_LOG_X_POS=DoubleVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["x_pos"]), + VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_X_POS=StringVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["x_pos"]), - # VAR_LABEL_OVERLAY_SMALL_LOG_Y_POS=StringVar(value=i18n.t("overlay_settings.y_position")), - # SLIDER_RANGE_OVERLAY_SMALL_LOG_Y_POS=(-0.8, 0.8), - # NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_Y_POS=160, - # VAR_OVERLAY_SMALL_LOG_Y_POS=DoubleVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["y_pos"]), - # VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_Y_POS=StringVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["y_pos"]), + VAR_LABEL_OVERLAY_SMALL_LOG_Y_POS=StringVar(value=i18n.t("overlay_settings.y_position")), + SLIDER_RANGE_OVERLAY_SMALL_LOG_Y_POS=(-0.8, 0.8), + NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_Y_POS=160, + VAR_OVERLAY_SMALL_LOG_Y_POS=DoubleVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["y_pos"]), + VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_Y_POS=StringVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["y_pos"]), - # VAR_LABEL_OVERLAY_SMALL_LOG_DEPTH=StringVar(value=i18n.t("overlay_settings.depth")), - # SLIDER_RANGE_OVERLAY_SMALL_LOG_DEPTH=(0.5, 1.5), - # NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_DEPTH=100, - # VAR_OVERLAY_SMALL_LOG_DEPTH=DoubleVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["depth"]), - # VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_DEPTH=StringVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["depth"]), + VAR_LABEL_OVERLAY_SMALL_LOG_DEPTH=StringVar(value=i18n.t("overlay_settings.depth")), + SLIDER_RANGE_OVERLAY_SMALL_LOG_DEPTH=(0.5, 1.5), + NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_DEPTH=100, + VAR_OVERLAY_SMALL_LOG_DEPTH=DoubleVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["depth"]), + VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_DEPTH=StringVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["depth"]), - # VAR_LABEL_OVERLAY_SMALL_LOG_DISPLAY_DURATION=StringVar(value=i18n.t("overlay_settings.display_duration")), - # SLIDER_RANGE_OVERLAY_SMALL_LOG_DISPLAY_DURATION=(1, 60), - # NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_DISPLAY_DURATION=59, - # VAR_OVERLAY_SMALL_LOG_DISPLAY_DURATION=IntVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["display_duration"]), - # VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_DISPLAY_DURATION=StringVar(value=f"{config.OVERLAY_SMALL_LOG_SETTINGS['display_duration']} second(s)"), + VAR_LABEL_OVERLAY_SMALL_LOG_DISPLAY_DURATION=StringVar(value=i18n.t("overlay_settings.display_duration")), + SLIDER_RANGE_OVERLAY_SMALL_LOG_DISPLAY_DURATION=(1, 60), + NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_DISPLAY_DURATION=59, + VAR_OVERLAY_SMALL_LOG_DISPLAY_DURATION=IntVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["display_duration"]), + VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_DISPLAY_DURATION=StringVar(value=f"{config.OVERLAY_SMALL_LOG_SETTINGS['display_duration']} second(s)"), - # VAR_LABEL_OVERLAY_SMALL_LOG_FADEOUT_DURATION=StringVar(value=i18n.t("overlay_settings.fadeout_duration")), - # SLIDER_RANGE_OVERLAY_SMALL_LOG_FADEOUT_DURATION=(0, 5), - # NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_FADEOUT_DURATION=5, - # VAR_OVERLAY_SMALL_LOG_FADEOUT_DURATION=IntVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["fadeout_duration"]), - # VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_FADEOUT_DURATION=StringVar(value=f"{config.OVERLAY_SMALL_LOG_SETTINGS['fadeout_duration']} second(s)"), + VAR_LABEL_OVERLAY_SMALL_LOG_FADEOUT_DURATION=StringVar(value=i18n.t("overlay_settings.fadeout_duration")), + SLIDER_RANGE_OVERLAY_SMALL_LOG_FADEOUT_DURATION=(0, 5), + NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_FADEOUT_DURATION=5, + VAR_OVERLAY_SMALL_LOG_FADEOUT_DURATION=IntVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["fadeout_duration"]), + VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_FADEOUT_DURATION=StringVar(value=f"{config.OVERLAY_SMALL_LOG_SETTINGS['fadeout_duration']} second(s)"), @@ -478,13 +478,13 @@ class View(): VAR_WHISPER_WEIGHT_TYPE=StringVar(value=self.getSelectableWhisperWeightTypeDict()[config.WHISPER_WEIGHT_TYPE]), - # # VR Tab - # VAR_LABEL_ENABLE_OVERLAY_SMALL_LOG=StringVar(value=i18n.t("config_window.enable_overlay_small_log.label")), - # VAR_DESC_ENABLE_OVERLAY_SMALL_LOG=None, - # # VAR_DESC_ENABLE_OVERLAY_SMALL_LOG=StringVar(value=i18n.t("config_window.enable_overlay_small_log.desc")), - # CALLBACK_SET_ENABLE_OVERLAY_SMALL_LOG=None, - # VAR_ENABLE_OVERLAY_SMALL_LOG=BooleanVar(value=config.ENABLE_OVERLAY_SMALL_LOG), - # VAR_OPEN_OVERLAY_SETTINGS_BUTTON=StringVar(value=i18n.t("config_window.enable_overlay_small_log.open_overlay_settings")), + # VR Tab + VAR_LABEL_ENABLE_OVERLAY_SMALL_LOG=StringVar(value=i18n.t("config_window.enable_overlay_small_log.label")), + VAR_DESC_ENABLE_OVERLAY_SMALL_LOG=None, + # VAR_DESC_ENABLE_OVERLAY_SMALL_LOG=StringVar(value=i18n.t("config_window.enable_overlay_small_log.desc")), + CALLBACK_SET_ENABLE_OVERLAY_SMALL_LOG=None, + VAR_ENABLE_OVERLAY_SMALL_LOG=BooleanVar(value=config.ENABLE_OVERLAY_SMALL_LOG), + VAR_OPEN_OVERLAY_SETTINGS_BUTTON=StringVar(value=i18n.t("config_window.enable_overlay_small_log.open_overlay_settings")), # Others Tab @@ -756,11 +756,11 @@ class View(): # VR Tab # VR Tab (Quick Settings) - # self.view_variable.CALLBACK_SET_OVERLAY_SETTINGS=config_window_registers.get("callback_set_overlay_settings", None) + self.view_variable.CALLBACK_SET_OVERLAY_SETTINGS=config_window_registers.get("callback_set_overlay_settings", None) - # self.view_variable.CALLBACK_SET_ENABLE_OVERLAY_SMALL_LOG=config_window_registers.get("callback_set_enable_overlay_small_log", None) - # # VR Tab (Quick Settings) - # self.view_variable.CALLBACK_SET_OVERLAY_SMALL_LOG_SETTINGS=config_window_registers.get("callback_set_overlay_small_log_settings", None) + self.view_variable.CALLBACK_SET_ENABLE_OVERLAY_SMALL_LOG=config_window_registers.get("callback_set_enable_overlay_small_log", None) + # VR Tab (Quick Settings) + self.view_variable.CALLBACK_SET_OVERLAY_SMALL_LOG_SETTINGS=config_window_registers.get("callback_set_overlay_small_log_settings", None) # Others Tab @@ -858,21 +858,21 @@ class View(): # Set Easter Egg - # self.count = 0 - # def clickedCounter(_e): - # if self.count < 2: - # self.count+=1 - # print("Easter egg count:", self.count) - # else: - # print("Easter egg count:", self.count, "Easter egg has enabled.") - # callFunctionIfCallable(self.view_variable.CALLBACK_ENABLE_EASTER_EGG) - # print(config.OVERLAY_UI_TYPE) + self.count = 0 + def clickedCounter(_e): + if self.count < 2: + self.count+=1 + print("Easter egg count:", self.count) + else: + print("Easter egg count:", self.count, "Easter egg has enabled.") + callFunctionIfCallable(self.view_variable.CALLBACK_ENABLE_EASTER_EGG) + print(config.OVERLAY_UI_TYPE) - # vrct_gui.sidebar_logo.bind( - # "", - # clickedCounter, - # "+" - # ) + vrct_gui.sidebar_logo.bind( + "", + clickedCounter, + "+" + ) # Insert sample conversation for testing. @@ -1114,32 +1114,32 @@ class View(): } - # def _toDefaultOverlaySettings(self): - # INIT_OVERLAY_SETTINGS = { - # "opacity": 1.0, - # "ui_scaling": 1.0, - # } - # INIT_OVERLAY_SMALL_LOG_SETTINGS = { - # "x_pos": 0.0, - # "y_pos": -0.41, - # "depth": 1.0, - # "display_duration": 5, - # "fadeout_duration": 2, - # } - # for key in INIT_OVERLAY_SETTINGS.keys(): - # callFunctionIfCallable(self.view_variable.CALLBACK_SET_OVERLAY_SETTINGS, INIT_OVERLAY_SETTINGS[key], key) + def _toDefaultOverlaySettings(self): + INIT_OVERLAY_SETTINGS = { + "opacity": 1.0, + "ui_scaling": 1.0, + } + INIT_OVERLAY_SMALL_LOG_SETTINGS = { + "x_pos": 0.0, + "y_pos": -0.41, + "depth": 1.0, + "display_duration": 5, + "fadeout_duration": 2, + } + for key in INIT_OVERLAY_SETTINGS.keys(): + callFunctionIfCallable(self.view_variable.CALLBACK_SET_OVERLAY_SETTINGS, INIT_OVERLAY_SETTINGS[key], key) - # for key in INIT_OVERLAY_SMALL_LOG_SETTINGS.keys(): - # callFunctionIfCallable(self.view_variable.CALLBACK_SET_OVERLAY_SMALL_LOG_SETTINGS, INIT_OVERLAY_SMALL_LOG_SETTINGS[key], key) + for key in INIT_OVERLAY_SMALL_LOG_SETTINGS.keys(): + callFunctionIfCallable(self.view_variable.CALLBACK_SET_OVERLAY_SMALL_LOG_SETTINGS, INIT_OVERLAY_SMALL_LOG_SETTINGS[key], key) - # self.setLatestConfigVariable("OverlayOpacity") - # self.setLatestConfigVariable("OverlayUiScaling") + self.setLatestConfigVariable("OverlayOpacity") + self.setLatestConfigVariable("OverlayUiScaling") - # self.setLatestConfigVariable("OverlaySmallLogXPos") - # self.setLatestConfigVariable("OverlaySmallLogYPos") - # self.setLatestConfigVariable("OverlaySmallLogDepth") - # self.setLatestConfigVariable("OverlaySmallLogDisplayDuration") - # self.setLatestConfigVariable("OverlaySmallLogFadeoutDuration") + self.setLatestConfigVariable("OverlaySmallLogXPos") + self.setLatestConfigVariable("OverlaySmallLogYPos") + self.setLatestConfigVariable("OverlaySmallLogDepth") + self.setLatestConfigVariable("OverlaySmallLogDisplayDuration") + self.setLatestConfigVariable("OverlaySmallLogFadeoutDuration") # Open Webpage Functions def openWebPage_Booth(self): @@ -1894,8 +1894,8 @@ class View(): # Print To Textbox. - # def printToTextbox_enableEasterEgg(self): - # self._printToTextbox_Info(i18n.t("main_window.textbox_system_message.enabled_easter_egg")) + def printToTextbox_enableEasterEgg(self): + self._printToTextbox_Info(i18n.t("main_window.textbox_system_message.enabled_easter_egg")) def printToTextbox_enableTranslation(self): self._printToTextbox_Info(i18n.t("main_window.textbox_system_message.enabled_translation")) diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/createSideMenuAndSettingsBoxContainers.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/createSideMenuAndSettingsBoxContainers.py index 52e72f01..d70a0eba 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/createSideMenuAndSettingsBoxContainers.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/createSideMenuAndSettingsBoxContainers.py @@ -104,21 +104,21 @@ def createSideMenuAndSettingsBoxContainers(config_window, settings, view_variabl ] }, }, - # { - # "side_menu_tab_attr_name": "side_menu_tab_vr", - # "label_attr_name": "label_vr", - # "selected_mark_attr_name": "selected_mark_vr", - # "textvariable": view_variable.VAR_SIDE_MENU_LABEL_VR, - # "setting_box_container_settings": { - # "setting_box_container_attr_name": "setting_box_container_vr", - # "setting_boxes": [ - # { - # "var_section_title": None, - # "setting_box": createSettingBox_Vr - # } - # ] - # }, - # }, + { + "side_menu_tab_attr_name": "side_menu_tab_vr", + "label_attr_name": "label_vr", + "selected_mark_attr_name": "selected_mark_vr", + "textvariable": view_variable.VAR_SIDE_MENU_LABEL_VR, + "setting_box_container_settings": { + "setting_box_container_attr_name": "setting_box_container_vr", + "setting_boxes": [ + { + "var_section_title": None, + "setting_box": createSettingBox_Vr + } + ] + }, + }, { "side_menu_tab_attr_name": "side_menu_tab_others", "label_attr_name": "label_others", 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 0d7d0ffb..93a249c7 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 @@ -18,9 +18,6 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v def checkboxSendMessageButtonTypeCallback(): callFunctionIfCallable(view_variable.CALLBACK_SET_SEND_MESSAGE_BUTTON_TYPE, view_variable.VAR_SEND_MESSAGE_BUTTON_TYPE.get()) - def checkboxNoticeXsoverlayCallback(checkbox_box_widget): - callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY, checkbox_box_widget.get()) - def checkboxAutoExportMessageLogsCallback(checkbox_box_widget): callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_AUTO_EXPORT_MESSAGE_LOGS, checkbox_box_widget.get()) @@ -64,15 +61,6 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v config_window.sb__send_message_button_type.grid(row=row) row+=1 - config_window.sb__notice_xsoverlay = createSettingBoxCheckbox( - for_var_label_text=view_variable.VAR_LABEL_ENABLE_NOTICE_XSOVERLAY, - for_var_desc_text=view_variable.VAR_DESC_ENABLE_NOTICE_XSOVERLAY, - checkbox_attr_name="sb__checkbox_notice_xsoverlay", - command=lambda: checkboxNoticeXsoverlayCallback(config_window.sb__checkbox_notice_xsoverlay), - variable=view_variable.VAR_ENABLE_NOTICE_XSOVERLAY, - ) - config_window.sb__notice_xsoverlay.grid(row=row) - row+=1 config_window.sb__auto_export_message_logs = createSettingBoxAutoExportMessageLogs( for_var_label_text=view_variable.VAR_LABEL_ENABLE_AUTO_EXPORT_MESSAGE_LOGS, diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_vr/createSettingBox_Vr.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_vr/createSettingBox_Vr.py index 2afa8748..8bb78264 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_vr/createSettingBox_Vr.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_vr/createSettingBox_Vr.py @@ -11,10 +11,13 @@ def createSettingBox_Vr(setting_box_wrapper, config_window, settings, view_varia callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_OVERLAY_SMALL_LOG, switch_widget.get()) def buttonOpenOverlaySettingsWindow(_e): - print(_e) callFunctionIfCallable(view_variable.CALLBACK_SET_OPEN_OVERLAY_SETTINGS_WINDOW) + def checkboxNoticeXsoverlayCallback(checkbox_box_widget): + callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY, checkbox_box_widget.get()) + + row=0 config_window.sb__enable_overlay_small_log = createSettingBox_Overlay( for_var_label_text=view_variable.VAR_LABEL_ENABLE_OVERLAY_SMALL_LOG, @@ -26,4 +29,15 @@ def createSettingBox_Vr(setting_box_wrapper, config_window, settings, view_varia label_button_clicked_command=buttonOpenOverlaySettingsWindow, ) config_window.sb__enable_overlay_small_log.grid(row=row) + row+=1 + + + config_window.sb__notice_xsoverlay = createSettingBoxCheckbox( + for_var_label_text=view_variable.VAR_LABEL_ENABLE_NOTICE_XSOVERLAY, + for_var_desc_text=view_variable.VAR_DESC_ENABLE_NOTICE_XSOVERLAY, + checkbox_attr_name="sb__checkbox_notice_xsoverlay", + command=lambda: checkboxNoticeXsoverlayCallback(config_window.sb__checkbox_notice_xsoverlay), + variable=view_variable.VAR_ENABLE_NOTICE_XSOVERLAY, + ) + config_window.sb__notice_xsoverlay.grid(row=row, pady=0) row+=1 \ No newline at end of file diff --git a/vrct_gui/main_window/createMainWindowWidgets.py b/vrct_gui/main_window/createMainWindowWidgets.py index 06c24932..447dfb1d 100644 --- a/vrct_gui/main_window/createMainWindowWidgets.py +++ b/vrct_gui/main_window/createMainWindowWidgets.py @@ -48,59 +48,59 @@ def createMainWindowWidgets(vrct_gui, settings, view_variable): # start from 3 main_topbar_column=3 - # # Overlay Settings Button - # vrct_gui.overlay_settings_container = CTkFrame( - # vrct_gui.main_topbar_container, - # corner_radius=settings.uism.UPDATE_AVAILABLE_BUTTON_CORNER_RADIUS, - # fg_color=settings.ctm.MAIN_BG_COLOR, - # cursor="hand2", - # ) - # vrct_gui.overlay_settings_container.grid(row=0, column=main_topbar_column, padx=settings.uism.UPDATE_AVAILABLE_BUTTON_PADX, pady=settings.uism.TOP_BAR_BUTTON_PADY, sticky="nsw") - # # vrct_gui.overlay_settings_container.grid_remove() + # Overlay Settings Button + vrct_gui.overlay_settings_container = CTkFrame( + vrct_gui.main_topbar_container, + corner_radius=settings.uism.UPDATE_AVAILABLE_BUTTON_CORNER_RADIUS, + fg_color=settings.ctm.MAIN_BG_COLOR, + cursor="hand2", + ) + vrct_gui.overlay_settings_container.grid(row=0, column=main_topbar_column, padx=settings.uism.UPDATE_AVAILABLE_BUTTON_PADX, pady=settings.uism.TOP_BAR_BUTTON_PADY, sticky="nsw") + # vrct_gui.overlay_settings_container.grid_remove() - # vrct_gui.overlay_settings_container.grid_rowconfigure((0,2), weight=1) + vrct_gui.overlay_settings_container.grid_rowconfigure((0,2), weight=1) - # vrct_gui.overlay_settings_icon = CTkLabel( - # vrct_gui.overlay_settings_container, - # text=None, - # corner_radius=0, - # height=0, - # image=CTkImage(settings.image_file.CONFIGURATION_ICON_DISABLED, size=settings.uism.UPDATE_AVAILABLE_BUTTON_SIZE) - # ) - # vrct_gui.overlay_settings_icon.grid(row=1, column=0, padx=(settings.uism.UPDATE_AVAILABLE_BUTTON_IPADX, settings.uism.UPDATE_AVAILABLE_PADX_BETWEEN_LABEL_AND_ICON), pady=0) + vrct_gui.overlay_settings_icon = CTkLabel( + vrct_gui.overlay_settings_container, + text=None, + corner_radius=0, + height=0, + image=CTkImage(settings.image_file.CONFIGURATION_ICON_DISABLED, size=settings.uism.UPDATE_AVAILABLE_BUTTON_SIZE) + ) + vrct_gui.overlay_settings_icon.grid(row=1, column=0, padx=(settings.uism.UPDATE_AVAILABLE_BUTTON_IPADX, settings.uism.UPDATE_AVAILABLE_PADX_BETWEEN_LABEL_AND_ICON), pady=0) - # vrct_gui.overlay_settings_label = CTkLabel( - # vrct_gui.overlay_settings_container, - # textvariable=view_variable.VAR_OVERLAY_SETTINGS, - # height=0, - # corner_radius=0, - # font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.UPDATE_AVAILABLE_BUTTON_FONT_SIZE, weight="normal"), - # anchor="e", - # text_color=settings.ctm.TOP_BAR_BUTTON_TEXT_COLOR, - # # text_color=settings.ctm.UPDATE_AVAILABLE_BUTTON_TEXT_COLOR, - # ) - # # This "right padx +1" is for fixing a bug that sticks out from the frame. I don't know why that happens... - # vrct_gui.overlay_settings_label.grid(row=1, column=1, padx=(0,settings.uism.UPDATE_AVAILABLE_BUTTON_IPADX+1), pady=0) + vrct_gui.overlay_settings_label = CTkLabel( + vrct_gui.overlay_settings_container, + textvariable=view_variable.VAR_OVERLAY_SETTINGS, + height=0, + corner_radius=0, + font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.UPDATE_AVAILABLE_BUTTON_FONT_SIZE, weight="normal"), + anchor="e", + text_color=settings.ctm.TOP_BAR_BUTTON_TEXT_COLOR, + # text_color=settings.ctm.UPDATE_AVAILABLE_BUTTON_TEXT_COLOR, + ) + # This "right padx +1" is for fixing a bug that sticks out from the frame. I don't know why that happens... + vrct_gui.overlay_settings_label.grid(row=1, column=1, padx=(0,settings.uism.UPDATE_AVAILABLE_BUTTON_IPADX+1), pady=0) - # bindButtonFunctionAndColor( - # target_widgets=[ - # vrct_gui.overlay_settings_container, - # vrct_gui.overlay_settings_label, - # vrct_gui.overlay_settings_icon, - # ], - # enter_color=settings.ctm.TOP_BAR_BUTTON_HOVERED_BG_COLOR, - # leave_color=settings.ctm.TOP_BAR_BUTTON_BG_COLOR, - # clicked_color=settings.ctm.TOP_BAR_BUTTON_CLICKED_BG_COLOR, - # buttonReleasedFunction=lambda e: callFunctionIfCallable(view_variable.CALLBACK_SET_OPEN_OVERLAY_SETTINGS_WINDOW), - # ) + bindButtonFunctionAndColor( + target_widgets=[ + vrct_gui.overlay_settings_container, + vrct_gui.overlay_settings_label, + vrct_gui.overlay_settings_icon, + ], + enter_color=settings.ctm.TOP_BAR_BUTTON_HOVERED_BG_COLOR, + leave_color=settings.ctm.TOP_BAR_BUTTON_BG_COLOR, + clicked_color=settings.ctm.TOP_BAR_BUTTON_CLICKED_BG_COLOR, + buttonReleasedFunction=lambda e: callFunctionIfCallable(view_variable.CALLBACK_SET_OPEN_OVERLAY_SETTINGS_WINDOW), + ) - # main_topbar_column+=1 + main_topbar_column+=1 # Update Available Button vrct_gui.update_available_container = CTkFrame( vrct_gui.main_topbar_container, diff --git a/vrct_gui/vrct_gui.py b/vrct_gui/vrct_gui.py index d234fd3e..cc0d2d97 100644 --- a/vrct_gui/vrct_gui.py +++ b/vrct_gui/vrct_gui.py @@ -14,7 +14,7 @@ from ._PrintToTextbox import _PrintToTextbox from .main_window import createMainWindowWidgets from .config_window import ConfigWindow -# from .quick_settings_window import QuickSettingsWindow +from .quick_settings_window import QuickSettingsWindow from .ui_utils import setDefaultActiveTab, setGeometryToCenterOfScreen, fadeInAnimation from utils import callFunctionIfCallable @@ -131,12 +131,11 @@ class VRCT_GUI(CTk): view_variable=self._view_variable ) - # self.quick_settings_window = QuickSettingsWindow( - # vrct_gui=self, - # settings=self.settings.config_window, - # view_variable=self._view_variable - # ) - # self.quick_settings_window.show() + self.quick_settings_window = QuickSettingsWindow( + vrct_gui=self, + settings=self.settings.config_window, + view_variable=self._view_variable + ) self.selectable_languages_window = _CreateSelectableLanguagesWindow( vrct_gui=self,