feat(ModuleNotifier): Add Module to get feedback in chat when modules toggle#258
feat(ModuleNotifier): Add Module to get feedback in chat when modules toggle#258IceTank wants to merge 3 commits intolambda-client:1.21.11from
Conversation
|
I refactored the ModuleNotifier so it listens to events produced by the module when toggling |
beanbag44
left a comment
There was a problem hiding this comment.
I dont know, just assuming but if portions of this pr and others are written with ai, please try to clean up the code (unused imports, old comments, etc), and test it to make sure it has the desired outcome
Remove redundant toggle listen in ModuleNotifier Clean up code
beanbag44
left a comment
There was a problem hiding this comment.
Im still not big on the idea of module toggles / on / off being cancellable. Maybe just remove that for now because i cant think of a time when that would be necessary. Aside from that as long as this is done its good to merge
| } | ||
| } | ||
|
|
||
| private fun logToTargets(module: Module, message: Text) { |
There was a problem hiding this comment.
could prob be changed to have the message: Text param be a TextBuilder.() -> Unit instead. That way you could have the block outside the param parenthesis
| description = "Notifies you when a module is enabled or disabled", | ||
| tag = ModuleTag.CLIENT | ||
| ) { | ||
| var notifyTarget by setting("Notify Target", setOf<NotifyTarget>(NotifyTarget.ActionBar), NotifyTarget.entries.toSet(), description = "Where to send notifications when modules are toggled") |
There was a problem hiding this comment.
i'd add params to the enum rather than using a collection setting here. One boolean for chat, and one for actionBar. Then have a third enum selection for Both, which sets true for both. Then just check if the enum has the value set to true for whatever youre testing
| import com.lambda.module.Module | ||
|
|
||
| /** | ||
| * Represents events related to toggling, enabling, and disabling of [Module]s. |
There was a problem hiding this comment.
the kt docs here are pretty self explanatory; can honestly just remove them for this class / child classes
|
oh also prob good to make this module enabled by default as its pretty standard across clients |
Adds chat feedback when modules toggle