mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-19 17:23:57 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1dc2176813 | ||
|
|
a7ec632a21 | ||
|
|
2b6d8eba78 | ||
|
|
6bc6a10d66 | ||
|
|
51f8b12e13 | ||
|
|
957a6b512e | ||
|
|
8bc1c1c58c |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydralauncher",
|
"name": "hydralauncher",
|
||||||
"version": "3.6.4",
|
"version": "3.6.7",
|
||||||
"description": "Hydra",
|
"description": "Hydra",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "Los Broxas",
|
"author": "Los Broxas",
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ const createSteamShortcut = async (
|
|||||||
|
|
||||||
if (!steamUserIds.length) {
|
if (!steamUserIds.length) {
|
||||||
logger.error("No Steam user ID found");
|
logger.error("No Steam user ID found");
|
||||||
return;
|
throw new Error("No Steam user ID found");
|
||||||
}
|
}
|
||||||
|
|
||||||
const [iconImage, heroImage, logoImage, coverImage, libraryImage] =
|
const [iconImage, heroImage, logoImage, coverImage, libraryImage] =
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { Downloader } from "@shared";
|
|||||||
import { levelKeys, db } from "./level";
|
import { levelKeys, db } from "./level";
|
||||||
import type { UserPreferences } from "@types";
|
import type { UserPreferences } from "@types";
|
||||||
import {
|
import {
|
||||||
WSClient,
|
|
||||||
SystemPath,
|
SystemPath,
|
||||||
CommonRedistManager,
|
CommonRedistManager,
|
||||||
TorBoxClient,
|
TorBoxClient,
|
||||||
@@ -47,7 +46,7 @@ export const loadState = async () => {
|
|||||||
|
|
||||||
await HydraApi.setupApi().then(() => {
|
await HydraApi.setupApi().then(() => {
|
||||||
uploadGamesBatch();
|
uploadGamesBatch();
|
||||||
WSClient.connect();
|
// WSClient.connect();
|
||||||
});
|
});
|
||||||
|
|
||||||
const downloads = await downloadsSublevel
|
const downloads = await downloadsSublevel
|
||||||
|
|||||||
@@ -279,13 +279,17 @@ export const findAchievementFiles = (game: Game) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const steamUserIds = await getSteamUsersIds();
|
const steamUserIds = await getSteamUsersIds();
|
||||||
const steamPath = await getSteamLocation();
|
const steamPath = await getSteamLocation().catch(() => null);
|
||||||
|
|
||||||
export const findAchievementFileInSteamPath = async (game: Game) => {
|
export const findAchievementFileInSteamPath = async (game: Game) => {
|
||||||
if (!steamUserIds.length) {
|
if (!steamUserIds.length) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!steamPath) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
const userPreferences = await db.get<string, UserPreferences | null>(
|
const userPreferences = await db.get<string, UserPreferences | null>(
|
||||||
levelKeys.userPreferences,
|
levelKeys.userPreferences,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { getUserData } from "./user/get-user-data";
|
|||||||
import { db } from "@main/level";
|
import { db } from "@main/level";
|
||||||
import { levelKeys } from "@main/level/sublevels";
|
import { levelKeys } from "@main/level/sublevels";
|
||||||
import type { Auth, User } from "@types";
|
import type { Auth, User } from "@types";
|
||||||
import { WSClient } from "./ws/ws-client";
|
|
||||||
|
|
||||||
interface HydraApiOptions {
|
interface HydraApiOptions {
|
||||||
needsAuth?: boolean;
|
needsAuth?: boolean;
|
||||||
@@ -103,8 +102,8 @@ export class HydraApi {
|
|||||||
WindowManager.mainWindow.webContents.send("on-signin");
|
WindowManager.mainWindow.webContents.send("on-signin");
|
||||||
await clearGamesRemoteIds();
|
await clearGamesRemoteIds();
|
||||||
uploadGamesBatch();
|
uploadGamesBatch();
|
||||||
WSClient.close();
|
// WSClient.close();
|
||||||
WSClient.connect();
|
// WSClient.connect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ export const getSteamLocation = async () => {
|
|||||||
reject(err);
|
reject(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
reject(new Error("SteamPath not found in registry"));
|
||||||
|
}
|
||||||
|
|
||||||
resolve(value.value);
|
resolve(value.value);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -78,7 +82,15 @@ export const getSteamAppDetails = async (
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getSteamUsersIds = async () => {
|
export const getSteamUsersIds = async () => {
|
||||||
const userDataPath = await getSteamLocation();
|
const userDataPath = await getSteamLocation().catch(() => null);
|
||||||
|
|
||||||
|
if (!userDataPath) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fs.existsSync(userDataPath)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
const userIds = fs.readdirSync(path.join(userDataPath, "userdata"), {
|
const userIds = fs.readdirSync(path.join(userDataPath, "userdata"), {
|
||||||
withFileTypes: true,
|
withFileTypes: true,
|
||||||
|
|||||||
@@ -181,6 +181,9 @@ export class WindowManager {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.mainWindow.on("close", async () => {
|
this.mainWindow.on("close", async () => {
|
||||||
|
const mainWindow = this.mainWindow;
|
||||||
|
this.mainWindow = null;
|
||||||
|
|
||||||
const userPreferences = await db.get<string, UserPreferences>(
|
const userPreferences = await db.get<string, UserPreferences>(
|
||||||
levelKeys.userPreferences,
|
levelKeys.userPreferences,
|
||||||
{
|
{
|
||||||
@@ -188,9 +191,11 @@ export class WindowManager {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (this.mainWindow) {
|
if (mainWindow) {
|
||||||
const lastBounds = this.mainWindow.getBounds();
|
mainWindow.setProgressBar(-1);
|
||||||
const isMaximized = this.mainWindow.isMaximized() ?? false;
|
|
||||||
|
const lastBounds = mainWindow.getBounds();
|
||||||
|
const isMaximized = mainWindow.isMaximized() ?? false;
|
||||||
const screenConfig = isMaximized
|
const screenConfig = isMaximized
|
||||||
? {
|
? {
|
||||||
x: undefined,
|
x: undefined,
|
||||||
@@ -207,9 +212,6 @@ export class WindowManager {
|
|||||||
if (userPreferences?.preferQuitInsteadOfHiding) {
|
if (userPreferences?.preferQuitInsteadOfHiding) {
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowManager.mainWindow?.setProgressBar(-1);
|
|
||||||
WindowManager.mainWindow = null;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.mainWindow.webContents.setWindowOpenHandler((handler) => {
|
this.mainWindow.webContents.setWindowOpenHandler((handler) => {
|
||||||
@@ -584,7 +586,7 @@ export class WindowManager {
|
|||||||
|
|
||||||
tray.setToolTip("Hydra Launcher");
|
tray.setToolTip("Hydra Launcher");
|
||||||
|
|
||||||
if (process.platform !== "darwin") {
|
if (process.platform === "win32") {
|
||||||
await updateSystemTray();
|
await updateSystemTray();
|
||||||
|
|
||||||
tray.addListener("double-click", () => {
|
tray.addListener("double-click", () => {
|
||||||
@@ -595,6 +597,18 @@ export class WindowManager {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tray.addListener("right-click", showContextMenu);
|
||||||
|
} else if (process.platform === "linux") {
|
||||||
|
await updateSystemTray();
|
||||||
|
|
||||||
|
tray.addListener("click", () => {
|
||||||
|
if (this.mainWindow) {
|
||||||
|
this.mainWindow.show();
|
||||||
|
} else {
|
||||||
|
this.createMainWindow();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
tray.addListener("right-click", showContextMenu);
|
tray.addListener("right-click", showContextMenu);
|
||||||
} else {
|
} else {
|
||||||
tray.addListener("click", showContextMenu);
|
tray.addListener("click", showContextMenu);
|
||||||
|
|||||||
@@ -41,7 +41,9 @@ export function GameItem({ game }: GameItemProps) {
|
|||||||
setAdded(exists);
|
setAdded(exists);
|
||||||
}, [library, game.shop, game.objectId]);
|
}, [library, game.shop, game.objectId]);
|
||||||
|
|
||||||
const addGameToLibrary = async (event: React.MouseEvent | React.KeyboardEvent) => {
|
const addGameToLibrary = async (
|
||||||
|
event: React.MouseEvent | React.KeyboardEvent
|
||||||
|
) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
if (added || isAddingToLibrary) return;
|
if (added || isAddingToLibrary) return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user