Skip to content

Commit 62b18b9

Browse files
committed
feat: add support for anomalies (in traditional Hearthstone)
1 parent f1202d1 commit 62b18b9

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

src/twitch-hdt.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ export interface BoardStateData {
3030
*/
3131
opponent?: BoardStatePlayer;
3232

33+
/**
34+
* The dbfId of the anomaly in traditional Hearthstone.
35+
*/
36+
traditional_anomaly?: number;
37+
3338
/**
3439
* The dbfId of the Battleground anomaly.
3540
*/

src/viewer/overlay/Overlay.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ const Trinket = styled(OverlayElement)`
156156
clip-path: circle(50% at 50% 50%);
157157
`;
158158

159+
const TraditionalAnomaly = styled(OverlayElement)`
160+
top: ${(props) => props.top || "unset"};
161+
left: ${(props) => props.left || "unset"};
162+
163+
height: 6.5vh;
164+
width: 6.5vh;
165+
clip-path: circle(50% at 50% 50%);
166+
`;
167+
159168
const BattlegroundsAnomaly = styled(OverlayElement)`
160169
top: ${(props) => props.top || "unset"};
161170
right: ${(props) => props.right || "unset"};
@@ -341,7 +350,12 @@ class Overlay extends React.Component<Props & TwitchExtProps, State> {
341350
const opponent =
342351
boardState && boardState.opponent ? boardState.opponent : {};
343352

344-
const anomaly =
353+
const traditionalAnomaly =
354+
boardState && boardState.traditional_anomaly
355+
? boardState.traditional_anomaly
356+
: null;
357+
358+
const battlegroundsAnomaly =
345359
boardState && boardState.battlegrounds_anomaly
346360
? boardState.battlegrounds_anomaly
347361
: null;
@@ -600,6 +614,10 @@ class Overlay extends React.Component<Props & TwitchExtProps, State> {
600614
</Weapon>
601615
)}
602616

617+
<TraditionalAnomaly left={"26.5vh"} top={"27vh"}>
618+
<Entity dbfId={traditionalAnomaly || null} />
619+
</TraditionalAnomaly>
620+
603621
{!ignoreDeck ? (
604622
<>
605623
<Deck top={"24vh"} right={"24vh"}>
@@ -635,7 +653,7 @@ class Overlay extends React.Component<Props & TwitchExtProps, State> {
635653
</>
636654
) : null}
637655
<BattlegroundsAnomaly right={"24vh"} top={"34.5vh"}>
638-
<Entity dbfId={anomaly || null} />
656+
<Entity dbfId={battlegroundsAnomaly || null} />
639657
</BattlegroundsAnomaly>
640658
</Offset>
641659
)}

0 commit comments

Comments
 (0)