Add achievements to base game

- Add a script to generate achievement data from Steamworks API
- Add achievements page with a link in sidebar
- Calculate achievements (1/min) with an engine counter
- Store achievements with a timestamp on unlocked in the PlayerObject
- Add a script to generate monochrome icons from Steam icons
- Add toast when unlocking an achievement
This commit is contained in:
Martin Fournier
2022-01-06 07:04:03 -05:00
parent 4363aa43fe
commit 844d518684
23 changed files with 1983 additions and 416 deletions
+10 -1
View File
@@ -76,6 +76,7 @@ import { InvitationModal } from "../Faction/ui/InvitationModal";
import { enterBitNode } from "../RedPill";
import { Context } from "./Context";
import { RecoveryMode, RecoveryRoot } from "./React/RecoveryRoot";
import { AchievementsRoot } from "../Achievements/AchievementsRoot";
const htmlLocation = location;
@@ -183,6 +184,9 @@ export let Router: IRouter = {
toStaneksGift: () => {
throw new Error("Router called before initialization");
},
toAchievements: () => {
throw new Error("Router called before initialization");
}
};
function determineStartPage(player: IPlayer): Page {
@@ -287,6 +291,9 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme
toStaneksGift: () => {
setPage(Page.StaneksGift);
},
toAchievements: () => {
setPage(Page.Achievements);
},
};
useEffect(() => {
@@ -408,7 +415,9 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme
Router.toTerminal();
}}
/>
) : (
) : page === Page.Achievements ? (
<AchievementsRoot />
) : (
<>
<Typography>Cannot load</Typography>
</>