mirror of
https://github.com/rommapp/romm.git
synced 2026-12-06 15:54:45 +01:00
Merge remote-tracking branch 'origin/master' into feat/patcher.js
This commit is contained in:
11 files changed
+706
-767
No files matched your search
@@ -246,8 +246,10 @@ function onFilterClick(filter: FilterType, value: string) {
|
||||
</v-row>
|
||||
</template>
|
||||
<v-row v-if="rom.is_identified">
|
||||
<v-col class="mt-4 text-right">
|
||||
<div v-if="dataSources.length > 0" class="text-grey">
|
||||
<v-col
|
||||
class="mt-4 text-right text-medium-emphasis text-caption font-italic"
|
||||
>
|
||||
<div v-if="dataSources.length > 0">
|
||||
Data provided by
|
||||
<template v-for="(source, index) in dataSources" :key="source.name">
|
||||
<a
|
||||
@@ -263,7 +265,7 @@ function onFilterClick(filter: FilterType, value: string) {
|
||||
</span> </template
|
||||
>.
|
||||
</div>
|
||||
<div v-if="rom.url_cover && coverImageSource" class="text-grey mt-1">
|
||||
<div v-if="rom.url_cover && coverImageSource" class="mt-1">
|
||||
Cover art provided by
|
||||
<a :href="rom.url_cover" target="_blank" style="color: inherit">
|
||||
{{ coverImageSource }}</a
|
||||
|
||||
@@ -2,15 +2,13 @@
|
||||
import type { Emitter } from "mitt";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { inject, ref } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import type { SaveSchema } from "@/__generated__";
|
||||
import EmptySaves from "@/components/common/EmptyStates/EmptySaves.vue";
|
||||
import AssetCard from "@/components/common/Game/AssetCard.vue";
|
||||
import storeAuth from "@/stores/auth";
|
||||
import { type DetailedRom } from "@/stores/roms";
|
||||
import type { Events } from "@/types/emitter";
|
||||
import { formatBytes, formatTimestamp, formatRelativeDate } from "@/utils";
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const auth = storeAuth();
|
||||
const { scopes } = storeToRefs(auth);
|
||||
const props = defineProps<{ rom: DetailedRom }>();
|
||||
@@ -112,70 +110,16 @@ function onCardClick(save: SaveSchema, event: MouseEvent) {
|
||||
:key="save.id"
|
||||
cols="6"
|
||||
sm="4"
|
||||
class="pa-1"
|
||||
class="pa-1 align-self-end"
|
||||
>
|
||||
<v-hover v-slot="{ isHovering, props: saveProps }">
|
||||
<v-card
|
||||
v-bind="saveProps"
|
||||
class="bg-toplayer transform-scale"
|
||||
:class="{
|
||||
'border-selected': selectedSaves.some((s) => s.id === save.id),
|
||||
}"
|
||||
@click="(e: MouseEvent) => onCardClick(save, e)"
|
||||
>
|
||||
<v-card-text class="pa-2">
|
||||
<v-slide-x-transition>
|
||||
<v-btn-group
|
||||
v-if="isHovering"
|
||||
class="position-absolute"
|
||||
density="compact"
|
||||
style="bottom: 4px; right: 4px"
|
||||
>
|
||||
<v-btn drawer :href="save.download_path" download size="small">
|
||||
<v-icon>mdi-download</v-icon>
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="scopes.includes('assets.write')"
|
||||
drawer
|
||||
size="small"
|
||||
@click="
|
||||
emitter?.emit('showDeleteSavesDialog', {
|
||||
rom: props.rom,
|
||||
saves: [save],
|
||||
})
|
||||
"
|
||||
>
|
||||
<v-icon class="text-romm-red"> mdi-delete </v-icon>
|
||||
</v-btn>
|
||||
</v-btn-group>
|
||||
</v-slide-x-transition>
|
||||
<v-row class="pa-1 text-caption" no-gutters>
|
||||
{{ save.file_name }}
|
||||
</v-row>
|
||||
<v-row class="ga-1 pa-1" no-gutters>
|
||||
<v-col v-if="save.emulator" cols="12">
|
||||
<v-chip size="x-small" color="orange" label>
|
||||
{{ save.emulator }}
|
||||
</v-chip>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<v-chip size="x-small" label>
|
||||
{{ formatBytes(save.file_size_bytes) }}
|
||||
</v-chip>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<div class="mt-1">
|
||||
{{ t("rom.updated") }}:
|
||||
{{ formatTimestamp(save.updated_at, locale) }}
|
||||
<span class="ml-1 text-grey text-caption"
|
||||
>({{ formatRelativeDate(save.updated_at) }})</span
|
||||
>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-hover>
|
||||
<AssetCard
|
||||
:asset="save"
|
||||
type="save"
|
||||
:selected="selectedSaves.some((s) => s.id === save.id)"
|
||||
:rom="props.rom"
|
||||
:scopes="scopes"
|
||||
@click="(e: MouseEvent) => onCardClick(save, e)"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<EmptySaves v-else />
|
||||
|
||||
@@ -2,16 +2,13 @@
|
||||
import type { Emitter } from "mitt";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { inject, ref } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import type { StateSchema } from "@/__generated__";
|
||||
import EmptySates from "@/components/common/EmptyStates/EmptyStates.vue";
|
||||
import AssetCard from "@/components/common/Game/AssetCard.vue";
|
||||
import storeAuth from "@/stores/auth";
|
||||
import { type DetailedRom } from "@/stores/roms";
|
||||
import type { Events } from "@/types/emitter";
|
||||
import { formatBytes, formatTimestamp, formatRelativeDate } from "@/utils";
|
||||
import { getEmptyCoverImage } from "@/utils/covers";
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const auth = storeAuth();
|
||||
const { scopes } = storeToRefs(auth);
|
||||
const props = defineProps<{ rom: DetailedRom }>();
|
||||
@@ -115,88 +112,16 @@ function onCardClick(state: StateSchema, event: MouseEvent) {
|
||||
:key="state.id"
|
||||
cols="6"
|
||||
sm="4"
|
||||
class="pa-1"
|
||||
class="pa-1 align-self-end"
|
||||
>
|
||||
<v-hover v-slot="{ isHovering, props: stateProps }">
|
||||
<v-card
|
||||
v-bind="stateProps"
|
||||
class="bg-toplayer transform-scale"
|
||||
:class="{
|
||||
'border-selected': selectedStates.some((s) => s.id === state.id),
|
||||
}"
|
||||
@click="(e: MouseEvent) => onCardClick(state, e)"
|
||||
>
|
||||
<v-card-text class="pa-2">
|
||||
<v-row no-gutters>
|
||||
<v-col cols="12">
|
||||
<v-img
|
||||
rounded
|
||||
:src="
|
||||
state.screenshot?.download_path ??
|
||||
getEmptyCoverImage(state.file_name, 16 / 9)
|
||||
"
|
||||
:aspect-ratio="16 / 9"
|
||||
>
|
||||
<v-slide-x-transition>
|
||||
<v-btn-group
|
||||
v-if="isHovering"
|
||||
class="position-absolute"
|
||||
density="compact"
|
||||
style="bottom: 4px; right: 4px"
|
||||
>
|
||||
<v-btn
|
||||
drawer
|
||||
:href="state.download_path"
|
||||
download
|
||||
size="small"
|
||||
>
|
||||
<v-icon>mdi-download</v-icon>
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="scopes.includes('assets.write')"
|
||||
drawer
|
||||
size="small"
|
||||
@click="
|
||||
emitter?.emit('showDeleteStatesDialog', {
|
||||
rom: props.rom,
|
||||
states: [state],
|
||||
})
|
||||
"
|
||||
>
|
||||
<v-icon class="text-romm-red"> mdi-delete </v-icon>
|
||||
</v-btn>
|
||||
</v-btn-group>
|
||||
</v-slide-x-transition>
|
||||
</v-img>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="py-2 text-caption" no-gutters>
|
||||
{{ state.file_name }}
|
||||
</v-row>
|
||||
<v-row class="ga-1" no-gutters>
|
||||
<v-col v-if="state.emulator" cols="12">
|
||||
<v-chip size="x-small" color="orange" label>
|
||||
{{ state.emulator }}
|
||||
</v-chip>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<v-chip size="x-small" label>
|
||||
{{ formatBytes(state.file_size_bytes) }}
|
||||
</v-chip>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<div class="mt-1">
|
||||
{{ t("rom.updated") }}:
|
||||
{{ formatTimestamp(state.updated_at, locale) }}
|
||||
<span class="ml-1 text-grey text-caption"
|
||||
>({{ formatRelativeDate(state.updated_at) }})</span
|
||||
>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-hover>
|
||||
<AssetCard
|
||||
:asset="state"
|
||||
type="state"
|
||||
:selected="selectedStates.some((s) => s.id === state.id)"
|
||||
:rom="props.rom"
|
||||
:scopes="scopes"
|
||||
@click="(e: MouseEvent) => onCardClick(state, e)"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<EmptySates v-else />
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
<script setup lang="ts">
|
||||
import type { Emitter } from "mitt";
|
||||
import { inject } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import type { SaveSchema, StateSchema } from "@/__generated__";
|
||||
import type { DetailedRom } from "@/stores/roms";
|
||||
import type { Events } from "@/types/emitter";
|
||||
import { formatBytes, formatTimestamp, formatRelativeDate } from "@/utils";
|
||||
import { getEmptyCoverImage } from "@/utils/covers";
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const emitter = inject<Emitter<Events>>("emitter");
|
||||
|
||||
export type AssetType = "save" | "state";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
asset: SaveSchema | StateSchema;
|
||||
type: AssetType;
|
||||
selected?: boolean;
|
||||
rom?: DetailedRom;
|
||||
showHoverActions?: boolean;
|
||||
showCloseButton?: boolean;
|
||||
scopes?: string[];
|
||||
cardStyle?: Record<string, any>;
|
||||
transformScale?: boolean;
|
||||
}>(),
|
||||
{
|
||||
selected: false,
|
||||
showHoverActions: true,
|
||||
showCloseButton: false,
|
||||
scopes: () => [],
|
||||
cardStyle: () => ({}),
|
||||
transformScale: true,
|
||||
},
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "click", event: MouseEvent): void;
|
||||
(e: "close"): void;
|
||||
}>();
|
||||
|
||||
function isState(asset: SaveSchema | StateSchema): asset is StateSchema {
|
||||
return "screenshot" in asset;
|
||||
}
|
||||
|
||||
function handleClick(event: MouseEvent) {
|
||||
emit("click", event);
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
emit("close");
|
||||
}
|
||||
|
||||
function handleDelete(event: Event) {
|
||||
event.stopPropagation();
|
||||
if (!props.rom) {
|
||||
return;
|
||||
}
|
||||
if (props.type === "save") {
|
||||
emitter?.emit("showDeleteSavesDialog", {
|
||||
rom: props.rom,
|
||||
saves: [props.asset as SaveSchema],
|
||||
});
|
||||
} else {
|
||||
emitter?.emit("showDeleteStatesDialog", {
|
||||
rom: props.rom,
|
||||
states: [props.asset as StateSchema],
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<v-hover v-slot="{ isHovering, props: hoverProps }">
|
||||
<v-card
|
||||
v-bind="hoverProps"
|
||||
:style="cardStyle"
|
||||
class="bg-toplayer"
|
||||
:class="{
|
||||
'border-selected': selected,
|
||||
'transform-scale': transformScale,
|
||||
}"
|
||||
@click="handleClick"
|
||||
>
|
||||
<v-card-text class="pa-2">
|
||||
<!-- Screenshot for states -->
|
||||
<v-row
|
||||
v-if="type === 'state' && isState(asset)"
|
||||
no-gutters
|
||||
class="bg-surface"
|
||||
>
|
||||
<v-col cols="12">
|
||||
<v-img
|
||||
rounded
|
||||
:src="
|
||||
asset.screenshot?.download_path ??
|
||||
getEmptyCoverImage(asset.file_name, 16 / 9)
|
||||
"
|
||||
:aspect-ratio="16 / 9"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- File name -->
|
||||
<v-row class="text-caption py-2 px-1 text-primary" no-gutters>
|
||||
{{ asset.file_name }}
|
||||
</v-row>
|
||||
|
||||
<!-- Metadata -->
|
||||
<v-row class="ga-1 pa-1" no-gutters>
|
||||
<v-col cols="12">
|
||||
<v-chip
|
||||
v-if="asset.emulator"
|
||||
size="x-small"
|
||||
color="orange"
|
||||
class="mr-2"
|
||||
label
|
||||
>
|
||||
{{ asset.emulator }}
|
||||
</v-chip>
|
||||
<v-chip size="x-small" label>
|
||||
{{ formatBytes(asset.file_size_bytes) }}
|
||||
</v-chip>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<div class="mt-2">
|
||||
{{ t("rom.updated") }}:
|
||||
{{ formatTimestamp(asset.updated_at, locale) }}
|
||||
</div>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<div class="mt-1">
|
||||
<span class="text-grey text-caption"
|
||||
>({{ formatRelativeDate(asset.updated_at) }})</span
|
||||
>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- Action buttons -->
|
||||
<v-slide-x-transition>
|
||||
<v-btn-group
|
||||
v-if="isHovering && showHoverActions"
|
||||
class="position-absolute"
|
||||
density="compact"
|
||||
style="bottom: 4px; right: 4px"
|
||||
>
|
||||
<v-btn drawer :href="asset.download_path" download size="small">
|
||||
<v-icon>mdi-download</v-icon>
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="scopes.includes('assets.write')"
|
||||
drawer
|
||||
size="small"
|
||||
@click="handleDelete"
|
||||
>
|
||||
<v-icon class="text-romm-red">mdi-delete</v-icon>
|
||||
</v-btn>
|
||||
</v-btn-group>
|
||||
</v-slide-x-transition>
|
||||
|
||||
<!-- Close button -->
|
||||
<v-btn
|
||||
v-if="showCloseButton"
|
||||
variant="text"
|
||||
size="small"
|
||||
class="position-absolute"
|
||||
style="bottom: 8px; right: 8px"
|
||||
@click.stop="handleClose"
|
||||
>
|
||||
<v-icon>mdi-close-circle-outline</v-icon>
|
||||
</v-btn>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-hover>
|
||||
</template>
|
||||
@@ -4,13 +4,12 @@ import { inject, ref } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useDisplay } from "vuetify";
|
||||
import type { SaveSchema } from "@/__generated__";
|
||||
import AssetCard from "@/components/common/Game/AssetCard.vue";
|
||||
import RDialog from "@/components/common/RDialog.vue";
|
||||
import type { DetailedRom } from "@/stores/roms";
|
||||
import type { Events } from "@/types/emitter";
|
||||
import { formatBytes, formatTimestamp } from "@/utils";
|
||||
import { getEmptyCoverImage } from "@/utils/covers";
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const { t } = useI18n();
|
||||
const { mdAndUp } = useDisplay();
|
||||
const show = ref(false);
|
||||
const rom = ref<DetailedRom | null>(null);
|
||||
@@ -38,67 +37,43 @@ function closeDialog() {
|
||||
<RDialog
|
||||
id="select-save-dialog"
|
||||
v-model="show"
|
||||
icon="mdi-format-wrap-square"
|
||||
icon="mdi-content-save-outline"
|
||||
scroll-content
|
||||
:width="mdAndUp ? '50vw' : '95vw'"
|
||||
@close="closeDialog"
|
||||
>
|
||||
<template #header>
|
||||
<span class="text-h5 ml-4">{{ t("play.select-save") }}</span>
|
||||
<v-row no-gutters class="justify-center">
|
||||
<span>{{ t("play.select-save") }}</span>
|
||||
</v-row>
|
||||
</template>
|
||||
<template #content>
|
||||
<div v-if="rom" class="d-flex justify-center ga-4 flex-md-wrap py-6 px-2">
|
||||
<v-card
|
||||
<v-row
|
||||
v-if="rom && rom.user_saves.length > 0"
|
||||
class="align-content-start pa-2"
|
||||
no-gutters
|
||||
>
|
||||
<v-col
|
||||
v-for="save in rom.user_saves"
|
||||
v-if="rom.user_saves.length > 0"
|
||||
:key="save.id"
|
||||
class="bg-toplayer transform-scale"
|
||||
width="200px"
|
||||
@click="onCardClick(save)"
|
||||
class="pa-1 align-self-end"
|
||||
cols="6"
|
||||
md="4"
|
||||
lg="3"
|
||||
>
|
||||
<v-card-text
|
||||
class="d-flex flex-column justify-end h-100"
|
||||
style="padding: 1.5rem"
|
||||
>
|
||||
<v-row>
|
||||
<v-img
|
||||
cover
|
||||
height="100%"
|
||||
min-height="75px"
|
||||
:src="
|
||||
save.screenshot?.download_path ??
|
||||
getEmptyCoverImage(save.file_name)
|
||||
"
|
||||
/>
|
||||
</v-row>
|
||||
<v-row class="mt-6 flex-grow-0">
|
||||
{{ save.file_name }}
|
||||
</v-row>
|
||||
<v-row
|
||||
class="mt-6 d-flex flex-md-wrap ga-2 flex-grow-0"
|
||||
style="min-height: 20px"
|
||||
>
|
||||
<v-chip v-if="save.emulator" size="x-small" color="orange" label>
|
||||
{{ save.emulator }}
|
||||
</v-chip>
|
||||
<v-chip size="x-small" label>
|
||||
{{ formatBytes(save.file_size_bytes) }}
|
||||
</v-chip>
|
||||
<v-chip size="x-small" label>
|
||||
{{ t("rom.updated") }}:
|
||||
{{ formatTimestamp(save.updated_at, locale) }}
|
||||
</v-chip>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<div v-else>
|
||||
<v-col class="text-center mt-6">
|
||||
<v-icon size="x-large"> mdi-help-rhombus-outline </v-icon>
|
||||
<p class="text-h4 mt-2">
|
||||
{{ t("rom.no-states-found") }}
|
||||
</p>
|
||||
</v-col>
|
||||
</div>
|
||||
<AssetCard
|
||||
:asset="save"
|
||||
type="save"
|
||||
:rom="rom"
|
||||
:show-hover-actions="false"
|
||||
@click="onCardClick(save)"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<div v-else class="text-center mt-6">
|
||||
<v-icon size="x-large"> mdi-help-rhombus-outline </v-icon>
|
||||
<p class="text-h4 mt-2">
|
||||
{{ t("rom.no-saves-found") }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
<template #append>
|
||||
|
||||
@@ -4,13 +4,12 @@ import { inject, ref } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useDisplay } from "vuetify";
|
||||
import type { StateSchema } from "@/__generated__";
|
||||
import AssetCard from "@/components/common/Game/AssetCard.vue";
|
||||
import RDialog from "@/components/common/RDialog.vue";
|
||||
import type { DetailedRom } from "@/stores/roms";
|
||||
import type { Events } from "@/types/emitter";
|
||||
import { formatBytes, formatTimestamp } from "@/utils";
|
||||
import { getEmptyCoverImage } from "@/utils/covers";
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const { t } = useI18n();
|
||||
const { mdAndUp } = useDisplay();
|
||||
const show = ref(false);
|
||||
const rom = ref<DetailedRom | null>(null);
|
||||
@@ -38,67 +37,43 @@ function closeDialog() {
|
||||
<RDialog
|
||||
id="select-state-dialog"
|
||||
v-model="show"
|
||||
icon="mdi-format-wrap-square"
|
||||
icon="mdi-file-outline"
|
||||
scroll-content
|
||||
:width="mdAndUp ? '50vw' : '95vw'"
|
||||
@close="closeDialog"
|
||||
>
|
||||
<template #header>
|
||||
<span class="text-h5 ml-4">{{ t("play.select-state") }}</span>
|
||||
<v-row no-gutters class="justify-center">
|
||||
<span>{{ t("play.select-state") }}</span>
|
||||
</v-row>
|
||||
</template>
|
||||
<template #content>
|
||||
<div v-if="rom" class="d-flex justify-center ga-4 flex-md-wrap py-6 px-2">
|
||||
<v-card
|
||||
<v-row
|
||||
v-if="rom && rom.user_states.length > 0"
|
||||
class="align-content-start pa-2"
|
||||
no-gutters
|
||||
>
|
||||
<v-col
|
||||
v-for="state in rom.user_states"
|
||||
v-if="rom.user_states.length > 0"
|
||||
:key="state.id"
|
||||
class="bg-toplayer transform-scale"
|
||||
width="200px"
|
||||
@click="onCardClick(state)"
|
||||
class="pa-1 align-self-end"
|
||||
cols="6"
|
||||
md="4"
|
||||
lg="3"
|
||||
>
|
||||
<v-card-text
|
||||
class="d-flex flex-column justify-end h-100"
|
||||
style="padding: 1.5rem"
|
||||
>
|
||||
<v-row>
|
||||
<v-img
|
||||
cover
|
||||
height="100%"
|
||||
min-height="75px"
|
||||
:src="
|
||||
state.screenshot?.download_path ??
|
||||
getEmptyCoverImage(state.file_name)
|
||||
"
|
||||
/>
|
||||
</v-row>
|
||||
<v-row class="mt-6 flex-grow-0">
|
||||
{{ state.file_name }}
|
||||
</v-row>
|
||||
<v-row
|
||||
class="mt-6 d-flex flex-md-wrap ga-2 flex-grow-0"
|
||||
style="min-height: 20px"
|
||||
>
|
||||
<v-chip v-if="state.emulator" size="x-small" color="orange" label>
|
||||
{{ state.emulator }}
|
||||
</v-chip>
|
||||
<v-chip size="x-small" label>
|
||||
{{ formatBytes(state.file_size_bytes) }}
|
||||
</v-chip>
|
||||
<v-chip size="x-small" label>
|
||||
{{ t("rom.updated") }}:
|
||||
{{ formatTimestamp(state.updated_at, locale) }}
|
||||
</v-chip>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<div v-else>
|
||||
<v-col class="text-center mt-6">
|
||||
<v-icon size="x-large"> mdi-help-rhombus-outline </v-icon>
|
||||
<p class="text-h4 mt-2">
|
||||
{{ t("rom.no-states-found") }}
|
||||
</p>
|
||||
</v-col>
|
||||
</div>
|
||||
<AssetCard
|
||||
:asset="state"
|
||||
type="state"
|
||||
:rom="rom"
|
||||
:show-hover-actions="false"
|
||||
@click="onCardClick(state)"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<div v-else class="text-center mt-6">
|
||||
<v-icon size="x-large"> mdi-help-rhombus-outline </v-icon>
|
||||
<p class="text-h4 mt-2">
|
||||
{{ t("rom.no-states-found") }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
<template #append>
|
||||
|
||||
@@ -47,14 +47,14 @@ body {
|
||||
}
|
||||
.transform-scale:hover,
|
||||
.transform-scale:focus {
|
||||
transform: scale(1.05) !important;
|
||||
transform: scale(1.07) !important;
|
||||
}
|
||||
.pointer {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
.border-selected {
|
||||
border: 1px solid rgba(var(--v-theme-primary)) !important;
|
||||
transform: scale(1.1);
|
||||
transform: scale(1.04);
|
||||
}
|
||||
.greyscale {
|
||||
filter: grayscale(100%);
|
||||
|
||||
Vendored
+1
@@ -81,6 +81,7 @@ export type Events = {
|
||||
selectSaveDialog: DetailedRom;
|
||||
selectStateDialog: DetailedRom;
|
||||
saveSelected: SaveSchema;
|
||||
openEmulatorJSCacheDialog: null;
|
||||
stateSelected: StateSchema;
|
||||
showAboutDialog: null;
|
||||
showNoteDialog: SimpleRom;
|
||||
|
||||
@@ -289,7 +289,7 @@ watch(
|
||||
"
|
||||
cols="auto"
|
||||
>
|
||||
<v-container width="270px" class="pa-0">
|
||||
<v-container class="pa-0">
|
||||
<AdditionalContent class="mt-2" :rom="currentRom" />
|
||||
</v-container>
|
||||
</v-col>
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,11 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import type { Emitter } from "mitt";
|
||||
import { onBeforeUnmount } from "vue";
|
||||
import { inject, ref } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import RDialog from "@/components/common/RDialog.vue";
|
||||
import type { Events } from "@/types/emitter";
|
||||
|
||||
const { t } = useI18n();
|
||||
const show = ref(false);
|
||||
|
||||
const emitter = inject<Emitter<Events>>("emitter");
|
||||
|
||||
const openCacheDialogHandler = () => {
|
||||
show.value = true;
|
||||
};
|
||||
|
||||
emitter?.on("openEmulatorJSCacheDialog", openCacheDialogHandler);
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
emitter?.off("openEmulatorJSCacheDialog", openCacheDialogHandler);
|
||||
});
|
||||
|
||||
function clearIndexDB() {
|
||||
window.indexedDB.deleteDatabase("/data/saves");
|
||||
window.indexedDB.deleteDatabase("EmulatorJS-roms");
|
||||
@@ -21,20 +36,6 @@ function closeDialog() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<v-row class="align-center mt-4 mx-2" no-gutters>
|
||||
<v-col>
|
||||
<v-btn
|
||||
block
|
||||
class="text-romm-red mt-6"
|
||||
variant="flat"
|
||||
prepend-icon="mdi-database-remove"
|
||||
@click="show = true"
|
||||
>
|
||||
{{ t("play.clear-cache") }}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<RDialog v-model="show" icon="mdi-database-remove" @close="closeDialog">
|
||||
<template #header>
|
||||
<v-row class="ml-2">
|
||||
|
||||
Reference in new issue
Block a user