Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/add context menu #236

Closed
wants to merge 11 commits into from
10 changes: 8 additions & 2 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
"discord": "Join our Discord",
"telegram": "Join our Telegram",
"x": "Follow on X",
"github": "Contribute on GitHub"
"github": "Contribute on GitHub",
"delete_installation_files": "Remove installation files",
"change_exe_path": "Change executable path",
"open_archive_path": "Open file location",
"game_executable": "Game executable"
},
"header": {
"search": "Search games",
Expand Down Expand Up @@ -96,6 +100,7 @@
"copy_to_clipboard": "Copy",
"copied_to_clipboard": "Copied",
"got_it": "Got it",
"game_executable": "Game executable",
"no_shop_details": "Could not retrieve shop details.",
"download_options": "Download options",
"download_path": "Download path",
Expand Down Expand Up @@ -135,7 +140,8 @@
"delete_modal_description": "This will remove all the installation files from your computer",
"install": "Install",
"real_debrid": "Real Debrid",
"torrent": "Torrent"
"torrent": "Torrent",
"delete_installation_modal_description": "This will remove the folder where your game was downloaded. If you have installed your game on the same place where you downloaded it, it will be deleted."
},
"settings": {
"downloads_path": "Downloads path",
Expand Down
10 changes: 8 additions & 2 deletions src/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
"discord": "Únete a nuestro Discord",
"telegram": "Únete a nuestro Telegram",
"x": "Síguenos en X",
"github": "Contribuye en GitHub"
"github": "Contribuye en GitHub",
"delete_installation_files": "Eliminar archivos de instalación",
"change_exe_path": "Cambiar la ruta del ejecutable",
"open_archive_path": "Abrir ubicación del archivo",
"game_executable": "\nEjecutable del juego"
},
"header": {
"search": "Buscar juegos",
Expand Down Expand Up @@ -95,6 +99,7 @@
"dont_show_it_again": "No mostrar de nuevo",
"copy_to_clipboard": "Copiar",
"copied_to_clipboard": "Copiado",
"game_executable": "Ejecutable del juego",
"got_it": "Entendido",
"no_shop_details": "No se pudieron obtener detalles de la tienda.",
"download_options": "Opciones de descarga",
Expand Down Expand Up @@ -135,7 +140,8 @@
"delete_modal_description": "Esto eliminará todos los archivos de instalación de tu computadora.",
"install": "Instalar",
"real_debrid": "Real Debrid",
"torrent": "Torrent"
"torrent": "Torrent",
"delete_installation_modal_description": "Esto eliminará la carpeta donde se descargó el juego. Si instalaste el juego en la misma ubicación donde lo descargaste, se eliminará."
},
"settings": {
"downloads_path": "Ruta de descarga",
Expand Down
12 changes: 9 additions & 3 deletions src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
"downloading": "{{title}} ({{percentage}} - Téléchargement en cours…)",
"filter": "Filtrer la bibliothèque",
"home": "Page d’accueil",
"follow_us": "Suivez-nous"
"follow_us": "Suivez-nous",
"delete_installation_files": "Supprimer les fichiers d'installation",
"change_exe_path": "Modifier le chemin de l'exécutable",
"open_archive_path": "Ouvrir l'emplacement du fichier",
"game_executable": "Exécutable du jeu"
},
"header": {
"search": "Recherche",
Expand Down Expand Up @@ -75,7 +79,8 @@
"close": "Fermer",
"deleting": "Suppression du programme d'installation…",
"playing_now": "Jeu en cours",
"last_time_played": "Dernièrement joué {{période}}"
"last_time_played": "Dernièrement joué {{période}}",
"game_executable": "Exécutable du jeu"
},
"activation": {
"title": "Activer Hydra",
Expand Down Expand Up @@ -106,7 +111,8 @@
"delete_modal_description": "Cela supprimera tous les fichiers d'installation de votre ordinateur",
"delete_modal_title": "Es-tu sûr?",
"deleting": "Suppression du programme d'installation…",
"install": "Installer"
"install": "Installer",
"delete_installation_modal_description": "Cela supprimera le dossier dans lequel votre jeu a été téléchargé. Si vous avez installé le jeu au même endroit où vous l'avez téléchargé, il sera supprimé."
},
"settings": {
"downloads_path": "Chemin des téléchargements",
Expand Down
12 changes: 9 additions & 3 deletions src/locales/hu/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
"downloading": "{{title}} ({{percentage}} - Letöltés…)",
"filter": "Könyvtár szűrése",
"follow_us": "Kövess minket",
"home": "Főoldal"
"home": "Főoldal",
"delete_installation_files": "Telepítési fájlok eltávolítása",
"change_exe_path": "Végrehajtható útvonalának módosítása",
"open_archive_path": "Fájl helyének megnyitása",
"game_executable": "A játék futtatható"
},
"header": {
"search": "Keresés",
Expand Down Expand Up @@ -84,7 +88,8 @@
"repacks_modal_description": "Choose the repack you want to download",
"downloads_path": "Letöltések helye",
"select_folder_hint": "Ahhoz, hogy megváltoztasd a helyet, hozzákell férned a",
"download_now": "Töltsd le most"
"download_now": "Töltsd le most",
"game_executable": "A játék futtatható"
},
"activation": {
"title": "Hydra Aktiválása",
Expand Down Expand Up @@ -115,7 +120,8 @@
"remove_from_list": "Eltávolítás",
"delete_modal_title": "Biztos vagy benne?",
"delete_modal_description": "Ez eltávolít minden telepítési fájlt a számítógépedről",
"install": "Telepítés"
"install": "Telepítés",
"delete_installation_modal_description": "Ezzel eltávolítja azt a mappát, ahová a játékot letöltötte. Ha a játékot ugyanarra a helyre telepítette, ahol letöltötte, akkor az törlődik."
},
"settings": {
"downloads_path": "Letöltések helye",
Expand Down
12 changes: 9 additions & 3 deletions src/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
"discord": "Unisciti al nostro Discord",
"telegram": "Unisciti al nostro Telegram",
"x": "Segui su X",
"github": "Contribuisci su GitHub"
"github": "Contribuisci su GitHub",
"delete_installation_files": "Rimuovi file di installazione",
"change_exe_path": "Modifica percorso dell'eseguibile",
"open_archive_path": "Apri posizione del file",
"game_executable": "Eseguibile del gioco"
},
"header": {
"search": "Cerca",
Expand Down Expand Up @@ -96,7 +100,8 @@
"dont_show_it_again": "Non mostrarlo più",
"copy_to_clipboard": "Copia",
"copied_to_clipboard": "Copiato",
"got_it": "Capito"
"got_it": "Capito",
"game_executable": "Eseguibile del gioco"
},
"activation": {
"title": "Attiva Hydra",
Expand Down Expand Up @@ -127,7 +132,8 @@
"remove_from_list": "Rimuovi",
"delete_modal_title": "Sei sicuro?",
"delete_modal_description": "Questo rimuoverà tutti i file di installazione dal tuo computer",
"install": "Installa"
"install": "Installa",
"delete_installation_modal_description": "Ciò rimuoverà la cartella in cui è stato scaricato il gioco. Se hai installato il gioco nella stessa posizione in cui lo hai scaricato, verrà eliminato."
},
"settings": {
"downloads_path": "Percorso dei download",
Expand Down
13 changes: 10 additions & 3 deletions src/locales/pl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"filter": "Filtruj biblioteke",
"follow_us": "Śledź nas",
"home": "Główna",
"delete_installation_files": "Usuń pliki instalacyjne",
"change_exe_path": "Zmień ścieżkę wykonywalną",
"open_archive_path": "Otwórz lokalizację pliku",
"game_executable": "Plik wykonywalny gry",
"discord": "Dołącz nasz Discord",
"telegram": "Dołącz nasz Telegram",
"x": "Śledź na X",
Expand Down Expand Up @@ -87,7 +91,6 @@
"change": "Zmień",
"repacks_modal_description": "Wybierz repack, który chcesz pobrać",
"select_folder_hint": "Aby zmienić domyślny folder, przejdź do",
"download_now": "Pobierz teraz",
"installation_instructions": "Instrukcja instalacji",
"installation_instructions_description": "Do zainstalowania tej gry wymagane są dodatkowe kroki",
"online_fix_instruction": "Gry OnlineFix wymagają hasła do wyodrębnienia. W razie potrzeby użyj następującego hasła:",
Expand All @@ -102,7 +105,10 @@
"previous_screenshot": "Poprzedni zrzut ekranu",
"next_screenshot": "Następny zrzut ekranu",
"screenshot": "Zrzut ekranu {{number}}",
"open_screenshot": "Otwórz zrzut ekranu {{number}}"
"open_screenshot": "Otwórz zrzut ekranu {{number}}",
"settings": "Ustawienia Hydra",
"download_now": "Pobierz teraz",
"game_executable": "Plik wykonywalny gry"
},
"activation": {
"title": "Aktywuj Hydra",
Expand Down Expand Up @@ -135,7 +141,8 @@
"delete_modal_description": "Spowoduje to usunięcie wszystkich plików instalacyjnych z komputera",
"install": "Instaluj",
"real_debrid": "Real Debrid",
"torrent": "Torrent"
"torrent": "Torrent",
"delete_installation_modal_description": "Spowoduje to usunięcie folderu, do którego została pobrana gra. Jeśli zainstalowałeś grę w tym samym miejscu, w którym ją pobrałeś, zostanie ona usunięta."
},
"settings": {
"downloads_path": "Ścieżka pobierania",
Expand Down
8 changes: 7 additions & 1 deletion src/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
"discord": "Entre no nosso Discord",
"telegram": "Entre no nosso Telegram",
"x": "Siga-nos no X",
"github": "Contribua no GitHub"
"github": "Contribua no GitHub",
"delete_installation_files": "Remover arquivos de instalação",
"change_exe_path": "Alterar caminho do executável",
"open_archive_path": "Abrir local do arquivo",
"game_executable": "Executável do jogo"
},
"header": {
"search": "Buscar jogos",
Expand Down Expand Up @@ -92,6 +96,7 @@
"copy_to_clipboard": "Copiar",
"copied_to_clipboard": "Copiado",
"got_it": "Entendi",
"game_executable": "Executável do jogo",
"no_shop_details": "Não foi possível obter os detalhes da loja.",
"download_options": "Opções de download",
"download_path": "Diretório de download",
Expand Down Expand Up @@ -127,6 +132,7 @@
"remove_from_list": "Remover",
"delete": "Remover instalador",
"delete_modal_description": "Isso removerá todos os arquivos de instalação do seu computador",
"delete_installation_modal_description": "Isso removerá a pasta onde seu jogo foi baixado. Caso você tenha instalado o jogo no mesmo local onde o baixou, ele será excluído.",
"delete_modal_title": "Tem certeza?",
"deleting": "Excluindo instalador…",
"install": "Instalar",
Expand Down
7 changes: 5 additions & 2 deletions src/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"discord": "Присоединяйтесь к Discord",
"telegram": "Присоединяйтесь к Telegram",
"x": "Подписывайтесь на X",
"github": "Внести свой вклад на GitHub"
"github": "Внести свой вклад на GitHub",
"game_executable": "Исполняемый файл игры"
},
"header": {
"search": "Поиск",
Expand Down Expand Up @@ -96,6 +97,7 @@
"copy_to_clipboard": "Копировать",
"copied_to_clipboard": "Скопировано",
"got_it": "Понятно",
"game_executable": "Исполняемый файл игры",
"no_shop_details": "Не удалось получить описание",
"download_options": "Вариантов загрузки",
"download_path": "Путь для загрузок",
Expand Down Expand Up @@ -135,7 +137,8 @@
"delete_modal_description": "Это удалит все установщики с вашего компьютера",
"install": "Установить",
"real_debrid": "Real Debrid",
"torrent": "Torrent"
"torrent": "Torrent",
"delete_installation_modal_description": "Это приведет к удалению папки, в которую была загружена ваша игра. Если вы установили игру в то же место, куда ее скачали, она будет удалена."
},
"settings": {
"downloads_path": "Путь загрузок",
Expand Down
2 changes: 1 addition & 1 deletion src/locales/tr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"follow_us": "Bizi takip et",
"home": "Ana menü",
"discord": "Discord'umuza katıl",
"telegram": "Telegram'umuza katıl",
"x": "X'te bizi takip et",
"github": "GitHub'da bize katkı yap"
},
Expand Down Expand Up @@ -88,6 +87,7 @@
"repacks_modal_description": "İndirmek istediğiiniz repacki seçin",
"downloads_path": "İndirme yolu",
"select_folder_hint": "Varsayılan klasörü değiştirmek için ulaşmanız gereken ayar",
"settings": "Ayarlar",
"download_now": "Şimdi",
"installation_instructions": "Kurulum",
"installation_instructions_description": "Bu oyunu kurmak için ek adımlar gerekiyor",
Expand Down
10 changes: 5 additions & 5 deletions src/main/entity/game.entity.ts
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to have changes on this file. Keep as little changes as possible, please

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
OneToOne,
Entity,
JoinColumn,
OneToOne,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from "typeorm";
import { Repack } from "./repack.entity";

