add some achievements
This commit is contained in:
parent
951ab90b1a
commit
9d367882fb
6 changed files with 41 additions and 2 deletions
|
@ -24,7 +24,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ComputedRef, inject, provide } from 'vue';
|
||||
import { ComputedRef, inject, onMounted, onUnmounted, provide } from 'vue';
|
||||
import RouterView from '@/components/global/RouterView.vue';
|
||||
import MkWindow from '@/components/MkWindow.vue';
|
||||
import { popout as _popout } from '@/scripts/popout';
|
||||
|
@ -35,6 +35,8 @@ import { mainRouter, routes } from '@/router';
|
|||
import { Router } from '@/nirax';
|
||||
import { i18n } from '@/i18n';
|
||||
import { PageMetadata, provideMetadataReceiver, setPageMetadata } from '@/scripts/page-metadata';
|
||||
import { openingWindowsCount } from '@/os';
|
||||
import { claimAchievement } from '@/scripts/achievements';
|
||||
|
||||
const props = defineProps<{
|
||||
initialPath: string;
|
||||
|
@ -128,6 +130,17 @@ function popout() {
|
|||
windowEl.close();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
openingWindowsCount.value++;
|
||||
if (openingWindowsCount.value >= 3) {
|
||||
claimAchievement('open3windows');
|
||||
}
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
openingWindowsCount.value--;
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
close,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue