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