Added HTML colors for SChat. Adapted Letters game for SChat.
This commit is contained in:
@@ -11,6 +11,20 @@ function schatItalic(text) {
|
||||
return `*${text}*`;
|
||||
}
|
||||
|
||||
function schatColor(text, color) {
|
||||
return `<span style="color: ${color}">${text}</span>`;
|
||||
}
|
||||
|
||||
function curate(fn) {
|
||||
return (text) => {
|
||||
if (text) {
|
||||
return fn(text);
|
||||
}
|
||||
|
||||
return '';
|
||||
};
|
||||
}
|
||||
|
||||
function bypass(text) {
|
||||
return text;
|
||||
}
|
||||
@@ -22,8 +36,9 @@ module.exports = (() => {
|
||||
|
||||
if (config.platform === 'schat') {
|
||||
const methods = {
|
||||
bold: schatBold,
|
||||
italic: schatItalic,
|
||||
bold: curate(schatBold),
|
||||
italic: curate(schatItalic),
|
||||
...Object.fromEntries(Object.entries(config.schatColors).map(([color, value]) => [color, curate((text) => schatColor(text, value))])),
|
||||
};
|
||||
|
||||
const handler = {
|
||||
|
||||
Reference in New Issue
Block a user