Skip to content

Commit dd92490

Browse files
darbyjackFredthedoggy
authored andcommitted
Misc Changes
- Made the toolbox in the top left clickable - Added social spy support for the converters
1 parent bd166c1 commit dd92490

File tree

9 files changed

+50
-16
lines changed

9 files changed

+50
-16
lines changed

converters/chatchat/deluxechat.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ const ChatChatDeluxeChatConverter = new Converter<
3131
"recipient-format": {
3232
parts: [],
3333
},
34+
"social-spy-format": {
35+
parts: [],
36+
},
3437
};
3538
if (deluxechatConfig.formats) {
3639
const formats = deluxechatConfig.formats;
@@ -121,6 +124,17 @@ const ChatChatDeluxeChatConverter = new Converter<
121124
break;
122125
}
123126
});
127+
128+
if (formats.social_spy) {
129+
const socialSpyFormat = formats.social_spy;
130+
const ccSocialSpyPartsFormat: string[] = [];
131+
132+
ccSocialSpyPartsFormat.push(MiniMessage(socialSpyFormat));
133+
ccSocialSpyPartsFormat.push("<message>");
134+
135+
chatchatSettingsConfig["social-spy-format"].parts =
136+
ccSocialSpyPartsFormat;
137+
}
124138
}
125139

126140
return {

converters/chatchat/essentialschat.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ const ChatChatEssentialsChatConverter = new Converter<
2525
"recipient-format": {
2626
parts: [],
2727
},
28+
"social-spy-format": {
29+
parts: [],
30+
},
2831
};
2932

3033
if (
@@ -71,6 +74,12 @@ const ChatChatEssentialsChatConverter = new Converter<
7174
);
7275
}
7376

77+
if (essentialschatConfig.language.socialSpyMsgFormat) {
78+
chatchatSettingsConfig["social-spy-format"].parts.push(
79+
MiniMessage(essentialschatConfig.language.socialSpyMsgFormat)
80+
);
81+
}
82+
7483
return {
7584
format: chatchatFormatsConfig,
7685
settings: chatchatSettingsConfig,

converters/chatchat/venturechat.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ const ChatChatVentureChatConverter = new Converter<
2525
"recipient-format": {
2626
parts: [],
2727
},
28+
"social-spy-format": {
29+
parts: [],
30+
},
2831
};
2932

3033
if (venturechatConfig.jsonformatting) {
@@ -93,6 +96,7 @@ const ChatChatVentureChatConverter = new Converter<
9396

9497
const toFormat = venturechatConfig.tellformatto;
9598
const fromFormat = venturechatConfig.tellformatfrom;
99+
const spyFormat = venturechatConfig.tellformatspy;
96100

97101
let ccPartsFormat: string[] = [];
98102

@@ -109,6 +113,14 @@ const ChatChatVentureChatConverter = new Converter<
109113
ccPartsFormat.push("<message>");
110114
chatchatSettingsConfig["recipient-format"].parts = ccPartsFormat;
111115

116+
// Reset
117+
ccPartsFormat = [];
118+
119+
// The spy format
120+
ccPartsFormat.push(MiniMessage(fromFormat));
121+
ccPartsFormat.push("<message>");
122+
chatchatSettingsConfig["social-spy-format"].parts = ccPartsFormat;
123+
112124
return {
113125
format: chatchatFormatsConfig,
114126
settings: chatchatSettingsConfig,

converters/types/chatchat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type ChatChatFormat = {
1212
export interface ChatChatSettingsConfig {
1313
"sender-format": ChatChatParts;
1414
"recipient-format": ChatChatParts;
15+
"social-spy-format": ChatChatParts;
1516
}
1617

1718
export interface ChatChatParts {

converters/types/essentialschat.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@
55
"EssentialsChatTypes": {
66
"type": "object",
77
"properties": {
8-
"essentials": {
8+
"config": {
99
"$ref": "#/definitions/EssentialsChatConfig"
1010
},
1111
"language": {
1212
"type": "object",
1313
"properties": {
1414
"msgFormat": {
1515
"type": "string"
16+
},
17+
"socialSpyMsgFormat": {
18+
"type": "string"
1619
}
1720
}
1821
}
1922
},
2023
"required": [
21-
"essentials",
24+
"config",
2225
"language"
2326
]
2427
},

converters/types/essentialschat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ export interface EssentialsChatTypes {
1313
essentials: EssentialsChatConfig;
1414
language: {
1515
msgFormat?: string;
16+
socialSpyMsgFormat?: string;
1617
};
1718
}

converters/types/venturechat.json

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$ref": "#/definitions/VentureChat",
3+
"$ref": "#/definitions/VentureChatConfig",
44
"definitions": {
5-
"VentureChat": {
6-
"type": "object",
7-
"properties": {
8-
"venturechat": {
9-
"$ref": "#/definitions/VentureChatConfig"
10-
}
11-
},
12-
"required": [
13-
"venturechat"
14-
]
15-
},
165
"VentureChatConfig": {
176
"type": "object",
187
"properties": {
@@ -22,6 +11,9 @@
2211
"tellformatfrom": {
2312
"type": "string"
2413
},
14+
"tellformatspy": {
15+
"type": "string"
16+
},
2517
"jsonformatting": {
2618
"type": "object",
2719
"additionalProperties": {
@@ -31,7 +23,8 @@
3123
},
3224
"required": [
3325
"tellformatto",
34-
"tellformatfrom"
26+
"tellformatfrom",
27+
"tellformatspy"
3528
]
3629
},
3730
"VentureChatFormat": {

converters/types/venturechat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface VentureChat {
77
export interface VentureChatConfig {
88
tellformatto: string;
99
tellformatfrom: string;
10+
tellformatspy: string;
1011
jsonformatting?: {
1112
[key: string]: VentureChatFormat;
1213
};

pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function ToolboxCard({
8383
link: string;
8484
}) {
8585
return (
86-
<Link href={link}>
86+
<Link href={link} passHref>
8787
<div
8888
css={tw`p-3 rounded-md bg-white/20 text-white hover:cursor-pointer width[13rem] h-48 block grid grid-cols-1 place-items-center`}
8989
>

0 commit comments

Comments
 (0)