mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: grayscale and update game details context on achievement event
This commit is contained in:
parent
50b34dc864
commit
54dae87a58
7 changed files with 43 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { gameAchievementRepository, gameRepository } from "@main/repository";
|
||||
import { publishNewAchievementNotification } from "../notifications";
|
||||
import type { GameShop, UnlockedAchievement } from "@types";
|
||||
import { WindowManager } from "../window-manager";
|
||||
|
||||
export const mergeAchievements = async (
|
||||
objectId: string,
|
||||
|
|
@ -28,6 +29,14 @@ export const mergeAchievements = async (
|
|||
});
|
||||
});
|
||||
|
||||
if (!newAchievements.length) return;
|
||||
|
||||
WindowManager.mainWindow?.webContents.send(
|
||||
"on-achievement-unlocked",
|
||||
objectId,
|
||||
shop
|
||||
);
|
||||
|
||||
for (const achievement of newAchievements) {
|
||||
const completeAchievement = JSON.parse(
|
||||
localGameAchievement?.achievements || "[]"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue