(add) new achievement
This commit is contained in:
parent
25e030a707
commit
d16ef2e16e
|
|
@ -1467,6 +1467,11 @@ export interface Locale {
|
|||
"description": string;
|
||||
"flavor": string;
|
||||
};
|
||||
"_smashTestNotificationButton": {
|
||||
"title": string;
|
||||
"description": string;
|
||||
"flavor": string;
|
||||
};
|
||||
};
|
||||
};
|
||||
"_role": {
|
||||
|
|
|
|||
|
|
@ -1391,6 +1391,10 @@ _achievements:
|
|||
title: "Brain Diver"
|
||||
description: "Brain Diverへのリンクを投稿した"
|
||||
flavor: "Misskey-Misskey La-Tu-Ma"
|
||||
_smashTestNotificationButton:
|
||||
title: "セルフ通知破壊"
|
||||
description: "通知テストを連打した"
|
||||
flavor: "ほどほどにしておきましょう"
|
||||
|
||||
_role:
|
||||
new: "ロールの作成"
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ export const ACHIEVEMENT_TYPES = [
|
|||
'setNameToSyuilo',
|
||||
'cookieClicked',
|
||||
'brainDiver',
|
||||
'smashTestNotificationButton',
|
||||
] as const;
|
||||
|
||||
@Injectable()
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ export const ACHIEVEMENT_TYPES = [
|
|||
'setNameToSyuilo',
|
||||
'cookieClicked',
|
||||
'brainDiver',
|
||||
'smashTestNotificationButton',
|
||||
] as const;
|
||||
|
||||
export const ACHIEVEMENT_BADGES = {
|
||||
|
|
@ -454,6 +455,11 @@ export const ACHIEVEMENT_BADGES = {
|
|||
bg: 'linear-gradient(0deg, rgb(144, 224, 255), rgb(255, 168, 252))',
|
||||
frame: 'bronze',
|
||||
},
|
||||
'smashTestNotificationButton': {
|
||||
img: '/fluent-emoji/1f514.png',
|
||||
bg: 'linear-gradient(0deg, rgb(187 183 59), rgb(255 143 77))',
|
||||
frame: 'bronze',
|
||||
},
|
||||
/* @see <https://github.com/misskey-dev/misskey/pull/10365#discussion_r1155511107>
|
||||
} as const satisfies Record<typeof ACHIEVEMENT_TYPES[number], {
|
||||
img: string;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@
|
|||
import * as Misskey from 'misskey-js';
|
||||
import * as os from '@/os';
|
||||
import { globalEvents } from '@/events';
|
||||
import { claimAchievement } from '@/scripts/achievements';
|
||||
|
||||
let smashCount = 0;
|
||||
let smashTimer: number | null = null;
|
||||
|
||||
/**
|
||||
* テスト通知を送信
|
||||
|
|
@ -31,4 +35,17 @@ export function testNotification(type: 'client' | 'server'): void {
|
|||
globalEvents.emit('clientNotification', notification);
|
||||
break;
|
||||
}
|
||||
|
||||
// セルフ通知破壊 実績関連
|
||||
smashCount++;
|
||||
if (smashCount >= 7) {
|
||||
claimAchievement('smashTestNotificationButton');
|
||||
smashCount = 0;
|
||||
}
|
||||
if (smashTimer) {
|
||||
clearTimeout(smashTimer);
|
||||
}
|
||||
smashTimer = window.setTimeout(() => {
|
||||
smashCount = 0;
|
||||
}, 300);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue