mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feature: wip-game-achievements
refactor: rename files
This commit is contained in:
parent
fabeedaa8a
commit
8fb62af0cf
18 changed files with 739 additions and 0 deletions
|
@ -5,6 +5,10 @@ import { createGame, updateGamePlaytime } from "./library-sync";
|
|||
import { GameRunning } from "@types";
|
||||
import { PythonInstance } from "./download";
|
||||
import { Game } from "@main/entity";
|
||||
import {
|
||||
startGameAchievementObserver,
|
||||
stopGameAchievementObserver,
|
||||
} from "@main/events/achievements/game-achievements-observer";
|
||||
|
||||
export const gamesPlaytime = new Map<
|
||||
number,
|
||||
|
@ -74,6 +78,8 @@ function onOpenGame(game: Game) {
|
|||
} else {
|
||||
createGame({ ...game, lastTimePlayed: new Date() }).catch(() => {});
|
||||
}
|
||||
|
||||
startGameAchievementObserver(game.id);
|
||||
}
|
||||
|
||||
function onTickGame(game: Game) {
|
||||
|
@ -125,4 +131,6 @@ const onCloseGame = (game: Game) => {
|
|||
} else {
|
||||
createGame(game).catch(() => {});
|
||||
}
|
||||
|
||||
stopGameAchievementObserver(game.id);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue