0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-18 12:12:43 +00:00

Nearly done, jsut need to clean up the json file and add local storage support

This commit is contained in:
Scott Tolksdorf
2015-11-16 00:52:29 -05:00
parent 3627ee3b49
commit e6e87457da
11 changed files with 214 additions and 44 deletions

View File

@@ -105,6 +105,8 @@ var NaturalCrit = React.createClass({
encounters : encounters,
monsterManual : MonsterManual,
players : 'jasper 13'
};
},
@@ -142,19 +144,21 @@ var NaturalCrit = React.createClass({
handleJSONChange : function(encounterIndex, json){
this.state.encounters[encounterIndex] = json;
this.setState({
encounters : this.state.encounters
})
},
handleEncounterChange : function(encounterIndex){
this.setState({
selectedEncounterIndex : encounterIndex
});
},
handlePlayerChange : function(e){
this.setState({
players : e.target.value
});
},
renderSelectedEncounter : function(){
@@ -169,6 +173,7 @@ var NaturalCrit = React.createClass({
key={selectedEncounter.name}
{...selectedEncounter}
monsterManual={this.state.monsterManual}
players={this.state.players}
/>
}
@@ -187,14 +192,15 @@ var NaturalCrit = React.createClass({
selectedEncounter={this.state.selectedEncounterIndex}
encounters={this.state.encounters}
monsterManual={this.state.monsterManual}
players={this.state.players}
onSelectEncounter={this.handleEncounterChange}
onJSONChange={this.handleJSONChange}
onPlayerChange={this.handlePlayerChange}
/>
<div className='encounterContainer'>
{this.renderSelectedEncounter()}
</div>
</div>
);