New source found from dndbeyond.com
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
import axios, { Canceler } from "axios";
|
||||
import React from "react";
|
||||
import { connect, DispatchProp } from "react-redux";
|
||||
import { AnyAction } from "redux";
|
||||
|
||||
import {
|
||||
Button,
|
||||
LoadingPlaceholder,
|
||||
Select,
|
||||
} from "@dndbeyond/character-components/es";
|
||||
import { Button, LoadingPlaceholder } from "@dndbeyond/character-components/es";
|
||||
import {
|
||||
ApiAdapterPromise,
|
||||
ApiAdapterRequestConfig,
|
||||
@@ -30,9 +27,11 @@ import {
|
||||
StartingEquipmentSlotContract,
|
||||
TypeValueLookup,
|
||||
DefinitionUtils,
|
||||
HtmlSelectOption,
|
||||
} from "@dndbeyond/character-rules-engine/es";
|
||||
|
||||
import { Link } from "~/components/Link";
|
||||
import { Select } from "~/components/Select";
|
||||
|
||||
// TODO need to remove this builder reference and replace with better heading
|
||||
import PageSubHeader from "../../../CharacterBuilder/components/PageSubHeader";
|
||||
@@ -42,6 +41,7 @@ import * as apiCreatorSelectors from "../../selectors/composite/apiCreator";
|
||||
import { SharedAppState } from "../../stores/typings";
|
||||
import { AppLoggerUtils, AppNotificationUtils } from "../../utils";
|
||||
import StartingEquipmentSlots from "./StartingEquipmentSlots";
|
||||
import styles from "./styles.module.css";
|
||||
import { StartingEquipmentRuleSlotSelection } from "./typings";
|
||||
|
||||
//duplicated from characterActions typingParts to avoid import issues
|
||||
@@ -51,6 +51,8 @@ interface StartingEquipmentAddRequestPayloadItem {
|
||||
entityId: number;
|
||||
entityTypeId: number;
|
||||
quantity: number;
|
||||
originEntityId: number | null;
|
||||
originEntityTypeId: number | null;
|
||||
}
|
||||
//duplicated from characterActions typingParts to avoid import issues
|
||||
interface StartingEquipmentAddRequestPayload {
|
||||
@@ -75,7 +77,9 @@ interface RuleChoiceGroupClearPayload {
|
||||
groupKey: RuleSlotChoiceKey;
|
||||
}
|
||||
|
||||
interface Props extends DispatchProp {
|
||||
// TODO: We are typing with AnyAction here to work around issues with UnknownAction, the type that was introduced in Redux 5.
|
||||
// If we decide to modernize to Redux 5, we will need to refactor much of the Rules Engine redux usage.
|
||||
interface Props extends DispatchProp<AnyAction> {
|
||||
isInitialView: boolean;
|
||||
onStartingEquipmentChoose?: () => void;
|
||||
startingClass: CharClass | null;
|
||||
@@ -527,6 +531,8 @@ class StartingEquipment extends React.PureComponent<Props, State> {
|
||||
entityId: item.id,
|
||||
entityTypeId: item.entityTypeId,
|
||||
quantity: rule.quantity ? rule.quantity : 1,
|
||||
originEntityId: null, //This was added for 2024 Artificer - they could be used for the starting equipment data origin
|
||||
originEntityTypeId: null, //This was added for 2024 Artificer - they could be used for the starting equipment data origin
|
||||
});
|
||||
}
|
||||
break;
|
||||
@@ -673,9 +679,9 @@ class StartingEquipment extends React.PureComponent<Props, State> {
|
||||
diceValues = DiceUtils.getDiceValuesRange(wealthDice);
|
||||
}
|
||||
|
||||
const diceOptions = diceValues.map((value) => ({
|
||||
const diceOptions: Array<HtmlSelectOption> = diceValues.map((value) => ({
|
||||
value,
|
||||
label: value,
|
||||
label: String(value),
|
||||
}));
|
||||
|
||||
let totalGold = this.getStartingGoldTotal();
|
||||
@@ -691,10 +697,13 @@ class StartingEquipment extends React.PureComponent<Props, State> {
|
||||
</div>
|
||||
<div className="starting-equipment-gold-entry-input">
|
||||
<Select
|
||||
className={styles.select}
|
||||
placeholder={`${diceCount}d${diceValue}`}
|
||||
options={diceOptions}
|
||||
onChange={this.handleGoldRolledNumberChange}
|
||||
value={rolledGoldTotal}
|
||||
name="starting-gold-rolled"
|
||||
searchThreshold={null}
|
||||
/>
|
||||
</div>
|
||||
<div className="starting-equipment-gold-entry-multiplier">
|
||||
|
||||
Reference in New Issue
Block a user