From 1fb071561675a76f8e7fbd43b179d4738582a5b4 Mon Sep 17 00:00:00 2001 From: darbyjack Date: Wed, 17 Aug 2022 17:43:53 -0500 Subject: [PATCH] Attempt to split out line entries --- converters/chatchat/deluxechat.ts | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/converters/chatchat/deluxechat.ts b/converters/chatchat/deluxechat.ts index 377d021..f3c96a3 100644 --- a/converters/chatchat/deluxechat.ts +++ b/converters/chatchat/deluxechat.ts @@ -44,18 +44,20 @@ const ChatChatDeluxeChatConverter = new Converter { - let formattedSegment = dcFormat[segment]; + let original = dcFormat[segment]; - if (formattedSegment) { + let formSeg: string[] = []; + + if (original) { // Add in the click command if it exists let segmentClick = dcFormat[(segment + "_click_command") as keyof DeluxeChatFormat]; if (segmentClick && segmentClick !== "") { - formattedSegment = + original = "" + - formattedSegment + + original + ""; } } @@ -66,16 +68,21 @@ const ChatChatDeluxeChatConverter = new Converter s && s !== ""); if (segmentHover && segmentHover.length > 0) { - formattedSegment = - "") + - "'>" + - formattedSegment + - ""; + formSeg.push(" { + formSeg.push(s + ""); + }); + formSeg.push("'>"); + formSeg.push(original); + formSeg.push(""); } } - if (formattedSegment !== "") { - ccFormat.parts[segment] = [MiniMessage(formattedSegment)]; + if (formSeg && formSeg.length > 0) { + let tmp: string[] = []; + formSeg.forEach((s) => { + tmp.push(MiniMessage(s)); + }); + ccFormat.parts[segment] = tmp; } } );