From 1acb0a9565a89f156db43d29e4c657abb71db005 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Wed, 6 Nov 2024 00:23:43 +0900 Subject: [PATCH] =?UTF-8?q?[Update]=20UI=E3=81=A7=E4=BD=BF=E3=81=86?= =?UTF-8?q?=E3=83=87=E3=83=BC=E3=82=BF=EF=BC=88min,max=E3=81=AA=E3=81=A9?= =?UTF-8?q?=EF=BC=89=E3=82=92=E6=B5=85=E3=81=84=E9=9A=8E=E5=B1=A4=E3=81=A7?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E3=80=82=20=E5=88=9D=E6=9C=9F=E3=83=87=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E9=80=81=E3=82=89=E3=82=8C=E3=81=A6?= =?UTF-8?q?=E3=81=8D=E3=81=A6=E3=81=84=E3=81=9Frange=E3=81=AA=E3=81=A9?= =?UTF-8?q?=E3=80=81=E5=BF=85=E8=A6=81=E3=81=AE=E3=81=AA=E3=81=84=E3=82=A8?= =?UTF-8?q?=E3=83=B3=E3=83=89=E3=83=9D=E3=82=A4=E3=83=B3=E3=83=88=E3=82=92?= =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E3=82=A2=E3=82=A6=E3=83=88?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/webui_mainloop.py | 34 +++++++++---------- .../setting_box/appearance/Appearance.jsx | 9 ++--- .../setting_box/device/Device.jsx | 9 ++--- src-ui/ui_configs.js | 15 +++++++- 4 files changed, 38 insertions(+), 29 deletions(-) diff --git a/src-python/webui_mainloop.py b/src-python/webui_mainloop.py index 45d4c284..3e9df2ce 100644 --- a/src-python/webui_mainloop.py +++ b/src-python/webui_mainloop.py @@ -98,7 +98,7 @@ mapping = { # Appearance "/get/data/version": {"status": True, "variable":controller.getVersion}, - "/get/data/transparency_range": {"status": True, "variable":controller.getTransparencyRange}, + # "/get/data/transparency_range": {"status": True, "variable":controller.getTransparencyRange}, "/get/data/transparency": {"status": True, "variable":controller.getTransparency}, "/set/data/transparency": {"status": True, "variable":controller.setTransparency}, @@ -106,15 +106,15 @@ mapping = { # "/get/data/appearance_theme": {"status": True, "variable":controller.getAppearanceTheme}, # "/set/data/appearance_theme": {"status": True, "variable":controller.setAppearanceTheme}, - "/get/data/ui_scaling_range": {"status": True, "variable":controller.getUiScalingRange}, + # "/get/data/ui_scaling_range": {"status": True, "variable":controller.getUiScalingRange}, "/get/data/ui_scaling": {"status": True, "variable":controller.getUiScaling}, "/set/data/ui_scaling": {"status": True, "variable":controller.setUiScaling}, - "/get/data/textbox_ui_scaling_range": {"status": True, "variable":controller.getTextboxUiScalingRange}, + # "/get/data/textbox_ui_scaling_range": {"status": True, "variable":controller.getTextboxUiScalingRange}, "/get/data/textbox_ui_scaling": {"status": True, "variable":controller.getTextboxUiScaling}, "/set/data/textbox_ui_scaling": {"status": True, "variable":controller.setTextboxUiScaling}, - "/get/data/message_box_ratio_range": {"status": True, "variable":controller.getMessageBoxRatioRange}, + # "/get/data/message_box_ratio_range": {"status": True, "variable":controller.getMessageBoxRatioRange}, "/get/data/message_box_ratio": {"status": True, "variable":controller.getMessageBoxRatio}, "/set/data/message_box_ratio": {"status": True, "variable":controller.setMessageBoxRatio}, @@ -124,9 +124,9 @@ mapping = { "/get/data/ui_language": {"status": True, "variable":controller.getUiLanguage}, "/set/data/ui_language": {"status": True, "variable":controller.setUiLanguage}, - "/get/data/restore_main_window_geometry": {"status": True, "variable":controller.getRestoreMainWindowGeometry}, - "/set/enable/restore_main_window_geometry": {"status": True, "variable":controller.setEnableRestoreMainWindowGeometry}, - "/set/disable/restore_main_window_geometry": {"status": True, "variable":controller.setDisableRestoreMainWindowGeometry}, + # "/get/data/restore_main_window_geometry": {"status": True, "variable":controller.getRestoreMainWindowGeometry}, + # "/set/enable/restore_main_window_geometry": {"status": True, "variable":controller.setEnableRestoreMainWindowGeometry}, + # "/set/disable/restore_main_window_geometry": {"status": True, "variable":controller.setDisableRestoreMainWindowGeometry}, "/get/data/main_window_geometry": {"status": True, "variable":controller.getMainWindowGeometry}, "/set/data/main_window_geometry": {"status": True, "variable":controller.setMainWindowGeometry}, @@ -160,8 +160,8 @@ mapping = { "/get/data/mic_device_list": {"status": True, "variable":controller.getMicDeviceList}, "/get/data/speaker_device_list": {"status": True, "variable":controller.getSpeakerDeviceList}, - "/get/data/max_mic_threshold": {"status": True, "variable":controller.getMaxMicThreshold}, - "/get/data/max_speaker_threshold": {"status": True, "variable":controller.getMaxSpeakerThreshold}, + # "/get/data/max_mic_threshold": {"status": True, "variable":controller.getMaxMicThreshold}, + # "/get/data/max_speaker_threshold": {"status": True, "variable":controller.getMaxSpeakerThreshold}, "/get/data/auto_mic_select": {"status": True, "variable":controller.getAutoMicSelect}, "/set/enable/auto_mic_select": {"status": True, "variable":controller.setEnableAutoMicSelect}, @@ -277,17 +277,17 @@ mapping = { "/set/enable/send_message_to_vrc": {"status": True, "variable":controller.setEnableSendMessageToVrc}, "/set/disable/send_message_to_vrc": {"status": True, "variable":controller.setDisableSendMessageToVrc}, - "/get/data/send_message_format": {"status": True, "variable":controller.getSendMessageFormat}, - "/set/data/send_message_format": {"status": True, "variable":controller.setSendMessageFormat}, + # "/get/data/send_message_format": {"status": True, "variable":controller.getSendMessageFormat}, + # "/set/data/send_message_format": {"status": True, "variable":controller.setSendMessageFormat}, - "/get/data/send_message_format_with_t": {"status": True, "variable":controller.getSendMessageFormatWithT}, - "/set/data/send_message_format_with_t": {"status": True, "variable":controller.setSendMessageFormatWithT}, + # "/get/data/send_message_format_with_t": {"status": True, "variable":controller.getSendMessageFormatWithT}, + # "/set/data/send_message_format_with_t": {"status": True, "variable":controller.setSendMessageFormatWithT}, - "/get/data/received_message_format": {"status": True, "variable":controller.getReceivedMessageFormat}, - "/set/data/received_message_format": {"status": True, "variable":controller.setReceivedMessageFormat}, + # "/get/data/received_message_format": {"status": True, "variable":controller.getReceivedMessageFormat}, + # "/set/data/received_message_format": {"status": True, "variable":controller.setReceivedMessageFormat}, - "/get/data/received_message_format_with_t": {"status": True, "variable":controller.getReceivedMessageFormatWithT}, - "/set/data/received_message_format_with_t": {"status": True, "variable":controller.setReceivedMessageFormatWithT}, + # "/get/data/received_message_format_with_t": {"status": True, "variable":controller.getReceivedMessageFormatWithT}, + # "/set/data/received_message_format_with_t": {"status": True, "variable":controller.setReceivedMessageFormatWithT}, "/get/data/send_received_message_to_vrc": {"status": True, "variable":controller.getSendReceivedMessageToVrc}, "/set/enable/send_received_message_to_vrc": {"status": True, "variable":controller.setEnableSendReceivedMessageToVrc}, diff --git a/src-ui/app/config_page/setting_section/setting_box/appearance/Appearance.jsx b/src-ui/app/config_page/setting_section/setting_box/appearance/Appearance.jsx index 635253b9..abc8b0c7 100644 --- a/src-ui/app/config_page/setting_section/setting_box/appearance/Appearance.jsx +++ b/src-ui/app/config_page/setting_section/setting_box/appearance/Appearance.jsx @@ -2,6 +2,7 @@ import clsx from "clsx"; import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import styles from "./Appearance.module.scss"; +import { ui_configs } from "@ui_configs"; import { useStore_SelectableFontFamilyList } from "@store"; import { useUiLanguage, @@ -38,12 +39,6 @@ export const Appearance = () => { const UiLanguageContainer = () => { const { t } = useTranslation(); const { currentUiLanguage, setUiLanguage } = useUiLanguage(); - const SELECTABLE_UI_LANGUAGES_DICT = { - en: "English", - ja: "日本語", - ko: "한국어", - "zh-Hant": "繁體中文", - }; const is_not_en_lang = currentUiLanguage.data !== "en" && currentUiLanguage.data !== undefined; return ( @@ -60,7 +55,7 @@ const UiLanguageContainer = () => {
{currentUiLanguage.state === "pending" && } - {Object.entries(SELECTABLE_UI_LANGUAGES_DICT).map(([key, value]) => ( + {Object.entries(ui_configs.selectable_ui_languages).map(([key, value]) => (
@@ -197,8 +198,8 @@ const Speaker_Container = () => {
diff --git a/src-ui/ui_configs.js b/src-ui/ui_configs.js index 1a67092c..12b0bcb4 100644 --- a/src-ui/ui_configs.js +++ b/src-ui/ui_configs.js @@ -5,4 +5,17 @@ export const translator_status = [ { translator_id: "Bing", translator_name: "Bing", is_available: false }, { translator_id: "Papago", translator_name: "Papago", is_available: false }, { translator_id: "CTranslate2", translator_name: `Internal\n(Default)`, is_available: false }, -]; \ No newline at end of file +]; + +export const ui_configs = { + mic_threshold_min: 0, + mic_threshold_max: 2000, + speaker_threshold_min: 0, + speaker_threshold_max: 4000, + selectable_ui_languages: { + en: "English", + ja: "日本語", + ko: "한국어", + "zh-Hant": "繁體中文", + } +}; \ No newline at end of file