Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/locales/bg_BG/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
"notes-updated-at": "Обновена {date}",
"now-playing": "Играна в момента",
"open-game": "Отвори {name}",
"open-in-flashpoint": "Open in Flashpoint",
"paused": "На пауза",
"pdf-toggle-sidebar": "Превключи страничната лента",
"personal": "Лично",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/cs_CZ/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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í",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/de_DE/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/en_GB/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/en_US/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/es_ES/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/fr_FR/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/hu_HU/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/it_IT/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/ja_JP/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
"notes-updated-at": "更新日 {date}",
"now-playing": "プレイ中",
"open-game": "{name}を開く",
"open-in-flashpoint": "Open in Flashpoint",
"paused": "一時停止中",
"pdf-toggle-sidebar": "サイドバーを切り替え",
"personal": "マイステータス",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/ko_KR/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
"notes-updated-at": "업데이트: {date}",
"now-playing": "현재 플레이중",
"open-game": "{name} 열기",
"open-in-flashpoint": "Open in Flashpoint",
"paused": "일시정지됨",
"pdf-toggle-sidebar": "사이드바 전환",
"personal": "개인",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/pl_PL/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/pt_BR/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/ro_RO/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/ru_RU/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
"notes-updated-at": "Обновлено {date}",
"now-playing": "Сейчас играют",
"open-game": "Открыть {name}",
"open-in-flashpoint": "Open in Flashpoint",
"paused": "Пауза",
"pdf-toggle-sidebar": "Переключить боковую панель",
"personal": "Личное",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/tr_TR/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/zh_CN/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
"notes-updated-at": "更新于 {date}",
"now-playing": "正在游玩",
"open-game": "打开 {name}",
"open-in-flashpoint": "Open in Flashpoint",
"paused": "已暂停",
"pdf-toggle-sidebar": "切换侧边栏",
"personal": "私人",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/zh_TW/rom.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
"notes-updated-at": "更新於 {date}",
"now-playing": "正在遊玩",
"open-game": "開啟 {name}",
"open-in-flashpoint": "Open in Flashpoint",
"paused": "已暫停",
"pdf-toggle-sidebar": "切換側邊欄",
"personal": "私人",
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/v2/components/GameActions/GameActionBtn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export type GameAction =
| "download"
| "copy-link"
| "qr"
| "flashpoint"
| "favorite"
| "collection"
| "status"
Expand Down Expand Up @@ -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",
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/v2/components/GameActions/GameActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/v2/components/GameActions/GameActionsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 />

Expand Down
23 changes: 23 additions & 0 deletions frontend/src/v2/composables/useGameActions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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}`;
Comment thread
gantoine marked this conversation as resolved.
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
Expand Down Expand Up @@ -365,6 +386,7 @@ export function useGameActions(
isFavorited,
canManageCollections,
canShareQR,
canOpenInFlashpoint,
canPlay,
canPlayStream,
canRemoveFromContinuePlaying,
Expand All @@ -379,6 +401,7 @@ export function useGameActions(
favorite,
share,
shareQR,
openInFlashpoint,
copyDownloadLink,
manageCollections,
refreshMetadata,
Expand Down
Loading