feat: settings to enable steam achievements search

This commit is contained in:
Zamitto
2025-09-01 12:51:49 -03:00
parent e0c5f80b68
commit 2b8cc506df
8 changed files with 52 additions and 3 deletions

View File

@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hydra</title>
<title>Hydra Launcher</title>
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self' 'unsafe-inline' * data: local:;"

View File

@@ -9,5 +9,16 @@
opacity: 1;
cursor: pointer;
}
&--with-tooltip {
display: flex;
flex-direction: row;
gap: 8px;
align-items: center;
}
&--tooltip {
cursor: pointer;
}
}
}

View File

@@ -5,6 +5,7 @@ import { CheckboxField } from "@renderer/components";
import { useAppSelector } from "@renderer/hooks";
import { settingsContext } from "@renderer/context";
import "./settings-behavior.scss";
import { QuestionIcon } from "@primer/octicons-react";
export function SettingsBehavior() {
const userPreferences = useAppSelector(
@@ -25,6 +26,7 @@ export function SettingsBehavior() {
showHiddenAchievementsDescription: false,
showDownloadSpeedInMegabytes: false,
extractFilesByDefault: true,
enableSteamAchievements: false,
});
const { t } = useTranslation("settings");
@@ -45,6 +47,8 @@ export function SettingsBehavior() {
showDownloadSpeedInMegabytes:
userPreferences.showDownloadSpeedInMegabytes ?? false,
extractFilesByDefault: userPreferences.extractFilesByDefault ?? true,
enableSteamAchievements:
userPreferences.enableSteamAchievements ?? false,
});
}
}, [userPreferences]);
@@ -164,6 +168,25 @@ export function SettingsBehavior() {
})
}
/>
<div className={`settings-behavior__checkbox-container--with-tooltip`}>
<CheckboxField
label={t("enable_steam_achievements")}
checked={form.enableSteamAchievements}
onChange={() =>
handleChange({
enableSteamAchievements: !form.enableSteamAchievements,
})
}
/>
<small
className="settings-behavior__checkbox-container--tooltip"
data-open-article="steam-achievements"
>
<QuestionIcon size={12} />
</small>
</div>
</>
);
}