feat(assets): new assets loading system (currently only for images)

This commit is contained in:
2025-12-17 12:28:48 +01:00
parent a31f72f41d
commit 2f16f382e5
106 changed files with 359 additions and 366 deletions

View File

@@ -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,
);
}
});