feat(assets): new assets loading system (currently only for images)
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import MENU_IMAGE from "/assets/images/settings/top-screen/touch_screen/touch-screen.webp";
|
||||
import MENU_DISABLED_IMAGE from "/assets/images/settings/top-screen/touch_screen/touch-screen-disabled.png";
|
||||
|
||||
const props = defineProps<{
|
||||
x: number;
|
||||
y: number;
|
||||
@@ -9,10 +6,7 @@ const props = defineProps<{
|
||||
|
||||
const settingsStore = useSettingsStore();
|
||||
|
||||
const [menuImage, menuDisabledImage] = useImages(
|
||||
MENU_IMAGE,
|
||||
MENU_DISABLED_IMAGE,
|
||||
);
|
||||
const { assets } = useAssets();
|
||||
|
||||
const isAnyOtherMenuOpen = computed(() =>
|
||||
settingsStore.isAnyOtherMenuOpen("touchScreen"),
|
||||
@@ -20,9 +14,17 @@ const isAnyOtherMenuOpen = computed(() =>
|
||||
|
||||
useRender((ctx) => {
|
||||
if (isAnyOtherMenuOpen.value) {
|
||||
ctx.drawImage(menuDisabledImage!, props.x, props.y);
|
||||
ctx.drawImage(
|
||||
assets.settings.topScreen.touchScreen.touchScreenDisabled,
|
||||
props.x,
|
||||
props.y,
|
||||
);
|
||||
} else {
|
||||
ctx.drawImage(menuImage!, props.x, props.y);
|
||||
ctx.drawImage(
|
||||
assets.settings.topScreen.touchScreen.touchScreen,
|
||||
props.x,
|
||||
props.y,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user