Add inventory system #1

Merged
notid merged 24 commits from sugary-panda into master 2026-04-28 22:05:12 -07:00

24 Commits

Author SHA1 Message Date
291d911a50 fix: handle ITEM cursor index in restore_cursor and remove duplicate 2026-04-27 07:49:59 -07:00
67c91a37b0 fix: wire item_confirmed signal and set item cursor icon 2026-04-27 07:49:59 -07:00
cec36b7aec fix: set Background to MOUSE_FILTER_PASS so clicks reach panel children 2026-04-27 07:49:59 -07:00
7c36d9ff55 fix: restore show_overlay and hide_overlay bodies (edit merged them) 2026-04-27 07:49:59 -07:00
91f4b1d8d5 debug: add logging to inventory overlay and backpack for click debugging 2026-04-27 07:49:58 -07:00
870e3a6ff7 fix: set Frame mouse_filter to PASS so clicks reach inventory slots 2026-04-27 07:49:58 -07:00
d039c996d1 fix: set ItemBox mouse_filter to PASS so clicks reach InventorySlot 2026-04-27 07:49:58 -07:00
eadbd636ac fix: single-click selects item and closes overlay 2026-04-27 07:49:58 -07:00
d2b1f4ab3d fix: add slot to grid before calling set_item so @onready nodes exist 2026-04-27 07:49:58 -07:00
7601c87600 fix: refresh inventory grid when overlay opens 2026-04-27 07:49:58 -07:00
a54fe6652f feat: add example splash item for inventory testing 2026-04-27 07:49:58 -07:00
cebd53ae8e fix: backpack icon returns to home position when overlay closes 2026-04-27 07:49:58 -07:00
81feaa4f4f fix: connect Background gui_input to close overlay on outside click 2026-04-27 07:49:58 -07:00
efc2b2249c fix: clicking outside inventory panel closes overlay 2026-04-27 07:49:58 -07:00
b3bad1d0e6 fix: correct overlay node path in MainGame signal handlers 2026-04-27 07:49:58 -07:00
a9ec2e6893 fix: wire backpack signals to root Node2D instead of HUD CanvasLayer 2026-04-27 07:49:58 -07:00
378bcdda47 fix: wire backpack signals and simplify positioning
- Connect overlay_show_requested/overlay_hide_requested signals in Game.tscn
  to new handlers in MainGame.gd that call show_overlay()/hide_overlay()
- Simplify backpack to fixed 70x70 position at top-left (layout_mode=0)
- Remove broken anchor overrides from Game.tscn that were anchoring to bottom
2026-04-27 07:49:58 -07:00
d94912bb79 fix: bind callbacks before passing to tween_callback, tighten backpack hitbox
- Godot 4's CallbackTweener doesn't have .bind() — move .bind() call
  inside tween_callback() for 3 callback sites
- Shrink InventoryBackpack Control to 60x60 (offset_right -70) so click
  area matches the visible BackpackIcon square
2026-04-27 07:49:58 -07:00
92866d5fc8 fix: make inventory backpack visible by instancing in Game.tscn and fixing Tween API
- Add InventoryBackpack under HUD CanvasLayer (layer 5) in Game.tscn
- Add InventoryOverlay under InventoryOverlayLayer CanvasLayer (layer 10)
- Fix Tween.TRANS_SINE_IN -> .set_trans(TRANS_SINE).set_ease(EASE_IN) in
  InventoryBackpack.gd (Godot 4.6 split transition and easing APIs)
2026-04-27 07:49:58 -07:00
9ed55d6345 feat: add untracked inventory files from previous session
- ItemDefinition.gd: Resource class with id, name, combination_category
- ItemDefinition.gd.uid: UID cache file
- InventoryManager.gd.uid: UID cache file (script was committed, UID was not)
- inventory-prd.md: Original product requirements document (791 lines)
- docs/plans/2026-04-26-001-feat-inventory-backpack-system-plan.md:
  Implementation plan with 6 units and 5 user-directed edits
2026-04-27 07:49:58 -07:00
c115810425 fix: remove class_name from InventoryManager to avoid autoload name conflict 2026-04-27 07:49:58 -07:00
e905a8adda feat: register InventoryManager as AutoLoad singleton 2026-04-27 07:49:58 -07:00
fb8798a4ae feat: integrate inventory with cursor system, scene input, and GameScript
- ActionState: add ITEM action (value 4) to enum and get_action_name()
- MainGame: right-click cycles through all 5 actions including ITEM;
  skips ITEM if nothing selected; clears selection when cycling away
- Scene: guard _unhandled_input() against active inventory overlay;
  handle ITEM action for world-wide item use; add give_item(),
  remove_item(), strip_items() helper methods
- SetPiece: handle ITEM action by calling scene's _use_item_on_setpiece()
- GameScript: add GiveItem and GiveItemDeferred script step classes
  for item acquisition during cutscenes
2026-04-27 07:47:45 -07:00
afcf92dbfd feat: implement InventoryBackpack FSM and InventoryOverlay
- InventoryBackpack: Control-based FSM with IDLE/OPEN/SELECTED/ACQUIRE/REMOVE
  states, Tween-based animations, guard condition checks, signal connections
  to InventoryManager for item_acquired/item_removed reactions
- InventoryOverlay: Full-screen overlay with fade-in/out, item grid via
  GridContainer, drag-and-drop item selection, combination via drag-to-slot,
  hover labels, right-click inspect
- InventorySlot: Individual slot with colored box placeholder, hover highlight,
  click/right-click/hover signals
2026-04-27 07:47:45 -07:00