buyShopItem(item) exists and is covered by unit tests, but nothing maps the HUD item id to it. Clicking Buy in the native shop overlay therefore does nothing (gold is not deducted, inventory is not updated).
Also
setItems has no equality guard, so updateModalHUDs rebuilds the whole shop every frame while the modal is open (C-7).
setItems only slice()s the array — item objects are shared with the caller.
Clicks on the shop panel background return false, so HUDScene.handleClick continues to lower panels.
## Summary
`ShopHUD.handleClick` fires `onAction("buyItem", id)` when a buy button is hit, but `DungeonCrawlerComponent` only handles `"close"`:
```ts
this.shopHUD.onAction = (action) => {
if (action === "close") this.showShopModal.set(false);
};
```
`buyShopItem(item)` exists and is covered by unit tests, but nothing maps the HUD item id to it. Clicking Buy in the native shop overlay therefore does nothing (gold is not deducted, inventory is not updated).
## Also
- `setItems` has no equality guard, so `updateModalHUDs` rebuilds the whole shop every frame while the modal is open (C-7).
- `setItems` only `slice()`s the array — item objects are shared with the caller.
- Clicks on the shop panel background return `false`, so `HUDScene.handleClick` continues to lower panels.
## Files
- `projects/spikersoft/src/app/_components/_games/dungeon-crawler/hud/shop-hud.ts`
- `projects/spikersoft/src/app/_components/_games/dungeon-crawler/dungeon-crawler.component.ts` (~2284, `buyShopItem` ~9267)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
ShopHUD.handleClickfiresonAction("buyItem", id)when a buy button is hit, butDungeonCrawlerComponentonly handles"close":buyShopItem(item)exists and is covered by unit tests, but nothing maps the HUD item id to it. Clicking Buy in the native shop overlay therefore does nothing (gold is not deducted, inventory is not updated).Also
setItemshas no equality guard, soupdateModalHUDsrebuilds the whole shop every frame while the modal is open (C-7).setItemsonlyslice()s the array — item objects are shared with the caller.false, soHUDScene.handleClickcontinues to lower panels.Files
projects/spikersoft/src/app/_components/_games/dungeon-crawler/hud/shop-hud.tsprojects/spikersoft/src/app/_components/_games/dungeon-crawler/dungeon-crawler.component.ts(~2284,buyShopItem~9267)Fixed in
spikersoft-angularPR #823 (a0f0ccd9). Closing.