From 02868bb8e7f6e21fa238485ae9b9f20b18f888a4 Mon Sep 17 00:00:00 2001 From: yagamuu Date: Fri, 9 Aug 2024 12:20:36 +0900 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E5=AE=9A=E6=9D=A1=E4=BB=B6=E3=81=A7?= =?UTF-8?q?=E6=9B=B2=E5=90=8D=E6=9C=AB=E5=B0=BE=E3=83=A9=E3=82=A4=E3=82=BB?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E6=83=85=E5=A0=B1=E3=82=92=E7=84=A1=E8=A6=96?= =?UTF-8?q?=E3=81=99=E3=82=8B=20(#751)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configschema.json | 7 ++++++- src/browser/graphics/components/music.tsx | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/configschema.json b/configschema.json index cc05dbfb..b5dc00e7 100644 --- a/configschema.json +++ b/configschema.json @@ -71,7 +71,12 @@ "additionalProperties": false, "properties": { "textPrefix": {"type": "string", "default": ""}, - "textSuffix": {"type": "string", "default": ""} + "textSuffix": {"type": "string", "default": ""}, + "removeMusicSuffix": { + "type": "array", + "items": {"type": "string"}, + "default": [] + } } }, "googleApiKey": {"type": "string"}, diff --git a/src/browser/graphics/components/music.tsx b/src/browser/graphics/components/music.tsx index d3eb51fd..d4ee5dd8 100644 --- a/src/browser/graphics/components/music.tsx +++ b/src/browser/graphics/components/music.tsx @@ -7,9 +7,15 @@ import {ThinText} from "./lib/text"; export const Music = () => { const playingMusic = useReplicant("playing-music"); + const isRemoveMusicSuffix = + nodecg.bundleConfig.music?.removeMusicSuffix?.some((music) => + playingMusic?.includes(music), + ); const text = `${ nodecg.bundleConfig.music?.textPrefix ?? "" - } ${playingMusic} ${nodecg.bundleConfig.music?.textSuffix ?? ""}`; + } ${playingMusic} ${ + !isRemoveMusicSuffix ? nodecg.bundleConfig.music?.textSuffix ?? "" : "" + }`; const ref = useRef(null); const [shownText, setShownText] = useState("");