Skip to content

Commit

Permalink
feat(overlay): battlegrounds anomalies
Browse files Browse the repository at this point in the history
  • Loading branch information
beheh committed Aug 22, 2023
1 parent 6ece942 commit 4c48d04
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/twitch-hdt.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export interface BoardStateData {
*/
opponent?: BoardStatePlayer;

/**
* The dbfId of the Battleground anomaly.
*/
battlegrounds_anomaly?: number;

/**
* Contains the game type of the current game.
*/
Expand Down
17 changes: 17 additions & 0 deletions src/viewer/overlay/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ const Weapon = styled(OverlayElement)`
clip-path: circle(50% at 50% 50%);
`;

const BattlegroundsAnomaly = styled(OverlayElement)`
top: ${(props) => props.top || "unset"};
right: ${(props) => props.right || "unset"};
height: 8.5vh;
width: 8.5vh;
clip-path: circle(50% at 50% 50%);
`;

const Deck = styled(OverlayElement)`
top: ${(props) => props.top || "unset"};
right: ${(props) => props.right || "unset"};
Expand Down Expand Up @@ -322,6 +331,11 @@ class Overlay extends React.Component<Props & TwitchExtProps, State> {
const opponent =
boardState && boardState.opponent ? boardState.opponent : {};

const anomaly =
boardState && boardState.battlegrounds_anomaly
? boardState.battlegrounds_anomaly
: null;

const gameType =
boardState && boardState.game_type
? boardState.game_type
Expand Down Expand Up @@ -585,6 +599,9 @@ class Overlay extends React.Component<Props & TwitchExtProps, State> {
</Deck>
</>
) : null}
<BattlegroundsAnomaly right={"24vh"} top={"34.5vh"}>
<Entity dbfId={anomaly || null} />
</BattlegroundsAnomaly>
</Offset>
)}
</PortalProvider>
Expand Down

0 comments on commit 4c48d04

Please sign in to comment.