Move the tweak prevention into a helper function and rename the module hooks w/ compatibility code
This commit is contained in:
parent
3d4376aa81
commit
9c8b6f37f9
20 changed files with 102 additions and 102 deletions
19
module/hooks/oft.preRegisterTweak.mjs
Normal file
19
module/hooks/oft.preRegisterTweak.mjs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
This hook is used to give external modules or systems the ability to interact
|
||||
with the tweak registration lifecycle to do something before a tweak is registered
|
||||
or being able to prevent registration of incompatible tweaks.
|
||||
|
||||
The hook receives a string indicating which tweak this hook is being called for
|
||||
and a boolean value indicating if the tweak is considered invasive. Returning
|
||||
explicit false prevents that tweak from being registered.
|
||||
|
||||
Invasive tweaks are additions that manipulate or override Document or helper
|
||||
classes. An example of an invasive tweak is the "toggleMouseBroadcast",
|
||||
tweak which replaces the existing "CONFIG.Canvas.layers.controls.layerClass"
|
||||
class, most of these tweaks do smartly extend from the same CONFIG class
|
||||
that they replace, however if they override a part of the class that
|
||||
other modules/systems rely on, then that is a good time to block that
|
||||
specific tweak's registration.
|
||||
|
||||
Call Signature: (tweakKey: string, isInvasive: boolean) => (void | boolean)
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue