The answer to that is yes, it can do that. Currently the method is a bit more crude than I’d like, but “blacklists” and “whitelists” for item types in bags is probably going to be a post-v1.0 feature.
I tried to do it myself and ran into a few bugs with the event handler system, so I’ve released UInv v0.9.7.1 as a bugfix release so this will work properly.
Once you’ve updated to UInv v0.9.7.1, what you’ll need to do is set up an event handler for “table”/“Accept” events using the AddEventHandler() function.
To do that, you’ll need to create a “table”/“Accept” event handler in your code like this:
<<run UInv.AddEventHandler("table", "Accept", "acceptTest")>>
That sets up a SugarCube widget or macro, or a JavaScript function, to handle accepting/rejecting items on “table”/“Accept” events.
In this case, the above code will tell UInv to call the <<acceptTest>>
widget whenever an “Accept” event is triggered on a table.
Next, you need to create a widget in a non-special non-story passage with a “widget” tag. The code you put there will be something like this:
<<widget "acceptTest">>
<<set _e = $args[0]>>
<<if _e.destBag == "CoinPouch">>
<<set _UInvReturn = {
acceptVal: !!UInv.ItemHasTag(_e.srcBag, _e.draggedItem, "type", "money")
}>>
<</if>>
<</widget>>
That widget checks to see if the item is being dropped on a bag named “CoinPouch”. If it is, it then checks to see if the item has a “money” tag included within its “type” property. If it doesn’t, then it won’t let that item drop into the “CoinPouch” bag. (See the AddEventHandler() function for details.)
I’ve added another passage to the sample code included with UInv to demonstrate how this works as well.
Please let me know if you have any questions or problems with that.