Skip to content

Commit

Permalink
fix(combat): items should show the effect name, not key
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Mar 17, 2023
1 parent 7a88e90 commit 47b6ec1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@
{{ item.name }}
</div>

<div class="effect" *ngIf="effectInfo && showEffectInfo">
<strong>{{ item.effects?.[0]?.effect }}</strong>: {{ effectInfo }}
</div>
<ng-container *ngIf="showEffectInfo">
<div class="effect" *ngFor="let effect of item.effects">
<ng-container *ngIf="getAbility(effect.effect) as effectRef">
<strong>{{ effectRef.name }}</strong>: {{ effectRef.description }}
</ng-container>
</div>
</ng-container>

<div class="effect-uses" *ngIf="effectInfo && showEffectInfo && showUses">
<div class="effect-uses" *ngIf="showEffectInfo && showUses">
<ion-text color="energy">{{ item.durability }} Use(s)</ion-text>
</div>
</ion-col>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { IGameItem } from '../../../interfaces';
import { IGameCombatAbility, IGameItem } from '../../../interfaces';
import { getItemRarityClass } from '../../helpers';
import { ContentService } from '../../services/content.service';

Expand All @@ -18,16 +18,12 @@ export class CombatItemDisplayComponent implements OnInit {
return getItemRarityClass(this.item);
}

get effectInfo() {
if(!this.item.effects) {
return '';
}

return this.contentService.getAbilityByName(this.item.effects[0].effect)?.description || '';
}

constructor(private contentService: ContentService) { }

ngOnInit() {}

getAbility(name: string): IGameCombatAbility {
return this.contentService.getAbilityByName(name) || '';
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export class RefiningPageDisplayComponent implements OnInit, OnChanges, OnDestro
this.setTotalResources();

this.resourcesSub = this.resources$.subscribe((resources) => {
console.log({ resources });
this.resources = resources;

this.setVisibleRecipes();
Expand Down

0 comments on commit 47b6ec1

Please sign in to comment.