From 37a548984caf7affd78f2a68508fd80941648297 Mon Sep 17 00:00:00 2001 From: Nick Kosarev Date: Tue, 7 Jan 2025 18:28:13 +0200 Subject: [PATCH] feat: character levels (#390) --- apps/telegram-game/auto-imports.d.ts | 3 + apps/telegram-game/components.d.ts | 1 + apps/telegram-game/src/components/Game.vue | 1 + .../components/GameCharacterProgression.vue | 7 ++ .../src/components/PageContainer.vue | 2 +- .../src/composables/useCharacter.ts | 17 +++ .../src/composables/useTelegramProfile.ts | 2 +- .../telegram-game/src/views/InventoryView.vue | 6 +- apps/telegram-game/src/views/QuestView.vue | 30 ++--- apps/telegram-game/src/views/ShopView.vue | 76 +++++++------ apps/telegram-game/src/views/TopView.vue | 104 +++++++++--------- .../api/telegram/character/active.get.ts | 54 +++++++++ packages/types/src/lib/types.ts | 10 ++ prisma/schema.prisma | 14 +++ 14 files changed, 222 insertions(+), 105 deletions(-) create mode 100644 apps/telegram-game/src/components/GameCharacterProgression.vue create mode 100644 apps/telegram-game/src/composables/useCharacter.ts create mode 100644 apps/website/server/api/telegram/character/active.get.ts diff --git a/apps/telegram-game/auto-imports.d.ts b/apps/telegram-game/auto-imports.d.ts index a237b955..3f5eacc9 100644 --- a/apps/telegram-game/auto-imports.d.ts +++ b/apps/telegram-game/auto-imports.d.ts @@ -8,6 +8,7 @@ export {} declare global { const EffectScope: typeof import('vue')['EffectScope'] const Icon: typeof import('@iconify/vue')['Icon'] + const _useCharacter: typeof import('./src/composables/useCharacter')['_useCharacter'] const addon: typeof import('./src/utils/gameClient')['addon'] const computed: typeof import('vue')['computed'] const createApp: typeof import('vue')['createApp'] @@ -61,8 +62,10 @@ declare global { const toValue: typeof import('vue')['toValue'] const triggerRef: typeof import('vue')['triggerRef'] const unref: typeof import('vue')['unref'] + const useApiFetch: typeof import('./src/composables/useTelegramProfile')['useApiFetch'] const useAttrs: typeof import('vue')['useAttrs'] const useBackButton: typeof import('./src/composables/useBackButton')['useBackButton'] + const useCharacter: typeof import('./src/composables/useCharacter')['useCharacter'] const useCharacters: typeof import('./src/composables/useCharacters')['useCharacters'] const useConfetti: typeof import('./src/composables/useConfetti')['useConfetti'] const useCssModule: typeof import('vue')['useCssModule'] diff --git a/apps/telegram-game/components.d.ts b/apps/telegram-game/components.d.ts index cc8f534d..3fcc9626 100644 --- a/apps/telegram-game/components.d.ts +++ b/apps/telegram-game/components.d.ts @@ -16,6 +16,7 @@ declare module 'vue' { ConfettiBackground: typeof import('./src/components/ConfettiBackground.vue')['default'] CouponActivationBlock: typeof import('./src/components/CouponActivationBlock.vue')['default'] Game: typeof import('./src/components/Game.vue')['default'] + GameCharacterProgression: typeof import('./src/components/GameCharacterProgression.vue')['default'] GameNavigator: typeof import('./src/components/GameNavigator.vue')['default'] Image: typeof import('./src/components/Image.vue')['default'] Modal: typeof import('./src/components/Modal.vue')['default'] diff --git a/apps/telegram-game/src/components/Game.vue b/apps/telegram-game/src/components/Game.vue index 7afebb07..e4c53226 100644 --- a/apps/telegram-game/src/components/Game.vue +++ b/apps/telegram-game/src/components/Game.vue @@ -5,6 +5,7 @@
+