-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move debug to component + add achievements (missing icons)
- Loading branch information
1 parent
a953bf2
commit e0f695b
Showing
6 changed files
with
278 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<script setup lang="ts"> | ||
import { ACHIEVEMENTS, type GameState } from '@/game'; | ||
import { computed } from 'vue'; | ||
import { faCheck } from '@fortawesome/pro-solid-svg-icons'; | ||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; | ||
import PanelSection from '../PanelSection.vue'; | ||
const props = defineProps<{ state: GameState }>(); | ||
const unlockedAchievements = computed(() => new Set(props.state.unlockedAchievements) as Set<string>); | ||
</script> | ||
|
||
<template> | ||
<PanelSection title="Achievements"> | ||
<div | ||
v-for="[achievementName, achievement] in Object.entries(ACHIEVEMENTS)" | ||
:key="achievementName" | ||
class="flex items-center space-x-1.5 bg-white p-1 bg-opacity-60" | ||
> | ||
<span | ||
class="flex min-h-[56px] min-w-[56px] items-center justify-center" | ||
:class="{ 'opacity-50': !unlockedAchievements.has(achievementName) }" | ||
> | ||
<img | ||
:src="achievement.icon" | ||
:alt="achievementName" | ||
class="h-full max-h-[56px] max-w-[56px] p-2" | ||
/> | ||
</span> | ||
|
||
<span class="flex flex-col text-left"> | ||
<span | ||
class="flex items-center text-sm font-semibold text-gray-600" | ||
:class="{ 'text-opacity-50': !unlockedAchievements.has(achievementName) }" | ||
> | ||
<span>{{ achievementName }}</span> | ||
<FontAwesomeIcon v-if="unlockedAchievements.has(achievementName)" :icon="faCheck" size="lg" class="-mt-0.5 ml-1.5 text-purple-600" /> | ||
</span> | ||
<p | ||
class="text-xs text-gray-500" | ||
:class="{ 'text-opacity-75': !unlockedAchievements.has(achievementName) }" | ||
> | ||
{{ achievement.description }} | ||
</p> | ||
</span> | ||
</div> | ||
</PanelSection> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
import AchievementsPanel from './achievements/AchievementsPanel.vue'; | ||
import AutoClickersPanel from './auto-clickers/AutoClickersPanel.vue'; | ||
import DebugPanel from './debug/DebugPanel.vue'; | ||
import PanelSection from './PanelSection.vue'; | ||
import SkinsPanel from './skins/SkinsPanel.vue'; | ||
import StatsPanel from './stats/StatsPanel.vue'; | ||
import ToppingsPanel from './toppings/ToppingsPanel.vue'; | ||
|
||
export { AutoClickersPanel, PanelSection, SkinsPanel, StatsPanel, ToppingsPanel }; | ||
export { | ||
AchievementsPanel, | ||
AutoClickersPanel, | ||
DebugPanel, | ||
PanelSection, | ||
SkinsPanel, | ||
StatsPanel, | ||
ToppingsPanel, | ||
}; |