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,12 +49,25 @@ export function Sidebar() {
/> */} /> */}
{achievements.length > 0 && ( {achievements.length > 0 && (
<>
<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 <div
style={{ style={{
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
gap: `${SPACING_UNIT}px`, gap: `${SPACING_UNIT}px`,
padding: `${SPACING_UNIT}px`, padding: `${SPACING_UNIT * 2}px`,
}} }}
> >
{achievements.map((achievement, index) => ( {achievements.map((achievement, index) => (
@ -70,12 +83,14 @@ export function Sidebar() {
> >
<img <img
style={{ style={{
height: "72px", height: "60px",
width: "72px", width: "60px",
filter: achievement.unlocked ? "none" : "grayscale(100%)", filter: achievement.unlocked ? "none" : "grayscale(100%)",
}} }}
src={ src={
achievement.unlocked ? achievement.icon : achievement.icongray achievement.unlocked
? achievement.icon
: achievement.icongray
} }
alt={achievement.displayName} alt={achievement.displayName}
loading="lazy" loading="lazy"
@ -87,6 +102,7 @@ export function Sidebar() {
</div> </div>
))} ))}
</div> </div>
</>
)} )}
{stats && ( {stats && (