}
};
-const Seed = ({ patch, seed }) => {
+const isDefaultSetting = (name, value) => {
+ switch (name) {
+ case 'area':
+ return value === 'Vanilla';
+ case 'boss':
+ return value === 'Vanilla';
+ case 'doublechaos':
+ return value === 'false';
+ case 'enemy':
+ return value === 'Vanilla';
+ case 'grahm':
+ return value === 'BookSouls';
+ case 'itempool':
+ return value === 'Standard';
+ case 'kicker':
+ return value === 'false';
+ case 'levelexp':
+ return value === 'Vanilla';
+ case 'logic':
+ return value === 'AreaTechTiers';
+ case 'mapassist':
+ return value === 'false';
+ case 'nodupes':
+ return value === 'false';
+ case 'noww':
+ return value === 'false';
+ case 'palette':
+ return value === 'Vanilla';
+ case 'panther':
+ return value === 'Rand70Dup';
+ case 'reqallsouls':
+ return value === 'false';
+ case 'shopprice':
+ return value === 'Vanilla';
+ case 'shopSouls':
+ return value === 'Vanilla';
+ case 'startshop':
+ return value === 'Vanilla';
+ case 'telestart':
+ return value === 'false';
+ case 'weight':
+ return value === '2.5';
+ default:
+ return false;
+ }
+};
+
+const Seed = ({ onRetry, patch, seed }) => {
const { rom } = useAosBaseRom();
return <Container>
<strong>{i18n.t(`aosSeeds.statuses.${seed.status}`)}</strong>
</p>
}
+ {seed.status === 'error' ?
+ <p>
+ <Button
+ onClick={onRetry}
+ variant="secondary"
+ >
+ {i18n.t('button.retry')}
+ </Button>
+ </p>
+ : null}
</Col>
</Row>
<h2 className="mt-5">{i18n.t('aosSeeds.generator')}</h2>
<p>{i18n.t(`aosSeeds.generators.${seed.generator}`)}</p>
+ {seed.settings ? <>
+ <h2 className="mt-5">{i18n.t('aosSeeds.settings')}</h2>
+ <Row>
+ {Object.entries(seed.settings).map(([key, value]) =>
+ <Col key={key} sm={4} md={3} lg={2} className="mb-2">
+ <small className="text-muted">
+ {i18n.t(`aosSeeds.settingName.${key}`)}
+ </small>
+ <br />
+ {isDefaultSetting(key, value) ?
+ i18n.t(`aosSeeds.settingValue.${key}.${value}`)
+ :
+ <strong>{i18n.t(`aosSeeds.settingValue.${key}.${value}`)}</strong>
+ }
+ </Col>
+ )}
+ </Row>
+ </> : null}
</Container>;
};
Seed.propTypes = {
+ onRetry: PropTypes.func,
patch: PropTypes.instanceOf(ArrayBuffer),
seed: PropTypes.shape({
generator: PropTypes.string,
preset: PropTypes.string,
race: PropTypes.bool,
seed: PropTypes.string,
+ settings: PropTypes.shape({
+ }),
status: PropTypes.string,
updated_at: PropTypes.string,
}),