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

@@ -1,10 +1,11 @@
import path from "node:path";
import fs from "node:fs";
import type { Game, AchievementFile } from "@types";
import type { Game, AchievementFile, UserPreferences } from "@types";
import { Cracker } from "@shared";
import { achievementsLogger } from "../logger";
import { SystemPath } from "../system-path";
import { getSteamLocation, getSteamUsersIds } from "../steam";
import { db, levelKeys } from "@main/level";
const getAppDataPath = () => {
if (process.platform === "win32") {
@@ -285,6 +286,17 @@ export const findAchievementFileInSteamPath = async (game: Game) => {
return [];
}
const userPreferences = await db.get<string, UserPreferences | null>(
levelKeys.userPreferences,
{
valueEncoding: "json",
}
);
if (!userPreferences?.enableSteamAchievements) {
return [];
}
const achievementFiles: AchievementFile[] = [];
for (const steamUserId of steamUserIds) {

View File

@@ -582,7 +582,7 @@ export class WindowManager {
tray.popUpContextMenu(contextMenu);
};
tray.setToolTip("Hydra");
tray.setToolTip("Hydra Launcher");
if (process.platform !== "darwin") {
await updateSystemTray();