generated from nhcarrigan/template
feat: add transcendence and apotheosis badges to public profile
- PublicProfileResponse now includes transcendenceCount and apotheosisCount - ProfileSettings adds showTranscendence and showApotheosis toggles (both on by default) - Profile page displays ✨ Apotheosis, 🌌 Transcendence, and ⭐ Prestige badges in that order - EditProfileModal exposes the two new visibility toggles under Current Run settings - Styled to match the resource bar badges (gold for apotheosis, purple for transcendence)
This commit is contained in:
@@ -30,6 +30,8 @@ const parseProfileSettings = (raw: unknown): ProfileSettings => {
|
||||
showCurrentGold: obj.showCurrentGold !== false,
|
||||
showCurrentClicks: obj.showCurrentClicks !== false,
|
||||
showPrestige: obj.showPrestige !== false,
|
||||
showTranscendence: obj.showTranscendence !== false,
|
||||
showApotheosis: obj.showApotheosis !== false,
|
||||
showBossesDefeated: obj.showBossesDefeated !== false,
|
||||
showQuestsCompleted: obj.showQuestsCompleted !== false,
|
||||
showAdventurersRecruited: obj.showAdventurersRecruited !== false,
|
||||
@@ -54,6 +56,8 @@ profileRouter.get("/:discordId", async (context) => {
|
||||
|
||||
const state = gameStateRecord?.state as unknown as GameState | undefined;
|
||||
const prestigeCount = state?.prestige.count ?? 0;
|
||||
const transcendenceCount = state?.transcendence?.count ?? 0;
|
||||
const apotheosisCount = state?.apotheosis?.count ?? 0;
|
||||
const profileSettings = parseProfileSettings(player.profileSettings);
|
||||
|
||||
const bossesDefeated = state?.bosses.filter((b) => b.status === "defeated").length ?? 0;
|
||||
@@ -81,6 +85,8 @@ profileRouter.get("/:discordId", async (context) => {
|
||||
currentRunGold: state?.player.totalGoldEarned ?? 0,
|
||||
currentRunClicks: state?.player.totalClicks ?? 0,
|
||||
prestigeCount,
|
||||
transcendenceCount,
|
||||
apotheosisCount,
|
||||
bossesDefeated,
|
||||
questsCompleted,
|
||||
adventurersRecruited,
|
||||
@@ -108,6 +114,8 @@ profileRouter.put("/", authMiddleware, async (context) => {
|
||||
showCurrentGold: body.profileSettings?.showCurrentGold !== false,
|
||||
showCurrentClicks: body.profileSettings?.showCurrentClicks !== false,
|
||||
showPrestige: body.profileSettings?.showPrestige !== false,
|
||||
showTranscendence: body.profileSettings?.showTranscendence !== false,
|
||||
showApotheosis: body.profileSettings?.showApotheosis !== false,
|
||||
showBossesDefeated: body.profileSettings?.showBossesDefeated !== false,
|
||||
showQuestsCompleted: body.profileSettings?.showQuestsCompleted !== false,
|
||||
showAdventurersRecruited: body.profileSettings?.showAdventurersRecruited !== false,
|
||||
|
||||
Reference in New Issue
Block a user