Skip to content

Commit

Permalink
better stance names and tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisinajar committed Aug 1, 2024
1 parent 6b85f85 commit 3a845a6
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions src/components/combat/stance-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,20 @@ import Divider from "@mui/material/Divider";
import { useHero } from "src/hooks/use-hero";
import { HeroStance } from "src/generated/graphql";

const stanceNameMap: { [x in HeroStance]?: string } = {
[HeroStance.Fire]: "Fireball",
[HeroStance.Ice]: "Blizzard",
[HeroStance.Lightning]: "Lightning Bolt",
};

const stanceDescriptions: { [x in HeroStance]: string } = {
[HeroStance.Normal]: "Normal stance with no pros or cons.",

[HeroStance.Combat]: "???",
[HeroStance.Reckless]: "Double accuracy but makes you twice as easy to hit.",
[HeroStance.Aggressive]: "???",
[HeroStance.Defensive]: "???",
[HeroStance.NecroticBeam]: "???",
[HeroStance.CloudofKnives]: "???",
[HeroStance.FrozenOrb]: "???",
[HeroStance.MageArmor]: "???",
[HeroStance.NormalArrow]: "???",
[HeroStance.BarbedArrow]: "???",
[HeroStance.BloodHunter]: "???",
[HeroStance.DarkPresence]: "???",
[HeroStance.AuraoftheLifeless]: "???",
[HeroStance.ShieldSmash]: "???",
[HeroStance.ShieldSlash]: "???",
[HeroStance.HolySmite]: "???",
[HeroStance.VengefulSmite]: "???",
[HeroStance.WarriorsStance]: "???",
[HeroStance.Hexblade]: "???",
[HeroStance.Focus]: "???",

[HeroStance.Fire]: "Converts 20% of magic damage into Fire damage.",
[HeroStance.Ice]: "Converts 20% of magic damage into Ice damage.",
[HeroStance.Lightning]: "Converts 20% of magic damage into Lightning damage.",
};

export function StanceSelector(props: {
Expand All @@ -46,7 +37,8 @@ export function StanceSelector(props: {
return null;
}
const stances = hero.availableStances.map((stance) => ({
name: stance,
name: stanceNameMap[stance] ?? stance,
stance,
tooltip: stanceDescriptions[stance],
}));

Expand Down Expand Up @@ -79,7 +71,7 @@ export function StanceSelector(props: {
sx={{ fontSize: "1rem", padding: 2 }}
size="large"
id={`set-stance-${stance.name.toLowerCase()}`}
onClick={() => handleChangeStance(stance.name)}
onClick={() => handleChangeStance(stance.stance)}
aria-label={`set stance ${stance.name}`}
/* startIcon={<ShieldIcon />} */
>
Expand Down

0 comments on commit 3a845a6

Please sign in to comment.