diff --git a/client/naturalCrit/encounter/monsterCard/monsterCard.less b/client/naturalCrit/encounter/monsterCard/monsterCard.less index 22e4356d0..4c0eb97cf 100644 --- a/client/naturalCrit/encounter/monsterCard/monsterCard.less +++ b/client/naturalCrit/encounter/monsterCard/monsterCard.less @@ -1,13 +1,5 @@ @marginSize : 10px; -.noselect(){ - -webkit-touch-callout : none; - -webkit-user-select : none; - -khtml-user-select : none; - -moz-user-select : none; - -ms-user-select : none; - user-select : none; -} .playerCard{ display : inline-block; box-sizing : border-box; diff --git a/client/naturalCrit/naturalCrit.less b/client/naturalCrit/naturalCrit.less index 94ccc122f..a39709234 100644 --- a/client/naturalCrit/naturalCrit.less +++ b/client/naturalCrit/naturalCrit.less @@ -24,4 +24,13 @@ body{ display: inline-block; vertical-align: top; } +} + +.noselect(){ + -webkit-touch-callout : none; + -webkit-user-select : none; + -khtml-user-select : none; + -moz-user-select : none; + -ms-user-select : none; + user-select : none; } \ No newline at end of file diff --git a/client/naturalCrit/sidebar/dmDice/dmDice.jsx b/client/naturalCrit/sidebar/dmDice/dmDice.jsx index f8f932091..6bc0fa61c 100644 --- a/client/naturalCrit/sidebar/dmDice/dmDice.jsx +++ b/client/naturalCrit/sidebar/dmDice/dmDice.jsx @@ -2,13 +2,55 @@ var React = require('react'); var _ = require('lodash'); var cx = require('classnames'); +var RollDice = require('naturalCrit/rollDice'); + var DmDice = React.createClass({ + getInitialState: function() { + return { + lastRoll:{ }, + diceNotation : { + a : "1d20", + b : "6d6 + 3", + c : "1d20 - 1" + } + + }; + }, + + roll : function(id){ + this.state.lastRoll[id] = RollDice(this.state.diceNotation[id]); + this.setState({ + lastRoll : this.state.lastRoll + }); + }, + handleChange : function(id, e){ + this.state.diceNotation[id] = e.target.value; + this.setState({ + diceNotation : this.state.diceNotation + }); + + e.stopPropagation(); + e.preventDefault(); + }, + + renderRolls : function(){ + var self = this; + return _.map(['a', 'b', 'c'], function(id){ + return