Overriding onDropItem & onSortItem
You'd override them in your sheet class.
7 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
There's no such thing as preventDefault() global function.
Overriding itself prevents the normal function unless you call it.
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
This is what that
super
thing you've seen around is for.
Without the "super.whatever()", you're completely overriding the method and none of the inherited behavior will firesuper - JavaScript | MDN
The super keyword is used to access and call functions on an object's
parent.
What you saw with
Inventory+
and libwrapper is how modules tend to override methods in existing classes which they do not control.
Inventory+ doesn't have control of the ActorSheet5e class, so it had to work around that by 'monkeypatching' the method after it's already been defined.
Since you're writing a system, it's unlikely you'll need libwrapper. Systems are the first-class citizens and don't really worry much about conflicts, modules are second class and do have to worry about conflicts.Unknown User•3y ago
Message Not Public
Sign In & Join Server To View