Skip to content

Commit

Permalink
feat: adding repacker friendly name
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrannychaseroperation committed Apr 20, 2024
1 parent 7878963 commit 1395cd4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 d’accueil",
"follow_us": "Suivez-nous"
},
"header": {
Expand Down
2 changes: 1 addition & 1 deletion src/main/entity/user-preferences.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class UserPreferences {
@Column("boolean", { default: false })
repackUpdatesNotificationsEnabled: boolean;

@Column("boolean", { default: false })
@Column("boolean", { default: true })
telemetryEnabled: boolean;

@CreateDateColumn()
Expand Down
11 changes: 8 additions & 3 deletions src/renderer/pages/game-details/hero-panel-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface HeroPanelActionsProps {
isGamePlaying: boolean;
isGameDownloading: boolean;
openRepacksModal: () => void;
openBinaryNotFoundModal: () => void;
getGame: () => void;
}

Expand All @@ -21,6 +22,7 @@ export function HeroPanelActions({
isGamePlaying,
isGameDownloading,
openRepacksModal,
openBinaryNotFoundModal,
getGame,
}: HeroPanelActionsProps) {
const [toggleLibraryGameDisabled, setToggleLibraryGameDisabled] =
Expand All @@ -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 }) => {
Expand Down Expand Up @@ -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();
});
};
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/pages/game-details/hero-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}>
Expand All @@ -184,6 +185,7 @@ export function HeroPanel({
gameDetails={gameDetails}
getGame={getGame}
openRepacksModal={openRepacksModal}
openBinaryNotFoundModal={() => setShowBinaryNotFoundModal(true)}
isGamePlaying={isGamePlaying}
isGameDownloading={isGameDownloading}
/>
Expand Down
7 changes: 6 additions & 1 deletion src/renderer/pages/game-details/repacks-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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(() => {
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 1395cd4

Please sign in to comment.