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}}\"",
"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.",
"achievements": "Achievements",
"cloud_save": "Cloud save",
"cloud_save_description": "Save your progress in the cloud and continue playing on any device",
"backups": "Backups",

View File

@ -127,6 +127,7 @@
"executable_path_in_use": "Executável em uso por \"{{game}}\"",
"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.",
"achievements": "Conquistas",
"cloud_save": "Salvamento em nuvem",
"cloud_save_description": "Matenha seu progresso na nuvem e continue de onde parou em qualquer dispositivo",
"backups": "Backups",

View File

@ -115,7 +115,8 @@
"download": "Transferir",
"executable_path_in_use": "Executável em uso por \"{{game}}\"",
"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": {
"title": "Ativação",

View File

@ -86,6 +86,10 @@ const getPathFromCracker = (cracker: Cracker) => {
folderPath: path.join(programData, "Steam", "Player"),
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",
alignItems: "center",
backgroundColor: vars.color.background,
justifyContent: "space-between",
});
export const requirementButtonContainer = style({

View File

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