From fd0069cb6ba0e76018674f0319804a5d8f8a1f86 Mon Sep 17 00:00:00 2001
From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com>
Date: Tue, 18 Feb 2025 15:36:08 +0900
Subject: [PATCH] =?UTF-8?q?[Update]=20UI:=20VRC=20ChatBox=E3=81=AE?=
=?UTF-8?q?=E9=80=9A=E7=9F=A5=E9=9F=B3=E3=81=AEON/OFF=20=E8=A8=AD=E5=AE=9A?=
=?UTF-8?q?=E9=A0=85=E7=9B=AE=E8=BF=BD=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
locales/en.yml | 3 ++
locales/ja.yml | 3 ++
.../setting_box/others/Others.jsx | 20 +++++++++++++
src-ui/logics/configs/index.js | 1 +
.../others/useEnableNotificationVrcSfx.js | 28 +++++++++++++++++++
src-ui/logics/useReceiveRoutes.js | 6 ++++
src-ui/store.js | 1 +
7 files changed, 62 insertions(+)
create mode 100644 src-ui/logics/configs/others/useEnableNotificationVrcSfx.js
diff --git a/locales/en.yml b/locales/en.yml
index 73ba1ed0..2879e404 100644
--- a/locales/en.yml
+++ b/locales/en.yml
@@ -239,6 +239,7 @@ config_page:
label: Show Only Translated Messages
others:
+ section_label_sounds: Sounds
auto_clear_the_message_box:
label: Auto Clear The Message Box
send_only_translated_messages:
@@ -254,6 +255,8 @@ config_page:
send_message_to_vrc:
label: Send Message To VRChat
desc: There is a way to use it without sending messages to VRChat, but it is not supported. Enable this feature when you intend to send a message to VRChat.
+ notification_vrc_sfx:
+ label: Enable Notification Sound When Sending Chat
send_received_message_to_vrc:
label: Send Received Message To VRChat
desc: Send the message you received from the speaker's sound to VRChat's chatbox.
diff --git a/locales/ja.yml b/locales/ja.yml
index 1218ef08..4603d81e 100644
--- a/locales/ja.yml
+++ b/locales/ja.yml
@@ -237,6 +237,7 @@ config_page:
label: 翻訳後のメッセージのみ表示する
others:
+ section_label_sounds: サウンド
auto_clear_the_message_box:
label: 送信後はチャットボックスを空にする
send_only_translated_messages:
@@ -252,6 +253,8 @@ config_page:
send_message_to_vrc:
label: VRChatにメッセージを送信する
desc: サポート対象外ですが、VRChatにメッセージを送信せずに使う方法があります。送信したい場合、この機能を有効にする事を忘れないでください。
+ notification_vrc_sfx:
+ label: チャット送信時に音を鳴らさない
send_received_message_to_vrc:
label: 受信したメッセージをVRChatに送信する
desc: スピーカーから聞き取り、文字起こしされたメッセージをVRChatに送信します。
diff --git a/src-ui/app/config_page/setting_section/setting_box/others/Others.jsx b/src-ui/app/config_page/setting_section/setting_box/others/Others.jsx
index f1e9a251..25fa5495 100644
--- a/src-ui/app/config_page/setting_section/setting_box/others/Others.jsx
+++ b/src-ui/app/config_page/setting_section/setting_box/others/Others.jsx
@@ -9,6 +9,7 @@ import {
useEnableVrcMicMuteSync,
useEnableSendMessageToVrc,
useEnableSendReceivedMessageToVrc,
+ useEnableNotificationVrcSfx,
} from "@logics_configs";
import {
@@ -25,6 +26,8 @@ import { Checkbox } from "@common_components";
import OpenFolderSvg from "@images/open_folder.svg?react";
export const Others = () => {
+ const { t } = useTranslation();
+
return (
@@ -34,6 +37,10 @@ export const Others = () => {
+
+
+
+
@@ -118,6 +125,19 @@ const SendMessageToVrcContainer = () => {
};
+const EnableNotificationVrcSfxContainer = () => {
+ const { t } = useTranslation();
+ const { currentEnableNotificationVrcSfx, toggleEnableNotificationVrcSfx } = useEnableNotificationVrcSfx();
+
+ return (
+
+ );
+};
+
const SendReceivedMessageToVrcContainer = () => {
const { t } = useTranslation();
const { currentEnableSendReceivedMessageToVrc, toggleEnableSendReceivedMessageToVrc } = useEnableSendReceivedMessageToVrc();
diff --git a/src-ui/logics/configs/index.js b/src-ui/logics/configs/index.js
index e47621c2..22439030 100644
--- a/src-ui/logics/configs/index.js
+++ b/src-ui/logics/configs/index.js
@@ -22,6 +22,7 @@ export { useEnableSendMessageToVrc } from "./others/useEnableSendMessageToVrc";
export { useEnableSendReceivedMessageToVrc } from "./others/useEnableSendReceivedMessageToVrc";
export { useEnableSendOnlyTranslatedMessages } from "./others/useEnableSendOnlyTranslatedMessages";
export { useEnableVrcMicMuteSync } from "./others/useEnableVrcMicMuteSync";
+export { useEnableNotificationVrcSfx } from "./others/useEnableNotificationVrcSfx";
export { useMicRecordTimeout } from "./transcription/useMicRecordTimeout";
export { useMicPhraseTimeout } from "./transcription/useMicPhraseTimeout";
diff --git a/src-ui/logics/configs/others/useEnableNotificationVrcSfx.js b/src-ui/logics/configs/others/useEnableNotificationVrcSfx.js
new file mode 100644
index 00000000..24e1096a
--- /dev/null
+++ b/src-ui/logics/configs/others/useEnableNotificationVrcSfx.js
@@ -0,0 +1,28 @@
+import { useStore_EnableNotificationVrcSfx } from "@store";
+import { useStdoutToPython } from "@logics/useStdoutToPython";
+
+export const useEnableNotificationVrcSfx = () => {
+ const { asyncStdoutToPython } = useStdoutToPython();
+ const { currentEnableNotificationVrcSfx, updateEnableNotificationVrcSfx, pendingEnableNotificationVrcSfx } = useStore_EnableNotificationVrcSfx();
+
+ const getEnableNotificationVrcSfx = () => {
+ pendingEnableNotificationVrcSfx();
+ asyncStdoutToPython("/get/data/notification_vrc_sfx");
+ };
+
+ const toggleEnableNotificationVrcSfx = () => {
+ pendingEnableNotificationVrcSfx();
+ if (currentEnableNotificationVrcSfx.data) {
+ asyncStdoutToPython("/set/disable/notification_vrc_sfx");
+ } else {
+ asyncStdoutToPython("/set/enable/notification_vrc_sfx");
+ }
+ };
+
+ return {
+ currentEnableNotificationVrcSfx,
+ getEnableNotificationVrcSfx,
+ toggleEnableNotificationVrcSfx,
+ updateEnableNotificationVrcSfx,
+ };
+};
\ No newline at end of file
diff --git a/src-ui/logics/useReceiveRoutes.js b/src-ui/logics/useReceiveRoutes.js
index d23f07e5..b3a5c4cd 100644
--- a/src-ui/logics/useReceiveRoutes.js
+++ b/src-ui/logics/useReceiveRoutes.js
@@ -69,6 +69,7 @@ import {
useIsEnabledOverlayLargeLog,
useOverlayLargeLogSettings,
useOverlayShowOnlyTranslatedMessages,
+ useEnableNotificationVrcSfx,
useHotkeys,
useOscIpAddress,
useOscPort,
@@ -170,6 +171,7 @@ export const useReceiveRoutes = () => {
const { updateOverlayLargeLogSettings } = useOverlayLargeLogSettings();
const { updateIsEnabledOverlayLargeLog } = useIsEnabledOverlayLargeLog();
const { updateOverlayShowOnlyTranslatedMessages } = useOverlayShowOnlyTranslatedMessages();
+ const { updateEnableNotificationVrcSfx } = useEnableNotificationVrcSfx();
const { updateHotkeys } = useHotkeys();
@@ -472,6 +474,10 @@ export const useReceiveRoutes = () => {
"/set/enable/send_received_message_to_vrc": updateEnableSendReceivedMessageToVrc,
"/set/disable/send_received_message_to_vrc": updateEnableSendReceivedMessageToVrc,
+ "/get/data/notification_vrc_sfx": updateEnableNotificationVrcSfx,
+ "/set/enable/notification_vrc_sfx": updateEnableNotificationVrcSfx,
+ "/set/disable/notification_vrc_sfx": updateEnableNotificationVrcSfx,
+
// Hotkeys
"/get/data/hotkeys": updateHotkeys,
"/set/data/hotkeys": updateHotkeys,
diff --git a/src-ui/store.js b/src-ui/store.js
index 17c74d20..5eb0746f 100644
--- a/src-ui/store.js
+++ b/src-ui/store.js
@@ -264,6 +264,7 @@ export const { atomInstance: Atom_EnableAutoExportMessageLogs, useHook: useStore
export const { atomInstance: Atom_EnableVrcMicMuteSync, useHook: useStore_EnableVrcMicMuteSync } = createAtomWithHook(false, "EnableVrcMicMuteSync");
export const { atomInstance: Atom_EnableSendMessageToVrc, useHook: useStore_EnableSendMessageToVrc } = createAtomWithHook(true, "EnableSendMessageToVrc");
export const { atomInstance: Atom_EnableSendReceivedMessageToVrc, useHook: useStore_EnableSendReceivedMessageToVrc } = createAtomWithHook(false, "EnableSendReceivedMessageToVrc");
+export const { atomInstance: Atom_EnableNotificationVrcSfx, useHook: useStore_EnableNotificationVrcSfx } = createAtomWithHook(true, "EnableNotificationVrcSfx");
// Hotkeys
export const { atomInstance: Atom_Hotkeys, useHook: useStore_Hotkeys } = createAtomWithHook({