-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor existing lifecycle into a more modular PluginModule #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Created an abstract class PluginModule to better handle multiple modules within the plugin and to appropriately handle the lifecycle - Construct injected common fields such as OverlayManager, Client, and the config - Field injected on-demand fields such as EventBus and GameEventManager - Automatically (un)registers the module from the EventBus - Re-fire various events by utilizing GameEventManager#simulateGameEvents within #startUp - Abstracted #onStartUp to handle module starts, #onShutdown to handle module stops, and #isEnabled to determine the status of the module
…ycle - Removed prior injections that have yet to be refactored - Refactored #startUp, #shutDown, and #onConfigChanged to utilize the new modular system to handle state changes
…fecycle - Refactored SurpriseExamHelper to the modular plugin lifecycle - Now extends PluginModule and implements respective methods, moving the existing start/stop login there - Use constructor injection and removed duplicate field injections - Injected SurpriseExamHelper and added it to the pluginModulesMap
- Improved handling initial runs when (re)starting the plugin when already inside the Surprise Exam random event - Primarily for when the puzzle interface is already on screen
feat(module): Created PluginModule class for modular plugin lifecycle
refactor: Start refactoring RandomEventHelper to modular plugin lifecycle
refactor(surpriseexam): Migrate SurpriseExamHelper to PluginModule lifecycle
feat(PluginModule): Add #isLoggedIn to check if the player is logged infeat(surpriseexam): Improve support for starting during active event
|
- Refactored PirateHelper to the modular plugin lifecycle - Now extends PluginModule and implements respective methods, moving the existing start/stop login there - Use constructor injection and removed duplicate field injections - Injected PirateHelper and added it to the pluginModulesMap
- Refactored MimeHelper to the modular plugin lifecycle - Now extends PluginModule and implements respective methods, moving the existing start/stop login there - Use constructor injection and removed duplicate field injections - Injected MimeHelper and added it to the pluginModulesMap
…, refactor - Improved handling initial runs when (re)starting the plugin when already inside the Mime random event - Primarily for when the emote button interface is already on screen - Change Mime text when undetermined emote answer - Use default font size for overlay - Refactored Mime animation checks and answer updating into #updateMimeAnimation
refactor(captarnav): Migrate PirateHelper to PluginModule lifecycle
refactor(mime): Migrate MimeHelper to PluginModule lifecycle
feat(mime): Improve support for starting during active event, overlay, refactor
|
|
Note, while testing the Mime module, I noticed that starting and stopping the refactored Gravedigger module (multiple times) seems to have overlay issues again when switching back to field injection for both overlays. |
- Refactored DrillDemonHelper to the modular plugin lifecycle - Now extends PluginModule and implements respective methods, moving the existing start/stop login there - Use constructor injection and removed duplicate field injections - Injected DrillDemonHelper and added it to the pluginModulesMap
- Improved handling initial runs when (re)starting the plugin when already inside the Drill Demon random event - Fix race condition issue with events - primarily regarding #onGroundObjectSpawned and exerciseMatsMultimap
refactor(drilldemon): Migrate DrillDemonHelper to PluginModule lifecycle
feat(drilldemon): Improve support for starting during active event
It's probably better to have kept the varbit initialization within #onNpcChanged, but I wanted to keep everything inline for the future. I want to handle varbit inits #onStartUp. Though looking back, I may have to reconsider this due to the way GravediggerHelper is implemented. Also, it does spam the log with 4/8 writes due to the varbit value being 0 and reaching Random-Event-Helper/src/main/java/randomeventhelper/randomevents/drilldemon/DrillDemonHelper.java Lines 235 to 248 in 773da8d
The log being log.warn("Drill Demon exercise varbit changed to unknown value: {}", exerciseVarbitValue); , but that's expected because of how Jagex inits the varbs to 0. I could just ignore it, but I think it'd be better to just have it for now.
|
- Refactored BeekeeperHelper to the modular plugin lifecycle - Now extends PluginModule and implements respective methods, moving the existing start/stop login there - Use constructor injection and removed duplicate field injections - Injected BeekeeperHelper and added it to the pluginModulesMap
- Improved handling initial runs when (re)starting the plugin when already inside the Beekeeper random event - Avoid constantly appending corresponding number to destination widget label
refactor(beekeeper): Migrate BeekeeperHelper to PluginModule lifecycle
feat(beekeeper): Improve support for starting during active event
|
- Improved handling initial runs when (re)starting the plugin when doing Capt' Arnav's Chest random event - Add missing isSolved = false assignment within PirateChestSolver#isChestCorrectlySet
feat(captarnav): Improve support for starting during active event
|
This PR is an attempt to better modularize my existing codebase and plugin lifecycle by using abstraction and primarily constructor injection. The few benefits to this refactor are:
Events Implemented and Tested
feat(module): Created PluginModule class for modular plugin lifecycle