Files
pihkaal-me/app/components/Settings/BottomScreen/Menus/Options/Menu.vue

50 lines
1.2 KiB
Vue

<script setup lang="ts">
const props = defineProps<{
x: number;
y: number;
}>();
const settingsStore = useSettingsStore();
const { assets } = useAssets();
const isOpen = computed(() => settingsStore.isMenuOpen("options"));
const isAnyOtherMenuOpen = computed(() =>
settingsStore.isAnyOtherMenuOpen("options"),
);
const animation = useMenuAnimation("options", isOpen);
useRender((ctx) => {
ctx.translate(props.x, props.y);
if (isOpen.value || animation.playing) {
ctx.drawImage(
assets.settings.topScreen.options.language,
0,
-48 + animation.stage1Offset,
);
ctx.drawImage(
assets.settings.topScreen.options.gbaMode,
48 - animation.stage2Offset,
-48 + animation.stage1Offset,
);
ctx.drawImage(
assets.settings.topScreen.options.startUp,
0,
-96 + animation.stage2Offset + animation.stage1Offset,
);
ctx.drawImage(assets.settings.topScreen.options.optionsActive, 0, 0);
} else if (isAnyOtherMenuOpen.value) {
ctx.drawImage(assets.settings.topScreen.options.optionsDisabled, 0, 0);
} else {
ctx.drawImage(assets.settings.topScreen.options.options, 0, 0);
}
});
defineOptions({
render: () => null,
});
</script>