Skip to content

Commit 08cd0f8

Browse files
committed
Misc Changes
- Made the toolbox in the top left clickable - Added social spy support for the converters
1 parent 698fe96 commit 08cd0f8

File tree

11 files changed

+105
-37
lines changed

11 files changed

+105
-37
lines changed

converters/chatchat/deluxechat.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ const ChatChatDeluxeChatConverter = new Converter<
2929
"recipient-format": {
3030
parts: [],
3131
},
32+
"social-spy-format": {
33+
parts: [],
34+
},
3235
};
3336
if (deluxechatConfig.formats) {
3437
const formats = deluxechatConfig.formats;
@@ -119,6 +122,17 @@ const ChatChatDeluxeChatConverter = new Converter<
119122
break;
120123
}
121124
});
125+
126+
if (formats.social_spy) {
127+
const socialSpyFormat = formats.social_spy;
128+
const ccSocialSpyPartsFormat: string[] = [];
129+
130+
ccSocialSpyPartsFormat.push(MiniMessage(socialSpyFormat));
131+
ccSocialSpyPartsFormat.push("<message>");
132+
133+
chatchatSettingsConfig["social-spy-format"].parts =
134+
ccSocialSpyPartsFormat;
135+
}
122136
}
123137

124138
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 (!essentialschatConfig.config || !essentialschatConfig.config.chat) {
@@ -68,6 +71,12 @@ const ChatChatEssentialsChatConverter = new Converter<
6871
);
6972
}
7073

74+
if (essentialschatConfig.language.socialSpyMsgFormat) {
75+
chatchatSettingsConfig["social-spy-format"].parts.push(
76+
MiniMessage(essentialschatConfig.language.socialSpyMsgFormat)
77+
);
78+
}
79+
7180
return {
7281
format: chatchatFormatsConfig,
7382
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/deluxechat.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@
9898
"$ref": "#/definitions/DeluxeChatPrivateMessageFormat"
9999
}
100100
},
101-
"required": ["to_recipient", "to_sender"]
101+
"required": [
102+
"to_recipient",
103+
"to_sender"
104+
]
102105
},
103106
"formats": {
104107
"type": "object",
@@ -199,4 +202,4 @@
199202
]
200203
}
201204
}
202-
}
205+
}

converters/types/essentialschat.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@
1313
"properties": {
1414
"msgFormat": {
1515
"type": "string"
16+
},
17+
"socialSpyMsgFormat": {
18+
"type": "string"
1619
}
1720
}
1821
}
1922
},
20-
"required": ["config", "language"]
23+
"required": [
24+
"config",
25+
"language"
26+
]
2127
},
2228
"EssentialsChatConfig": {
2329
"type": "object",
@@ -26,7 +32,10 @@
2632
"type": "object",
2733
"properties": {
2834
"format": {
29-
"type": ["string", "null"]
35+
"type": [
36+
"string",
37+
"null"
38+
]
3039
},
3140
"group-formats": {
3241
"anyOf": [
@@ -44,7 +53,9 @@
4453
}
4554
}
4655
},
47-
"required": ["chat"]
56+
"required": [
57+
"chat"
58+
]
4859
}
4960
}
50-
}
61+
}

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
config: EssentialsChatConfig;
1414
language: {
1515
msgFormat?: string;
16+
socialSpyMsgFormat?: string;
1617
};
1718
}

converters/types/venturechat.json

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,21 @@
1111
"tellformatfrom": {
1212
"type": "string"
1313
},
14+
"tellformatspy": {
15+
"type": "string"
16+
},
1417
"jsonformatting": {
1518
"type": "object",
1619
"additionalProperties": {
1720
"$ref": "#/definitions/VentureChatFormat"
1821
}
1922
}
2023
},
21-
"required": ["tellformatto", "tellformatfrom"]
24+
"required": [
25+
"tellformatto",
26+
"tellformatfrom",
27+
"tellformatspy"
28+
]
2229
},
2330
"VentureChatFormat": {
2431
"type": "object",
@@ -33,7 +40,9 @@
3340
}
3441
}
3542
},
36-
"required": ["priority"]
43+
"required": [
44+
"priority"
45+
]
3746
},
3847
"VentureChatJsonComponent": {
3948
"type": "object",
@@ -51,7 +60,11 @@
5160
"type": "string"
5261
}
5362
},
54-
"required": ["hover_text", "click_action", "click_text"]
63+
"required": [
64+
"hover_text",
65+
"click_action",
66+
"click_text"
67+
]
5568
}
5669
}
57-
}
70+
}

