diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 63682eee..3b227e5d 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -101,15 +101,23 @@ "open_screenshot": "Open screenshot {{number}}", "download_settings": "Download settings", "downloader": "Downloader", - "select_executable": "Select executable", + "select_executable": "Select", "no_executable_selected": "No executable selected", "open_folder": "Open folder", - "open_download_location": "Abrir local de download", - "create_shortcut": "Create shortcut", + "open_download_location": "See downloaded files", + "create_shortcut": "Create desktop shortcut", "remove_files": "Remove files", "remove_from_library_title": "Are you sure?", "remove_from_library_description": "This will remove {{game}} from your library", - "options": "Options" + "options": "Options", + "executable_section_title": "Executable", + "executable_section_description": "Path of the file that will be executed when \"Play\" is clicked", + "downloads_secion_title": "Downloads", + "downloads_section_description": "Check out updates or other versions of this game", + "danger_zone_section_title": "Danger zone", + "danger_zone_section_description": "Remove this game from your library or the files downloaded by Hydra", + "download_in_progress": "Download in progress", + "download_paused": "Download paused" }, "activation": { "title": "Activate Hydra", diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json index 77121bd5..174abacd 100644 --- a/src/locales/pt/translation.json +++ b/src/locales/pt/translation.json @@ -98,15 +98,23 @@ "open_screenshot": "Ver captura de tela {{number}}", "download_settings": "Ajustes do download", "downloader": "Downloader", - "select_executable": "Selecionar executável", + "select_executable": "Selecionar", "no_executable_selected": "Nenhum executável selecionado", "open_folder": "Abrir pasta", - "open_download_location": "Abrir local de download", - "create_shortcut": "Criar atalho", + "open_download_location": "Ver arquivos baixados", + "create_shortcut": "Criar atalho na área de trabalho", "remove_files": "Remover arquivos", - "remove_from_library_description": "Tem certeza que deseja remover {{game}} da sua biblioteca?", + "options": "Opções", + "remove_from_library_description": "Isso irá remover {{game}} da sua biblioteca", "remove_from_library_title": "Tem certeza?", - "options": "Opções" + "executable_section_title": "Executável", + "executable_section_description": "O caminho do arquivo que será executado ao clicar em \"Jogar\"", + "downloads_secion_title": "Downloads", + "downloads_section_description": "Confira atualizações ou versões diferentes para este mesmo título", + "danger_zone_section_title": "Zona de perigo", + "danger_zone_section_description": "Remova o jogo da sua biblioteca ou os arquivos que foram baixados pelo Hydra", + "download_in_progress": "Download em andamento", + "download_paused": "Download pausado" }, "activation": { "title": "Ativação", diff --git a/src/main/events/library/create-game-shortcut.ts b/src/main/events/library/create-game-shortcut.ts index 7ce37bee..17b7e42c 100644 --- a/src/main/events/library/create-game-shortcut.ts +++ b/src/main/events/library/create-game-shortcut.ts @@ -13,10 +13,13 @@ const createGameShortcut = async ( if (game) { const filePath = game.executablePath; + + const options = { filePath, name: game.title }; + return createDesktopShortcut({ - windows: { filePath }, - linux: { filePath }, - osx: { filePath }, + windows: options, + linux: options, + osx: options, }); } diff --git a/src/main/events/library/remove-game-from-library.ts b/src/main/events/library/remove-game-from-library.ts index 2581a555..29a7a635 100644 --- a/src/main/events/library/remove-game-from-library.ts +++ b/src/main/events/library/remove-game-from-library.ts @@ -5,7 +5,10 @@ const removeGameFromLibrary = async ( _event: Electron.IpcMainInvokeEvent, gameId: number ) => { - gameRepository.update({ id: gameId }, { isDeleted: true }); + gameRepository.update( + { id: gameId }, + { isDeleted: true, executablePath: null } + ); }; registerEvent("removeGameFromLibrary", removeGameFromLibrary); diff --git a/src/renderer/src/components/button/button.css.ts b/src/renderer/src/components/button/button.css.ts index e342b2e9..c730ecfd 100644 --- a/src/renderer/src/components/button/button.css.ts +++ b/src/renderer/src/components/button/button.css.ts @@ -55,4 +55,15 @@ export const button = styleVariants({ color: "#c0c1c7", }, ], + danger: [ + base, + { + border: `solid 1px #a31533`, + backgroundColor: "transparent", + color: "white", + ":hover": { + backgroundColor: "#a31533", + }, + }, + ], }); diff --git a/src/renderer/src/components/hero/hero.tsx b/src/renderer/src/components/hero/hero.tsx index f0d52029..0cfdbea5 100644 --- a/src/renderer/src/components/hero/hero.tsx +++ b/src/renderer/src/components/hero/hero.tsx @@ -54,7 +54,7 @@ export function Hero() { >
diff --git a/src/renderer/src/components/modal/modal.css.ts b/src/renderer/src/components/modal/modal.css.ts
index fcac6f4b..110f16f8 100644
--- a/src/renderer/src/components/modal/modal.css.ts
+++ b/src/renderer/src/components/modal/modal.css.ts
@@ -2,24 +2,25 @@ import { keyframes, style } from "@vanilla-extract/css";
import { recipe } from "@vanilla-extract/recipes";
import { SPACING_UNIT, vars } from "../../theme.css";
-export const fadeIn = keyframes({
- "0%": { opacity: 0 },
+export const scaleFadeIn = keyframes({
+ "0%": { opacity: "0", scale: "0.5" },
"100%": {
- opacity: 1,
+ opacity: "1",
+ scale: "1",
},
});
-export const fadeOut = keyframes({
- "0%": { opacity: 1 },
+export const scaleFadeOut = keyframes({
+ "0%": { opacity: "1", scale: "1" },
"100%": {
- opacity: 0,
+ opacity: "0",
+ scale: "0.5",
},
});
export const modal = recipe({
base: {
- animationName: fadeIn,
- animationDuration: "0.3s",
+ animation: `${scaleFadeIn} 0.2s cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running`,
backgroundColor: vars.color.background,
borderRadius: "4px",
maxWidth: "600px",
@@ -33,8 +34,8 @@ export const modal = recipe({
variants: {
closing: {
true: {
- animationName: fadeOut,
- opacity: 0,
+ animationName: scaleFadeOut,
+ opacity: "0",
},
},
large: {
diff --git a/src/renderer/src/pages/game-details/game-details.context.tsx b/src/renderer/src/pages/game-details/game-details.context.tsx
index 2c3fd61a..e4889275 100644
--- a/src/renderer/src/pages/game-details/game-details.context.tsx
+++ b/src/renderer/src/pages/game-details/game-details.context.tsx
@@ -3,7 +3,7 @@ import { useParams, useSearchParams } from "react-router-dom";
import { setHeaderTitle } from "@renderer/features";
import { getSteamLanguage } from "@renderer/helpers";
-import { useAppDispatch, useDownload } from "@renderer/hooks";
+import { useAppDispatch, useAppSelector, useDownload } from "@renderer/hooks";
import type { Game, GameRepack, GameShop, ShopDetails } from "@types";
@@ -16,6 +16,7 @@ import {
RepacksModal,
} from "./modals";
import { Downloader } from "@shared";
+import { GameOptionsModal } from "./modals/game-options-modal";
export interface GameDetailsContext {
game: Game | null;
@@ -29,6 +30,8 @@ export interface GameDetailsContext {
gameColor: string;
setGameColor: React.Dispatch{t("downloading_metadata")}
; - } else if (game.progress !== 1) { - downloadContent = ( -{t("not_played_yet", { title: game?.title })}
- {downloadContent} + {hasDownload && downloadInProgressInfo} > ); } @@ -89,15 +84,9 @@ export function HeroPanelPlaytime() { if (isGameRunning) { return ( <> - {downloadContent || ( -- {t("play_time", { - amount: formatPlayTime(), - })} -
- )} -{t("playing_now")}
+ + {hasDownload && downloadInProgressInfo} > ); } @@ -110,7 +99,9 @@ export function HeroPanelPlaytime() { })} - {downloadContent || ( + {hasDownload ? ( + downloadInProgressInfo + ) : (
{t("last_time_played", {
period: lastTimePlayed,
diff --git a/src/renderer/src/pages/game-details/hero/hero-panel.css.ts b/src/renderer/src/pages/game-details/hero/hero-panel.css.ts
index 54297b0b..5dfed5d8 100644
--- a/src/renderer/src/pages/game-details/hero/hero-panel.css.ts
+++ b/src/renderer/src/pages/game-details/hero/hero-panel.css.ts
@@ -36,6 +36,7 @@ export const downloadDetailsRow = style({
export const downloadsLink = style({
color: vars.color.body,
+ textDecoration: "underline",
});
export const progressBar = recipe({
diff --git a/src/renderer/src/pages/game-details/modals/game-options-modal.css.ts b/src/renderer/src/pages/game-details/modals/game-options-modal.css.ts
index a6a854df..b8c538f0 100644
--- a/src/renderer/src/pages/game-details/modals/game-options-modal.css.ts
+++ b/src/renderer/src/pages/game-details/modals/game-options-modal.css.ts
@@ -7,6 +7,17 @@ export const optionsContainer = style({
flexDirection: "column",
});
+export const gameOptionHeader = style({
+ display: "flex",
+ flexDirection: "column",
+ gap: `${SPACING_UNIT}px`,
+});
+
+export const gameOptionHeaderDescription = style({
+ fontFamily: "'Fira Sans', sans-serif",
+ fontWeight: "400",
+});
+
export const gameOptionRow = style({
display: "flex",
gap: `${SPACING_UNIT}px`,
diff --git a/src/renderer/src/pages/game-details/modals/game-options-modal.tsx b/src/renderer/src/pages/game-details/modals/game-options-modal.tsx
index 145e262c..b40d93ab 100644
--- a/src/renderer/src/pages/game-details/modals/game-options-modal.tsx
+++ b/src/renderer/src/pages/game-details/modals/game-options-modal.tsx
@@ -4,7 +4,6 @@ import { Button, Modal, TextField } from "@renderer/components";
import type { Game } from "@types";
import * as styles from "./game-options-modal.css";
import { gameDetailsContext } from "../game-details.context";
-import { NoEntryIcon, TrashIcon } from "@primer/octicons-react";
import { DeleteGameModal } from "@renderer/pages/downloads/delete-game-modal";
import { useDownload } from "@renderer/hooks";
import { RemoveGameFromLibraryModal } from "./remove-from-library-modal";
@@ -13,43 +12,50 @@ export interface GameOptionsModalProps {
visible: boolean;
game: Game;
onClose: () => void;
- selectGameExecutable: () => Promise{t("executable_section_title")}
+
+ {t("executable_section_description")}
+
{t("downloads_secion_title")}
+
+ {t("downloads_section_description")}
+
{t("danger_zone_section_title")}
+
+ {t("danger_zone_section_description")}
+
+