Merge branch 'feature/game-achievements' into chore/test-preview

# Conflicts:
#	src/locales/en/translation.json
#	src/locales/pt-BR/translation.json
This commit is contained in:
Zamitto 2024-10-07 12:35:25 -03:00
commit 49ca2bf3c2
6 changed files with 60 additions and 36 deletions

View File

@ -131,6 +131,7 @@
"executable_path_in_use": "Executable already in use by \"{{game}}\"", "executable_path_in_use": "Executable already in use by \"{{game}}\"",
"warning": "Warning:", "warning": "Warning:",
"hydra_needs_to_remain_open": "for this download, Hydra needs to remain open util its conclusion. In case Hydra closes before the conclusion, you will lose your progress.", "hydra_needs_to_remain_open": "for this download, Hydra needs to remain open util its conclusion. In case Hydra closes before the conclusion, you will lose your progress.",
"achievements": "Achievements",
"cloud_save": "Cloud save", "cloud_save": "Cloud save",
"cloud_save_description": "Save your progress in the cloud and continue playing on any device", "cloud_save_description": "Save your progress in the cloud and continue playing on any device",
"backups": "Backups", "backups": "Backups",

View File

@ -127,6 +127,7 @@
"executable_path_in_use": "Executável em uso por \"{{game}}\"", "executable_path_in_use": "Executável em uso por \"{{game}}\"",
"warning": "Aviso:", "warning": "Aviso:",
"hydra_needs_to_remain_open": "para este download, o Hydra precisa ficar aberto até a conclusão. Caso o Hydra encerre antes da conclusão, perderá seu progresso.", "hydra_needs_to_remain_open": "para este download, o Hydra precisa ficar aberto até a conclusão. Caso o Hydra encerre antes da conclusão, perderá seu progresso.",
"achievements": "Conquistas",
"cloud_save": "Salvamento em nuvem", "cloud_save": "Salvamento em nuvem",
"cloud_save_description": "Matenha seu progresso na nuvem e continue de onde parou em qualquer dispositivo", "cloud_save_description": "Matenha seu progresso na nuvem e continue de onde parou em qualquer dispositivo",
"backups": "Backups", "backups": "Backups",

View File

@ -115,7 +115,8 @@
"download": "Transferir", "download": "Transferir",
"executable_path_in_use": "Executável em uso por \"{{game}}\"", "executable_path_in_use": "Executável em uso por \"{{game}}\"",
"warning": "Aviso:", "warning": "Aviso:",
"hydra_needs_to_remain_open": "para este download, o Hydra precisa ficar aberto até a conclusão. Caso o Hydra encerre antes da conclusão, perderá seu progresso." "hydra_needs_to_remain_open": "para este download, o Hydra precisa ficar aberto até a conclusão. Caso o Hydra encerre antes da conclusão, perderá seu progresso.",
"achievements": "Conquistas"
}, },
"activation": { "activation": {
"title": "Ativação", "title": "Ativação",

View File

@ -86,6 +86,10 @@ const getPathFromCracker = (cracker: Cracker) => {
folderPath: path.join(programData, "Steam", "Player"), folderPath: path.join(programData, "Steam", "Player"),
fileLocation: ["stats", "achievements.ini"], fileLocation: ["stats", "achievements.ini"],
}, },
{
folderPath: path.join(programData, "Steam", "dodi"),
fileLocation: ["stats", "achievements.ini"],
},
]; ];
} }

View File

@ -24,6 +24,7 @@ export const contentSidebarTitle = style({
display: "flex", display: "flex",
alignItems: "center", alignItems: "center",
backgroundColor: vars.color.background, backgroundColor: vars.color.background,
justifyContent: "space-between",
}); });
export const requirementButtonContainer = style({ export const requirementButtonContainer = style({

View File

@ -49,44 +49,60 @@ export function Sidebar() {
/> */} /> */}
{achievements.length > 0 && ( {achievements.length > 0 && (
<div <>
style={{ <div
display: "flex", className={styles.contentSidebarTitle}
flexDirection: "column", style={{ border: "none" }}
gap: `${SPACING_UNIT}px`, >
padding: `${SPACING_UNIT}px`, <h3>
}} {t("achievements")}{" "}
> <span style={{ fontSize: "12px" }}>
{achievements.map((achievement, index) => ( ({achievements.filter((a) => a.unlocked).length}/
<div {achievements.length})
key={index} </span>
style={{ </h3>
display: "flex", </div>
flexDirection: "row", <div
alignItems: "center", style={{
gap: `${SPACING_UNIT}px`, display: "flex",
}} flexDirection: "column",
title={achievement.description} gap: `${SPACING_UNIT}px`,
> padding: `${SPACING_UNIT * 2}px`,
<img }}
>
{achievements.map((achievement, index) => (
<div
key={index}
style={{ style={{
height: "72px", display: "flex",
width: "72px", flexDirection: "row",
filter: achievement.unlocked ? "none" : "grayscale(100%)", alignItems: "center",
gap: `${SPACING_UNIT}px`,
}} }}
src={ title={achievement.description}
achievement.unlocked ? achievement.icon : achievement.icongray >
} <img
alt={achievement.displayName} style={{
loading="lazy" height: "60px",
/> width: "60px",
<div> filter: achievement.unlocked ? "none" : "grayscale(100%)",
<p>{achievement.displayName}</p> }}
{achievement.unlockTime && format(achievement.unlockTime)} src={
achievement.unlocked
? achievement.icon
: achievement.icongray
}
alt={achievement.displayName}
loading="lazy"
/>
<div>
<p>{achievement.displayName}</p>
{achievement.unlockTime && format(achievement.unlockTime)}
</div>
</div> </div>
</div> ))}
))} </div>
</div> </>
)} )}
{stats && ( {stats && (