Hook
annotation class Hook
Annotation to mark a static method as a OpMode lifecycle hook, which will be executed at the desired phase of any OpMode lifecycle, via the BunyipsLib listener.
Methods marked with this annotation must have exactly zero method parameters, and must be static, or they will not be executed.
Method visibility does not impact the ability for this method to be run. These methods are executed even if a BunyipsOpMode is not running.
To access the current OpMode from these hooks, see getOpMode.
Do note the Hook will not execute on System OpModes or BunyipsLib-integrated OpModes (such as HardwareTester). You can bypass this by passing in a boolean flag ignoreOpModeType, but should be used with caution.
Author
Lucas Bubner, 2024
Since
7.0.0