Skip to content

Fix doors tracking and improve Lua error reporting - #44

Merged
emosaru merged 1 commit into
avaloniafrom
claude/hungry-jones
Apr 13, 2026
Merged

Fix doors tracking and improve Lua error reporting#44
emosaru merged 1 commit into
avaloniafrom
claude/hungry-jones

Conversation

@emosaru

@emosaru emosaru commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix case-sensitive code lookups: Remove ToLower() calls in ItemDatabase code provider indexing that broke Lua packs using case-sensitive item codes (e.g. door slots in CodeTracker)
  • Fix IgnoreUserInput blocking IClickHandler: CanExecute now always returns true so capture grids can intercept clicks on IgnoreUserInput items; the guard runs in Execute after the IClickHandler check. Removed IsHitTestVisible binding that blocked all interaction.
  • Add Lua call stack tracing: All Lua call sites now use xpcall + debug.traceback via SafeCall(), providing full Lua call stacks in developer console error output
  • Improved error formatting: Dedicated LuaException handling in OutputException for cleaner developer console output; script paths passed to DoString for better error source identification

Closes #41

Test plan

  • Load CodeTracker pack with Door Shuffle variant
  • Verify door slot items are clickable and capture grid appears
  • Verify regular items with IgnoreUserInput=true still block default click behavior
  • Trigger a Lua error and verify the developer console shows a full Lua call stack

🤖 Generated with Claude Code

- Remove case-insensitive ToLower() calls in ItemDatabase code provider
  indexing, preserving Lua's case-sensitive code lookups
- Allow IClickHandler to intercept clicks on IgnoreUserInput items by
  making CanExecute always return true (guard moves to Execute, after
  IClickHandler check)
- Remove IsHitTestVisible binding that blocked all interaction on
  IgnoreUserInput items
- Add xpcall/debug.traceback wrapper (SafeCall) for all Lua call sites
  to capture full Lua call stacks in error output
- Add dedicated LuaException formatting in developer console
- Pass script path to DoString for better error source identification

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@emosaru
emosaru requested a review from a team April 13, 2026 09:41
@emosaru
emosaru merged commit 6fc3d19 into avalonia Apr 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant