feat: create game shortcut

This commit is contained in:
Zamitto 2024-06-05 16:42:45 -03:00
parent 6dfd7279dc
commit 086ee8ac04
7 changed files with 52 additions and 1 deletions

View file

@ -59,6 +59,7 @@ declare global {
shop: GameShop,
executablePath: string | null
) => Promise<void>;
createGameShortcut: (id: number) => Promise<boolean>;
updateExecutablePath: (id: number, executablePath: string) => Promise<void>;
getLibrary: () => Promise<LibraryGame[]>;
openGameInstaller: (gameId: number) => Promise<boolean>;

View file

@ -50,6 +50,10 @@ export function GameOptionsModal({
}
};
const handleCreateShortcut = async () => {
await window.electron.createGameShortcut(game.id);
};
const handleDeleteGame = async () => {
await removeGameInstaller(game.id);
};
@ -160,6 +164,15 @@ export function GameOptionsModal({
{t("open_download_options")}
</Button>
</div>
<div className={styles.downloadSourceField}>
<Button
onClick={handleCreateShortcut}
theme="outline"
disabled={deleting}
>
{"criar atalho na area de trabalho"}
</Button>
</div>
</div>
</Modal>
</>