converters/types/venturechat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
export interface VentureChatConfig {
44
tellformatto: string;
55
tellformatfrom: string;
6+
tellformatspy: string;
67
jsonformatting?: {
78
[key: string]: VentureChatFormat;
89
};

pages/_app.tsx

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,32 @@ function Toolbox({ Component, pageProps }: AppProps) {
1616
css={tw`text-white bg-black w-full md:px-8 p-2 h-14 flex flex-row text-white md:px-12`}
1717
>
1818
<div css={tw`flex flex-row w-full`}>
19-
<div css={tw`flex flex-row`}>
20-
<div css={tw`my-auto`}>
21-
<FontAwesomeIcon icon={faToolbox} size={"2x"} />
22-
</div>
23-
<div css={tw`ml-2 my-auto font-bold text-center`}>
24-
<p
25-
css={css`
26-
margin-bottom: -0.2rem;
27-
`}
28-
>
29-
HelpChat
30-
</p>
31-
<p
32-
css={css`
33-
margin-top: -0.2rem;
34-
${tw`text-xs`}
35-
`}
36-
>
37-
ToolBox
38-
</p>
19+
<Link href={"/"} passHref>
20+
<div css={tw`flex flex-row`}>
21+
<div css={tw`my-auto`}>
22+
<FontAwesomeIcon icon={faToolbox} size={"2x"} />
23+
</div>
24+
<div css={tw`ml-2 my-auto font-bold text-center`}>
25+
<p
26+
css={css`
27+
margin-bottom: -0.2rem;
28+
`}
29+
>
30+
HelpChat
31+
</p>
32+
<p
33+
css={css`
34+
margin-top: -0.2rem;
35+
${tw`text-xs`}
36+
`}
37+
>
38+
ToolBox
39+
</p>
40+
</div>
3941
</div>
40-
</div>
42+
</Link>
4143
<div css={tw`flex flex-row flex-grow flex-shrink`}>
42-
<Link href={"/"}>
44+
<Link href={"/"} passHref>
4345
<p
4446
css={tw`px-3 mx-1 py-2 my-auto ml-auto hover:cursor-pointer`}
4547
>
@@ -48,12 +50,13 @@ function Toolbox({ Component, pageProps }: AppProps) {
4850
</Link>
4951
<Link
5052
href={"https://www.spigotmc.org/members/helpchat.1491649/"}
53+
passHref
5154
>
5255
<p css={tw`px-3 mx-1 py-2 my-auto hover:cursor-pointer`}>
5356
Spigot
5457
</p>
5558
</Link>
56-
<Link href={"https://github.com/HelpChat"}>
59+
<Link href={"https://github.com/HelpChat"} passHref>
5760
<p css={tw`px-3 mx-1 py-2 my-auto hover:cursor-pointer`}>
5861
Github
5962
</p>
@@ -82,7 +85,7 @@ function Toolbox({ Component, pageProps }: AppProps) {
8285
if (Array.isArray(Tools[key])) {
8386
(Tools[key] as ToolboxTool[]).forEach((tool) => {
8487
children.push(
85-
<Link href={tool.link}>
88+
<Link href={tool.link} passHref>
8689
<p
8790
css={tw`px-3 mx-1 pt-3 ml-1 pb-1 hover:cursor-pointer`}
8891
>
@@ -99,7 +102,7 @@ function Toolbox({ Component, pageProps }: AppProps) {
99102
key1
100103
].forEach((tool) => {
101104
children.push(
102-
<Link href={tool.link}>
105+
<Link href={tool.link} passHref>
103106
<p
104107
css={tw`px-3 mx-1 pt-3 ml-2 pb-1 hover:cursor-pointer`}
105108
>
@@ -134,7 +137,7 @@ function Toolbox({ Component, pageProps }: AppProps) {
134137
})}
135138
</div>
136139
</div>
137-
<Link href={"https://discord.gg/helpchat"}>
140+
<Link href={"https://discord.gg/helpchat"} passHref>
138141
<p
139142
css={tw`px-3 mx-1 py-2 my-auto hover:cursor-pointer bg-white text-black rounded-md`}
140143
>

0 commit comments

Comments
 (0)