[Medium] [Bug] Off-hand slot not visually blocked when 2-handed weapon is equipped #341
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug: Off-hand slot not visually blocked when 2-handed weapon is equipped
Steps to reproduce
Expected
The Off Hand slot should be visually blocked/greyed out with an indication that it's unavailable due to the 2-handed weapon.
Actual
The Off Hand slot shows "Empty" without any visual indication that it's blocked. Users can interact with it normally, which is misleading since a 2-handed weapon should prevent off-hand equipment.
Root cause
The EquipmentSlotGrid component does not check the
twoHandedproperty of the equipped main hand item when rendering the off-hand slot. It should display a disabled/greyed-out state when a 2-handed weapon is in the main hand.Store
useCraftingStore(equipment instances) →EquipmentSlotGrid.tsx(rendering)Starting work. Will investigate the off-hand slot visual blocking when a 2-handed weapon is equipped.
Fix complete.
Root cause:
EquipmentSlotGridrendered all empty slots identically — the off-hand slot showed as a normal "Empty" dashed-border slot even when a two-handed weapon was equipped in mainHand, giving no visual indication that the slot was blocked.Changes made:
EquipmentSlotGrid.tsx— AddedgetTwoHandedBlocker()helper that checks ifmainHandhas a two-handed weapon and returns the weapon name. When blocked, the off-hand slot now renders with aLockicon,"Blocked: <weapon name>"label, reduced opacity (opacity-60), and muted border — visually distinct from normal "Empty" slots.EquipmentSlotGrid.test.ts— New regression test file (11 tests) verifying all 4 two-handed types (basicStaff,oakStaff,arcanistStaff,battlestaff) are correctly flagged, non-two-handed types remain unblocked, and all two-handed types are in themainHandslot category.Files changed: 5 files, 109 insertions, 3 deletions. All 1105 tests pass. Committed and pushed to master.