New source found from dndbeyond.com
This commit is contained in:
+9
-2
@@ -64,12 +64,19 @@ export default class ClassFeatureSnippet extends React.PureComponent<Props> {
|
||||
};
|
||||
|
||||
renderDescription = (): React.ReactNode => {
|
||||
const { feature, showDescription } = this.props;
|
||||
const { feature, showDescription, charClass } = this.props;
|
||||
|
||||
const isStartingClass = ClassUtils.isStartingClass(charClass);
|
||||
const multiClassDescription =
|
||||
ClassFeatureUtils.getMultiClassDescription(feature);
|
||||
|
||||
// If the class feature is accessible, show the description or multi-class description, otherwise show a "Check out the Marketplace" message.
|
||||
const description: string | null = AccessUtils.isAccessible(
|
||||
ClassFeatureUtils.getAccessType(feature)
|
||||
)
|
||||
? ClassFeatureUtils.getDescription(feature)
|
||||
? !isStartingClass && multiClassDescription
|
||||
? multiClassDescription
|
||||
: ClassFeatureUtils.getDescription(feature)
|
||||
: "Check out the Marketplace to unlock this Class Feature.";
|
||||
|
||||
return showDescription
|
||||
|
||||
+2
-3
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { RacialTraitAccessors } from "@dndbeyond/character-rules-engine/es/engine/RacialTrait";
|
||||
|
||||
import {
|
||||
AbilityLookup,
|
||||
BaseFeat,
|
||||
@@ -16,7 +16,6 @@ import {
|
||||
CharacterFeaturesManager,
|
||||
} from "@dndbeyond/character-rules-engine/es";
|
||||
|
||||
|
||||
import { DataOriginTypeEnum } from "~/constants";
|
||||
import { FeatureSnippet } from "~/subApps/sheet/components/FeatureSnippet";
|
||||
|
||||
@@ -83,7 +82,7 @@ export default class SpeciesTraitFeatureSnippet extends React.PureComponent<Prop
|
||||
|
||||
const feats = featuresManager.getDataOriginOnlyFeatsByPrimary(
|
||||
DataOriginTypeEnum.RACE,
|
||||
`${RacialTraitAccessors.getId(speciesTrait)}`
|
||||
`${RacialTraitUtils.getId(speciesTrait)}`
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user