Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions app/account/companions/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const CompanionBox = ({ companion, editable = false, setOwned }: { companion: Co
onChange={handleChecked}
/>
<IconImage data={companion.imageData} />
<Text>{companion.name}</Text>
</Box>
<Text>{companion.getBonus()}</Text>
</ShadowBox>
Expand All @@ -56,7 +57,7 @@ function CompanionDisplay() {
const setOwned = (companion: Companion, owned: boolean) => {
companion.owned = owned;
}

const editCompanions = () => {
setAllowEditing(true);
}
Expand Down Expand Up @@ -96,7 +97,11 @@ function CompanionDisplay() {
</Box>
<Grid columns={{ size: 'auto', count: 4 }} gap="medium">
{
companions.map((companion, index) => <CompanionBox key={index} companion={companion} editable={allowEditing} setOwned={setOwned} />)
companions
.filter((companion) => companion.data.desc !== 'Not officially in the game and may never be')
.map((companion, index) =>
<CompanionBox key={index} companion={companion} editable={allowEditing} setOwned={setOwned} />
)
}
</Grid>
</Box>
Expand Down
4 changes: 2 additions & 2 deletions data/domain/companions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Player } from "./player";
export class Companion {
owned: boolean = false;
real: boolean = false;
constructor(public id: number, public data: CompanionModel, public imageData: ImageData) { }
constructor(public id: number, public name: string, public data: CompanionModel, public imageData: ImageData) { }

getBonus = () => {
return this.data.desc.replace(/{/g, "+");
Expand All @@ -23,7 +23,7 @@ export class Companion {
const enemy = EnemyInfo.find(enemy => enemy.id == c.data.id);
const imageData = { location: enemy?.id.toLowerCase() ?? "Unknown", width: 67, height: 67 }

return new Companion(c.index, c.data, imageData);
return new Companion(c.index, enemy?.details.Name ?? "Unknown", c.data, imageData);
});
}
}
Expand Down
Loading