Skip to content

Commit

Permalink
Hide stats from cards with HIDE_STATS
Browse files Browse the repository at this point in the history
Closes #128
  • Loading branch information
jleclanche committed Sep 4, 2016
1 parent 2fff3c5 commit dbd8dae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Shrinkwrap dependencies
- Add `gulp sentry:release`
- Add ES2015 polyfills using babel-polyfill
- Hide statistics for minions with HIDE_STATS (#128)

### Changed
- Replace own HearthstoneJSON implementation with common one
Expand Down
7 changes: 6 additions & 1 deletion ts/components/game/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ class Card extends React.Component<CardProps, {}> {
switch (cardType) {
case CardType.MINION:
classNames.push("card-minion");
if (entity.getTag(GameTag.HIDE_STATS)) {
break;
};
var attack = <Attack attack={!this.props.isHidden && !this.props.defaultStats ? entity.getAtk() : defaultAttack}
default={defaultAttack}/>;
var health = <Health health={!this.props.isHidden && !this.props.defaultStats ? entity.getHealth() : defaultHealth}
Expand Down Expand Up @@ -190,7 +193,9 @@ class Card extends React.Component<CardProps, {}> {
cardArtDirectory={this.props.cardArtDirectory}
mulligan={this.props.mulligan}
/>
<Cost cost={!this.props.isHidden && !this.props.defaultStats ? entity.getCost() : defaultCost} default={defaultCost}/>
{entity.getTag(GameTag.HIDE_STATS) == 0 ?
<Cost cost={!this.props.isHidden && !this.props.defaultStats ? entity.getCost() : defaultCost} default={defaultCost}/>
: null}
<h1>{title}</h1>
<div className="description">
<p style={textStyle} dangerouslySetInnerHTML={{ __html: description }}></p>
Expand Down

0 comments on commit dbd8dae

Please sign in to comment.