feat: adding repacker friendly name

This commit is contained in:
Hydra 2024-04-20 20:40:16 +01:00
parent 78789632b4
commit 1395cd40a9
No known key found for this signature in database
6 changed files with 19 additions and 7 deletions

View File

@ -25,7 +25,7 @@
"downloads": "Descargas",
"search_results": "Resultados de búsqueda",
"settings": "Ajustes",
"home": "Hogar"
"home": "Início"
},
"bottom_panel": {
"no_downloads_in_progress": "Sin descargas en progreso",

View File

@ -16,7 +16,7 @@
"paused": "{{title}} (En pause)",
"downloading": "{{title}} ({{percentage}} - Téléchargement en cours…)",
"filter": "Filtrer la bibliothèque",
"home": "Maison",
"home": "Page daccueil",
"follow_us": "Suivez-nous"
},
"header": {

View File

@ -23,7 +23,7 @@ export class UserPreferences {
@Column("boolean", { default: false })
repackUpdatesNotificationsEnabled: boolean;
@Column("boolean", { default: false })
@Column("boolean", { default: true })
telemetryEnabled: boolean;
@CreateDateColumn()

View File

@ -12,6 +12,7 @@ export interface HeroPanelActionsProps {
isGamePlaying: boolean;
isGameDownloading: boolean;
openRepacksModal: () => void;
openBinaryNotFoundModal: () => void;
getGame: () => void;
}
@ -21,6 +22,7 @@ export function HeroPanelActions({
isGamePlaying,
isGameDownloading,
openRepacksModal,
openBinaryNotFoundModal,
getGame,
}: HeroPanelActionsProps) {
const [toggleLibraryGameDisabled, setToggleLibraryGameDisabled] =
@ -43,7 +45,10 @@ export function HeroPanelActions({
.showOpenDialog({
properties: ["openFile"],
filters: [
{ name: "Game executable (.exe)", extensions: ["exe", "app"] },
{
name: "Game executable",
extensions: window.electron.platform === "win32" ? ["exe"] : [],
},
],
})
.then(({ filePaths }) => {
@ -78,8 +83,8 @@ export function HeroPanelActions({
};
const openGameInstaller = () => {
window.electron.openGameInstaller(game.id).then(() => {
// if (!isBinaryInPath) setShowBinaryNotFoundModal(true);
window.electron.openGameInstaller(game.id).then((isBinaryInPath) => {
if (!isBinaryInPath) openBinaryNotFoundModal();
updateLibrary();
});
};

View File

@ -176,6 +176,7 @@ export function HeroPanel({
visible={showBinaryNotFoundModal}
onClose={() => setShowBinaryNotFoundModal(false)}
/>
<div style={{ backgroundColor: color }} className={styles.panel}>
<div className={styles.content}>{getInfo()}</div>
<div className={styles.actions}>
@ -184,6 +185,7 @@ export function HeroPanel({
gameDetails={gameDetails}
getGame={getGame}
openRepacksModal={openRepacksModal}
openBinaryNotFoundModal={() => setShowBinaryNotFoundModal(true)}
isGamePlaying={isGamePlaying}
isGameDownloading={isGameDownloading}
/>

View File

@ -10,6 +10,7 @@ import type { DiskSpace } from "check-disk-space";
import { format } from "date-fns";
import { SPACING_UNIT } from "@renderer/theme.css";
import { formatBytes } from "@renderer/utils";
import { useAppSelector } from "@renderer/hooks";
export interface RepacksModalProps {
visible: boolean;
@ -28,6 +29,10 @@ export function RepacksModal({
const [diskFreeSpace, setDiskFreeSpace] = useState<DiskSpace>(null);
const [filteredRepacks, setFilteredRepacks] = useState<GameRepack[]>([]);
const repackersFriendlyNames = useAppSelector(
(state) => state.repackersFriendlyNames.value
);
const { t } = useTranslation("game_details");
useEffect(() => {
@ -85,7 +90,7 @@ export function RepacksModal({
>
<p style={{ color: "#DADBE1" }}>{repack.title}</p>
<p style={{ fontSize: "12px" }}>
{repack.fileSize} - {repack.repacker} -{" "}
{repack.fileSize} - {repackersFriendlyNames[repack.repacker]} -{" "}
{format(repack.uploadDate, "dd/MM/yyyy")}
</p>
</Button>