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
+20
View File
@@ -37,6 +37,7 @@ import CheckIcon from "@mui/icons-material/Check"; // Milestones
import HelpIcon from "@mui/icons-material/Help"; // Tutorial
import SettingsIcon from "@mui/icons-material/Settings"; // options
import DeveloperBoardIcon from "@mui/icons-material/DeveloperBoard"; // Dev
import EmojiEventsIcon from "@mui/icons-material/EmojiEvents"; // Achievements
import AccountBoxIcon from "@mui/icons-material/AccountBox";
import PublicIcon from "@mui/icons-material/Public";
import LiveHelpIcon from "@mui/icons-material/LiveHelp";
@@ -256,6 +257,10 @@ export function SidebarRoot(props: IProps): React.ReactElement {
props.router.toDevMenu();
}
function clickAchievements(): void {
props.router.toAchievements();
}
useEffect(() => {
// Shortcuts to navigate through the game
// Alt-t - Terminal
@@ -747,6 +752,21 @@ export function SidebarRoot(props: IProps): React.ReactElement {
</Typography>
</ListItemText>
</ListItem>
<ListItem
button
key={"Achievements"}
className={clsx({
[classes.active]: props.page === Page.Achievements,
})}
onClick={clickAchievements}
>
<ListItemIcon>
<EmojiEventsIcon color={props.page !== Page.Achievements ? "secondary" : "primary"} />
</ListItemIcon>
<ListItemText>
<Typography color={props.page !== Page.Achievements ? "secondary" : "primary"}>Achievements</Typography>
</ListItemText>
</ListItem>
<ListItem
button
key={"Options"}