mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: create game shortcut
This commit is contained in:
parent
6dfd7279dc
commit
086ee8ac04
7 changed files with 52 additions and 1 deletions
1
src/renderer/src/declaration.d.ts
vendored
1
src/renderer/src/declaration.d.ts
vendored
|
@ -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>;
|
||||
|
|
|
@ -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>
|
||||
</>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue