Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Attempt to split out line entries #30

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions converters/chatchat/deluxechat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,20 @@ const ChatChatDeluxeChatConverter = new Converter<DeluxeChat,

(["channel", "prefix", "name", "suffix"] as const).forEach(
(segment) => {
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 =
"<click:run_command:'" +
segmentClick +
"'>" +
formattedSegment +
original +
"</click>";
}
}
Expand All @@ -66,16 +68,21 @@ const ChatChatDeluxeChatConverter = new Converter<DeluxeChat,
dcFormat[(segment + "_tooltip") as keyof DeluxeChatFormat]
)).filter((s) => s && s !== "");
if (segmentHover && segmentHover.length > 0) {
formattedSegment =
"<hover:show_text:'" +
segmentHover.join("<newline>") +
"'>" +
formattedSegment +
"</hover>";
formSeg.push("<hover:show_text:'");
segmentHover.forEach((s) => {
formSeg.push(s + "<newline>");
});
formSeg.push("'>");
formSeg.push(original);
formSeg.push("</hover>");
}
}
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;
}
}
);
Expand Down