mirror of
https://github.com/rommapp/romm.git
synced 2026-12-04 21:02:21 +01:00
fixed platform icon
This commit is contained in:
@@ -3,6 +3,7 @@ import type { SearchRomSchema } from "@/__generated__";
|
||||
import ActionBar from "@/components/common/Game/Card/ActionBar.vue";
|
||||
import GameCardFlags from "@/components/common/Game/Card/Flags.vue";
|
||||
import Sources from "@/components/common/Game/Card/Sources.vue";
|
||||
import PlatformIcon from "@/components/common/Platform/Icon.vue";
|
||||
import storeCollections from "@/stores/collections";
|
||||
import storeDownload from "@/stores/download";
|
||||
import storeGalleryView from "@/stores/galleryView";
|
||||
@@ -22,6 +23,7 @@ const props = withDefaults(
|
||||
pointerOnHover?: boolean;
|
||||
titleOnFooter?: boolean;
|
||||
showActionBar?: boolean;
|
||||
showPlatformIcon?: boolean;
|
||||
showFav?: boolean;
|
||||
withBorder?: boolean;
|
||||
withBorderRommAccent?: boolean;
|
||||
@@ -34,6 +36,7 @@ const props = withDefaults(
|
||||
pointerOnHover: true,
|
||||
titleOnFooter: false,
|
||||
showActionBar: false,
|
||||
showPlatformIcon: false,
|
||||
showFav: false,
|
||||
withBorder: false,
|
||||
withBorderRommAccent: false,
|
||||
@@ -153,7 +156,22 @@ onMounted(() => {
|
||||
<slot name="prepend-inner"></slot>
|
||||
</v-row>
|
||||
</div>
|
||||
<div class="position-absolute append-inner">
|
||||
<div class="position-absolute append-inner-left">
|
||||
<v-btn
|
||||
v-if="romsStore.isSimpleRom(rom) && showPlatformIcon"
|
||||
@click.stop=""
|
||||
class="label-platform translucent-dark"
|
||||
rounded="0"
|
||||
size="small"
|
||||
>
|
||||
<platform-icon
|
||||
:size="25"
|
||||
:key="rom.platform_slug"
|
||||
:slug="rom.platform_slug"
|
||||
/>
|
||||
</v-btn>
|
||||
</div>
|
||||
<div class="position-absolute append-inner-right">
|
||||
<v-btn
|
||||
v-if="
|
||||
romsStore.isSimpleRom(rom) &&
|
||||
@@ -172,9 +190,7 @@ onMounted(() => {
|
||||
}}
|
||||
</v-icon>
|
||||
</v-btn>
|
||||
<slot name="append-inner"> </slot>
|
||||
</div>
|
||||
|
||||
<template #error>
|
||||
<v-img
|
||||
:src="`/assets/default/cover/big_${theme.global.name.value}_missing_cover.png`"
|
||||
@@ -238,7 +254,15 @@ onMounted(() => {
|
||||
-moz-user-select: none; /* Firefox */
|
||||
-ms-user-select: none; /* Internet Explorer/Edge */
|
||||
}
|
||||
.append-inner {
|
||||
.append-inner-left {
|
||||
bottom: 0rem;
|
||||
left: 0rem;
|
||||
}
|
||||
.label-platform {
|
||||
right: 0.2rem;
|
||||
top: 0.1rem;
|
||||
}
|
||||
.append-inner-right {
|
||||
bottom: 0rem;
|
||||
right: 0rem;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import GameCard from "@/components/common/Game/Card/Base.vue";
|
||||
import GameCardFlags from "@/components/common/Game/Card/Flags.vue";
|
||||
import PlatformIcon from "@/components/common/Platform/Icon.vue";
|
||||
import RDialog from "@/components/common/RDialog.vue";
|
||||
import romApi from "@/services/api/rom";
|
||||
@@ -199,21 +198,9 @@ onBeforeUnmount(() => {
|
||||
title-on-hover
|
||||
show-flags
|
||||
transform-scale
|
||||
show-platform-icon
|
||||
show-fav
|
||||
>
|
||||
<template #footer>
|
||||
<v-row class="pa-1 align-center" no-gutters>
|
||||
<v-col class="pa-0 ml-1 text-truncate">
|
||||
<span>{{ rom.name }}</span>
|
||||
</v-col>
|
||||
<platform-icon
|
||||
:size="20"
|
||||
:key="rom.platform_slug"
|
||||
:slug="rom.platform_slug"
|
||||
/>
|
||||
</v-row>
|
||||
</template>
|
||||
</game-card>
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import storeConfig from "@/stores/config";
|
||||
import { ref } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{ slug: string; size?: number; rounded?: number }>(),
|
||||
{ size: 40, rounded: 0 }
|
||||
);
|
||||
const configStore = storeConfig();
|
||||
const slug = configStore.value.PLATFORMS_VERSIONS[props.slug] ?? props.slug;
|
||||
const platformIconUrl = ref(`/assets/platforms/${slug.toLowerCase()}.ico`);
|
||||
const { config } = storeToRefs(configStore);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<v-avatar :size="size" :rounded="rounded">
|
||||
<v-img :src="platformIconUrl"
|
||||
<v-img
|
||||
:src="`/assets/platforms/${
|
||||
config.PLATFORMS_VERSIONS
|
||||
? config.PLATFORMS_VERSIONS[props.slug]
|
||||
? config.PLATFORMS_VERSIONS[props.slug].toLowerCase()
|
||||
: props.slug.toLowerCase()
|
||||
: props.slug.toLowerCase()
|
||||
}.ico`"
|
||||
><template #error
|
||||
><v-img src="/assets/platforms/default.ico"></v-img></template
|
||||
></v-img>
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import EmptyFirmware from "@/components/common/EmptyFirmware.vue";
|
||||
import EmptyGame from "@/components/common/EmptyGame.vue";
|
||||
import EmptyPlatform from "@/components/common/EmptyPlatform.vue";
|
||||
import EmptyFirmware from "@/components/common/EmptyFirmware.vue";
|
||||
import RommIso from "@/components/common/RommIso.vue";
|
||||
import { onMounted, ref, useSlots } from "vue";
|
||||
import { useDisplay } from "vuetify";
|
||||
|
||||
// Props
|
||||
withDefaults(
|
||||
@@ -33,7 +32,6 @@ withDefaults(
|
||||
}
|
||||
);
|
||||
const emit = defineEmits(["update:modelValue", "close"]);
|
||||
const { mdAndDown } = useDisplay();
|
||||
const hasToolbarSlot = ref(false);
|
||||
const hasPrependSlot = ref(false);
|
||||
const hasAppendSlot = ref(false);
|
||||
|
||||
@@ -3,47 +3,44 @@ import ExcludedCard from "@/components/Management/ExcludedCard.vue";
|
||||
import RSection from "@/components/common/RSection.vue";
|
||||
import storeAuth from "@/stores/auth";
|
||||
import storeConfig from "@/stores/config";
|
||||
import type { Events } from "@/types/emitter";
|
||||
import type { Emitter } from "mitt";
|
||||
import { inject, ref } from "vue";
|
||||
import { ref } from "vue";
|
||||
|
||||
// Props
|
||||
const emitter = inject<Emitter<Events>>("emitter");
|
||||
const configStore = storeConfig();
|
||||
const authStore = storeAuth();
|
||||
const exclusions = [
|
||||
{
|
||||
set: configStore.value.EXCLUDED_PLATFORMS,
|
||||
set: configStore.config.EXCLUDED_PLATFORMS,
|
||||
title: "Platform",
|
||||
icon: "mdi-controller-off",
|
||||
emit: "platform",
|
||||
},
|
||||
{
|
||||
set: configStore.value.EXCLUDED_SINGLE_FILES,
|
||||
set: configStore.config.EXCLUDED_SINGLE_FILES,
|
||||
title: "Single rom files",
|
||||
icon: "mdi-file-document-remove-outline",
|
||||
emit: "singleFile",
|
||||
},
|
||||
{
|
||||
set: configStore.value.EXCLUDED_SINGLE_EXT,
|
||||
set: configStore.config.EXCLUDED_SINGLE_EXT,
|
||||
title: "Single Roms Extensions",
|
||||
icon: "mdi-file-document-remove-outline",
|
||||
emit: "singleFileExt",
|
||||
},
|
||||
{
|
||||
set: configStore.value.EXCLUDED_MULTI_FILES,
|
||||
set: configStore.config.EXCLUDED_MULTI_FILES,
|
||||
title: "Multi Roms Files",
|
||||
icon: "mdi-file-document-remove-outline",
|
||||
emit: "multiFile",
|
||||
},
|
||||
{
|
||||
set: configStore.value.EXCLUDED_MULTI_PARTS_FILES,
|
||||
set: configStore.config.EXCLUDED_MULTI_PARTS_FILES,
|
||||
title: "Multi Roms Parts Files",
|
||||
icon: "mdi-file-document-remove-outline",
|
||||
emit: "multiFilePart",
|
||||
},
|
||||
{
|
||||
set: configStore.value.EXCLUDED_MULTI_PARTS_EXT,
|
||||
set: configStore.config.EXCLUDED_MULTI_PARTS_EXT,
|
||||
title: "Multi Roms Parts Extensions",
|
||||
icon: "mdi-file-document-remove-outline",
|
||||
emit: "multiFilePartExt",
|
||||
|
||||
@@ -6,13 +6,14 @@ import storeAuth from "@/stores/auth";
|
||||
import storeConfig from "@/stores/config";
|
||||
import type { Events } from "@/types/emitter";
|
||||
import type { Emitter } from "mitt";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { inject, ref } from "vue";
|
||||
|
||||
// Props
|
||||
const emitter = inject<Emitter<Events>>("emitter");
|
||||
const configStore = storeConfig();
|
||||
const authStore = storeAuth();
|
||||
const platformsBinding = configStore.value.PLATFORMS_BINDING;
|
||||
const configStore = storeConfig();
|
||||
const { config } = storeToRefs(configStore);
|
||||
const editable = ref(false);
|
||||
</script>
|
||||
|
||||
@@ -33,7 +34,7 @@ const editable = ref(false);
|
||||
<template #content>
|
||||
<v-row no-gutters class="align-center">
|
||||
<v-col
|
||||
v-for="(slug, fsSlug) in platformsBinding"
|
||||
v-for="(slug, fsSlug) in config.PLATFORMS_BINDING"
|
||||
:key="slug"
|
||||
cols="6"
|
||||
sm="4"
|
||||
|
||||
@@ -6,13 +6,14 @@ import storeAuth from "@/stores/auth";
|
||||
import storeConfig from "@/stores/config";
|
||||
import type { Events } from "@/types/emitter";
|
||||
import type { Emitter } from "mitt";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { inject, ref } from "vue";
|
||||
|
||||
// Props
|
||||
const emitter = inject<Emitter<Events>>("emitter");
|
||||
const configStore = storeConfig();
|
||||
const authStore = storeAuth();
|
||||
const platformsVersions = configStore.value.PLATFORMS_VERSIONS;
|
||||
const configStore = storeConfig();
|
||||
const { config } = storeToRefs(configStore);
|
||||
const editable = ref(false);
|
||||
</script>
|
||||
|
||||
@@ -33,7 +34,7 @@ const editable = ref(false);
|
||||
<template #content>
|
||||
<v-row no-gutters class="align-center">
|
||||
<v-col
|
||||
v-for="(slug, fsSlug) in platformsVersions"
|
||||
v-for="(slug, fsSlug) in config.PLATFORMS_VERSIONS"
|
||||
:key="slug"
|
||||
cols="6"
|
||||
sm="4"
|
||||
|
||||
@@ -4,24 +4,38 @@ import type { ConfigResponse } from "@/__generated__";
|
||||
|
||||
export default defineStore("config", {
|
||||
state: () => {
|
||||
return { value: {} as ConfigResponse };
|
||||
return {
|
||||
config: {
|
||||
EXCLUDED_PLATFORMS: [],
|
||||
EXCLUDED_SINGLE_EXT: [],
|
||||
EXCLUDED_SINGLE_FILES: [],
|
||||
EXCLUDED_MULTI_FILES: [],
|
||||
EXCLUDED_MULTI_PARTS_EXT: [],
|
||||
EXCLUDED_MULTI_PARTS_FILES: [],
|
||||
PLATFORMS_BINDING: {},
|
||||
PLATFORMS_VERSIONS: {},
|
||||
ROMS_FOLDER_NAME: "",
|
||||
FIRMWARE_FOLDER_NAME: "",
|
||||
HIGH_PRIO_STRUCTURE_PATH: "",
|
||||
} as ConfigResponse,
|
||||
};
|
||||
},
|
||||
|
||||
actions: {
|
||||
set(data: ConfigResponse) {
|
||||
this.value = data;
|
||||
this.config = data;
|
||||
},
|
||||
addPlatformBinding(fsSlug: string, slug: string) {
|
||||
this.value.PLATFORMS_BINDING[fsSlug] = slug;
|
||||
this.config.PLATFORMS_BINDING[fsSlug] = slug;
|
||||
},
|
||||
removePlatformBinding(fsSlug: string) {
|
||||
delete this.value.PLATFORMS_BINDING[fsSlug];
|
||||
delete this.config.PLATFORMS_BINDING[fsSlug];
|
||||
},
|
||||
addPlatformVersion(fsSlug: string, slug: string) {
|
||||
this.value.PLATFORMS_VERSIONS[fsSlug] = slug;
|
||||
this.config.PLATFORMS_VERSIONS[fsSlug] = slug;
|
||||
},
|
||||
removePlatformVersion(fsSlug: string) {
|
||||
delete this.value.PLATFORMS_VERSIONS[fsSlug];
|
||||
delete this.config.PLATFORMS_VERSIONS[fsSlug];
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
import GalleryAppBarCollection from "@/components/Gallery/AppBar/Collection/Base.vue";
|
||||
import FabOverlay from "@/components/Gallery/FabOverlay.vue";
|
||||
import EmptyGame from "@/components/common/EmptyGame.vue";
|
||||
import EmptyCollection from "@/components/common/EmptyCollection.vue";
|
||||
import EmptyGame from "@/components/common/EmptyGame.vue";
|
||||
import GameCard from "@/components/common/Game/Card/Base.vue";
|
||||
import GameCardFlags from "@/components/common/Game/Card/Flags.vue";
|
||||
import GameDataTable from "@/components/common/Game/Table.vue";
|
||||
import collectionApi from "@/services/api/collection";
|
||||
import romApi from "@/services/api/rom";
|
||||
import storeCollections from "@/stores/collections";
|
||||
import storeGalleryFilter from "@/stores/galleryFilter";
|
||||
import storeGalleryView from "@/stores/galleryView";
|
||||
import storeCollections from "@/stores/collections";
|
||||
import storeRoms, { type SimpleRom } from "@/stores/roms";
|
||||
import type { Events } from "@/types/emitter";
|
||||
import { normalizeString, views } from "@/utils";
|
||||
@@ -288,8 +287,7 @@ onBeforeUnmount(() => {
|
||||
@click="onGameClick"
|
||||
@touchstart="onGameTouchStart"
|
||||
@touchend="onGameTouchEnd"
|
||||
>
|
||||
</game-card>
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<!-- Gallery list view -->
|
||||
|
||||
@@ -288,8 +288,7 @@ onBeforeUnmount(() => {
|
||||
@click="onGameClick"
|
||||
@touchstart="onGameTouchStart"
|
||||
@touchend="onGameTouchEnd"
|
||||
>
|
||||
</game-card>
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<!-- Gallery list view -->
|
||||
|
||||
Reference in New Issue
Block a user