Skip to content

Commit

Permalink
fix(combat): can no longer eat food while in combat
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Mar 24, 2023
1 parent 7ae3092 commit 649de45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/pages/character/inventory/inventory.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<app-game-icon class="popup-icon" [icon]="item.icon" [inlineIconSize]="true"></app-game-icon> {{ item.name }}
</ion-item>

<ion-item class="cursor-pointer" (click)="eat(item)" *ngIf="item.category === 'Foods' && ((item.oocHealth || 0) > 0 || (item.oocEnergy || 0) > 0)">
<ion-item class="cursor-pointer" (click)="eat(item)" *ngIf="item.category === 'Foods' && ((item.oocHealth || 0) > 0 || (item.oocEnergy || 0) > 0)" [class.hidden]="encounter$ | async">
<ion-label class="ion-text-wrap">
Eat To Heal
<span *ngIf="item.oocHealth || item.oocEnergy">&nbsp;(+{{ item.oocHealth || 0 }}/{{ item.oocEnergy || 0}} HP/Energy)</span>
Expand Down
3 changes: 2 additions & 1 deletion src/app/pages/character/inventory/inventory.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Select, Store } from '@ngxs/store';
import { sortBy, uniq } from 'lodash';
import { Observable, Subscription } from 'rxjs';
import { IGameItem } from '../../../../interfaces';
import { CharSelectState } from '../../../../stores';
import { CharSelectState, CombatState } from '../../../../stores';
import { OOCEatFood } from '../../../../stores/combat/combat.actions';
import { QuickSellItemFromInventory, SellItem, SendToStockpile } from '../../../../stores/mercantile/mercantile.actions';
import { setDiscordStatus } from '../../../helpers/electron';
Expand All @@ -16,6 +16,7 @@ import { setDiscordStatus } from '../../../helpers/electron';
export class InventoryPage implements OnInit, OnDestroy {

@Select(CharSelectState.activeCharacterInventory) inventory$!: Observable<IGameItem[]>;
@Select(CombatState.currentEncounter) encounter$!: Observable<any>;

public activeCategory = '';
public categorySub!: Subscription;
Expand Down

0 comments on commit 649de45

Please sign in to comment.