|
|
@ -40,7 +40,7 @@ import Tractor from '../tractor/Tractor.jsx'
|
|
|
|
import { GAME_STATES, ALERTS } from '../../constants.js'
|
|
|
|
import { GAME_STATES, ALERTS } from '../../constants.js'
|
|
|
|
import { itemCard, itemCardShort, fateCard, ridgeNames } from 'game.js'
|
|
|
|
import { itemCard, itemCardShort, fateCard, ridgeNames } from 'game.js'
|
|
|
|
import { setSelectedCard, setMessagePanelSpace, setMPDims, movePlayer,
|
|
|
|
import { setSelectedCard, setMessagePanelSpace, setMPDims, movePlayer,
|
|
|
|
nextUIAction, alert, alertHandled } from './actions.js'
|
|
|
|
nextUIAction, alert, alertHandled, setCardError } from './actions.js'
|
|
|
|
import { buy, roll, endTurn, loan, trade, submitTradeAccept,
|
|
|
|
import { buy, roll, endTurn, loan, trade, submitTradeAccept,
|
|
|
|
submitTradeDeny, submitTradeCancel, audit,
|
|
|
|
submitTradeDeny, submitTradeCancel, audit,
|
|
|
|
buyUncleBert, skip } from './interface.js'
|
|
|
|
buyUncleBert, skip } from './interface.js'
|
|
|
@ -1673,12 +1673,14 @@ class BoardApp extends React.Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={this.tabClass(SCREENS.cards)}>
|
|
|
|
<div className={this.tabClass(SCREENS.cards)}>
|
|
|
|
<Row>
|
|
|
|
<Row>
|
|
|
|
<div className='cell medium-auto'>
|
|
|
|
<Col width="12">
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<CardList ui={this.props.ui} cardId={this.state.card.id}
|
|
|
|
<CardList ui={this.props.ui} cardId={this.state.card.id}
|
|
|
|
setCard={this.setCard} />
|
|
|
|
setCard={this.setCard} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className='cell medium-auto'>
|
|
|
|
<div>
|
|
|
|
<Card ui={this.props.ui}
|
|
|
|
<Card ui={this.props.ui}
|
|
|
|
|
|
|
|
setCardError={this.props.setCardError}
|
|
|
|
playerCash={this.props.player.cash}
|
|
|
|
playerCash={this.props.player.cash}
|
|
|
|
playerDebt={this.props.player.debt}
|
|
|
|
playerDebt={this.props.player.debt}
|
|
|
|
card={this.state.card}
|
|
|
|
card={this.state.card}
|
|
|
@ -1687,6 +1689,7 @@ class BoardApp extends React.Component {
|
|
|
|
max={Math.floor(Math.min(this.props.player.cash / 1000, this.state.card.total / 1000))}
|
|
|
|
max={Math.floor(Math.min(this.props.player.cash / 1000, this.state.card.total / 1000))}
|
|
|
|
cash={(this.state.card.total * this.props.game.settings.downPayment) / 1000} />
|
|
|
|
cash={(this.state.card.total * this.props.game.settings.downPayment) / 1000} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={this.tabClass(SCREENS.loans)}>
|
|
|
|
<div className={this.tabClass(SCREENS.loans)}>
|
|
|
@ -1730,7 +1733,7 @@ class BoardApp extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
export default connect(
|
|
|
|
state => state.farm,
|
|
|
|
state => state.farm,
|
|
|
|
{ setMessagePanelSpace, setMPDims, nextUIAction, movePlayer, alert, alertHandled }
|
|
|
|
{ setMessagePanelSpace, setMPDims, nextUIAction, movePlayer, alert, alertHandled, setCardError }
|
|
|
|
)(BoardApp)
|
|
|
|
)(BoardApp)
|
|
|
|
|
|
|
|
|
|
|
|
class Card extends React.Component {
|
|
|
|
class Card extends React.Component {
|
|
|
@ -1755,6 +1758,7 @@ class Card extends React.Component {
|
|
|
|
parseInt(target.value)), this.props.max);
|
|
|
|
parseInt(target.value)), this.props.max);
|
|
|
|
if (isNaN(value)) { value = this.props.min; }
|
|
|
|
if (isNaN(value)) { value = this.props.min; }
|
|
|
|
this.setState({ cash: value });
|
|
|
|
this.setState({ cash: value });
|
|
|
|
|
|
|
|
this.props.setCardError(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
handleSubmit = e => {
|
|
|
|
handleSubmit = e => {
|
|
|
@ -1799,6 +1803,13 @@ class Card extends React.Component {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
{this.props.ui.cardError ? (
|
|
|
|
|
|
|
|
<Row>
|
|
|
|
|
|
|
|
<Col width="12">
|
|
|
|
|
|
|
|
<span className="error">{this.props.ui.cardError}</span>
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
) : (<></>)}
|
|
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
|
</div>); break;
|
|
|
|
</div>); break;
|
|
|
@ -1831,7 +1842,7 @@ class CardListComp extends React.Component {
|
|
|
|
cards = ui.cards,
|
|
|
|
cards = ui.cards,
|
|
|
|
cardOps = cards.map((c, i) =>
|
|
|
|
cardOps = cards.map((c, i) =>
|
|
|
|
(<li key={i} className={c.id == this.props.cardId ? 'card-select-selected' : ''}
|
|
|
|
(<li key={i} className={c.id == this.props.cardId ? 'card-select-selected' : ''}
|
|
|
|
onClick={() => this.props.setCard(c)}>
|
|
|
|
onClick={() => { this.props.setCard(c); this.props.setCardError(false); }}>
|
|
|
|
{c.summary}
|
|
|
|
{c.summary}
|
|
|
|
</li>));
|
|
|
|
</li>));
|
|
|
|
|
|
|
|
|
|
|
@ -1847,5 +1858,5 @@ class CardListComp extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
const CardList = connect(
|
|
|
|
const CardList = connect(
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
{ setSelectedCard }
|
|
|
|
{ setSelectedCard, setCardError }
|
|
|
|
)(CardListComp)
|
|
|
|
)(CardListComp)
|
|
|
|