diff --git a/emulation/3ds/roms/pokemon ultra.3ds b/emulation/3ds/roms/pokemon ultra moon.3ds similarity index 100% rename from emulation/3ds/roms/pokemon ultra.3ds rename to emulation/3ds/roms/pokemon ultra moon.3ds diff --git a/emulation/gb/roms/pokemon.gb b/emulation/3ds/roms/pokemon ultra sun.3ds similarity index 100% rename from emulation/gb/roms/pokemon.gb rename to emulation/3ds/roms/pokemon ultra sun.3ds diff --git a/emulation/3ds/roms/pokemon y.3ds b/emulation/3ds/roms/pokemon y.3ds new file mode 100644 index 000000000..e69de29bb diff --git a/emulation/3ds/roms/zelda majoras mask.3ds b/emulation/3ds/roms/zelda majoras mask.3ds new file mode 100644 index 000000000..e69de29bb diff --git a/emulation/3ds/roms/zelda ocarina of time.3ds b/emulation/3ds/roms/zelda ocarina of time.3ds new file mode 100644 index 000000000..e69de29bb diff --git a/emulation/gb/roms/pokemon yellow.gb b/emulation/gb/roms/pokemon yellow.gb new file mode 100644 index 000000000..e69de29bb diff --git a/emulation/gba/roms/pokemon emerald.gba b/emulation/gba/roms/pokemon emerald.gba new file mode 100644 index 000000000..e69de29bb diff --git a/emulation/resources/3ds/Metroid - Samus Returns_l.png b/emulation/resources/3ds/Metroid - Samus Returns_l.png index 2ab1689e1..0898cfe78 100644 Binary files a/emulation/resources/3ds/Metroid - Samus Returns_l.png and b/emulation/resources/3ds/Metroid - Samus Returns_l.png differ diff --git a/emulation/resources/3ds/Metroid - Samus Returns_s.png b/emulation/resources/3ds/Metroid - Samus Returns_s.png index 5c53b703c..2027cbd7c 100644 Binary files a/emulation/resources/3ds/Metroid - Samus Returns_s.png and b/emulation/resources/3ds/Metroid - Samus Returns_s.png differ diff --git a/emulation/resources/3ds/pokemon ultra moon_l.png b/emulation/resources/3ds/pokemon ultra moon_l.png new file mode 100644 index 000000000..23964c53b Binary files /dev/null and b/emulation/resources/3ds/pokemon ultra moon_l.png differ diff --git a/emulation/resources/3ds/pokemon ultra moon_s.png b/emulation/resources/3ds/pokemon ultra moon_s.png new file mode 100644 index 000000000..d6df4e082 Binary files /dev/null and b/emulation/resources/3ds/pokemon ultra moon_s.png differ diff --git a/emulation/resources/3ds/pokemon ultra sun_l.png b/emulation/resources/3ds/pokemon ultra sun_l.png new file mode 100644 index 000000000..1e9392c4b Binary files /dev/null and b/emulation/resources/3ds/pokemon ultra sun_l.png differ diff --git a/emulation/resources/3ds/pokemon ultra sun_s.png b/emulation/resources/3ds/pokemon ultra sun_s.png new file mode 100644 index 000000000..0f8d98705 Binary files /dev/null and b/emulation/resources/3ds/pokemon ultra sun_s.png differ diff --git a/emulation/resources/3ds/zelda majoras mask_l.png b/emulation/resources/3ds/zelda majoras mask_l.png new file mode 100644 index 000000000..2c5813461 Binary files /dev/null and b/emulation/resources/3ds/zelda majoras mask_l.png differ diff --git a/emulation/resources/3ds/zelda majoras mask_s.png b/emulation/resources/3ds/zelda majoras mask_s.png new file mode 100644 index 000000000..13cd326e5 Binary files /dev/null and b/emulation/resources/3ds/zelda majoras mask_s.png differ diff --git a/emulation/resources/3ds/zelda ocarina of time_l.png b/emulation/resources/3ds/zelda ocarina of time_l.png new file mode 100644 index 000000000..ce3c30fc7 Binary files /dev/null and b/emulation/resources/3ds/zelda ocarina of time_l.png differ diff --git a/emulation/resources/3ds/zelda ocarina of time_s.png b/emulation/resources/3ds/zelda ocarina of time_s.png new file mode 100644 index 000000000..ae0c1c95a Binary files /dev/null and b/emulation/resources/3ds/zelda ocarina of time_s.png differ diff --git a/emulation/resources/gba/pokemon emerald_l.png b/emulation/resources/gba/pokemon emerald_l.png new file mode 100644 index 000000000..f88ea512a Binary files /dev/null and b/emulation/resources/gba/pokemon emerald_l.png differ diff --git a/emulation/resources/gba/pokemon emerald_s.png b/emulation/resources/gba/pokemon emerald_s.png new file mode 100644 index 000000000..ef812b06c Binary files /dev/null and b/emulation/resources/gba/pokemon emerald_s.png differ diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 6a23f14c1..e59e174aa 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,21 +1,25 @@ - + - + @@ -28,7 +32,7 @@ const scanning = ref(false) * { scrollbar-width: none; /* scrollbar-width: thin; */ - scrollbar-color: #808080 #ffffff; + scrollbar-color: #6e6e6e rgba(0, 0, 0, 0);; } /* Chrome, Edge, and Safari */ @@ -44,6 +48,5 @@ const scanning = ref(false) *::-webkit-scrollbar-thumb { background-color: #808080; border-radius: 5px; - /* border: 3px solid #ffffff; */ } diff --git a/frontend/src/components/Navigation.vue b/frontend/src/components/Navigation.vue index d044ac06a..73966b129 100644 --- a/frontend/src/components/Navigation.vue +++ b/frontend/src/components/Navigation.vue @@ -6,15 +6,14 @@ import { useTheme } from "vuetify"; // Props const platforms = ref([]) -const currentPlatformName = ref(localStorage.getItem('currentPlatformName') || "") -const currentPlatformSlug = ref(localStorage.getItem('currentPlatformSlug') || "") +const currentPlatform = ref(JSON.parse(localStorage.getItem('currentPlatform')) || "") const platformsToScan = ref([]) -const scanOverwrite = ref(false) const scanning = ref(false) +const scanOverwrite = ref(false) const gettingRomsFlag = ref(false) +const filter = ref('') const drawer = ref(null) const settings = ref(null) -const filter = ref('') const rail = (localStorage.getItem('rail') == 'true') ? ref(true) : ref(false) const theme = useTheme() const darkMode = (localStorage.getItem('theme') == 'light') ? ref(false) : ref(true) @@ -36,14 +35,17 @@ async function getPlatforms() { }).catch((error) => {console.log(error)}) } +function setFilter(filter) { + // Sets the roms filter + emitter.emit('romsFilter', filter) +} + async function selectPlatform(platform){ // Select the current platform await router.push(import.meta.env.BASE_URL) - localStorage.setItem('currentPlatformSlug', platform.slug) - localStorage.setItem('currentPlatformName', platform.name) - emitter.emit('currentPlatform', platform.slug) - currentPlatformName.value = platform.name - currentPlatformSlug.value = platform.slug + localStorage.setItem('currentPlatform', JSON.stringify(platform)) + emitter.emit('currentPlatform', platform) + currentPlatform.value = platform } function toggleRail(){ @@ -56,7 +58,6 @@ async function scan() { // Complete scan of by platform console.log("scanning...") scanning.value = true - emitter.emit('scanning', true) const platforms = [] toRaw(platformsToScan)._rawValue.forEach(p => { platforms.push(toRaw(p)) @@ -69,8 +70,7 @@ async function scan() { console.log(response.data) }).catch((error) => {console.log(error)}) scanning.value = false - emitter.emit('scanning', false) - // router.go() + emitter.emit('scanning') } else{ platforms.forEach(async p => { @@ -83,17 +83,11 @@ async function scan() { console.log(response.data) }).catch((error) => {console.log(error)}) scanning.value = false - emitter.emit('scanning', false) - // router.go() + emitter.emit('scanning') }); } } -function setFilter(filter) { - // Sets the roms filter - emitter.emit('romsFilter', filter) -} - function toggleTheme() { // Toggle dark/light theme theme.global.name.value = darkMode.value ? "dark" : "light" @@ -105,74 +99,75 @@ getPlatforms() - + - - Settings + + Settings + - + - + Scan Scanning - + - - + + - + - + - + - ROM MANAGER + ROM MANAGER - + - + - - + + - + - + - mdi-cog + mdi-cog - + + @:click="selectPlatform(platform)" + class="mt-3"> - + - + mdi-arrow-collapse-right mdi-arrow-collapse-left diff --git a/frontend/src/components/RomsDetail.vue b/frontend/src/components/RomsDetail.vue index b9afe8645..b32662ecc 100644 --- a/frontend/src/components/RomsDetail.vue +++ b/frontend/src/components/RomsDetail.vue @@ -3,13 +3,11 @@ import axios from 'axios' import { ref, inject, toRaw } from "vue"; // Props -const rom = ref("") -const scanOverwrite = ref(false) -rom.value = JSON.parse(localStorage.getItem('currentRom')) || '' -const matchedRoms = ref([]) +const rom = ref(JSON.parse(localStorage.getItem('currentRom')) || '') const searching = ref(false) +const matchedRoms = ref([]) const changing = ref(false) -const romFilename = ref(rom.value.filename) +const romNewName = ref(rom.value.filename) const submitted = ref(false) // Event listeners bus @@ -56,10 +54,10 @@ async function changeRom(newRomRaw) { async function submitEdit() { submitted.value = true await axios.patch('/api/platforms/'+rom.value.p_slug+'/roms/'+rom.value.filename, { - filename: romFilename.value + filename: romNewName.value }).then((response) => { - console.log("update "+rom.value.filename+" to "+romFilename.value) - rom.value.filename = romFilename.value + console.log("update "+rom.value.filename+" to "+romNewName.value) + rom.value.filename = romNewName.value }).catch((error) => {console.log(error)}) } @@ -67,14 +65,14 @@ async function submitEdit() { - + - + @@ -85,37 +83,37 @@ async function submitEdit() { - + - + - - - + + + - + Search IGDB - + - {{ rom.name }} + {{ rom.name }} - - + + Edit @@ -123,14 +121,14 @@ async function submitEdit() { - - - - Submit + + + + Submit - + Delete @@ -150,10 +148,10 @@ async function submitEdit() { Slug: {{ rom.r_slug }} Platform: {{ rom.p_slug }} Cover: {{ rom.path_cover_l }} - + {{ rom.summary }} - + \ No newline at end of file diff --git a/frontend/src/components/RomsGallery.vue b/frontend/src/components/RomsGallery.vue index b5269ad13..6f30127c9 100644 --- a/frontend/src/components/RomsGallery.vue +++ b/frontend/src/components/RomsGallery.vue @@ -8,17 +8,34 @@ import { saveAs } from 'file-saver' const roms = ref([]) const romsFiltered = ref([]) const currentFilter = ref('') -const noRoms = ref(false) -var currentPlatformSlug = localStorage.getItem('currentPlatformSlug') || "" const router = useRouter() const forceImgReload = Date.now() // Event listeners bus const emitter = inject('emitter') -emitter.on('currentPlatform', (platform) => { getRoms(platform) }) +emitter.on('currentPlatform', (platform) => { getRoms(platform.slug) }) emitter.on('romsFilter', (filter) => { setFilter(filter) }) // Functions +async function getRoms(platform) { + console.log("Getting roms...") + emitter.emit('gettingRoms', true) + await axios.get('/api/platforms/'+platform+'/roms').then((response) => { + console.log("Roms loaded!") + console.log(response.data.data) + roms.value = response.data.data + setFilter(currentFilter.value) + }).catch((error) => {console.log(error)}) + emitter.emit('gettingRoms', false) +} + +async function selectRom(rom) { + console.log("Selected rom "+rom.name) + localStorage.setItem('currentRom', JSON.stringify(rom)) + await router.push(import.meta.env.BASE_URL+'details') + emitter.emit('currentRom', rom) +} + function normalizeString(s) { return s.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g,"") } @@ -29,40 +46,19 @@ function setFilter(filter) { return normalizeString(rom.name).includes(currentFilter.value) }) } - -async function getRoms(platform) { - currentPlatformSlug = platform - console.log("Getting roms...") - emitter.emit('gettingRoms', true) - await axios.get('/api/platforms/'+platform+'/roms').then((response) => { - console.log("Roms loaded!") - console.log(response.data.data) - roms.value = response.data.data - setFilter(currentFilter.value) - if (roms.value.length == 0){ noRoms.value = true }else{ noRoms.value = false } - }).catch((error) => {console.log(error)}) - emitter.emit('gettingRoms', false) -} -function downloadRom(filename) { - console.log("Downloading "+filename) - axios.get('/assets/emulation/'+currentPlatformSlug+'/roms/'+filename, { responseType: 'blob' }).then(response => { - saveAs(new Blob([response.data], { type: 'application/file' }), filename) +function downloadRom(rom) { + console.log("Downloading "+rom.filename) + axios.get('/assets/emulation/'+rom.p_slug+'/roms/'+rom.filename, { responseType: 'blob' }).then(response => { + saveAs(new Blob([response.data], { type: 'application/file' }), rom.filename) }).catch(console.error) } -function downloadSave(name) { - console.log("Downloading "+name+" save file") +function downloadSave(rom) { + console.log("Downloading "+rom.filename+" save file") } -async function selectRom(rom) { - console.log("Selected rom "+rom.name) - localStorage.setItem('currentRom', JSON.stringify(rom)) - await router.push(import.meta.env.BASE_URL+'details') - emitter.emit('currentRom', rom) -} - -onMounted(() => { if(currentPlatformSlug){ getRoms(currentPlatformSlug) } }) +onMounted(() => { if(localStorage.getItem('currentPlatform')){ getRoms(JSON.parse(localStorage.getItem('currentPlatform')).slug) } }) @@ -70,29 +66,29 @@ onMounted(() => { if(currentPlatformSlug){ getRoms(currentPlatformSlug) } }) - + - {{ rom.filename }} + {{ rom.filename }} - + - {{ rom.filename }} - + {{ rom.filename }} + - - + + - - Feels cold here... mdi-emoticon-sad + + Feels cold here... mdi-emoticon-sad
Scan
Scanning