mirror of
https://github.com/mileswolfallen2/OmniEmu2.0.git
synced 2026-12-06 08:33:53 +00:00
feat: release v0.2.0 with beta features toggle and new frontend support
- Added support for experimental emulators (ES-DE, NeoStation, Pegasus) behind a beta toggle in settings. - Implemented manual installation prompts for ES-DE and NeoStation on macOS. - Updated user agent to v0.1.3 across various modules. - Enhanced the Emulators page with conditional install buttons for beta emulators. - Introduced a new settings section for enabling/disabling beta features. - Updated release notes for v0.2.0 detailing new features and improvements. - Added project specification document for OmniEmu 2.0.
This commit is contained in:
1 parent
630deea100
commit
89446e4f96
19 files changed
+1609
-38
No files matched your search
+432
-2
@@ -1,8 +1,10 @@
|
||||
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
||||
import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync, statSync } from 'fs';
|
||||
import { join, dirname } from 'path';
|
||||
import { app } from 'electron';
|
||||
import { ConfigPreset, InstallProgress, Platform } from '../shared/types';
|
||||
import { getPlatform, isWindows, isMacOS } from './platform';
|
||||
import { knownEmulators, checkEmulator } from './emulators';
|
||||
import { settings } from './settings';
|
||||
|
||||
const platform = getPlatform();
|
||||
|
||||
@@ -256,6 +258,27 @@ volume = 100
|
||||
},
|
||||
},
|
||||
],
|
||||
esde: [
|
||||
{
|
||||
name: 'OmniEmu Recommended',
|
||||
description: 'Pre-configures ES-DE with your ROM directory and installed emulators',
|
||||
files: {},
|
||||
},
|
||||
],
|
||||
neostation: [
|
||||
{
|
||||
name: 'OmniEmu Recommended',
|
||||
description: 'Pre-configures NeoStation with your ROM directory and installed emulators',
|
||||
files: {},
|
||||
},
|
||||
],
|
||||
pegasus: [
|
||||
{
|
||||
name: 'OmniEmu Recommended',
|
||||
description: 'Generates Pegasus collection files for all your ROMs with correct launch commands',
|
||||
files: {},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
// ---- Remote presets URL ----
|
||||
@@ -267,7 +290,7 @@ async function fetchRemotePresets(): Promise<Record<string, ConfigPreset[]> | nu
|
||||
const { get } = await import('https');
|
||||
const data = await new Promise<string>((resolve, reject) => {
|
||||
get(presetSourceUrl, {
|
||||
headers: { 'User-Agent': 'OmniEmu/0.1.2' },
|
||||
headers: { 'User-Agent': 'OmniEmu/0.1.3' },
|
||||
timeout: 10000,
|
||||
}, (res) => {
|
||||
if (res.statusCode !== 200) { reject(new Error(`HTTP ${res.statusCode}`)); return; }
|
||||
@@ -367,6 +390,21 @@ function getConfigDir(emulatorId: string, installPath: string): string {
|
||||
darwin: join(require('os').homedir(), 'Library', 'Application Support', 'melonDS'),
|
||||
linux: join(require('os').homedir(), '.config', 'melonDS'),
|
||||
},
|
||||
esde: {
|
||||
win32: join(require('os').homedir(), 'ES-DE'),
|
||||
darwin: join(require('os').homedir(), 'ES-DE'),
|
||||
linux: join(require('os').homedir(), 'ES-DE'),
|
||||
},
|
||||
neostation: {
|
||||
win32: join(process.env.LOCALAPPDATA || join(require('os').homedir(), 'AppData', 'Local'), 'neostation'),
|
||||
darwin: join(require('os').homedir(), 'Library', 'Application Support', 'neostation'),
|
||||
linux: join(require('os').homedir(), '.local', 'share', 'neostation'),
|
||||
},
|
||||
pegasus: {
|
||||
win32: join(process.env.LOCALAPPDATA || join(require('os').homedir(), 'AppData', 'Local'), 'pegasus-frontend'),
|
||||
darwin: join(require('os').homedir(), 'Library', 'Preferences', 'pegasus-frontend'),
|
||||
linux: join(require('os').homedir(), '.config', 'pegasus-frontend'),
|
||||
},
|
||||
};
|
||||
return platformDirs[emulatorId]?.[platform] || dirname(installPath);
|
||||
}
|
||||
@@ -419,12 +457,404 @@ export async function applyRecommendedConfig(
|
||||
installPath: string,
|
||||
onProgress?: (p: InstallProgress) => void
|
||||
): Promise<boolean> {
|
||||
if (emulatorId === 'esde') {
|
||||
return configureEsde(installPath, onProgress);
|
||||
}
|
||||
if (emulatorId === 'neostation') {
|
||||
return configureNeostation(installPath, onProgress);
|
||||
}
|
||||
if (emulatorId === 'pegasus') {
|
||||
return configurePegasus(installPath, onProgress);
|
||||
}
|
||||
const presets = await getPresets(emulatorId);
|
||||
if (presets.length === 0) return false;
|
||||
await applyPreset(emulatorId, presets[0], installPath, onProgress);
|
||||
return true;
|
||||
}
|
||||
|
||||
// ---- ES-DE Configuration ----
|
||||
|
||||
/** Map OmniEmu emulator IDs to ES-DE find-rules emulator names */
|
||||
const esdeEmulatorNames: Record<string, string> = {
|
||||
retroarch: 'RETROARCH',
|
||||
dolphin: 'DOLPHIN',
|
||||
rpcs3: 'RPCS3',
|
||||
pcsx2: 'PCSX2',
|
||||
duckstation: 'DUCKSTATION',
|
||||
mame: 'MAME',
|
||||
ppsspp: 'PPSSPP',
|
||||
melonds: 'MELONDS',
|
||||
flycast: 'FLYCAST',
|
||||
eden: 'EDEN',
|
||||
};
|
||||
|
||||
function getEsdeEmulatorName(emulatorId: string): string | undefined {
|
||||
return esdeEmulatorNames[emulatorId];
|
||||
}
|
||||
|
||||
function generateEsFindRules(): string {
|
||||
const lines: string[] = [
|
||||
'<?xml version="1.0"?>',
|
||||
'<!-- ES-DE find rules generated by OmniEmu -->',
|
||||
'<ruleList>',
|
||||
];
|
||||
|
||||
for (const emu of knownEmulators) {
|
||||
if (emu.id === 'esde') continue;
|
||||
const esdeName = getEsdeEmulatorName(emu.id);
|
||||
if (!esdeName) continue;
|
||||
|
||||
const state = checkEmulator(emu.id);
|
||||
if (!state.installed || !state.path) continue;
|
||||
|
||||
lines.push(` <emulator name="${esdeName}">`);
|
||||
lines.push(' <rule type="staticpath">');
|
||||
lines.push(` <entry>${state.path}</entry>`);
|
||||
lines.push(' </rule>');
|
||||
lines.push(' </emulator>');
|
||||
}
|
||||
|
||||
lines.push('</ruleList>');
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
function generateEsSettingsXml(romDir: string, mediaDir: string): string {
|
||||
return [
|
||||
'<?xml version="1.0"?>',
|
||||
'<!-- ES-DE settings generated by OmniEmu -->',
|
||||
'<viewSettings>',
|
||||
` <string name="ROMDirectory" value="${romDir}" />`,
|
||||
` <string name="MediaDirectory" value="${mediaDir}" />`,
|
||||
'</viewSettings>',
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
async function configureEsde(
|
||||
installPath: string,
|
||||
onProgress?: (p: InstallProgress) => void
|
||||
): Promise<boolean> {
|
||||
const report = onProgress
|
||||
? (percent: number, message: string) =>
|
||||
onProgress({ emulatorId: 'esde', stage: 'configuring', percent, message })
|
||||
: () => {};
|
||||
|
||||
report(0, 'Configuring ES-DE...');
|
||||
|
||||
const esdeConfigDir = getConfigDir('esde', installPath);
|
||||
const settingsDir = join(esdeConfigDir, 'settings');
|
||||
const customSystemsDir = join(esdeConfigDir, 'custom_systems');
|
||||
|
||||
if (!existsSync(settingsDir)) mkdirSync(settingsDir, { recursive: true });
|
||||
if (!existsSync(customSystemsDir)) mkdirSync(customSystemsDir, { recursive: true });
|
||||
|
||||
report(25, 'Writing ES-DE settings...');
|
||||
|
||||
const romDir = settings.get().romsDirectory || join(require('os').homedir(), 'Documents', 'roms');
|
||||
const mediaDir = join(esdeConfigDir, 'downloaded_media');
|
||||
|
||||
const settingsXml = generateEsSettingsXml(romDir, mediaDir);
|
||||
writeFileSync(join(settingsDir, 'es_settings.xml'), settingsXml, 'utf-8');
|
||||
|
||||
report(50, 'Writing emulator find rules...');
|
||||
|
||||
const findRules = generateEsFindRules();
|
||||
writeFileSync(join(customSystemsDir, 'es_find_rules.xml'), findRules, 'utf-8');
|
||||
|
||||
report(75, 'Creating media directory...');
|
||||
|
||||
if (!existsSync(mediaDir)) mkdirSync(mediaDir, { recursive: true });
|
||||
|
||||
report(100, 'ES-DE configured');
|
||||
|
||||
const markerDir = join(app.getPath('userData'), 'configs');
|
||||
if (!existsSync(markerDir)) mkdirSync(markerDir, { recursive: true });
|
||||
writeFileSync(join(markerDir, 'esde.configured'), new Date().toISOString(), 'utf-8');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ---- NeoStation Configuration ----
|
||||
|
||||
function generateNeostationConfig(romDir: string): string {
|
||||
const emulatorsDir = settings.get().emulatorsDirectory || join(app.getPath('userData'), 'emulators');
|
||||
|
||||
// Build emulator paths map from installed emulators
|
||||
const emulatorPaths: Record<string, string> = {};
|
||||
for (const emu of knownEmulators) {
|
||||
if (emu.id === 'neostation' || emu.id === 'esde') continue;
|
||||
const state = checkEmulator(emu.id);
|
||||
if (state.installed && state.path) {
|
||||
emulatorPaths[emu.id] = state.path;
|
||||
}
|
||||
}
|
||||
|
||||
return JSON.stringify({
|
||||
roms_directory: romDir,
|
||||
emulators_directory: emulatorsDir,
|
||||
emulators: emulatorPaths,
|
||||
}, null, 2);
|
||||
}
|
||||
|
||||
async function configureNeostation(
|
||||
installPath: string,
|
||||
onProgress?: (p: InstallProgress) => void
|
||||
): Promise<boolean> {
|
||||
const report = onProgress
|
||||
? (percent: number, message: string) =>
|
||||
onProgress({ emulatorId: 'neostation', stage: 'configuring', percent, message })
|
||||
: () => {};
|
||||
|
||||
report(0, 'Configuring NeoStation...');
|
||||
|
||||
const configDir = getConfigDir('neostation', installPath);
|
||||
if (!existsSync(configDir)) mkdirSync(configDir, { recursive: true });
|
||||
|
||||
report(25, 'Writing NeoStation configuration...');
|
||||
|
||||
const romDir = settings.get().romsDirectory || join(require('os').homedir(), 'Documents', 'roms');
|
||||
const configContent = generateNeostationConfig(romDir);
|
||||
writeFileSync(join(configDir, 'omniemu_config.json'), configContent, 'utf-8');
|
||||
|
||||
report(50, 'Discovering installed emulators...');
|
||||
|
||||
// Create symlinks to ROM directories for NeoStation to discover
|
||||
const romsLink = join(configDir, 'roms');
|
||||
try {
|
||||
if (!existsSync(romsLink)) {
|
||||
const { symlinkSync } = require('fs');
|
||||
symlinkSync(romDir, romsLink);
|
||||
}
|
||||
} catch { /* ignore if symlink fails */ }
|
||||
|
||||
report(75, 'Finalizing...');
|
||||
|
||||
report(100, 'NeoStation configured');
|
||||
|
||||
const markerDir = join(app.getPath('userData'), 'configs');
|
||||
if (!existsSync(markerDir)) mkdirSync(markerDir, { recursive: true });
|
||||
writeFileSync(join(markerDir, 'neostation.configured'), new Date().toISOString(), 'utf-8');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ---- Pegasus Frontend Configuration ----
|
||||
|
||||
interface PegasusSystemMeta {
|
||||
name: string;
|
||||
shortname: string;
|
||||
extensions: string[];
|
||||
}
|
||||
|
||||
const pegasusSystemMeta: Record<string, PegasusSystemMeta> = {
|
||||
nes: { name: 'Nintendo Entertainment System', shortname: 'nes', extensions: ['nes', 'fds'] },
|
||||
snes: { name: 'Super Nintendo Entertainment System', shortname: 'snes', extensions: ['smc', 'sfc', 'fig', 'swc'] },
|
||||
n64: { name: 'Nintendo 64', shortname: 'n64', extensions: ['n64', 'z64', 'v64'] },
|
||||
gb: { name: 'Game Boy', shortname: 'gb', extensions: ['gb'] },
|
||||
gbc: { name: 'Game Boy Color', shortname: 'gbc', extensions: ['gbc'] },
|
||||
gba: { name: 'Game Boy Advance', shortname: 'gba', extensions: ['gba'] },
|
||||
nds: { name: 'Nintendo DS', shortname: 'nds', extensions: ['nds'] },
|
||||
ps1: { name: 'PlayStation', shortname: 'psx', extensions: ['bin', 'cue', 'iso', 'chd', 'pbp'] },
|
||||
ps2: { name: 'PlayStation 2', shortname: 'ps2', extensions: ['iso', 'bin', 'chd', 'gz'] },
|
||||
ps3: { name: 'PlayStation 3', shortname: 'ps3', extensions: ['iso'] },
|
||||
psp: { name: 'PlayStation Portable', shortname: 'psp', extensions: ['iso', 'cso', 'pbp'] },
|
||||
gc: { name: 'GameCube', shortname: 'gamecube', extensions: ['gcm', 'gcz', 'iso', 'rvz'] },
|
||||
wii: { name: 'Wii', shortname: 'wii', extensions: ['wbfs', 'iso', 'gcz', 'rvz'] },
|
||||
switch: { name: 'Nintendo Switch', shortname: 'switch', extensions: ['nsp', 'xci'] },
|
||||
arcade: { name: 'Arcade', shortname: 'arcade', extensions: ['zip', '7z'] },
|
||||
dreamcast: { name: 'Sega Dreamcast', shortname: 'dreamcast', extensions: ['gdi', 'cdi', 'chd'] },
|
||||
'sega-md': { name: 'Sega Mega Drive', shortname: 'genesis', extensions: ['bin', 'md', 'smd'] },
|
||||
'sega-saturn': { name: 'Sega Saturn', shortname: 'saturn', extensions: ['bin', 'cue', 'chd'] },
|
||||
pce: { name: 'PC Engine', shortname: 'pce', extensions: ['pce'] },
|
||||
};
|
||||
|
||||
function getPegasusLaunchCommand(emulatorPath: string, emulatorId: string): string {
|
||||
const fp = '{file.path}';
|
||||
const esc = (s: string) => `"${s}"`;
|
||||
switch (emulatorId) {
|
||||
case 'retroarch': {
|
||||
const core = isWindows() ? '_libretro.dll' : '_libretro.so';
|
||||
return esc(emulatorPath) + ' -L ' + esc('{core_dir}/' + core) + ' ' + esc(fp);
|
||||
}
|
||||
case 'dolphin': return esc(emulatorPath) + ' --exec=' + esc(fp);
|
||||
case 'rpcs3': return esc(emulatorPath) + ' ' + esc(fp);
|
||||
case 'pcsx2': return esc(emulatorPath) + ' ' + esc(fp);
|
||||
case 'duckstation':return esc(emulatorPath) + ' ' + esc(fp);
|
||||
case 'mame': return esc(emulatorPath) + ' ' + esc(fp);
|
||||
case 'flycast': return esc(emulatorPath) + ' ' + esc(fp);
|
||||
case 'melonDS': return esc(emulatorPath) + ' ' + esc(fp);
|
||||
case 'eden': return esc(emulatorPath) + ' ' + esc(fp);
|
||||
case 'ppsspp': return esc(emulatorPath) + ' ' + esc(fp);
|
||||
default: return esc(emulatorPath) + ' ' + esc(fp);
|
||||
}
|
||||
}
|
||||
|
||||
function generatePegasusCollection(systemId: string, romDir: string, launchCmd: string): string {
|
||||
const meta = pegasusSystemMeta[systemId];
|
||||
if (!meta) return '';
|
||||
|
||||
const systemDir = join(romDir, systemId);
|
||||
const lines: string[] = [];
|
||||
|
||||
lines.push(`collection: ${meta.name}`);
|
||||
lines.push(`shortname: ${meta.shortname}`);
|
||||
lines.push(`extensions: ${meta.extensions.join(', ')}`);
|
||||
lines.push(`launch: ${launchCmd}`);
|
||||
lines.push('');
|
||||
|
||||
// Scan for ROM files in this system directory
|
||||
if (existsSync(systemDir)) {
|
||||
try {
|
||||
const files = readdirSync(systemDir);
|
||||
for (const file of files) {
|
||||
const filePath = join(systemDir, file);
|
||||
const stat = statSync(filePath);
|
||||
if (!stat.isFile()) continue;
|
||||
|
||||
const ext = file.split('.').pop()?.toLowerCase() || '';
|
||||
if (!meta.extensions.includes(ext)) continue;
|
||||
|
||||
const title = file.replace(/\.[^/.]+$/, '').replace(/ \(.*\)$/, '');
|
||||
|
||||
lines.push(`game: ${title}`);
|
||||
lines.push(`file: ${file}`);
|
||||
lines.push(`launch: ${launchCmd}`);
|
||||
lines.push('');
|
||||
}
|
||||
} catch { /* skip unreadable */ }
|
||||
}
|
||||
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
/** Generate Pegasus collection files in each ROM subdirectory. Called on app startup. */
|
||||
export function generatePegasusCollectionsForRomDir(romDir: string): void {
|
||||
if (!existsSync(romDir)) return;
|
||||
|
||||
const emuPaths: Record<string, string> = {};
|
||||
for (const emu of knownEmulators) {
|
||||
if (emu.id === 'pegasus' || emu.id === 'esde' || emu.id === 'neostation' || emu.id === 'emubuddy') continue;
|
||||
const state = checkEmulator(emu.id);
|
||||
if (state.installed && state.path) {
|
||||
emuPaths[emu.id] = state.path;
|
||||
}
|
||||
}
|
||||
const defaultEmu = emuPaths['retroarch'] || Object.values(emuPaths)[0] || 'retroarch';
|
||||
|
||||
const emuPrefs: Record<string, string> = {
|
||||
nes: 'retroarch', snes: 'retroarch', n64: 'retroarch',
|
||||
gb: 'retroarch', gbc: 'retroarch', gba: 'retroarch', nds: 'retroarch',
|
||||
ps1: 'duckstation', ps2: 'pcsx2', psp: 'ppsspp',
|
||||
gc: 'dolphin', wii: 'dolphin', switch: 'eden',
|
||||
arcade: 'mame', dreamcast: 'flycast',
|
||||
'sega-md': 'retroarch', 'sega-saturn': 'retroarch', pce: 'retroarch',
|
||||
};
|
||||
|
||||
for (const [systemId, meta] of Object.entries(pegasusSystemMeta)) {
|
||||
const systemDir = join(romDir, systemId);
|
||||
if (!existsSync(systemDir)) continue;
|
||||
|
||||
const preferredEmu = emuPrefs[systemId] || 'retroarch';
|
||||
const emuPath = emuPaths[preferredEmu] || defaultEmu;
|
||||
const launchCmd = getPegasusLaunchCommand(emuPath, preferredEmu);
|
||||
|
||||
const collection = generatePegasusCollection(systemId, romDir, launchCmd);
|
||||
if (!collection) continue;
|
||||
|
||||
writeFileSync(join(systemDir, 'metadata.pegasus.txt'), collection, 'utf-8');
|
||||
}
|
||||
}
|
||||
|
||||
async function configurePegasus(
|
||||
installPath: string,
|
||||
onProgress?: (p: InstallProgress) => void
|
||||
): Promise<boolean> {
|
||||
const report = onProgress
|
||||
? (percent: number, message: string) =>
|
||||
onProgress({ emulatorId: 'pegasus', stage: 'configuring', percent, message })
|
||||
: () => {};
|
||||
|
||||
report(0, 'Configuring Pegasus Frontend...');
|
||||
|
||||
const configDir = getConfigDir('pegasus', installPath);
|
||||
const metafilesDir = join(configDir, 'metafiles');
|
||||
if (!existsSync(metafilesDir)) mkdirSync(metafilesDir, { recursive: true });
|
||||
|
||||
report(10, 'Scanning ROM directories...');
|
||||
|
||||
const romDir = settings.get().romsDirectory || join(require('os').homedir(), 'Documents', 'roms');
|
||||
|
||||
// Get installed emulator paths
|
||||
const emuPaths: Record<string, string> = {};
|
||||
for (const emu of knownEmulators) {
|
||||
if (emu.id === 'pegasus' || emu.id === 'esde' || emu.id === 'neostation' || emu.id === 'emubuddy') continue;
|
||||
const state = checkEmulator(emu.id);
|
||||
if (state.installed && state.path) {
|
||||
emuPaths[emu.id] = state.path;
|
||||
}
|
||||
}
|
||||
const defaultEmu = emuPaths['retroarch'] || Object.values(emuPaths)[0] || 'retroarch';
|
||||
|
||||
const emuPrefs: Record<string, string> = {
|
||||
nes: 'retroarch', snes: 'retroarch', n64: 'retroarch',
|
||||
gb: 'retroarch', gbc: 'retroarch', gba: 'retroarch', nds: 'retroarch',
|
||||
ps1: 'duckstation', ps2: 'pcsx2', psp: 'ppsspp',
|
||||
gc: 'dolphin', wii: 'dolphin', switch: 'eden',
|
||||
arcade: 'mame', dreamcast: 'flycast',
|
||||
'sega-md': 'retroarch', 'sega-saturn': 'retroarch', pce: 'retroarch',
|
||||
};
|
||||
|
||||
report(25, 'Writing collection files to ROM directories...');
|
||||
|
||||
let systemsProcessed = 0;
|
||||
const totalSystems = Object.keys(pegasusSystemMeta).length;
|
||||
|
||||
// Write a metadata.pegasus.txt directly into each ROM subdirectory
|
||||
for (const [systemId, meta] of Object.entries(pegasusSystemMeta)) {
|
||||
systemsProcessed++;
|
||||
report(25 + Math.round((systemsProcessed / totalSystems) * 50),
|
||||
`Processing ${meta.name}...`);
|
||||
|
||||
const systemDir = join(romDir, systemId);
|
||||
if (!existsSync(systemDir)) continue;
|
||||
|
||||
// Pick the best emulator for this system
|
||||
const preferredEmu = emuPrefs[systemId] || 'retroarch';
|
||||
const emuPath = emuPaths[preferredEmu] || defaultEmu;
|
||||
const launchCmd = getPegasusLaunchCommand(emuPath, preferredEmu);
|
||||
|
||||
// Generate collection content for this system
|
||||
const collection = generatePegasusCollection(systemId, romDir, launchCmd);
|
||||
if (!collection) continue;
|
||||
|
||||
// Write metadata.pegasus.txt directly into the ROM subdirectory
|
||||
writeFileSync(join(systemDir, 'metadata.pegasus.txt'), collection, 'utf-8');
|
||||
|
||||
// Also write a copy to Pegasus's central metafiles dir as backup
|
||||
writeFileSync(join(metafilesDir, `${systemId}.pegasus.txt`), collection, 'utf-8');
|
||||
}
|
||||
|
||||
report(80, 'Writing Pegasus settings...');
|
||||
|
||||
// Point Pegasus at the ROMs directory
|
||||
const settingsFile = join(configDir, 'settings.txt');
|
||||
const settingsContent = [
|
||||
'# Pegasus settings generated by OmniEmu',
|
||||
'game_dirs:',
|
||||
` ${romDir}`,
|
||||
].join('\n');
|
||||
writeFileSync(settingsFile, settingsContent, 'utf-8');
|
||||
|
||||
report(100, 'Pegasus Frontend configured');
|
||||
|
||||
const markerDir = join(app.getPath('userData'), 'configs');
|
||||
if (!existsSync(markerDir)) mkdirSync(markerDir, { recursive: true });
|
||||
writeFileSync(join(markerDir, 'pegasus.configured'), new Date().toISOString(), 'utf-8');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ---- Controller Configuration ----
|
||||
|
||||
/** Write controller config for a given emulator — PS-aware */
|
||||
export function applyControllerConfig(emulatorId: string, installPath: string, controllerName?: string): boolean {
|
||||
const configDir = getConfigDir(emulatorId, installPath);
|
||||
|
||||
+229
-1
@@ -436,6 +436,186 @@ export const knownEmulators: EmulatorConfig[] = [
|
||||
linux: 'https://github.com/flyinghead/flycast/releases',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'esde',
|
||||
name: 'ES-DE',
|
||||
description: 'EmulationStation Desktop Edition — multi-system frontend & game launcher',
|
||||
platforms: [
|
||||
'nes', 'snes', 'n64', 'gb', 'gbc', 'gba', 'nds',
|
||||
'ps1', 'ps2', 'ps3', 'psp', 'gc', 'wii', 'switch',
|
||||
'arcade', 'dreamcast', 'sega-md', 'sega-saturn', 'sega-dc', 'pce',
|
||||
],
|
||||
defaultPath: {
|
||||
win32: 'C:\\Program Files\\ES-DE\\esde.exe',
|
||||
darwin: '/Applications/ES-DE.app/Contents/MacOS/esde',
|
||||
linux: '/usr/bin/es-de',
|
||||
},
|
||||
downloads: {
|
||||
win32: [
|
||||
{
|
||||
url: 'https://gitlab.com/es-de/emulationstation-de/-/package_files/288156889/download',
|
||||
format: 'exe',
|
||||
installerType: 'nsis',
|
||||
executablePath: 'esde.exe',
|
||||
},
|
||||
],
|
||||
darwin: [
|
||||
{
|
||||
url: 'https://gitlab.com/es-de/emulationstation-de/-/package_files/288889626/download',
|
||||
format: 'dmg',
|
||||
arch: 'arm64',
|
||||
},
|
||||
{
|
||||
url: 'https://gitlab.com/es-de/emulationstation-de/-/package_files/288889701/download',
|
||||
format: 'dmg',
|
||||
arch: 'x64',
|
||||
},
|
||||
],
|
||||
linux: [
|
||||
{
|
||||
url: 'https://gitlab.com/es-de/emulationstation-de/-/package_files/288156961/download',
|
||||
format: 'appimage',
|
||||
arch: 'x64',
|
||||
},
|
||||
{
|
||||
url: 'https://gitlab.com/es-de/emulationstation-de/-/package_files/288156935/download',
|
||||
format: 'appimage',
|
||||
arch: 'arm64',
|
||||
},
|
||||
],
|
||||
},
|
||||
supported: true,
|
||||
websiteUrl: {
|
||||
win32: 'https://es-de.org/download/',
|
||||
darwin: 'https://es-de.org/download/',
|
||||
linux: 'https://es-de.org/download/',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'neostation',
|
||||
name: 'NeoStation',
|
||||
description: 'Modern multi-platform emulation frontend — auto-discovers emulators and ROMs',
|
||||
platforms: [
|
||||
'nes', 'snes', 'n64', 'gb', 'gbc', 'gba', 'nds',
|
||||
'ps1', 'ps2', 'ps3', 'psp', 'gc', 'wii', 'switch',
|
||||
'arcade', 'dreamcast', 'sega-md', 'sega-saturn', 'sega-dc', 'pce',
|
||||
],
|
||||
defaultPath: {
|
||||
win32: 'C:\\Program Files\\NeoStation\\neostation.exe',
|
||||
darwin: '/Applications/NeoStation.app/Contents/MacOS/neostation',
|
||||
linux: '/usr/bin/neostation',
|
||||
},
|
||||
downloads: {
|
||||
win32: [
|
||||
{
|
||||
url: 'https://github.com/misobadev/neostation-frontend/releases/download/v0.9.3%2B114/neostation-windows-x64-0.9.3+114.zip',
|
||||
format: 'zip',
|
||||
executablePath: 'neostation.exe',
|
||||
},
|
||||
],
|
||||
darwin: [
|
||||
{
|
||||
url: 'https://github.com/misobadev/neostation-frontend/releases/download/v0.9.3%2B114/neostation-macos-universal-0.9.3+114.dmg',
|
||||
format: 'dmg',
|
||||
},
|
||||
],
|
||||
linux: [
|
||||
{
|
||||
url: 'https://github.com/misobadev/neostation-frontend/releases/download/v0.9.3%2B114/neostation-linux-x86_64-0.9.3+114.AppImage',
|
||||
format: 'appimage',
|
||||
},
|
||||
],
|
||||
},
|
||||
supported: true,
|
||||
websiteUrl: {
|
||||
win32: 'https://neostation.dev/downloads/',
|
||||
darwin: 'https://neostation.dev/downloads/',
|
||||
linux: 'https://neostation.dev/downloads/',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'emubuddy',
|
||||
name: 'EmuBuddy',
|
||||
description: 'Cross-platform emulation frontend — one-click setup, game downloading, controller support',
|
||||
platforms: [
|
||||
'nes', 'snes', 'n64', 'gb', 'gbc', 'gba', 'nds',
|
||||
'ps1', 'ps2', 'psp', 'gc', 'wii', 'dreamcast', 'sega-saturn',
|
||||
],
|
||||
defaultPath: {
|
||||
win32: 'C:\\Program Files\\EmuBuddy\\EmuBuddyLauncher.exe',
|
||||
darwin: '/Applications/EmuBuddy.app/Contents/MacOS/EmuBuddy',
|
||||
linux: '/usr/bin/emubuddy',
|
||||
},
|
||||
downloads: {
|
||||
win32: [
|
||||
{
|
||||
url: 'https://github.com/computerex/EmuBuddy/releases/download/1.0.0/EmuBuddy-Windows-v1.0.0.zip',
|
||||
format: 'zip',
|
||||
executablePath: 'EmuBuddyLauncher.exe',
|
||||
},
|
||||
],
|
||||
darwin: [
|
||||
{
|
||||
url: 'https://github.com/computerex/EmuBuddy/releases/download/1.0.0/EmuBuddy-macOS-v1.0.0.zip',
|
||||
format: 'zip',
|
||||
},
|
||||
],
|
||||
linux: [
|
||||
{
|
||||
url: 'https://github.com/computerex/EmuBuddy/releases/download/1.0.0/EmuBuddy-Linux-v1.0.0.zip',
|
||||
format: 'zip',
|
||||
},
|
||||
],
|
||||
},
|
||||
supported: true,
|
||||
websiteUrl: {
|
||||
win32: 'https://github.com/computerex/EmuBuddy',
|
||||
darwin: 'https://github.com/computerex/EmuBuddy',
|
||||
linux: 'https://github.com/computerex/EmuBuddy',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'pegasus',
|
||||
name: 'Pegasus Frontend',
|
||||
description: 'Cross-platform customizable game launcher with theme support',
|
||||
platforms: [
|
||||
'nes', 'snes', 'n64', 'gb', 'gbc', 'gba', 'nds',
|
||||
'ps1', 'ps2', 'ps3', 'psp', 'gc', 'wii', 'switch',
|
||||
'arcade', 'dreamcast', 'sega-md', 'sega-saturn', 'sega-dc', 'pce',
|
||||
],
|
||||
defaultPath: {
|
||||
win32: 'C:\\Program Files\\Pegasus\\pegasus-fe.exe',
|
||||
darwin: '/Applications/Pegasus.app/Contents/MacOS/pegasus-fe',
|
||||
linux: '/usr/bin/pegasus-fe',
|
||||
},
|
||||
downloads: {
|
||||
win32: [
|
||||
{
|
||||
url: 'https://github.com/mmatyas/pegasus-frontend/releases/download/weekly_2024w38/pegasus-fe_alpha16-82-gc3462e68_win-mingw-static.zip',
|
||||
format: 'zip',
|
||||
executablePath: 'pegasus-fe.exe',
|
||||
},
|
||||
],
|
||||
darwin: [
|
||||
{
|
||||
url: 'https://github.com/mmatyas/pegasus-frontend/releases/download/weekly_2024w38/pegasus-fe_alpha16-82-gc3462e68_macos-static.zip',
|
||||
format: 'zip',
|
||||
},
|
||||
],
|
||||
linux: [
|
||||
{
|
||||
url: 'https://github.com/mmatyas/pegasus-frontend/releases/download/weekly_2024w38/pegasus-fe_alpha16-82-gc3462e68_x11-static.zip',
|
||||
format: 'zip',
|
||||
},
|
||||
],
|
||||
},
|
||||
supported: true,
|
||||
websiteUrl: {
|
||||
win32: 'https://pegasus-frontend.org/download/',
|
||||
darwin: 'https://pegasus-frontend.org/download/',
|
||||
linux: 'https://pegasus-frontend.org/download/',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export function findEmulator(id: string): EmulatorConfig | undefined {
|
||||
@@ -525,6 +705,42 @@ function alternativePaths(emulatorId: string): string[] {
|
||||
join(omniEmuDir, 'flycast'),
|
||||
join(omniEmuDir, 'Flycast.app', 'Contents', 'MacOS', 'Flycast'),
|
||||
join(home, 'Applications', 'Flycast.app', 'Contents', 'MacOS', 'Flycast'),
|
||||
'/usr/local/bin/flycast',
|
||||
],
|
||||
esde: [
|
||||
join(omniEmuDir, 'esde.exe'),
|
||||
join(omniEmuDir, 'ES-DE', 'esde.exe'),
|
||||
join(omniEmuDir, 'es-de'),
|
||||
join(omniEmuDir, 'ES-DE.app', 'Contents', 'MacOS', 'esde'),
|
||||
join(home, 'Applications', 'ES-DE.app', 'Contents', 'MacOS', 'esde'),
|
||||
'/usr/local/bin/es-de',
|
||||
'/usr/bin/es-de',
|
||||
],
|
||||
neostation: [
|
||||
join(omniEmuDir, 'neostation.exe'),
|
||||
join(omniEmuDir, 'NeoStation', 'neostation.exe'),
|
||||
join(omniEmuDir, 'neostation'),
|
||||
join(omniEmuDir, 'NeoStation.app', 'Contents', 'MacOS', 'neostation'),
|
||||
join(home, 'Applications', 'NeoStation.app', 'Contents', 'MacOS', 'neostation'),
|
||||
'/usr/local/bin/neostation',
|
||||
'/usr/bin/neostation',
|
||||
],
|
||||
emubuddy: [
|
||||
join(omniEmuDir, 'EmuBuddyLauncher.exe'),
|
||||
join(omniEmuDir, 'EmuBuddy', 'EmuBuddyLauncher.exe'),
|
||||
join(omniEmuDir, 'EmuBuddyLauncher'),
|
||||
join(omniEmuDir, 'EmuBuddy.app', 'Contents', 'MacOS', 'EmuBuddy'),
|
||||
join(home, 'Applications', 'EmuBuddy.app', 'Contents', 'MacOS', 'EmuBuddy'),
|
||||
'/usr/local/bin/emubuddy',
|
||||
'/usr/bin/emubuddy',
|
||||
],
|
||||
pegasus: [
|
||||
join(omniEmuDir, 'pegasus-fe.exe'),
|
||||
join(omniEmuDir, 'pegasus-fe'),
|
||||
join(omniEmuDir, 'Pegasus.app', 'Contents', 'MacOS', 'pegasus-fe'),
|
||||
join(home, 'Applications', 'Pegasus.app', 'Contents', 'MacOS', 'pegasus-fe'),
|
||||
'/usr/local/bin/pegasus-fe',
|
||||
'/usr/bin/pegasus-fe',
|
||||
],
|
||||
melonds: [
|
||||
join(omniEmuDir, 'melonDS.exe'),
|
||||
@@ -597,7 +813,11 @@ export function checkEmulator(id: string): EmulatorState {
|
||||
}
|
||||
|
||||
export function getAllEmulatorStates(): EmulatorState[] {
|
||||
return knownEmulators.map((e) => checkEmulator(e.id));
|
||||
const s = settings.get();
|
||||
const beta = !!s.betaFeatures;
|
||||
return knownEmulators
|
||||
.filter(e => (e.id === 'esde' || e.id === 'neostation' || e.id === 'pegasus') ? beta : true)
|
||||
.map((e) => checkEmulator(e.id));
|
||||
}
|
||||
|
||||
export function launchEmulator(emulatorId: string): boolean {
|
||||
@@ -697,6 +917,14 @@ function launchArgs(emulatorId: string, romPath: string): string {
|
||||
return `"${romPath}"`;
|
||||
case 'flycast':
|
||||
return `"${romPath}"`;
|
||||
case 'esde':
|
||||
return '';
|
||||
case 'neostation':
|
||||
return '';
|
||||
case 'emubuddy':
|
||||
return '';
|
||||
case 'pegasus':
|
||||
return '';
|
||||
default:
|
||||
return `"${romPath}"`;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import { settings } from './settings';
|
||||
import { isMacOS } from './platform';
|
||||
import { ensureRomsStructure } from './emulators';
|
||||
import { setupAutoUpdater } from './updater';
|
||||
import { generatePegasusCollectionsForRomDir } from './configurator';
|
||||
|
||||
let mainWindow: BrowserWindow | null = null;
|
||||
let tray: Tray | null = null;
|
||||
@@ -123,6 +124,14 @@ app.whenReady().then(() => {
|
||||
createWindow();
|
||||
createTray();
|
||||
|
||||
// Auto-generate Pegasus collection files if Pegasus is configured
|
||||
try {
|
||||
const s = settings.get();
|
||||
if (s.betaFeatures && s.romsDirectory) {
|
||||
generatePegasusCollectionsForRomDir(s.romsDirectory);
|
||||
}
|
||||
} catch { /* ignore */ }
|
||||
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) createWindow();
|
||||
else mainWindow?.show();
|
||||
|
||||
+54
-9
@@ -26,7 +26,7 @@ function downloadFile(url: string, dest: string, onProgress: (pct: number) => vo
|
||||
const doRequest = (currentUrl: string) => {
|
||||
const protocol = currentUrl.startsWith('https') ? httpsGet : httpGet;
|
||||
const opts: RequestOptions = {
|
||||
headers: { 'User-Agent': 'OmniEmu/0.1.2' },
|
||||
headers: { 'User-Agent': 'OmniEmu/0.1.3' },
|
||||
timeout: 30000,
|
||||
};
|
||||
protocol(currentUrl, opts, (response) => {
|
||||
@@ -85,14 +85,18 @@ function findAppInDir(dir: string): string | undefined {
|
||||
|
||||
for (const e of dirs) {
|
||||
if (e.name.endsWith('.app')) {
|
||||
const macosBin = join(dir, e.name, 'Contents', 'MacOS', basename(e.name, '.app'));
|
||||
if (existsSync(macosBin)) return macosBin;
|
||||
const macosDir = join(dir, e.name, 'Contents', 'MacOS');
|
||||
if (existsSync(macosDir)) {
|
||||
const candidates = readdirSync(macosDir);
|
||||
const bin = candidates.find(b => statSync(join(macosDir, b)).mode & 0o111);
|
||||
if (bin) return join(macosDir, bin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const e of files) {
|
||||
const lowerName = e.name.toLowerCase();
|
||||
const knownNames = ['retroarch', 'dolphin-emu', 'dolphin', 'rpcs3', 'ryujinx', 'eden', 'mame', 'mame64', 'pcsx2', 'duckstation'];
|
||||
const knownNames = ['retroarch', 'dolphin-emu', 'dolphin', 'rpcs3', 'ryujinx', 'eden', 'mame', 'mame64', 'pcsx2', 'duckstation', 'esde'];
|
||||
const isExec = e.name.endsWith('.exe') || e.name.endsWith('.AppImage')
|
||||
|| knownNames.includes(lowerName);
|
||||
if (isExec) return join(dir, e.name);
|
||||
@@ -152,18 +156,56 @@ async function extractArchive(
|
||||
}
|
||||
case 'dmg': {
|
||||
if (!isMacOS()) throw new Error('DMG files can only be extracted on macOS');
|
||||
const mountPoint = `/tmp/omniemu_${emulatorId}_${randomBytes(4).toString('hex')}`;
|
||||
onProgress('Opening DMG (please accept the license in the dialog)...');
|
||||
execSync(`open "${archivePath}"`);
|
||||
let mountPoint = '';
|
||||
for (let i = 0; i < 60; i++) {
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
try {
|
||||
const lines = execSync('ls /Volumes/').toString().split('\n').filter(Boolean);
|
||||
for (const vol of lines) {
|
||||
const volPath = join('/Volumes', vol);
|
||||
if (existsSync(join(volPath, 'ES-DE.app')) || existsSync(join(volPath, '..app'))) {
|
||||
mountPoint = volPath;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!mountPoint) {
|
||||
for (const vol of lines) {
|
||||
const volPath = join('/Volumes', vol);
|
||||
if (statSync(volPath).isDirectory() && vol.toLowerCase().includes('es-de')) {
|
||||
mountPoint = volPath;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!mountPoint) {
|
||||
for (const vol of lines) {
|
||||
if (vol === 'Macintosh HD' || vol.startsWith('Recovery') || vol === 'OpenCode' || vol.startsWith('com.apple')) continue;
|
||||
const volPath = join('/Volumes', vol);
|
||||
try {
|
||||
const entries = readdirSync(volPath);
|
||||
if (entries.some(e => e.endsWith('.app'))) {
|
||||
mountPoint = volPath;
|
||||
break;
|
||||
}
|
||||
} catch { /* skip */ }
|
||||
}
|
||||
}
|
||||
if (mountPoint) break;
|
||||
} catch { /* retry */ }
|
||||
}
|
||||
if (!mountPoint) throw new Error('DMG did not mount within 60 seconds. Please accept the license dialog and try again.');
|
||||
try {
|
||||
execOrThrow(`hdiutil attach "${archivePath}" -mountpoint "${mountPoint}" -nobrowse -quiet`);
|
||||
const result = execSync(`ls "${mountPoint}" 2>/dev/null || true`).toString();
|
||||
for (const item of result.split('\n').filter(Boolean)) {
|
||||
const entries = readdirSync(mountPoint);
|
||||
for (const item of entries) {
|
||||
const src = join(mountPoint, item);
|
||||
if (item.endsWith('.app') || (statSync(src).isDirectory() && !item.startsWith('.'))) {
|
||||
execOrThrow(`cp -R "${src}" "${destDir}/"`);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
execOrThrow(`hdiutil detach "${mountPoint}" -quiet 2>/dev/null; true`);
|
||||
try { execSync(`hdiutil detach "${mountPoint}" -quiet 2>/dev/null`); } catch { /* ignore */ }
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -344,6 +386,9 @@ export function findInstalledBinary(emulatorId: string, installDir: string, exec
|
||||
if (emulatorId === 'retroarch') {
|
||||
appNames.unshift('RetroArch.app');
|
||||
}
|
||||
if (emulatorId === 'esde') {
|
||||
appNames.unshift('ES-DE.app');
|
||||
}
|
||||
|
||||
for (const appName of appNames) {
|
||||
const appDir = join(installDir, appName);
|
||||
|
||||
@@ -33,7 +33,11 @@ export function registerIpcHandlers(): void {
|
||||
// Emulators
|
||||
ipcMain.handle('emulators:list', () => {
|
||||
const plat = getPlatform();
|
||||
const s = settings.get();
|
||||
const beta = !!s.betaFeatures;
|
||||
return knownEmulators.filter(e => {
|
||||
// Gate beta emulators behind beta toggle
|
||||
if ((e.id === 'esde' || e.id === 'neostation' || e.id === 'pegasus') && !beta) return false;
|
||||
const hasDownload = e.downloads?.[plat] && e.downloads[plat]!.length > 0;
|
||||
const hasPackage = !!e.packageNames?.[plat];
|
||||
return hasDownload || hasPackage;
|
||||
@@ -49,6 +53,39 @@ export function registerIpcHandlers(): void {
|
||||
async (event, emulatorId: string) => {
|
||||
const config = findEmulator(emulatorId);
|
||||
if (!config) throw new Error(`Unknown emulator: ${emulatorId}`);
|
||||
|
||||
// ES-DE on macOS: manual install (DMG requires license acceptance in Finder)
|
||||
if (emulatorId === 'esde' && getPlatform() === 'darwin') {
|
||||
const result = await dialog.showMessageBox(BrowserWindow.fromWebContents(event.sender)!, {
|
||||
type: 'info',
|
||||
title: 'Install ES-DE',
|
||||
message: 'ES-DE must be installed manually on macOS',
|
||||
detail: 'OmniEmu will open the ES-DE download page. Please download and install ES-DE, then return to OmniEmu and click Configure.',
|
||||
buttons: ['Open Download Page', 'Cancel'],
|
||||
defaultId: 0,
|
||||
});
|
||||
if (result.response === 0) {
|
||||
shell.openExternal('https://es-de.org/#Download');
|
||||
}
|
||||
return checkEmulator(emulatorId);
|
||||
}
|
||||
|
||||
// NeoStation on macOS: manual install (DMG requires license acceptance in Finder)
|
||||
if (emulatorId === 'neostation' && getPlatform() === 'darwin') {
|
||||
const result = await dialog.showMessageBox(BrowserWindow.fromWebContents(event.sender)!, {
|
||||
type: 'info',
|
||||
title: 'Install NeoStation',
|
||||
message: 'NeoStation must be installed manually on macOS',
|
||||
detail: 'OmniEmu will open the NeoStation download page. Please download and install NeoStation, then return to OmniEmu and click Configure.',
|
||||
buttons: ['Open Download Page', 'Cancel'],
|
||||
defaultId: 0,
|
||||
});
|
||||
if (result.response === 0) {
|
||||
shell.openExternal('https://neostation.dev/downloads/');
|
||||
}
|
||||
return checkEmulator(emulatorId);
|
||||
}
|
||||
|
||||
if (!config.downloads) throw new Error(`No downloads configured for ${emulatorId}`);
|
||||
|
||||
const platform = getPlatform();
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ const raConsoleIds: Record<string, number> = {
|
||||
dreamcast: 27, arcade: 99,
|
||||
};
|
||||
|
||||
const userAgent = 'OmniEmu/0.1.2';
|
||||
const userAgent = 'OmniEmu/0.1.3';
|
||||
|
||||
function fetchText(url: string): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
+3
-3
@@ -120,7 +120,7 @@ export async function findValidThumbnail(title: string, platform: string): Promi
|
||||
|
||||
function fetchText(url: string): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const req = httpsGet(url, { headers: { 'User-Agent': 'OmniEmu/0.1.2' }, timeout: 10000 }, (res) => {
|
||||
const req = httpsGet(url, { headers: { 'User-Agent': 'OmniEmu/0.1.3' }, timeout: 10000 }, (res) => {
|
||||
let data = '';
|
||||
res.on('data', (chunk: string) => data += chunk);
|
||||
res.on('end', () => resolve(data));
|
||||
@@ -134,7 +134,7 @@ function urlExists(url: string): Promise<boolean> {
|
||||
return new Promise((resolve) => {
|
||||
const req = httpsGet(url, {
|
||||
method: 'GET',
|
||||
headers: { 'User-Agent': 'OmniEmu/0.1.2' },
|
||||
headers: { 'User-Agent': 'OmniEmu/0.1.3' },
|
||||
timeout: 10000,
|
||||
}, (res) => {
|
||||
// GitHub raw returns 200 for existing or redirects to it
|
||||
@@ -238,7 +238,7 @@ export function cacheMetadata(romPath: string, metadata: GameMetadata): void {
|
||||
writeMetadataCache(cache);
|
||||
}
|
||||
|
||||
const mobygamesUA = 'Mozilla/5.0 (compatible; OmniEmu/0.1.2; +https://github.com/mileswolfallen2/OmniEmu2.0)';
|
||||
const mobygamesUA = 'Mozilla/5.0 (compatible; OmniEmu/0.1.3; +https://github.com/mileswolfallen2/OmniEmu2.0)';
|
||||
|
||||
function mobyFetch(url: string): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
@@ -36,7 +36,7 @@ export function Sidebar({ currentPage, onNavigate }: SidebarProps) {
|
||||
))}
|
||||
</nav>
|
||||
<div className="sidebar-footer">
|
||||
v0.1.2
|
||||
v0.1.3
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ export function useGamepadNav(onNavigate: (page: Page) => void, currentPage: Pag
|
||||
const lastTime = useRef<Record<string, number>>({});
|
||||
const [connected, setConnected] = useState(false);
|
||||
const [showLegend, setShowLegend] = useState(false);
|
||||
const legendTimer = useRef<ReturnType<typeof setTimeout>>();
|
||||
const legendTimer = useRef<ReturnType<typeof setTimeout>>(undefined);
|
||||
|
||||
const showLegendTemporarily = useCallback(() => {
|
||||
setShowLegend(true);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import type { EmulatorState, SystemInfo, GameEntry } from '../../shared/types';
|
||||
|
||||
export function Dashboard({ onNavigate }: { onNavigate?: (tab: string) => void }) {
|
||||
export function Dashboard({ onNavigate }: { onNavigate?: (tab: 'dashboard' | 'emulators' | 'library' | 'settings' | 'controller' | 'utilities') => void }) {
|
||||
const [emulators, setEmulators] = useState<EmulatorState[]>([]);
|
||||
const [system, setSystem] = useState<SystemInfo | null>(null);
|
||||
const [recent, setRecent] = useState<GameEntry[]>([]);
|
||||
|
||||
@@ -5,6 +5,8 @@ interface ProgressMap {
|
||||
[emulatorId: string]: InstallProgress;
|
||||
}
|
||||
|
||||
const isMacOS = navigator.userAgent.includes('Mac');
|
||||
|
||||
export function EmulatorsPage() {
|
||||
const [states, setStates] = useState<EmulatorState[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -209,20 +211,40 @@ export function EmulatorsPage() {
|
||||
>
|
||||
{!state.installed && state.config.supported && (
|
||||
<>
|
||||
<button
|
||||
className="btn btn-primary btn-sm"
|
||||
disabled={isActioning}
|
||||
onClick={() => handleInstallAndConfigure(state.config.id)}
|
||||
>
|
||||
{isActioning ? 'Working...' : 'Install & Configure'}
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-secondary btn-sm"
|
||||
disabled={isActioning}
|
||||
onClick={() => handleInstall(state.config.id)}
|
||||
>
|
||||
Install Only
|
||||
</button>
|
||||
{state.config.id === 'esde' && isMacOS ? (
|
||||
<button
|
||||
className="btn btn-primary btn-sm"
|
||||
disabled={isActioning}
|
||||
onClick={() => handleInstall(state.config.id)}
|
||||
>
|
||||
{isActioning ? 'Working...' : 'Install Manually'}
|
||||
</button>
|
||||
) : state.config.id === 'neostation' && isMacOS ? (
|
||||
<button
|
||||
className="btn btn-primary btn-sm"
|
||||
disabled={isActioning}
|
||||
onClick={() => handleInstall(state.config.id)}
|
||||
>
|
||||
{isActioning ? 'Working...' : 'Install Manually'}
|
||||
</button>
|
||||
) : (
|
||||
<>
|
||||
<button
|
||||
className="btn btn-primary btn-sm"
|
||||
disabled={isActioning}
|
||||
onClick={() => handleInstallAndConfigure(state.config.id)}
|
||||
>
|
||||
{isActioning ? 'Working...' : 'Install & Configure'}
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-secondary btn-sm"
|
||||
disabled={isActioning}
|
||||
onClick={() => handleInstall(state.config.id)}
|
||||
>
|
||||
Install Only
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
@@ -224,6 +224,27 @@ export function SettingsPage() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="settings-section">
|
||||
<h3>Experimental</h3>
|
||||
|
||||
<div className="setting-row">
|
||||
<div>
|
||||
<div className="setting-label">Enable Beta Features</div>
|
||||
<div className="setting-desc">
|
||||
Unlocks experimental emulators and frontends (ES-DE, NeoStation)
|
||||
</div>
|
||||
</div>
|
||||
<label className="toggle">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={!!settings.betaFeatures}
|
||||
onChange={(e) => update({ betaFeatures: e.target.checked })}
|
||||
/>
|
||||
<span className="toggle-slider" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="settings-section">
|
||||
<h3>Presets</h3>
|
||||
|
||||
@@ -390,7 +411,7 @@ export function SettingsPage() {
|
||||
<div className="settings-section">
|
||||
<h3>About</h3>
|
||||
<p className="text-sm text-muted">
|
||||
OmniEmu v{updateInfo?.version || '0.1.2'} · Cross-platform emulator manager
|
||||
OmniEmu v{updateInfo?.version || '0.1.3'} · Cross-platform emulator manager
|
||||
<br />
|
||||
Built with Electron + React + TypeScript
|
||||
</p>
|
||||
|
||||
@@ -19,13 +19,17 @@ declare global {
|
||||
};
|
||||
emulators: {
|
||||
list: () => Promise<EmulatorConfig[]>;
|
||||
systemAssignments: () => Promise<Record<string, string[]>>;
|
||||
states: () => Promise<EmulatorState[]>;
|
||||
check: (id: string) => Promise<EmulatorState>;
|
||||
install: (id: string) => Promise<EmulatorState>;
|
||||
launch: (id: string) => Promise<boolean>;
|
||||
uninstall: (id: string) => Promise<{ removed: boolean; state: EmulatorState }>;
|
||||
configure: (id: string, installPath: string) => Promise<{ success: boolean; state: EmulatorState }>;
|
||||
presets: (id: string) => Promise<ConfigPreset[]>;
|
||||
configured: (id: string, installPath?: string) => Promise<boolean>;
|
||||
openWebsite: (id: string) => Promise<boolean>;
|
||||
updateControllerConfig: (id: string, installPath: string, controllerName?: string) => Promise<boolean>;
|
||||
onInstallProgress: (cb: (p: InstallProgress) => void) => () => void;
|
||||
};
|
||||
roms: {
|
||||
@@ -34,11 +38,19 @@ declare global {
|
||||
};
|
||||
game: {
|
||||
launch: (emulatorId: string, romPath: string) => Promise<boolean>;
|
||||
recent: () => Promise<GameEntry[]>;
|
||||
clearRecent: () => Promise<boolean>;
|
||||
scrapeArt: (title: string, platform: string) => Promise<string | undefined>;
|
||||
cacheCovers: (entries: { romPath: string; coverUrl: string }[]) => Promise<boolean>;
|
||||
scrapeMetadata: (romPath: string, title: string, platform: string) => Promise<GameMetadata>;
|
||||
achievements: (romPath: string, title: string, platform: string) => Promise<AchievementInfo | null>;
|
||||
};
|
||||
bios: {
|
||||
listKnown: () => Promise<any[]>;
|
||||
scan: (directory?: string) => Promise<any[]>;
|
||||
selectDirectory: () => Promise<string | null>;
|
||||
configureRetroArch: (configDir: string, biosDir: string) => Promise<boolean>;
|
||||
};
|
||||
settings: {
|
||||
get: () => Promise<AppSettings>;
|
||||
save: (s: Partial<AppSettings>) => Promise<AppSettings>;
|
||||
@@ -48,6 +60,19 @@ declare global {
|
||||
romsDirectory: () => Promise<string>;
|
||||
emulatorsDirectory: () => Promise<string>;
|
||||
};
|
||||
utilities: {
|
||||
regenerateRomsStructure: () => Promise<boolean>;
|
||||
};
|
||||
retroachievements: {
|
||||
save: (username: string, password: string) => Promise<Record<string, boolean>>;
|
||||
};
|
||||
updates: {
|
||||
check: () => Promise<boolean>;
|
||||
download: () => Promise<boolean>;
|
||||
quitAndInstall: () => Promise<boolean>;
|
||||
onStatus: (cb: (status: Record<string, unknown>) => void) => () => void;
|
||||
onDownloadProgress: (cb: (progress: Record<string, unknown>) => void) => () => void;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +117,8 @@ export interface AppSettings {
|
||||
retroAchievementsPassword?: string;
|
||||
/** RetroAchievements Web API Key (from retroachievements.org/settings) */
|
||||
retroAchievementsApiKey?: string;
|
||||
/** Enable experimental/beta features (ES-DE, NeoStation, etc.) */
|
||||
betaFeatures?: boolean;
|
||||
}
|
||||
|
||||
export interface RetroAchievement {
|
||||
|
||||
Reference in new issue
Block a user