mirror of
https://github.com/chaoticbackup/chaoticbackup.github.io.git
synced 2026-04-03 15:45:33 -05:00
unique, loyal, legendary
This commit is contained in:
parent
fb7ac94ab6
commit
18a577ef99
File diff suppressed because one or more lines are too long
|
|
@ -12,21 +12,25 @@ import loki from 'lokijs';
|
|||
|
||||
@inject((stores, props, context) => props) @observer
|
||||
export default class SearchForm extends React.Component {
|
||||
type = "";
|
||||
swamp = "or";
|
||||
stones = {};
|
||||
tribes = {};
|
||||
elements = {};
|
||||
rarity = {};
|
||||
sets = {};
|
||||
gender = {};
|
||||
mc = {};
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.reset();
|
||||
this.filter = new loki("filter.db");
|
||||
}
|
||||
|
||||
reset = () => {
|
||||
this.type = "";
|
||||
this.swamp = "or";
|
||||
this.stones = {};
|
||||
this.tribes = {};
|
||||
this.elements = {};
|
||||
this.rarity = {};
|
||||
this.sets = {};
|
||||
this.gender = {};
|
||||
this.mc = {};
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
let setsInput = [];
|
||||
|
|
@ -84,6 +88,12 @@ export default class SearchForm extends React.Component {
|
|||
<label>Max Mugic Counters: <input type="text" style={{width: '20px'}} ref={(input) => this.mc.max = input} /></label>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<label><input type="checkbox" ref={(input) => this.stones.unique = input}/>Unique</label>
|
||||
<label><input type="checkbox" ref={(input) => this.stones.loyal = input}/>loyal</label>
|
||||
<label><input type="checkbox" ref={(input) => this.stones.legendary = input}/>Male</label>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<label><input type="checkbox" ref={(input) => this.gender.Ambiguous = input}/>Ambiguous</label>
|
||||
<label><input type="checkbox" ref={(input) => this.gender.Female = input}/>Female</label>
|
||||
|
|
@ -96,7 +106,8 @@ export default class SearchForm extends React.Component {
|
|||
<label>"Show all cards":<input type="checkbox" ref={(input) => this.stones.allCards = input}/></label>
|
||||
</p>
|
||||
<br />
|
||||
<input type="submit" value="Search" /> <input type="button" disabled value="Reset" />
|
||||
<input type="submit" value="Search" />
|
||||
<input type="button" value="Reset" disabled onClick={this.reset} />
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
|
|
@ -240,6 +251,21 @@ export default class SearchForm extends React.Component {
|
|||
creatureResults = creatureResults.find({'gsx$mugicability': {'$lte': this.mc.max.value}});
|
||||
}
|
||||
|
||||
if (this.stones.unique.checked) {
|
||||
creatureResults = creatureResults.find({'gsx$unique': {'$gt': 0}});
|
||||
attackResults = attackResults.find({'gsx$unique': {'$gt': 0}});
|
||||
}
|
||||
|
||||
if (this.stones.loyal.checked) {
|
||||
creatureResults = creatureResults.find({'gsx$loyal': {'$gt': 0}});
|
||||
attackResults = attackResults.find({'gsx$loyal': {'$gt': 0}});
|
||||
}
|
||||
|
||||
if (this.stones.legendary.checked) {
|
||||
creatureResults = creatureResults.find({'gsx$legendary': {'$gt': 0}});
|
||||
attackResults = attackResults.find({'gsx$legendary': {'$gt': 0}});
|
||||
}
|
||||
|
||||
// Merge data
|
||||
if (!this.type || this.type=="Creature") {
|
||||
let temp = creatureResults.data()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user