0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-03 01:52:42 +00:00

Polishing up the monster card

This commit is contained in:
Scott Tolksdorf
2015-11-14 18:29:51 -05:00
parent 3dee96ad38
commit 3b16e16958
5 changed files with 92 additions and 46 deletions

View File

@@ -40,6 +40,7 @@ var AttackSlot = React.createClass({
if(diceRoll[0] == 20) res = 'Crit!';
}
this.state.lastRoll[key] = res
this.state.lastRoll[key + 'key'] = _.uniqueId(key);
this.setState({
lastRoll : this.state.lastRoll
})
@@ -67,8 +68,8 @@ var AttackSlot = React.createClass({
renderNotes : function(){
var notes = _.omit(this.props, ['name', 'atk', 'dmg', 'uses', 'heal']);
return _.map(notes, function(text, key){
return key + ': ' + text
}).join(', ');
return <div>{key + ': ' + text}</div>
});
},
renderRolls : function(){
@@ -86,7 +87,7 @@ var AttackSlot = React.createClass({
})} />
{self.props[type]}
</button>
<span>{self.state.lastRoll[type] || ''}</span>
<span key={self.state.lastRoll[type+'key']}>{self.state.lastRoll[type] || ''}</span>
</div>
})