mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 10:32:57 +01:00
feat: add "Open in Flashpoint" game action
Adds a v2 game action that hands a ROM's flashpoint_id to the OS `flashpoint://` protocol handler so the locally installed Flashpoint launcher starts the title. The action only appears when the ROM has a flashpoint_id. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "Обновена {date}",
|
||||
"now-playing": "Играна в момента",
|
||||
"open-game": "Отвори {name}",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "На пауза",
|
||||
"pdf-toggle-sidebar": "Превключи страничната лента",
|
||||
"personal": "Лично",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "Aktualizováno {date}",
|
||||
"now-playing": "Právě hraje",
|
||||
"open-game": "Otevřít {name}",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "Pozastaveno",
|
||||
"pdf-toggle-sidebar": "Přepnout postranní panel",
|
||||
"personal": "Osobní",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "Aktualisiert {date}",
|
||||
"now-playing": "Derzeit gespielt",
|
||||
"open-game": "{name} öffnen",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "Pausiert",
|
||||
"pdf-toggle-sidebar": "Seitenleiste umschalten",
|
||||
"personal": "Persönlich",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "Updated {date}",
|
||||
"now-playing": "Now playing",
|
||||
"open-game": "Open {name}",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "Paused",
|
||||
"pdf-toggle-sidebar": "Toggle sidebar",
|
||||
"personal": "Personal",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "Updated {date}",
|
||||
"now-playing": "Now playing",
|
||||
"open-game": "Open {name}",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "Paused",
|
||||
"pdf-toggle-sidebar": "Toggle sidebar",
|
||||
"personal": "Personal",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "Actualizada {date}",
|
||||
"now-playing": "Jugando",
|
||||
"open-game": "Abrir {name}",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "Pausado",
|
||||
"pdf-toggle-sidebar": "Mostrar/ocultar barra lateral",
|
||||
"personal": "Personal",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "Mise à jour le {date}",
|
||||
"now-playing": "En train de jouer",
|
||||
"open-game": "Ouvrir {name}",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "En pause",
|
||||
"pdf-toggle-sidebar": "Basculer la barre latérale",
|
||||
"personal": "Personnel",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "Frissítve: {date}",
|
||||
"now-playing": "Most játszott",
|
||||
"open-game": "{name} megnyitása",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "Szüneteltetve",
|
||||
"pdf-toggle-sidebar": "Oldalsáv ki/be",
|
||||
"personal": "Személyes",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "Aggiornata il {date}",
|
||||
"now-playing": "Stai giocando",
|
||||
"open-game": "Apri {name}",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "In pausa",
|
||||
"pdf-toggle-sidebar": "Mostra/nascondi barra laterale",
|
||||
"personal": "Personale",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "更新日 {date}",
|
||||
"now-playing": "プレイ中",
|
||||
"open-game": "{name}を開く",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "一時停止中",
|
||||
"pdf-toggle-sidebar": "サイドバーを切り替え",
|
||||
"personal": "マイステータス",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "업데이트: {date}",
|
||||
"now-playing": "현재 플레이중",
|
||||
"open-game": "{name} 열기",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "일시정지됨",
|
||||
"pdf-toggle-sidebar": "사이드바 전환",
|
||||
"personal": "개인",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "Zaktualizowano {date}",
|
||||
"now-playing": "Aktualnie grane",
|
||||
"open-game": "Otwórz {name}",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "Wstrzymane",
|
||||
"pdf-toggle-sidebar": "Przełącz pasek boczny",
|
||||
"personal": "Osobiste",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "Atualizada {date}",
|
||||
"now-playing": "Jogando agora",
|
||||
"open-game": "Abrir {name}",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "Pausado",
|
||||
"pdf-toggle-sidebar": "Alternar barra lateral",
|
||||
"personal": "Pessoal",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "Actualizată {date}",
|
||||
"now-playing": "În curs de joc",
|
||||
"open-game": "Deschide {name}",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "În pauză",
|
||||
"pdf-toggle-sidebar": "Comută bara laterală",
|
||||
"personal": "Personal",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "Обновлено {date}",
|
||||
"now-playing": "Сейчас играют",
|
||||
"open-game": "Открыть {name}",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "Пауза",
|
||||
"pdf-toggle-sidebar": "Переключить боковую панель",
|
||||
"personal": "Личное",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "{date} tarihinde güncellendi",
|
||||
"now-playing": "Şu an oynanıyor",
|
||||
"open-game": "{name} oyununu aç",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "Duraklatıldı",
|
||||
"pdf-toggle-sidebar": "Kenar çubuğunu aç/kapat",
|
||||
"personal": "Kişisel",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "更新于 {date}",
|
||||
"now-playing": "正在游玩",
|
||||
"open-game": "打开 {name}",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "已暂停",
|
||||
"pdf-toggle-sidebar": "切换侧边栏",
|
||||
"personal": "私人",
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"notes-updated-at": "更新於 {date}",
|
||||
"now-playing": "正在遊玩",
|
||||
"open-game": "開啟 {name}",
|
||||
"open-in-flashpoint": "Open in Flashpoint",
|
||||
"paused": "已暫停",
|
||||
"pdf-toggle-sidebar": "切換側邊欄",
|
||||
"personal": "私人",
|
||||
|
||||
@@ -68,6 +68,7 @@ export type GameAction =
|
||||
| "download"
|
||||
| "copy-link"
|
||||
| "qr"
|
||||
| "flashpoint"
|
||||
| "favorite"
|
||||
| "collection"
|
||||
| "status"
|
||||
@@ -190,6 +191,15 @@ const preset = computed<Preset>(() => {
|
||||
active: false,
|
||||
};
|
||||
}
|
||||
if (props.action === "flashpoint") {
|
||||
return {
|
||||
icon: "mdi-rocket-launch-outline",
|
||||
label: t("rom.open-in-flashpoint"),
|
||||
activeIcon: null,
|
||||
onClick: actions.openInFlashpoint,
|
||||
active: false,
|
||||
};
|
||||
}
|
||||
if (props.action === "favorite") {
|
||||
return {
|
||||
icon: "mdi-heart-outline",
|
||||
|
||||
@@ -85,6 +85,14 @@ useGridNav(rootEl, {
|
||||
:size="btnSize"
|
||||
variant="surface"
|
||||
/>
|
||||
<GameActionBtn
|
||||
v-if="actions.canOpenInFlashpoint.value"
|
||||
:rom="rom"
|
||||
action="flashpoint"
|
||||
:size="btnSize"
|
||||
variant="surface"
|
||||
with-label
|
||||
/>
|
||||
<GameActionBtn
|
||||
:rom="rom"
|
||||
action="favorite"
|
||||
|
||||
@@ -56,6 +56,12 @@ function run(fn: () => void | Promise<void>) {
|
||||
icon="mdi-qrcode"
|
||||
@click="run(actions.shareQR)"
|
||||
/>
|
||||
<RMenuItem
|
||||
v-if="actions.canOpenInFlashpoint.value"
|
||||
:label="t('rom.open-in-flashpoint')"
|
||||
icon="mdi-rocket-launch-outline"
|
||||
@click="run(actions.openInFlashpoint)"
|
||||
/>
|
||||
|
||||
<RDivider />
|
||||
|
||||
|
||||
@@ -188,6 +188,13 @@ export function useGameActions(
|
||||
return rom ? isNintendoDSRom(rom) : false;
|
||||
});
|
||||
|
||||
// The stored `flashpoint_id` is the game's UUID, which the `flashpoint://`
|
||||
// protocol handler resolves to launch the title locally.
|
||||
const canOpenInFlashpoint = computed(() => {
|
||||
const rom = getRom();
|
||||
return Boolean(rom?.flashpoint_id);
|
||||
});
|
||||
|
||||
function play() {
|
||||
const rom = getRom();
|
||||
if (!rom) return;
|
||||
@@ -274,6 +281,20 @@ export function useGameActions(
|
||||
emitter?.emit("showQRCodeDialog", rom);
|
||||
}
|
||||
|
||||
// Hands the game's Flashpoint UUID to the OS `flashpoint://` protocol
|
||||
// handler so the locally installed Flashpoint launcher starts it.
|
||||
// We click a synthesized anchor rather than window.open so no blank
|
||||
// tab is left behind when the handler takes over.
|
||||
function openInFlashpoint() {
|
||||
const rom = getRom();
|
||||
if (!rom?.flashpoint_id) return;
|
||||
const a = document.createElement("a");
|
||||
a.href = `flashpoint://${rom.flashpoint_id}`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
}
|
||||
|
||||
// Copies the API download URL (origin + /api/roms/.../content/...) so
|
||||
// the user can paste it into another device or share it. v1 used this
|
||||
// for handhelds that can ingest a direct download URL. Falls back to a
|
||||
@@ -365,6 +386,7 @@ export function useGameActions(
|
||||
isFavorited,
|
||||
canManageCollections,
|
||||
canShareQR,
|
||||
canOpenInFlashpoint,
|
||||
canPlay,
|
||||
canPlayStream,
|
||||
canRemoveFromContinuePlaying,
|
||||
@@ -379,6 +401,7 @@ export function useGameActions(
|
||||
favorite,
|
||||
share,
|
||||
shareQR,
|
||||
openInFlashpoint,
|
||||
copyDownloadLink,
|
||||
manageCollections,
|
||||
refreshMetadata,
|
||||
|
||||
Reference in New Issue
Block a user