From e10b04b78b9966fdacd182073716655f4d850fec Mon Sep 17 00:00:00 2001 From: Hydra Date: Sat, 20 Apr 2024 15:54:08 -0300 Subject: [PATCH] feat: add a modal to select game installation folder (pt and en translation) --- forge.config.ts | 6 +- src/locales/en/translation.json | 8 +- src/locales/pt/translation.json | 8 +- .../events/library/add-game-to-library.ts | 2 +- .../events/torrenting/start-game-download.ts | 6 +- src/preload.ts | 13 +- src/renderer/assets/lottie/settings.json | 1055 ++++++++++++++++- src/renderer/declaration.d.ts | 3 +- src/renderer/hooks/use-download.ts | 5 +- .../pages/game-details/game-details.tsx | 8 +- .../pages/game-details/repacks-modal.tsx | 20 +- .../game-details/select-folder-modal.css.tsx | 19 + .../game-details/select-folder-modal.tsx | 103 ++ 13 files changed, 1232 insertions(+), 24 deletions(-) create mode 100644 src/renderer/pages/game-details/select-folder-modal.css.tsx create mode 100644 src/renderer/pages/game-details/select-folder-modal.tsx diff --git a/forge.config.ts b/forge.config.ts index 21718764..94cfac57 100644 --- a/forge.config.ts +++ b/forge.config.ts @@ -20,7 +20,7 @@ const linuxPkgConfig = { icon: "images/icon.png", genericName: "Games Launcher", name: "hydra-launcher", - productName: "Hydra" + productName: "Hydra", }; const config: ForgeConfig = { @@ -50,10 +50,10 @@ const config: ForgeConfig = { }), new MakerZIP({}, ["darwin", "linux"]), new MakerRpm({ - options: linuxPkgConfig + options: linuxPkgConfig, }), new MakerDeb({ - options: linuxPkgConfig + options: linuxPkgConfig, }), ], publishers: [ diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index f59f1e87..a9fcb19d 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -77,7 +77,13 @@ "play": "Play", "deleting": "Deleting installer…", "close": "Close", - "playing_now": "Playing now" + "playing_now": "Playing now", + "change": "Change", + "select_folder_description": "Select the folder where the game will be installed", + "downloads_path": "Downloads path", + "select_folder_hint": "To change the default folder, access the", + "hydra_settings": "Hydra settings", + "download_now": "Download now" }, "activation": { "title": "Activate Hydra", diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json index 145163b4..c2d24840 100644 --- a/src/locales/pt/translation.json +++ b/src/locales/pt/translation.json @@ -73,7 +73,13 @@ "not_played_yet": "Você ainda não jogou {{title}}", "close": "Fechar", "deleting": "Excluindo instalador…", - "playing_now": "Jogando agora" + "playing_now": "Jogando agora", + "change": "Mudar", + "select_folder_description": "Selecione a pasta em que o jogo será baixado", + "downloads_path": "Diretório do download", + "select_folder_hint": "Para trocar a pasta padrão, acesse as ", + "hydra_settings": "Configurações do Hydra", + "download_now": "Baixe agora" }, "activation": { "title": "Ativação", diff --git a/src/main/events/library/add-game-to-library.ts b/src/main/events/library/add-game-to-library.ts index 8680b29a..12e4c8bf 100644 --- a/src/main/events/library/add-game-to-library.ts +++ b/src/main/events/library/add-game-to-library.ts @@ -10,7 +10,7 @@ const addGameToLibrary = async ( _event: Electron.IpcMainInvokeEvent, objectID: string, title: string, - gameShop: GameShop, + gameShop: GameShop ) => { const iconUrl = await getImageBase64(await getSteamGameIconUrl(objectID)); diff --git a/src/main/events/torrenting/start-game-download.ts b/src/main/events/torrenting/start-game-download.ts index 570fd2ec..f661a956 100644 --- a/src/main/events/torrenting/start-game-download.ts +++ b/src/main/events/torrenting/start-game-download.ts @@ -5,7 +5,6 @@ import { GameStatus } from "@main/constants"; import { registerEvent } from "../register-event"; import type { GameShop } from "@types"; -import { getDownloadsPath } from "../helpers/get-downloads-path"; import { getImageBase64 } from "@main/helpers"; import { In } from "typeorm"; @@ -14,7 +13,8 @@ const startGameDownload = async ( repackId: number, objectID: string, title: string, - gameShop: GameShop + gameShop: GameShop, + downloadPath: string ) => { const [game, repack] = await Promise.all([ gameRepository.findOne({ @@ -37,7 +37,7 @@ const startGameDownload = async ( writePipe.write({ action: "pause" }); - const downloadsPath = game?.downloadPath ?? (await getDownloadsPath()); + const downloadsPath = game?.downloadPath ?? downloadPath; await gameRepository.update( { diff --git a/src/preload.ts b/src/preload.ts index 93acde24..7ee37d0b 100644 --- a/src/preload.ts +++ b/src/preload.ts @@ -15,8 +15,17 @@ contextBridge.exposeInMainWorld("electron", { repackId: number, objectID: string, title: string, - shop: GameShop - ) => ipcRenderer.invoke("startGameDownload", repackId, objectID, title, shop), + shop: GameShop, + downloadPath: string + ) => + ipcRenderer.invoke( + "startGameDownload", + repackId, + objectID, + title, + shop, + downloadPath + ), cancelGameDownload: (gameId: number) => ipcRenderer.invoke("cancelGameDownload", gameId), pauseGameDownload: (gameId: number) => diff --git a/src/renderer/assets/lottie/settings.json b/src/renderer/assets/lottie/settings.json index 4d37e53a..92fa645e 100644 --- a/src/renderer/assets/lottie/settings.json +++ b/src/renderer/assets/lottie/settings.json @@ -1 +1,1054 @@ -{"v":"4.8.0","meta":{"g":"LottieFiles AE 3.5.6","a":"","k":"","d":"","tc":""},"fr":60,"ip":0,"op":120,"w":900,"h":900,"nm":"Pre-comp 1","ddd":0,"assets":[{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"estrela Outlines 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.933],"y":[0]},"t":0,"s":[0]},{"t":60,"s":[180]}],"ix":10},"p":{"a":0,"k":[450,450,0],"ix":2},"a":{"a":0,"k":[308.5,333,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.011,34.469],[34.47,-0.012],[-0.011,-34.469],[-34.47,0.011]],"o":[[-0.012,-34.47],[-34.469,0.011],[0.012,34.47],[34.469,-0.012]],"v":[[62.333,0.005],[-0.101,-62.387],[-62.493,0.047],[-0.059,62.439]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,-68.917],[68.916,0],[0,68.916],[-68.916,0]],"o":[[0,68.916],[-68.916,0],[0,-68.917],[68.916,0]],"v":[[124.725,0.005],[-0.059,124.789],[-124.843,0.005],[-0.059,-124.779]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[15.804,-1.372],[1.206,-4.575],[0,0],[18.676,-9.234],[6.656,-4.451],[23.252,6.364],[0,0],[0.832,-1.206],[6.697,-14.392],[-3.327,-3.328],[0,0],[1.331,-20.755],[-0.499,-8.062],[17.095,-16.887],[0,0],[-0.582,-1.289],[-9.151,-12.977],[-4.575,1.248],[0,0],[-17.345,-11.563],[-7.196,-3.578],[-6.114,-23.293],[0,0],[-1.497,-0.124],[-15.804,1.373],[-1.207,4.575],[0,0],[-18.676,9.234],[-6.655,4.451],[-23.251,-6.364],[0,0],[-0.832,1.206],[-6.739,14.392],[3.327,3.328],[0,0],[-1.331,20.755],[0.499,8.061],[-17.095,16.887],[0,0],[0.582,1.289],[9.144,12.981],[4.576,-1.248],[0,0],[17.345,11.563],[7.202,3.563],[6.114,23.293],[0,0],[1.498,0.125]],"o":[[-1.497,0.125],[0,0],[-6.114,23.334],[-7.196,3.578],[-17.345,11.563],[0,0],[-4.534,-1.248],[-9.151,12.978],[-0.582,1.289],[0,0],[17.095,16.887],[-0.5,8.062],[1.331,20.755],[0,0],[-3.369,3.328],[6.738,14.392],[0.832,1.248],[0,0],[23.293,-6.364],[6.697,4.451],[18.593,9.234],[0,0],[1.206,4.533],[15.804,1.373],[1.498,-0.124],[0,0],[6.114,-23.335],[7.196,-3.578],[17.345,-11.563],[0,0],[4.534,1.206],[9.151,-13.019],[0.582,-1.289],[0,0],[-17.095,-16.887],[0.499,-8.062],[-1.331,-20.756],[0,0],[3.369,-3.328],[-6.715,-14.39],[-0.832,-1.248],[0,0],[-23.293,6.364],[-6.676,-4.47],[-18.592,-9.234],[0,0],[-1.207,-4.575],[-15.804,-1.372]],"v":[[-23.81,-269.32],[-29.508,-263.247],[-41.529,-217.285],[-83.04,-167.829],[-103.838,-155.766],[-167.436,-144.536],[-213.314,-157.139],[-221.425,-155.267],[-245.259,-114.089],[-242.805,-106.185],[-208.905,-72.66],[-186.86,-12.099],[-186.86,12.109],[-208.905,72.671],[-242.805,106.195],[-245.259,114.099],[-221.425,155.236],[-213.314,157.15],[-167.477,144.547],[-103.838,155.777],[-82.999,167.839],[-41.529,217.295],[-29.508,263.257],[-23.81,269.329],[23.691,269.329],[29.39,263.257],[41.411,217.295],[82.922,167.839],[103.719,155.777],[167.317,144.547],[213.196,157.15],[221.307,155.277],[245.141,114.099],[242.687,106.195],[208.787,72.671],[186.742,12.109],[186.742,-12.098],[208.787,-72.66],[242.687,-106.185],[245.141,-114.089],[221.307,-155.225],[213.196,-157.139],[167.359,-144.536],[103.719,-155.766],[82.88,-167.828],[41.411,-217.285],[29.39,-263.247],[23.691,-269.32]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ind":3,"ty":"sh","ix":4,"ks":{"a":0,"k":{"i":[[-9.816,0],[-9.697,-0.846],[-7.071,-26.828],[0,0],[-5.532,-2.745],[-8.902,-5.948],[-2.745,0.79],[0,0],[-17.802,-25.331],[-8.236,-17.72],[19.758,-19.508],[0,0],[-0.416,-6.114],[0.666,-10.69],[-2.079,-1.997],[0,0],[13.102,-28.076],[11.232,-15.979],[26.787,7.363],[0,0],[5.117,-3.411],[9.602,-4.741],[0.707,-2.745],[0,0],[30.904,-2.663],[19.401,1.705],[7.03,26.87],[0,0],[5.532,2.745],[8.891,5.969],[2.746,-0.79],[0,0],[17.802,25.332],[8.277,17.703],[-19.716,19.508],[0,0],[0.416,6.114],[-0.666,10.693],[2.08,1.997],[0,0],[-13.102,28.076],[-11.242,15.972],[-26.787,-7.363],[0,0],[-5.116,3.411],[-9.608,4.742],[-0.707,2.745],[0,0],[-30.905,2.704]],"o":[[9.733,0.014],[30.904,2.662],[0,0],[0.749,2.745],[9.609,4.742],[5.116,3.411],[0,0],[26.787,-7.321],[11.231,16.014],[13.102,28.076],[0,0],[-2.038,1.997],[0.666,10.69],[-0.416,6.114],[0,0],[19.758,19.508],[-8.252,17.703],[-17.802,25.373],[0,0],[-2.787,-0.79],[-8.902,5.952],[-5.532,2.745],[0,0],[-6.987,26.87],[-19.402,1.705],[-30.905,-2.663],[0,0],[-0.748,-2.745],[-9.611,-4.723],[-5.116,-3.411],[0,0],[-26.786,7.321],[-11.208,-16.008],[-13.102,-28.076],[0,0],[2.08,-1.997],[-0.666,-10.693],[0.416,-6.114],[0,0],[-19.716,-19.508],[8.241,-17.709],[17.802,-25.373],[0,0],[2.787,0.79],[8.901,-5.948],[5.532,-2.745],[0,0],[6.988,-26.87],[9.608,-0.832]],"v":[[-0.059,-332.751],[29.099,-331.462],[89.785,-279.095],[101.764,-233.049],[110.582,-223.733],[138.368,-207.676],[150.804,-204.723],[196.683,-217.327],[272.385,-191.123],[301.668,-140.459],[286.527,-61.805],[252.669,-28.28],[249.009,-16.051],[249.009,16.061],[252.669,28.289],[286.527,61.815],[301.668,140.47],[272.385,191.09],[196.683,217.295],[150.846,204.734],[138.367,207.687],[110.582,223.743],[101.806,233.059],[89.743,279.063],[29.099,331.473],[-29.217,331.473],[-89.862,279.063],[-101.883,233.059],[-110.701,223.743],[-138.486,207.687],[-150.923,204.734],[-196.802,217.336],[-272.504,191.132],[-301.786,140.47],[-286.687,61.815],[-252.788,28.289],[-249.127,16.061],[-249.127,-16.051],[-252.788,-28.28],[-286.687,-61.805],[-301.786,-140.459],[-272.504,-191.08],[-196.801,-217.285],[-150.964,-204.723],[-138.486,-207.676],[-110.701,-223.733],[-101.924,-233.049],[-89.862,-279.053],[-29.217,-331.504]],"c":true},"ix":2},"nm":"Path 4","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.898460657456,0.889815326765,0.896223060758,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[308.077,333.249],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":8,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":120,"st":0,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"estrela Outlines 2 Comp 1","refId":"comp_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[450,450,0],"ix":2},"a":{"a":0,"k":[450,450,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[1,1,0.333],"y":[0,0,0]},"t":0,"s":[100,100,100]},{"i":{"x":[0,0,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":30,"s":[80,80,100]},{"t":60,"s":[100,100,100]}],"ix":6}},"ao":0,"hasMask":true,"masksProperties":[{"inv":false,"mode":"a","pt":{"a":0,"k":{"i":[[89.47,0],[0,-89.47],[-89.47,0],[0,89.47]],"o":[[-89.47,0],[0,89.47],[89.47,0],[0,-89.47]],"v":[[446,286],[284,448],[446,610],[608,448]],"c":true},"ix":1},"o":{"a":0,"k":100,"ix":3},"x":{"a":0,"k":0,"ix":4},"nm":"Mask 1"}],"w":900,"h":900,"ip":0,"op":120,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"estrela Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.84],"y":[-1.753]},"o":{"x":[0],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.361],"y":[1]},"o":{"x":[0],"y":[0]},"t":28,"s":[15]},{"t":60,"s":[180]}],"ix":10},"p":{"a":0,"k":[450,450,0],"ix":2},"a":{"a":0,"k":[308.5,333,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.011,34.469],[34.47,-0.012],[-0.011,-34.469],[-34.47,0.011]],"o":[[-0.012,-34.47],[-34.469,0.011],[0.012,34.47],[34.469,-0.012]],"v":[[62.333,0.005],[-0.101,-62.387],[-62.493,0.047],[-0.059,62.439]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,-68.917],[68.916,0],[0,68.916],[-68.916,0]],"o":[[0,68.916],[-68.916,0],[0,-68.917],[68.916,0]],"v":[[124.725,0.005],[-0.059,124.789],[-124.843,0.005],[-0.059,-124.779]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[15.804,-1.372],[1.206,-4.575],[0,0],[18.676,-9.234],[6.656,-4.451],[23.252,6.364],[0,0],[0.832,-1.206],[6.697,-14.392],[-3.327,-3.328],[0,0],[1.331,-20.755],[-0.499,-8.062],[17.095,-16.887],[0,0],[-0.582,-1.289],[-9.151,-12.977],[-4.575,1.248],[0,0],[-17.345,-11.563],[-7.196,-3.578],[-6.114,-23.293],[0,0],[-1.497,-0.124],[-15.804,1.373],[-1.207,4.575],[0,0],[-18.676,9.234],[-6.655,4.451],[-23.251,-6.364],[0,0],[-0.832,1.206],[-6.739,14.392],[3.327,3.328],[0,0],[-1.331,20.755],[0.499,8.061],[-17.095,16.887],[0,0],[0.582,1.289],[9.144,12.981],[4.576,-1.248],[0,0],[17.345,11.563],[7.202,3.563],[6.114,23.293],[0,0],[1.498,0.125]],"o":[[-1.497,0.125],[0,0],[-6.114,23.334],[-7.196,3.578],[-17.345,11.563],[0,0],[-4.534,-1.248],[-9.151,12.978],[-0.582,1.289],[0,0],[17.095,16.887],[-0.5,8.062],[1.331,20.755],[0,0],[-3.369,3.328],[6.738,14.392],[0.832,1.248],[0,0],[23.293,-6.364],[6.697,4.451],[18.593,9.234],[0,0],[1.206,4.533],[15.804,1.373],[1.498,-0.124],[0,0],[6.114,-23.335],[7.196,-3.578],[17.345,-11.563],[0,0],[4.534,1.206],[9.151,-13.019],[0.582,-1.289],[0,0],[-17.095,-16.887],[0.499,-8.062],[-1.331,-20.756],[0,0],[3.369,-3.328],[-6.715,-14.39],[-0.832,-1.248],[0,0],[-23.293,6.364],[-6.676,-4.47],[-18.592,-9.234],[0,0],[-1.207,-4.575],[-15.804,-1.372]],"v":[[-23.81,-269.32],[-29.508,-263.247],[-41.529,-217.285],[-83.04,-167.829],[-103.838,-155.766],[-167.436,-144.536],[-213.314,-157.139],[-221.425,-155.267],[-245.259,-114.089],[-242.805,-106.185],[-208.905,-72.66],[-186.86,-12.099],[-186.86,12.109],[-208.905,72.671],[-242.805,106.195],[-245.259,114.099],[-221.425,155.236],[-213.314,157.15],[-167.477,144.547],[-103.838,155.777],[-82.999,167.839],[-41.529,217.295],[-29.508,263.257],[-23.81,269.329],[23.691,269.329],[29.39,263.257],[41.411,217.295],[82.922,167.839],[103.719,155.777],[167.317,144.547],[213.196,157.15],[221.307,155.277],[245.141,114.099],[242.687,106.195],[208.787,72.671],[186.742,12.109],[186.742,-12.098],[208.787,-72.66],[242.687,-106.185],[245.141,-114.089],[221.307,-155.225],[213.196,-157.139],[167.359,-144.536],[103.719,-155.766],[82.88,-167.828],[41.411,-217.285],[29.39,-263.247],[23.691,-269.32]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ind":3,"ty":"sh","ix":4,"ks":{"a":0,"k":{"i":[[-9.816,0],[-9.697,-0.846],[-7.071,-26.828],[0,0],[-5.532,-2.745],[-8.902,-5.948],[-2.745,0.79],[0,0],[-17.802,-25.331],[-8.236,-17.72],[19.758,-19.508],[0,0],[-0.416,-6.114],[0.666,-10.69],[-2.079,-1.997],[0,0],[13.102,-28.076],[11.232,-15.979],[26.787,7.363],[0,0],[5.117,-3.411],[9.602,-4.741],[0.707,-2.745],[0,0],[30.904,-2.663],[19.401,1.705],[7.03,26.87],[0,0],[5.532,2.745],[8.891,5.969],[2.746,-0.79],[0,0],[17.802,25.332],[8.277,17.703],[-19.716,19.508],[0,0],[0.416,6.114],[-0.666,10.693],[2.08,1.997],[0,0],[-13.102,28.076],[-11.242,15.972],[-26.787,-7.363],[0,0],[-5.116,3.411],[-9.608,4.742],[-0.707,2.745],[0,0],[-30.905,2.704]],"o":[[9.733,0.014],[30.904,2.662],[0,0],[0.749,2.745],[9.609,4.742],[5.116,3.411],[0,0],[26.787,-7.321],[11.231,16.014],[13.102,28.076],[0,0],[-2.038,1.997],[0.666,10.69],[-0.416,6.114],[0,0],[19.758,19.508],[-8.252,17.703],[-17.802,25.373],[0,0],[-2.787,-0.79],[-8.902,5.952],[-5.532,2.745],[0,0],[-6.987,26.87],[-19.402,1.705],[-30.905,-2.663],[0,0],[-0.748,-2.745],[-9.611,-4.723],[-5.116,-3.411],[0,0],[-26.786,7.321],[-11.208,-16.008],[-13.102,-28.076],[0,0],[2.08,-1.997],[-0.666,-10.693],[0.416,-6.114],[0,0],[-19.716,-19.508],[8.241,-17.709],[17.802,-25.373],[0,0],[2.787,0.79],[8.901,-5.948],[5.532,-2.745],[0,0],[6.988,-26.87],[9.608,-0.832]],"v":[[-0.059,-332.751],[29.099,-331.462],[89.785,-279.095],[101.764,-233.049],[110.582,-223.733],[138.368,-207.676],[150.804,-204.723],[196.683,-217.327],[272.385,-191.123],[301.668,-140.459],[286.527,-61.805],[252.669,-28.28],[249.009,-16.051],[249.009,16.061],[252.669,28.289],[286.527,61.815],[301.668,140.47],[272.385,191.09],[196.683,217.295],[150.846,204.734],[138.367,207.687],[110.582,223.743],[101.806,233.059],[89.743,279.063],[29.099,331.473],[-29.217,331.473],[-89.862,279.063],[-101.883,233.059],[-110.701,223.743],[-138.486,207.687],[-150.923,204.734],[-196.802,217.336],[-272.504,191.132],[-301.786,140.47],[-286.687,61.815],[-252.788,28.289],[-249.127,16.061],[-249.127,-16.051],[-252.788,-28.28],[-286.687,-61.805],[-301.786,-140.459],[-272.504,-191.08],[-196.801,-217.285],[-150.964,-204.723],[-138.486,-207.676],[-110.701,-223.733],[-101.924,-233.049],[-89.862,-279.053],[-29.217,-331.504]],"c":true},"ix":2},"nm":"Path 4","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.898460657456,0.889815326765,0.896223060758,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[308.077,333.249],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":8,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":120,"st":0,"bm":0}],"markers":[]} \ No newline at end of file +{ + "v": "4.8.0", + "meta": { "g": "LottieFiles AE 3.5.6", "a": "", "k": "", "d": "", "tc": "" }, + "fr": 60, + "ip": 0, + "op": 120, + "w": 900, + "h": 900, + "nm": "Pre-comp 1", + "ddd": 0, + "assets": [ + { + "id": "comp_0", + "layers": [ + { + "ddd": 0, + "ind": 1, + "ty": 4, + "nm": "estrela Outlines 2", + "sr": 1, + "ks": { + "o": { "a": 0, "k": 100, "ix": 11 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.933], "y": [0] }, + "t": 0, + "s": [0] + }, + { "t": 60, "s": [180] } + ], + "ix": 10 + }, + "p": { "a": 0, "k": [450, 450, 0], "ix": 2 }, + "a": { "a": 0, "k": [308.5, 333, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0.011, 34.469], + [34.47, -0.012], + [-0.011, -34.469], + [-34.47, 0.011] + ], + "o": [ + [-0.012, -34.47], + [-34.469, 0.011], + [0.012, 34.47], + [34.469, -0.012] + ], + "v": [ + [62.333, 0.005], + [-0.101, -62.387], + [-62.493, 0.047], + [-0.059, 62.439] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ind": 1, + "ty": "sh", + "ix": 2, + "ks": { + "a": 0, + "k": { + "i": [ + [0, -68.917], + [68.916, 0], + [0, 68.916], + [-68.916, 0] + ], + "o": [ + [0, 68.916], + [-68.916, 0], + [0, -68.917], + [68.916, 0] + ], + "v": [ + [124.725, 0.005], + [-0.059, 124.789], + [-124.843, 0.005], + [-0.059, -124.779] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 2", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ind": 2, + "ty": "sh", + "ix": 3, + "ks": { + "a": 0, + "k": { + "i": [ + [15.804, -1.372], + [1.206, -4.575], + [0, 0], + [18.676, -9.234], + [6.656, -4.451], + [23.252, 6.364], + [0, 0], + [0.832, -1.206], + [6.697, -14.392], + [-3.327, -3.328], + [0, 0], + [1.331, -20.755], + [-0.499, -8.062], + [17.095, -16.887], + [0, 0], + [-0.582, -1.289], + [-9.151, -12.977], + [-4.575, 1.248], + [0, 0], + [-17.345, -11.563], + [-7.196, -3.578], + [-6.114, -23.293], + [0, 0], + [-1.497, -0.124], + [-15.804, 1.373], + [-1.207, 4.575], + [0, 0], + [-18.676, 9.234], + [-6.655, 4.451], + [-23.251, -6.364], + [0, 0], + [-0.832, 1.206], + [-6.739, 14.392], + [3.327, 3.328], + [0, 0], + [-1.331, 20.755], + [0.499, 8.061], + [-17.095, 16.887], + [0, 0], + [0.582, 1.289], + [9.144, 12.981], + [4.576, -1.248], + [0, 0], + [17.345, 11.563], + [7.202, 3.563], + [6.114, 23.293], + [0, 0], + [1.498, 0.125] + ], + "o": [ + [-1.497, 0.125], + [0, 0], + [-6.114, 23.334], + [-7.196, 3.578], + [-17.345, 11.563], + [0, 0], + [-4.534, -1.248], + [-9.151, 12.978], + [-0.582, 1.289], + [0, 0], + [17.095, 16.887], + [-0.5, 8.062], + [1.331, 20.755], + [0, 0], + [-3.369, 3.328], + [6.738, 14.392], + [0.832, 1.248], + [0, 0], + [23.293, -6.364], + [6.697, 4.451], + [18.593, 9.234], + [0, 0], + [1.206, 4.533], + [15.804, 1.373], + [1.498, -0.124], + [0, 0], + [6.114, -23.335], + [7.196, -3.578], + [17.345, -11.563], + [0, 0], + [4.534, 1.206], + [9.151, -13.019], + [0.582, -1.289], + [0, 0], + [-17.095, -16.887], + [0.499, -8.062], + [-1.331, -20.756], + [0, 0], + [3.369, -3.328], + [-6.715, -14.39], + [-0.832, -1.248], + [0, 0], + [-23.293, 6.364], + [-6.676, -4.47], + [-18.592, -9.234], + [0, 0], + [-1.207, -4.575], + [-15.804, -1.372] + ], + "v": [ + [-23.81, -269.32], + [-29.508, -263.247], + [-41.529, -217.285], + [-83.04, -167.829], + [-103.838, -155.766], + [-167.436, -144.536], + [-213.314, -157.139], + [-221.425, -155.267], + [-245.259, -114.089], + [-242.805, -106.185], + [-208.905, -72.66], + [-186.86, -12.099], + [-186.86, 12.109], + [-208.905, 72.671], + [-242.805, 106.195], + [-245.259, 114.099], + [-221.425, 155.236], + [-213.314, 157.15], + [-167.477, 144.547], + [-103.838, 155.777], + [-82.999, 167.839], + [-41.529, 217.295], + [-29.508, 263.257], + [-23.81, 269.329], + [23.691, 269.329], + [29.39, 263.257], + [41.411, 217.295], + [82.922, 167.839], + [103.719, 155.777], + [167.317, 144.547], + [213.196, 157.15], + [221.307, 155.277], + [245.141, 114.099], + [242.687, 106.195], + [208.787, 72.671], + [186.742, 12.109], + [186.742, -12.098], + [208.787, -72.66], + [242.687, -106.185], + [245.141, -114.089], + [221.307, -155.225], + [213.196, -157.139], + [167.359, -144.536], + [103.719, -155.766], + [82.88, -167.828], + [41.411, -217.285], + [29.39, -263.247], + [23.691, -269.32] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 3", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ind": 3, + "ty": "sh", + "ix": 4, + "ks": { + "a": 0, + "k": { + "i": [ + [-9.816, 0], + [-9.697, -0.846], + [-7.071, -26.828], + [0, 0], + [-5.532, -2.745], + [-8.902, -5.948], + [-2.745, 0.79], + [0, 0], + [-17.802, -25.331], + [-8.236, -17.72], + [19.758, -19.508], + [0, 0], + [-0.416, -6.114], + [0.666, -10.69], + [-2.079, -1.997], + [0, 0], + [13.102, -28.076], + [11.232, -15.979], + [26.787, 7.363], + [0, 0], + [5.117, -3.411], + [9.602, -4.741], + [0.707, -2.745], + [0, 0], + [30.904, -2.663], + [19.401, 1.705], + [7.03, 26.87], + [0, 0], + [5.532, 2.745], + [8.891, 5.969], + [2.746, -0.79], + [0, 0], + [17.802, 25.332], + [8.277, 17.703], + [-19.716, 19.508], + [0, 0], + [0.416, 6.114], + [-0.666, 10.693], + [2.08, 1.997], + [0, 0], + [-13.102, 28.076], + [-11.242, 15.972], + [-26.787, -7.363], + [0, 0], + [-5.116, 3.411], + [-9.608, 4.742], + [-0.707, 2.745], + [0, 0], + [-30.905, 2.704] + ], + "o": [ + [9.733, 0.014], + [30.904, 2.662], + [0, 0], + [0.749, 2.745], + [9.609, 4.742], + [5.116, 3.411], + [0, 0], + [26.787, -7.321], + [11.231, 16.014], + [13.102, 28.076], + [0, 0], + [-2.038, 1.997], + [0.666, 10.69], + [-0.416, 6.114], + [0, 0], + [19.758, 19.508], + [-8.252, 17.703], + [-17.802, 25.373], + [0, 0], + [-2.787, -0.79], + [-8.902, 5.952], + [-5.532, 2.745], + [0, 0], + [-6.987, 26.87], + [-19.402, 1.705], + [-30.905, -2.663], + [0, 0], + [-0.748, -2.745], + [-9.611, -4.723], + [-5.116, -3.411], + [0, 0], + [-26.786, 7.321], + [-11.208, -16.008], + [-13.102, -28.076], + [0, 0], + [2.08, -1.997], + [-0.666, -10.693], + [0.416, -6.114], + [0, 0], + [-19.716, -19.508], + [8.241, -17.709], + [17.802, -25.373], + [0, 0], + [2.787, 0.79], + [8.901, -5.948], + [5.532, -2.745], + [0, 0], + [6.988, -26.87], + [9.608, -0.832] + ], + "v": [ + [-0.059, -332.751], + [29.099, -331.462], + [89.785, -279.095], + [101.764, -233.049], + [110.582, -223.733], + [138.368, -207.676], + [150.804, -204.723], + [196.683, -217.327], + [272.385, -191.123], + [301.668, -140.459], + [286.527, -61.805], + [252.669, -28.28], + [249.009, -16.051], + [249.009, 16.061], + [252.669, 28.289], + [286.527, 61.815], + [301.668, 140.47], + [272.385, 191.09], + [196.683, 217.295], + [150.846, 204.734], + [138.367, 207.687], + [110.582, 223.743], + [101.806, 233.059], + [89.743, 279.063], + [29.099, 331.473], + [-29.217, 331.473], + [-89.862, 279.063], + [-101.883, 233.059], + [-110.701, 223.743], + [-138.486, 207.687], + [-150.923, 204.734], + [-196.802, 217.336], + [-272.504, 191.132], + [-301.786, 140.47], + [-286.687, 61.815], + [-252.788, 28.289], + [-249.127, 16.061], + [-249.127, -16.051], + [-252.788, -28.28], + [-286.687, -61.805], + [-301.786, -140.459], + [-272.504, -191.08], + [-196.801, -217.285], + [-150.964, -204.723], + [-138.486, -207.676], + [-110.701, -223.733], + [-101.924, -233.049], + [-89.862, -279.053], + [-29.217, -331.504] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 4", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "mm", + "mm": 1, + "nm": "Merge Paths 1", + "mn": "ADBE Vector Filter - Merge", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [0.898460657456, 0.889815326765, 0.896223060758, 1], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [308.077, 333.249], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 8, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 120, + "st": 0, + "bm": 0 + } + ] + } + ], + "layers": [ + { + "ddd": 0, + "ind": 1, + "ty": 0, + "nm": "estrela Outlines 2 Comp 1", + "refId": "comp_0", + "sr": 1, + "ks": { + "o": { "a": 0, "k": 100, "ix": 11 }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { "a": 0, "k": [450, 450, 0], "ix": 2 }, + "a": { "a": 0, "k": [450, 450, 0], "ix": 1 }, + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667, 0.667], "y": [1, 1, 1] }, + "o": { "x": [1, 1, 0.333], "y": [0, 0, 0] }, + "t": 0, + "s": [100, 100, 100] + }, + { + "i": { "x": [0, 0, 0.667], "y": [1, 1, 1] }, + "o": { "x": [0.333, 0.333, 0.333], "y": [0, 0, 0] }, + "t": 30, + "s": [80, 80, 100] + }, + { "t": 60, "s": [100, 100, 100] } + ], + "ix": 6 + } + }, + "ao": 0, + "hasMask": true, + "masksProperties": [ + { + "inv": false, + "mode": "a", + "pt": { + "a": 0, + "k": { + "i": [ + [89.47, 0], + [0, -89.47], + [-89.47, 0], + [0, 89.47] + ], + "o": [ + [-89.47, 0], + [0, 89.47], + [89.47, 0], + [0, -89.47] + ], + "v": [ + [446, 286], + [284, 448], + [446, 610], + [608, 448] + ], + "c": true + }, + "ix": 1 + }, + "o": { "a": 0, "k": 100, "ix": 3 }, + "x": { "a": 0, "k": 0, "ix": 4 }, + "nm": "Mask 1" + } + ], + "w": 900, + "h": 900, + "ip": 0, + "op": 120, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 2, + "ty": 4, + "nm": "estrela Outlines", + "sr": 1, + "ks": { + "o": { "a": 0, "k": 100, "ix": 11 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.84], "y": [-1.753] }, + "o": { "x": [0], "y": [0] }, + "t": 0, + "s": [0] + }, + { + "i": { "x": [0.361], "y": [1] }, + "o": { "x": [0], "y": [0] }, + "t": 28, + "s": [15] + }, + { "t": 60, "s": [180] } + ], + "ix": 10 + }, + "p": { "a": 0, "k": [450, 450, 0], "ix": 2 }, + "a": { "a": 0, "k": [308.5, 333, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0.011, 34.469], + [34.47, -0.012], + [-0.011, -34.469], + [-34.47, 0.011] + ], + "o": [ + [-0.012, -34.47], + [-34.469, 0.011], + [0.012, 34.47], + [34.469, -0.012] + ], + "v": [ + [62.333, 0.005], + [-0.101, -62.387], + [-62.493, 0.047], + [-0.059, 62.439] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ind": 1, + "ty": "sh", + "ix": 2, + "ks": { + "a": 0, + "k": { + "i": [ + [0, -68.917], + [68.916, 0], + [0, 68.916], + [-68.916, 0] + ], + "o": [ + [0, 68.916], + [-68.916, 0], + [0, -68.917], + [68.916, 0] + ], + "v": [ + [124.725, 0.005], + [-0.059, 124.789], + [-124.843, 0.005], + [-0.059, -124.779] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 2", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ind": 2, + "ty": "sh", + "ix": 3, + "ks": { + "a": 0, + "k": { + "i": [ + [15.804, -1.372], + [1.206, -4.575], + [0, 0], + [18.676, -9.234], + [6.656, -4.451], + [23.252, 6.364], + [0, 0], + [0.832, -1.206], + [6.697, -14.392], + [-3.327, -3.328], + [0, 0], + [1.331, -20.755], + [-0.499, -8.062], + [17.095, -16.887], + [0, 0], + [-0.582, -1.289], + [-9.151, -12.977], + [-4.575, 1.248], + [0, 0], + [-17.345, -11.563], + [-7.196, -3.578], + [-6.114, -23.293], + [0, 0], + [-1.497, -0.124], + [-15.804, 1.373], + [-1.207, 4.575], + [0, 0], + [-18.676, 9.234], + [-6.655, 4.451], + [-23.251, -6.364], + [0, 0], + [-0.832, 1.206], + [-6.739, 14.392], + [3.327, 3.328], + [0, 0], + [-1.331, 20.755], + [0.499, 8.061], + [-17.095, 16.887], + [0, 0], + [0.582, 1.289], + [9.144, 12.981], + [4.576, -1.248], + [0, 0], + [17.345, 11.563], + [7.202, 3.563], + [6.114, 23.293], + [0, 0], + [1.498, 0.125] + ], + "o": [ + [-1.497, 0.125], + [0, 0], + [-6.114, 23.334], + [-7.196, 3.578], + [-17.345, 11.563], + [0, 0], + [-4.534, -1.248], + [-9.151, 12.978], + [-0.582, 1.289], + [0, 0], + [17.095, 16.887], + [-0.5, 8.062], + [1.331, 20.755], + [0, 0], + [-3.369, 3.328], + [6.738, 14.392], + [0.832, 1.248], + [0, 0], + [23.293, -6.364], + [6.697, 4.451], + [18.593, 9.234], + [0, 0], + [1.206, 4.533], + [15.804, 1.373], + [1.498, -0.124], + [0, 0], + [6.114, -23.335], + [7.196, -3.578], + [17.345, -11.563], + [0, 0], + [4.534, 1.206], + [9.151, -13.019], + [0.582, -1.289], + [0, 0], + [-17.095, -16.887], + [0.499, -8.062], + [-1.331, -20.756], + [0, 0], + [3.369, -3.328], + [-6.715, -14.39], + [-0.832, -1.248], + [0, 0], + [-23.293, 6.364], + [-6.676, -4.47], + [-18.592, -9.234], + [0, 0], + [-1.207, -4.575], + [-15.804, -1.372] + ], + "v": [ + [-23.81, -269.32], + [-29.508, -263.247], + [-41.529, -217.285], + [-83.04, -167.829], + [-103.838, -155.766], + [-167.436, -144.536], + [-213.314, -157.139], + [-221.425, -155.267], + [-245.259, -114.089], + [-242.805, -106.185], + [-208.905, -72.66], + [-186.86, -12.099], + [-186.86, 12.109], + [-208.905, 72.671], + [-242.805, 106.195], + [-245.259, 114.099], + [-221.425, 155.236], + [-213.314, 157.15], + [-167.477, 144.547], + [-103.838, 155.777], + [-82.999, 167.839], + [-41.529, 217.295], + [-29.508, 263.257], + [-23.81, 269.329], + [23.691, 269.329], + [29.39, 263.257], + [41.411, 217.295], + [82.922, 167.839], + [103.719, 155.777], + [167.317, 144.547], + [213.196, 157.15], + [221.307, 155.277], + [245.141, 114.099], + [242.687, 106.195], + [208.787, 72.671], + [186.742, 12.109], + [186.742, -12.098], + [208.787, -72.66], + [242.687, -106.185], + [245.141, -114.089], + [221.307, -155.225], + [213.196, -157.139], + [167.359, -144.536], + [103.719, -155.766], + [82.88, -167.828], + [41.411, -217.285], + [29.39, -263.247], + [23.691, -269.32] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 3", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ind": 3, + "ty": "sh", + "ix": 4, + "ks": { + "a": 0, + "k": { + "i": [ + [-9.816, 0], + [-9.697, -0.846], + [-7.071, -26.828], + [0, 0], + [-5.532, -2.745], + [-8.902, -5.948], + [-2.745, 0.79], + [0, 0], + [-17.802, -25.331], + [-8.236, -17.72], + [19.758, -19.508], + [0, 0], + [-0.416, -6.114], + [0.666, -10.69], + [-2.079, -1.997], + [0, 0], + [13.102, -28.076], + [11.232, -15.979], + [26.787, 7.363], + [0, 0], + [5.117, -3.411], + [9.602, -4.741], + [0.707, -2.745], + [0, 0], + [30.904, -2.663], + [19.401, 1.705], + [7.03, 26.87], + [0, 0], + [5.532, 2.745], + [8.891, 5.969], + [2.746, -0.79], + [0, 0], + [17.802, 25.332], + [8.277, 17.703], + [-19.716, 19.508], + [0, 0], + [0.416, 6.114], + [-0.666, 10.693], + [2.08, 1.997], + [0, 0], + [-13.102, 28.076], + [-11.242, 15.972], + [-26.787, -7.363], + [0, 0], + [-5.116, 3.411], + [-9.608, 4.742], + [-0.707, 2.745], + [0, 0], + [-30.905, 2.704] + ], + "o": [ + [9.733, 0.014], + [30.904, 2.662], + [0, 0], + [0.749, 2.745], + [9.609, 4.742], + [5.116, 3.411], + [0, 0], + [26.787, -7.321], + [11.231, 16.014], + [13.102, 28.076], + [0, 0], + [-2.038, 1.997], + [0.666, 10.69], + [-0.416, 6.114], + [0, 0], + [19.758, 19.508], + [-8.252, 17.703], + [-17.802, 25.373], + [0, 0], + [-2.787, -0.79], + [-8.902, 5.952], + [-5.532, 2.745], + [0, 0], + [-6.987, 26.87], + [-19.402, 1.705], + [-30.905, -2.663], + [0, 0], + [-0.748, -2.745], + [-9.611, -4.723], + [-5.116, -3.411], + [0, 0], + [-26.786, 7.321], + [-11.208, -16.008], + [-13.102, -28.076], + [0, 0], + [2.08, -1.997], + [-0.666, -10.693], + [0.416, -6.114], + [0, 0], + [-19.716, -19.508], + [8.241, -17.709], + [17.802, -25.373], + [0, 0], + [2.787, 0.79], + [8.901, -5.948], + [5.532, -2.745], + [0, 0], + [6.988, -26.87], + [9.608, -0.832] + ], + "v": [ + [-0.059, -332.751], + [29.099, -331.462], + [89.785, -279.095], + [101.764, -233.049], + [110.582, -223.733], + [138.368, -207.676], + [150.804, -204.723], + [196.683, -217.327], + [272.385, -191.123], + [301.668, -140.459], + [286.527, -61.805], + [252.669, -28.28], + [249.009, -16.051], + [249.009, 16.061], + [252.669, 28.289], + [286.527, 61.815], + [301.668, 140.47], + [272.385, 191.09], + [196.683, 217.295], + [150.846, 204.734], + [138.367, 207.687], + [110.582, 223.743], + [101.806, 233.059], + [89.743, 279.063], + [29.099, 331.473], + [-29.217, 331.473], + [-89.862, 279.063], + [-101.883, 233.059], + [-110.701, 223.743], + [-138.486, 207.687], + [-150.923, 204.734], + [-196.802, 217.336], + [-272.504, 191.132], + [-301.786, 140.47], + [-286.687, 61.815], + [-252.788, 28.289], + [-249.127, 16.061], + [-249.127, -16.051], + [-252.788, -28.28], + [-286.687, -61.805], + [-301.786, -140.459], + [-272.504, -191.08], + [-196.801, -217.285], + [-150.964, -204.723], + [-138.486, -207.676], + [-110.701, -223.733], + [-101.924, -233.049], + [-89.862, -279.053], + [-29.217, -331.504] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 4", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "mm", + "mm": 1, + "nm": "Merge Paths 1", + "mn": "ADBE Vector Filter - Merge", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [0.898460657456, 0.889815326765, 0.896223060758, 1], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [308.077, 333.249], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 8, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 120, + "st": 0, + "bm": 0 + } + ], + "markers": [] +} diff --git a/src/renderer/declaration.d.ts b/src/renderer/declaration.d.ts index cceed299..393717ba 100644 --- a/src/renderer/declaration.d.ts +++ b/src/renderer/declaration.d.ts @@ -22,7 +22,8 @@ declare global { repackId: number, objectID: string, title: string, - shop: GameShop + shop: GameShop, + downloadPath: string ) => Promise; cancelGameDownload: (gameId: number) => Promise; pauseGameDownload: (gameId: number) => Promise; diff --git a/src/renderer/hooks/use-download.ts b/src/renderer/hooks/use-download.ts index 522dd2c2..27f90e8d 100644 --- a/src/renderer/hooks/use-download.ts +++ b/src/renderer/hooks/use-download.ts @@ -28,10 +28,11 @@ export function useDownload() { repackId: number, objectID: string, title: string, - shop: GameShop + shop: GameShop, + downloadPath: string ) => window.electron - .startGameDownload(repackId, objectID, title, shop) + .startGameDownload(repackId, objectID, title, shop, downloadPath) .then((game) => { dispatch(clearDownload()); updateLibrary(); diff --git a/src/renderer/pages/game-details/game-details.tsx b/src/renderer/pages/game-details/game-details.tsx index 12d9d940..88e91ba2 100644 --- a/src/renderer/pages/game-details/game-details.tsx +++ b/src/renderer/pages/game-details/game-details.tsx @@ -138,12 +138,16 @@ export function GameDetails() { }; }, [game?.id, isGamePlaying, getGame]); - const handleStartDownload = async (repackId: number) => { + const handleStartDownload = async ( + repackId: number, + downloadPath: string + ) => { return startDownload( repackId, gameDetails.objectID, gameDetails.name, - shop as GameShop + shop as GameShop, + downloadPath ).then(() => { getGame(); setShowRepacksModal(false); diff --git a/src/renderer/pages/game-details/repacks-modal.tsx b/src/renderer/pages/game-details/repacks-modal.tsx index b3917b23..bb47060e 100644 --- a/src/renderer/pages/game-details/repacks-modal.tsx +++ b/src/renderer/pages/game-details/repacks-modal.tsx @@ -10,11 +10,12 @@ 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 { SelectFolderModal } from "./select-folder-modal"; export interface RepacksModalProps { visible: boolean; gameDetails: ShopDetails; - startDownload: (repackId: number) => Promise; + startDownload: (repackId: number, downloadPath: string) => Promise; onClose: () => void; } @@ -24,9 +25,10 @@ export function RepacksModal({ startDownload, onClose, }: RepacksModalProps) { - const [downloadStarting, setDownloadStarting] = useState(false); + const [openSelectFolderModal, setOpenSelectFolderModal] = useState(false); const [diskFreeSpace, setDiskFreeSpace] = useState(null); const [filteredRepacks, setFilteredRepacks] = useState([]); + const [repack, setRepack] = useState(null); const { t } = useTranslation("game_details"); @@ -45,10 +47,8 @@ export function RepacksModal({ }, [visible]); const handleRepackClick = (repack: GameRepack) => { - setDownloadStarting(true); - startDownload(repack.id).finally(() => { - setDownloadStarting(false); - }); + setRepack(repack); + setOpenSelectFolderModal(true); }; const handleFilter: React.ChangeEventHandler = (event) => { @@ -70,6 +70,13 @@ export function RepacksModal({ })} onClose={onClose} > + setOpenSelectFolderModal(false)} + gameDetails={gameDetails} + startDownload={startDownload} + repack={repack} + />
@@ -80,7 +87,6 @@ export function RepacksModal({ key={repack.id} theme="dark" onClick={() => handleRepackClick(repack)} - disabled={downloadStarting} className={styles.repackButton} >

{repack.title}

diff --git a/src/renderer/pages/game-details/select-folder-modal.css.tsx b/src/renderer/pages/game-details/select-folder-modal.css.tsx new file mode 100644 index 00000000..7d32bccc --- /dev/null +++ b/src/renderer/pages/game-details/select-folder-modal.css.tsx @@ -0,0 +1,19 @@ +import { style } from "@vanilla-extract/css"; +import { SPACING_UNIT, vars } from "@renderer/theme.css"; + +export const container = style({ + display: "flex", + flexDirection: "column", + gap: `${SPACING_UNIT * 2}px`, + width: "100%", +}); + +export const downloadsPathField = style({ + display: "flex", + gap: `${SPACING_UNIT * 2}px`, +}); + +export const hintText = style({ + fontSize: 12, + color: vars.color.bodyText, +}); diff --git a/src/renderer/pages/game-details/select-folder-modal.tsx b/src/renderer/pages/game-details/select-folder-modal.tsx new file mode 100644 index 00000000..4ba06ece --- /dev/null +++ b/src/renderer/pages/game-details/select-folder-modal.tsx @@ -0,0 +1,103 @@ +import { Button, Modal, TextField } from "@renderer/components"; +import { GameRepack, ShopDetails } from "@types"; +import { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; + +import * as styles from "./select-folder-modal.css"; +import { Link } from "react-router-dom"; + +export interface SelectFolderModalProps { + visible: boolean; + gameDetails: ShopDetails; + onClose: () => void; + startDownload: (repackId: number, downloadPath: string) => Promise; + repack: GameRepack; +} + +export function SelectFolderModal({ + visible, + gameDetails, + onClose, + startDownload, + repack, +}: SelectFolderModalProps) { + const { t } = useTranslation("game_details"); + + const [selectedPath, setSelectedPath] = useState({ + downloadsPath: "", + }); + const [downloadStarting, setDownloadStarting] = useState(false); + + useEffect(() => { + Promise.all([ + window.electron.getDefaultDownloadsPath(), + window.electron.getUserPreferences(), + ]).then(([path, userPreferences]) => { + setSelectedPath({ + downloadsPath: userPreferences?.downloadsPath || path, + }); + }); + }, []); + + const handleChooseDownloadsPath = async () => { + const { filePaths } = await window.electron.showOpenDialog({ + defaultPath: selectedPath.downloadsPath, + properties: ["openDirectory"], + }); + + if (filePaths && filePaths.length > 0) { + const path = filePaths[0]; + setSelectedPath({ downloadsPath: path }); + } + }; + + const handleStartClick = () => { + setDownloadStarting(true); + startDownload(repack.id, selectedPath.downloadsPath).finally(() => { + setDownloadStarting(false); + }); + }; + + return ( + +
+
+ + + +
+

+ {t("select_folder_hint")}{" "} + + {t("hydra_settings")} + +

+ +
+
+ ); +}