Compare commits
No commits in common. "21ecdf77c61ca3141cc5018bde158fb4a15414b6" and "be59329581595d89afae98f43a2d9bbb42083d98" have entirely different histories.
21ecdf77c6
...
be59329581
Binary file not shown.
Before Width: | Height: | Size: 350 B |
Binary file not shown.
Before Width: | Height: | Size: 65 KiB |
@ -58,9 +58,6 @@ const avatarPartsDef = {
|
|||||||
fur: 10,
|
fur: 10,
|
||||||
eyes: 15,
|
eyes: 15,
|
||||||
mouth: 10
|
mouth: 10
|
||||||
},
|
|
||||||
'nctv': {
|
|
||||||
body: null,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,23 +169,6 @@ 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.
|
||||||
@ -314,21 +294,6 @@ 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) {
|
||||||
@ -372,9 +337,6 @@ if (isMainThread) {
|
|||||||
throw err
|
throw err
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
} else if (part === 'nctv') {
|
|
||||||
generateNigbotAvatar();
|
|
||||||
parentPort.postMessage('done');
|
|
||||||
} else {
|
} else {
|
||||||
generateAvatars(part).then(
|
generateAvatars(part).then(
|
||||||
() => {
|
() => {
|
||||||
|
@ -175,7 +175,6 @@ avatar_set_description: |
|
|||||||
Please refer to the documentation:
|
Please refer to the documentation:
|
||||||
<a href="https://livingston.frama.io/peertube-plugin-livechat/documentation/admin/settings/" target="_blank">Settings</a>.
|
<a href="https://livingston.frama.io/peertube-plugin-livechat/documentation/admin/settings/" target="_blank">Settings</a>.
|
||||||
avatar_set_option_sepia: "Sepia (Peertube mascot)"
|
avatar_set_option_sepia: "Sepia (Peertube mascot)"
|
||||||
avatar_set_option_nctv: "NCTV Branded"
|
|
||||||
avatar_set_option_cat: "Cats"
|
avatar_set_option_cat: "Cats"
|
||||||
avatar_set_option_bird: "Birds"
|
avatar_set_option_bird: "Birds"
|
||||||
avatar_set_option_fenec: "Fenecs (Mobilizon mascot)"
|
avatar_set_option_fenec: "Fenecs (Mobilizon mascot)"
|
||||||
|
@ -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', 'nctv'].includes(avatarSet)) {
|
if (!['sepia', 'cat', 'bird', 'fenec', 'abstract', 'legacy'].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'
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ import { LivechatProsodyAuth } from './prosody/auth'
|
|||||||
import { loc } from './loc'
|
import { loc } from './loc'
|
||||||
const escapeHTML = require('escape-html')
|
const escapeHTML = require('escape-html')
|
||||||
|
|
||||||
type AvatarSet = 'sepia' | 'cat' | 'bird' | 'fenec' | 'abstract' | 'legacy' | 'nctv'
|
type AvatarSet = 'sepia' | 'cat' | 'bird' | 'fenec' | 'abstract' | 'legacy'
|
||||||
|
|
||||||
async function initSettings (options: RegisterServerOptions): Promise<void> {
|
async function initSettings (options: RegisterServerOptions): Promise<void> {
|
||||||
const { peertubeHelpers, settingsManager } = options
|
const { peertubeHelpers, settingsManager } = options
|
||||||
@ -506,7 +506,6 @@ 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: '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') },
|
||||||
|
@ -28,7 +28,6 @@ These files are used to generate multiple avatars (see the `build-avatars.js` sc
|
|||||||
* `assets/images/avatars/bird` contains new birds avatar set, based on the work of David Revoy (see copyright informations)
|
* `assets/images/avatars/bird` contains new birds avatar set, based on the work of David Revoy (see copyright informations)
|
||||||
* `assets/images/avatars/fenec` contains new fenecs avatar set, based on the work of David Revoy (see copyright informations)
|
* `assets/images/avatars/fenec` contains new fenecs avatar set, based on the work of David Revoy (see copyright informations)
|
||||||
* `assets/images/avatars/abstract` contains new abstract avatar set, based on the work of David Revoy (see copyright informations)
|
* `assets/images/avatars/abstract` contains new abstract avatar set, based on the work of David Revoy (see copyright informations)
|
||||||
* `assets/images/avatars/nctv` contains NCTV avatar, based on the work of The Almighty Kek
|
|
||||||
|
|
||||||
### assets/styles
|
### assets/styles
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user