filter out selected moves
This commit is contained in:
parent
f991d9ff1f
commit
c923b21a78
2
dist/main-bundle.js
vendored
2
dist/main-bundle.js
vendored
File diff suppressed because one or more lines are too long
@ -50,6 +50,29 @@ export class MovesExplorer extends React.Component<IMovesExplorerProps> {
|
|||||||
styles.wrapper,
|
styles.wrapper,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const chargeMove1Options = chargeMoves.slice(0);
|
||||||
|
const chargeMove2Options = chargeMoves.slice(0);
|
||||||
|
|
||||||
|
if (chargeMove1) {
|
||||||
|
chargeMove2Options.some((move, index) => {
|
||||||
|
if (move.id === chargeMove1.id) {
|
||||||
|
chargeMove2Options.splice(index, 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chargeMove2) {
|
||||||
|
chargeMove1Options.some((move, index) => {
|
||||||
|
if (move.id === chargeMove2.id) {
|
||||||
|
chargeMove1Options.splice(index, 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={ wrapperCss }>
|
<div className={ wrapperCss }>
|
||||||
<h3 className="title">Move Selection</h3>
|
<h3 className="title">Move Selection</h3>
|
||||||
@ -67,7 +90,7 @@ export class MovesExplorer extends React.Component<IMovesExplorerProps> {
|
|||||||
menuLabel="Charge Move 1"
|
menuLabel="Charge Move 1"
|
||||||
movesById={ movesById }
|
movesById={ movesById }
|
||||||
selectedMove={ chargeMove1 }
|
selectedMove={ chargeMove1 }
|
||||||
options={ chargeMoves }
|
options={ chargeMove1Options }
|
||||||
handleToggleOpen={ this.handleToggleChargeMove1Menu }
|
handleToggleOpen={ this.handleToggleChargeMove1Menu }
|
||||||
handleChangeSelectedOption={ this.handleChangeChargeMove1 }
|
handleChangeSelectedOption={ this.handleChangeChargeMove1 }
|
||||||
/>
|
/>
|
||||||
@ -76,7 +99,7 @@ export class MovesExplorer extends React.Component<IMovesExplorerProps> {
|
|||||||
menuLabel="Charge Move 2"
|
menuLabel="Charge Move 2"
|
||||||
movesById={ movesById }
|
movesById={ movesById }
|
||||||
selectedMove={ chargeMove2 }
|
selectedMove={ chargeMove2 }
|
||||||
options={ chargeMoves }
|
options={ chargeMove2Options }
|
||||||
handleToggleOpen={ this.handleToggleChargeMove2Menu }
|
handleToggleOpen={ this.handleToggleChargeMove2Menu }
|
||||||
handleChangeSelectedOption={ this.handleChangeChargeMove2 }
|
handleChangeSelectedOption={ this.handleChangeChargeMove2 }
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user