Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

filterObjectEnter applies result from first to all objects in a group #29

Open
darrellanderson opened this issue Sep 6, 2020 · 0 comments
Labels
bug Something isn't working lua Lua scripting

Comments

@darrellanderson
Copy link

Describe the bug
Dragging a group of objects to a container tests filterObjectEnter on one, then applies that value to all.

To Reproduce
Steps to reproduce the behavior:

  1. Create a bag with filterObjectEnter that rejects the first time, accepts the second (script below).
  2. Create a handful of random objects.
  3. Select the group of objects and drag all to the bag.
  4. Observe a single call to filterObjectEnter, all objects are rejected.
  5. Drag same group to the bag again.
  6. Observe a single call to filterObjectEnter, all objects are accepted.

Expected behavior
The filter method should be called separately for each object.

Screenshots
If applicable, add screenshots to help explain your problem.

Lua Scripts & XML UI:
If applicable, Lua:

function filterObjectEnter(enter_object)
    _n = (_n or 0) + 1
    local result = (_n % 2) == 0
    print('filter: ' .. _n .. ' ' .. tostring(result))
    return result
end

Tabletop Simulator Info (please complete the following information):

  • OS: macOS
  • Version 12.4.3

Known workarounds
N/A

Additional context
N/A

@Benjamin-Dobell Benjamin-Dobell added bug Something isn't working lua Lua scripting labels Sep 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working lua Lua scripting
Projects
None yet
Development

No branches or pull requests

2 participants