feat: centralize all screen related callbacks in useScreen

This commit is contained in:
2025-12-29 21:01:19 +01:00
parent e9412a2e20
commit f60fb3625c
42 changed files with 184 additions and 128 deletions

View File

@@ -1,5 +1,7 @@
<script setup lang="ts">
useRender((ctx) => {
const { onRender } = useScreen();
onRender((ctx) => {
ctx.font = "10px NDS10";
ctx.fillStyle = "#000000";
ctx.fillText("GBA Mode", 10, 20);

View File

@@ -1,5 +1,7 @@
<script setup lang="ts">
useRender((ctx) => {
const { onRender } = useScreen();
onRender((ctx) => {
ctx.font = "10px NDS10";
ctx.fillStyle = "#000000";
ctx.fillText("Language", 10, 20);

View File

@@ -4,6 +4,8 @@ const props = defineProps<{
y: number;
}>();
const { onRender } = useScreen();
const settingsStore = useSettingsStore();
const menusContext = inject<{
isSubmenuSelected: ComputedRef<boolean>;
@@ -27,7 +29,7 @@ const isAnyOtherMenuOpen = computed(() => {
const animation = useMenuAnimation("options", isOpen);
useRender((ctx) => {
onRender((ctx) => {
ctx.translate(props.x, props.y);
if (isOpen.value || animation.playing) {

View File

@@ -1,5 +1,7 @@
<script setup lang="ts">
useRender((ctx) => {
const { onRender } = useScreen();
onRender((ctx) => {
ctx.font = "10px NDS10";
ctx.fillStyle = "#000000";
ctx.fillText("Startup", 10, 20);