polats Claude Opus 4.8 (1M context) commited on
Commit
63d105f
·
1 Parent(s): e46cfbf

Equip from skill detail now updates the live skill bar at once

Browse files

Equipping a skill from its detail sheet patched the persona but never pushed the
new bar to the on-field hero, so the skill only became usable after switching
heroes or dying/respawning (which rebuild the player). The detail equip handler
now calls comboCtrl.setHeroSkills(resolveEquipped(hero)) like the bar-management
path already does — the engine bar + buttons rebuild immediately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. web/tiny.js +3 -1
web/tiny.js CHANGED
@@ -532,7 +532,9 @@ whenEl('battle-stage', async (el) => {
532
  let eq = (cur.equippedSkills || []).slice()
533
  if (eq.includes(sk.id)) eq = eq.filter((i) => i !== sk.id)
534
  else { if (eq.length >= 3) { eqBtn.textContent = 'Slots full (3) — remove one first'; return } eq.push(sk.id) }
535
- patchPersona(cur.id, { equippedSkills: eq }); currentHero = getPersona(cur.id); paintEq(); renderSheet()
 
 
536
  })
537
  paintEq(); sh.append(eqBtn)
538
  back.addEventListener('pointerdown', (e) => { if (e.target === back) closeDetail() })
 
532
  let eq = (cur.equippedSkills || []).slice()
533
  if (eq.includes(sk.id)) eq = eq.filter((i) => i !== sk.id)
534
  else { if (eq.length >= 3) { eqBtn.textContent = 'Slots full (3) — remove one first'; return } eq.push(sk.id) }
535
+ patchPersona(cur.id, { equippedSkills: eq }); currentHero = getPersona(cur.id)
536
+ comboCtrl?.setHeroSkills?.(resolveEquipped(currentHero)) // live-update the on-field hero's bar so it's usable at once
537
+ paintEq(); renderSheet()
538
  })
539
  paintEq(); sh.append(eqBtn)
540
  back.addEventListener('pointerdown', (e) => { if (e.target === back) closeDetail() })