import type { GameShop } from "@types";
import { Downloader, GameStatus } from "@shared";
import type { GameShop } from "@types";

@Entity("game")
export class Game {
Expand Down
13 changes: 8 additions & 5 deletions src/main/events/index.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
import { defaultDownloadsPath } from "@main/constants";
import { app, ipcMain } from "electron";

import "./autoupdater/check-for-updates";
import "./autoupdater/continue-to-main-window";
import "./autoupdater/restart-and-install-update";
import "./catalogue/get-catalogue";
import "./catalogue/get-game-shop-details";
import "./catalogue/get-games";
import "./catalogue/get-how-long-to-beat";
import "./catalogue/get-random-game";
import "./catalogue/search-games";
import "./catalogue/search-game-repacks";
import "./catalogue/search-games";
import "./hardware/get-disk-free-space";
import "./library/add-game-to-library";
import "./library/change-executable-path";
import "./library/close-game";
import "./library/delete-game-folder";
import "./library/get-game-by-object-id";
import "./library/get-library";
import "./library/open-game";
import "./library/open-game-folder";
import "./library/open-game-installer";
import "./library/remove-game";
import "./library/remove-game-from-library";
Expand All @@ -24,12 +29,10 @@ import "./torrenting/cancel-game-download";
import "./torrenting/pause-game-download";
import "./torrenting/resume-game-download";
import "./torrenting/start-game-download";

import "./user-preferences/auto-launch";
import "./user-preferences/get-user-preferences";
import "./user-preferences/update-user-preferences";
import "./user-preferences/auto-launch";
import "./autoupdater/check-for-updates";
import "./autoupdater/restart-and-install-update";
import "./autoupdater/continue-to-main-window";

ipcMain.handle("ping", () => "pong");
ipcMain.handle("getVersion", () => app.getVersion());
Expand Down
20 changes: 20 additions & 0 deletions src/main/events/library/change-executable-path.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { gameRepository } from "@main/repository";

import { registerEvent } from "../register-event";

const changeExecutablePath = async (
_event: Electron.IpcMainInvokeEvent,
gameId: number,
newExecutablePath: string
) => {
await gameRepository.update(
{
id: gameId,
},
{
executablePath: newExecutablePath,
}
);
};

registerEvent("changeExecutablePath", changeExecutablePath);
8 changes: 3 additions & 5 deletions src/main/events/library/delete-game-folder.ts
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to have changes on this file. Keep as little changes as possible, please.

Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import path from "node:path";
import fs from "node:fs";
import path from "node:path";

import { GameStatus } from "@shared";
import { gameRepository } from "@main/repository";

import { getDownloadsPath } from "../helpers/get-downloads-path";
import { logger } from "@main/services";
import { getDownloadsPath } from "../helpers/get-downloads-path";
import { registerEvent } from "../register-event";

const deleteGameFolder = async (
_event: Electron.IpcMainInvokeEvent,
gameId: number
): Promise<void> => {
): Promise<void | null> => {
const game = await gameRepository.findOne({
where: {
id: gameId,
status: GameStatus.Cancelled,
isDeleted: false,
},
});
Expand Down
Loading
Loading