mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-29 05:38:30 +01:00
(add) achivement
This commit is contained in:
parent
30fc67ff44
commit
d848bee0b8
5 changed files with 23 additions and 1 deletions
4
locales/index.d.ts
vendored
4
locales/index.d.ts
vendored
|
@ -1612,6 +1612,10 @@ export interface Locale {
|
|||
"title": string;
|
||||
"description": string;
|
||||
};
|
||||
"_tutorialCompleted": {
|
||||
"title": string;
|
||||
"description": string;
|
||||
};
|
||||
};
|
||||
};
|
||||
"_role": {
|
||||
|
|
|
@ -1524,6 +1524,9 @@ _achievements:
|
|||
_smashTestNotificationButton:
|
||||
title: "テスト過剰"
|
||||
description: "通知のテストをごく短時間のうちに連続して行った"
|
||||
_tutorialCompleted:
|
||||
title: "Misskey初心者講座 修了証"
|
||||
description: "チュートリアルを完了した"
|
||||
|
||||
_role:
|
||||
new: "ロールの作成"
|
||||
|
|
|
@ -86,6 +86,7 @@ export const ACHIEVEMENT_TYPES = [
|
|||
'cookieClicked',
|
||||
'brainDiver',
|
||||
'smashTestNotificationButton',
|
||||
'tutorialCompleted',
|
||||
] as const;
|
||||
|
||||
@Injectable()
|
||||
|
|
|
@ -148,7 +148,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, shallowRef } from 'vue';
|
||||
import { ref, shallowRef, watch } from 'vue';
|
||||
import MkModalWindow from '@/components/MkModalWindow.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import XNote from '@/components/MkTutorialDialog.Note.vue';
|
||||
|
@ -159,6 +159,7 @@ import MkAnimBg from '@/components/MkAnimBg.vue';
|
|||
import { i18n } from '@/i18n.js';
|
||||
import { instance } from '@/instance.js';
|
||||
import { host } from '@/config.js';
|
||||
import { claimAchievement } from '@/scripts/achievements.js';
|
||||
import * as os from '@/os.js';
|
||||
|
||||
const props = defineProps<{
|
||||
|
@ -174,6 +175,13 @@ const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
|
|||
// eslint-disable-next-line vue/no-setup-props-destructure
|
||||
const page = ref(props.initialPage ?? 0);
|
||||
|
||||
watch(page, (to) => {
|
||||
// チュートリアルの枚数を増やしたら必ず変更すること!!
|
||||
if (to === 6) {
|
||||
claimAchievement('tutorialCompleted');
|
||||
}
|
||||
});
|
||||
|
||||
const isReactionTutorialPushed = ref<boolean>(false);
|
||||
const isSensitiveTutorialSucceeded = ref<boolean>(false);
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@ export const ACHIEVEMENT_TYPES = [
|
|||
'cookieClicked',
|
||||
'brainDiver',
|
||||
'smashTestNotificationButton',
|
||||
'tutorialCompleted',
|
||||
] as const;
|
||||
|
||||
export const ACHIEVEMENT_BADGES = {
|
||||
|
@ -460,6 +461,11 @@ export const ACHIEVEMENT_BADGES = {
|
|||
bg: 'linear-gradient(0deg, rgb(187 183 59), rgb(255 143 77))',
|
||||
frame: 'bronze',
|
||||
},
|
||||
'tutorialCompleted': {
|
||||
img: '/fluent-emoji/1f393.png',
|
||||
bg: 'linear-gradient(0deg, rgb(220 223 225), rgb(172 192 207))',
|
||||
frame: 'bronze',
|
||||
},
|
||||
/* @see <https://github.com/misskey-dev/misskey/pull/10365#discussion_r1155511107>
|
||||
} as const satisfies Record<typeof ACHIEVEMENT_TYPES[number], {
|
||||
img: string;
|
||||
|
|
Loading…
Reference in a new issue