Skip to content

Commit

Permalink
chore/add-context-menu: remove debug code & make other adjusts
Browse files Browse the repository at this point in the history
  • Loading branch information
guibzo committed May 9, 2024
1 parent e043178 commit 542307e
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 29 deletions.
6 changes: 4 additions & 2 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"github": "Contribute on GitHub",
"delete_installation_files": "Remove installation files",
"change_exe_path": "Change executable path",
"open_archive_path": "Open file location"
"open_archive_path": "Open file location",
"game_executable": "Game executable"
},
"header": {
"search": "Search",
Expand Down Expand Up @@ -99,7 +100,8 @@
"dont_show_it_again": "Don't show it again",
"copy_to_clipboard": "Copy",
"copied_to_clipboard": "Copied",
"got_it": "Got it"
"got_it": "Got it",
"game_executable": "Game executable"
},
"activation": {
"title": "Activate Hydra",
Expand Down
6 changes: 4 additions & 2 deletions src/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"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"
"open_archive_path": "Abrir ubicación del archivo",
"game_executable": "\nEjecutable del juego"
},
"header": {
"search": "Buscar",
Expand Down Expand Up @@ -93,7 +94,8 @@
"dodi_installation_instruction": "Cuando abras el instalador de DODI, presiona la tecla hacia arriba del teclado <0 /> para iniciar el proceso de instalación:",
"dont_show_it_again": "No mostrar de nuevo",
"copy_to_clipboard": "Copiar",
"copied_to_clipboard": "Copiado"
"copied_to_clipboard": "Copiado",
"game_executable": "Ejecutable del juego"
},
"activation": {
"title": "Activar Hydra",
Expand Down
6 changes: 4 additions & 2 deletions src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"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"
"open_archive_path": "Ouvrir l'emplacement du fichier",
"game_executable": "Exécutable du jeu"
},
"header": {
"search": "Recherche",
Expand Down Expand Up @@ -78,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
6 changes: 4 additions & 2 deletions src/locales/hu/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"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"
"open_archive_path": "Fájl helyének megnyitása",
"game_executable": "A játék futtatható"
},
"header": {
"search": "Keresés",
Expand Down Expand Up @@ -87,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
6 changes: 4 additions & 2 deletions src/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"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"
"open_archive_path": "Apri posizione del file",
"game_executable": "Eseguibile del gioco"
},
"header": {
"search": "Cerca",
Expand Down Expand Up @@ -99,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
6 changes: 4 additions & 2 deletions src/locales/pl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"home": "Główna",
"delete_installation_files": "Usuń pliki instalacyjne",
"change_exe_path": "Zmień ścieżkę wykonywalną",
"open_archive_path": "Otwórz lokalizację pliku"
"open_archive_path": "Otwórz lokalizację pliku",
"game_executable": "Plik wykonywalny gry"
},
"header": {
"search": "Szukaj",
Expand Down Expand Up @@ -86,7 +87,8 @@
"downloads_path": "Ścieżka pobierania",
"select_folder_hint": "Aby zmienić domyślny folder, przejdź do",
"settings": "Ustawienia Hydra",
"download_now": "Pobierz teraz"
"download_now": "Pobierz teraz",
"game_executable": "Plik wykonywalny gry"
},
"activation": {
"title": "Aktywuj Hydra",
Expand Down
6 changes: 4 additions & 2 deletions src/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"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"
"open_archive_path": "Abrir local do arquivo",
"game_executable": "Executável do jogo"
},
"header": {
"search": "Buscar",
Expand Down Expand Up @@ -95,7 +96,8 @@
"dont_show_it_again": "Não mostrar novamente",
"copy_to_clipboard": "Copiar",
"copied_to_clipboard": "Copiado",
"got_it": "Entendi"
"got_it": "Entendi",
"game_executable": "Executável do jogo"
},
"activation": {
"title": "Ativação",
Expand Down
6 changes: 4 additions & 2 deletions src/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"home": "Главная",
"discord": "Присоединяйся к Discord",
"x": "Подписывайтесь на X",
"github": "Внести свой вклад в GitHub"
"github": "Внести свой вклад в GitHub",
"game_executable": "Исполняемый файл игры"
},
"header": {
"search": "Поиск",
Expand Down Expand Up @@ -96,7 +97,8 @@
"dont_show_it_again": "Не показывать это снова",
"copy_to_clipboard": "Копировать",
"copied_to_clipboard": "Скопировано",
"got_it": "Понятно"
"got_it": "Понятно",
"game_executable": "Исполняемый файл игры"
},
"activation": {
"title": "Активировать Hydra",
Expand Down
6 changes: 4 additions & 2 deletions src/locales/tr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"github": "GitHub'da bize katkı yap",
"delete_installation_files": "Kurulum dosyalarını kaldır",
"change_exe_path": "Yürütülebilir yolu değiştir",
"open_archive_path": "Dosya konumunu aç"
"open_archive_path": "Dosya konumunu aç",
"game_executable": "Yürütülebilir oyun"
},
"header": {
"search": "Ara",
Expand Down Expand Up @@ -99,7 +100,8 @@
"dont_show_it_again": "Tekrar gösterme",
"copy_to_clipboard": "Kopyala",
"copied_to_clipboard": "Kopyalandı",
"got_it": "Tamam"
"got_it": "Tamam",
"game_executable": "Yürütülebilir oyun"
},
"activation": {
"title": "Hydra'yı aktif et",
Expand Down
14 changes: 7 additions & 7 deletions src/renderer/src/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function Sidebar() {
);

const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
const [axilCoordinates, setAxilCoordinates] = useState({
const [axisCoordinates, setAxisCoordinates] = useState({
x: 0,
y: 0,
});
Expand Down Expand Up @@ -86,7 +86,7 @@ export function Sidebar() {
properties: ["openFile"],
filters: [
{
name: "Game executable",
name: t("game_executable"),
extensions: window.electron.platform === "win32" ? ["exe"] : [],
},
],
Expand Down Expand Up @@ -271,7 +271,7 @@ export function Sidebar() {
theme="dark"
/>

<div className={styles.menu}>
<ul className={styles.menu}>
{filteredLibrary.map((game) => {
return (
<Fragment key={game.id}>
Expand All @@ -286,7 +286,7 @@ export function Sidebar() {
onContextMenu={(e) => {
setIsContextMenuOpen(true);
setCurrentGame(game);
setAxilCoordinates({
setAxisCoordinates({
x: e.pageX,
y: e.pageY,
});
Expand Down Expand Up @@ -316,8 +316,8 @@ export function Sidebar() {
<div
className={styles.contextMenu}
style={{
top: axilCoordinates.y - 15,
left: axilCoordinates.x,
top: axisCoordinates.y - 15,
left: axisCoordinates.x,
}}
>
<menu className={styles.contextMenuList}>
Expand Down Expand Up @@ -376,7 +376,7 @@ export function Sidebar() {
</Fragment>
);
})}
</div>
</ul>

<DeleteModal
visible={showDeleteModal}
Expand Down
1 change: 0 additions & 1 deletion src/renderer/src/hooks/use-download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export function useDownload() {
dispatch(setGameDeleting(gameId));
return window.electron.deleteGameFolder(gameId);
})
.catch(() => {})
.finally(() => {
updateLibrary();
dispatch(removeGameFromDeleting(gameId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function HeroPanelActions({
properties: ["openFile"],
filters: [
{
name: "Game executable",
name: t("game_executable"),
extensions: window.electron.platform === "win32" ? ["exe"] : [],
},
],
Expand Down Expand Up @@ -94,8 +94,6 @@ export function HeroPanelActions({
};

const openGame = async () => {
await updateLibrary();

if (game?.executablePath) {
window.electron.openGame(game.id, game.executablePath);
return;
Expand Down

0 comments on commit 542307e

Please sign in to comment.