Compare commits
11 Commits
8dd6ed7888
...
nctv-avata
Author | SHA1 | Date | |
---|---|---|---|
21ecdf77c6 | |||
cfe2ac0607 | |||
74566a895a | |||
587334a3e1 | |||
30cce2ec03 | |||
24f48788ab | |||
bed00aa4c5 | |||
fd16c95b8f | |||
39f6e4c637 | |||
f8c34213cb | |||
eb889711f5 |
BIN
assets/images/avatars/nctv/hat_01.png
Normal file
BIN
assets/images/avatars/nctv/hat_01.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 350 B |
@ -60,7 +60,7 @@ const avatarPartsDef = {
|
|||||||
mouth: 10
|
mouth: 10
|
||||||
},
|
},
|
||||||
'nctv': {
|
'nctv': {
|
||||||
background: null
|
body: null,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,6 +172,23 @@ async function generateAvatars (part) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const generateNigbotAvatar = async () => {
|
||||||
|
console.log('Starting generating nigbot avatar');
|
||||||
|
|
||||||
|
const inputDir = './assets/images/avatars/nctv/';
|
||||||
|
const outputDir = './dist/server/avatars/nctv/';
|
||||||
|
fs.mkdirSync(outputDir, { recursive: true });
|
||||||
|
|
||||||
|
const buff = await sharp(path.join(inputDir, 'nigbot.png')).toBuffer();
|
||||||
|
await sharp(buff)
|
||||||
|
.resize(60, 60)
|
||||||
|
.png({ palette: true })
|
||||||
|
.toFile(path.join(outputDir, '1.png'));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async function generateBotsAvatars () {
|
async function generateBotsAvatars () {
|
||||||
{
|
{
|
||||||
// Moderation bot avatar: choosing some parts, and turning it so it is facing left.
|
// Moderation bot avatar: choosing some parts, and turning it so it is facing left.
|
||||||
@ -297,6 +314,21 @@ async function generateBotsAvatars () {
|
|||||||
})
|
})
|
||||||
.toFile(path.join(botOutputDir, '1.png'))
|
.toFile(path.join(botOutputDir, '1.png'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// Nigbot avatar for users
|
||||||
|
const inputDir = './assets/images/avatars/nctv'
|
||||||
|
const botOutputDir = './dist/server/bot_avatars/nctv/'
|
||||||
|
fs.mkdirSync(botOutputDir, { recursive: true })
|
||||||
|
const buff = await sharp(path.join(inputDir, 'nigbot.png'))
|
||||||
|
.toBuffer()
|
||||||
|
|
||||||
|
await sharp(buff)
|
||||||
|
// .resize(60, 60)
|
||||||
|
.png()
|
||||||
|
.toFile(path.join(botOutputDir, '1.png'))
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isMainThread) {
|
if (isMainThread) {
|
||||||
@ -340,6 +372,9 @@ if (isMainThread) {
|
|||||||
throw err
|
throw err
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
} else if (part === 'nctv') {
|
||||||
|
generateNigbotAvatar();
|
||||||
|
parentPort.postMessage('done');
|
||||||
} else {
|
} else {
|
||||||
generateAvatars(part).then(
|
generateAvatars(part).then(
|
||||||
() => {
|
() => {
|
||||||
|
@ -102,7 +102,7 @@ async function getProsodyFilePaths (options: RegisterServerOptions): Promise<Pro
|
|||||||
}
|
}
|
||||||
|
|
||||||
let avatarSet: AvatarSet = (settings['avatar-set'] ?? 'sepia') as AvatarSet
|
let avatarSet: AvatarSet = (settings['avatar-set'] ?? 'sepia') as AvatarSet
|
||||||
if (!['sepia', 'cat', 'bird', 'fenec', 'abstract', 'legacy'].includes(avatarSet)) {
|
if (!['sepia', 'cat', 'bird', 'fenec', 'abstract', 'legacy', 'nctv'].includes(avatarSet)) {
|
||||||
logger.error('Invalid avatar-set setting, using sepia as default')
|
logger.error('Invalid avatar-set setting, using sepia as default')
|
||||||
avatarSet = 'sepia'
|
avatarSet = 'sepia'
|
||||||
}
|
}
|
||||||
|
@ -506,7 +506,7 @@ function initThemingSettings ({ registerSetting }: RegisterServerOptions): void
|
|||||||
private: true,
|
private: true,
|
||||||
options: [
|
options: [
|
||||||
{ value: 'sepia', label: loc('avatar_set_option_sepia') },
|
{ value: 'sepia', label: loc('avatar_set_option_sepia') },
|
||||||
{ value: 'NCTV', label: loc('avatar_set_option_nctv') },
|
{ value: 'nctv', label: loc('avatar_set_option_nctv') },
|
||||||
{ value: 'cat', label: loc('avatar_set_option_cat') },
|
{ value: 'cat', label: loc('avatar_set_option_cat') },
|
||||||
{ value: 'bird', label: loc('avatar_set_option_bird') },
|
{ value: 'bird', label: loc('avatar_set_option_bird') },
|
||||||
{ value: 'fenec', label: loc('avatar_set_option_fenec') },
|
{ value: 'fenec', label: loc('avatar_set_option_fenec') },
|
||||||
|
Reference in New Issue
Block a user