-
Notifications
You must be signed in to change notification settings - Fork 4
Rewrite notes
Jayant edited this page Aug 11, 2023
·
5 revisions
- rewriting plugin into Typescript
- making the code more modular to allow more flexibility in adding new features/conditionss
-
- go AFK
- joining afk vc
- timeout
- discord idle mode event
- go unAFK
- focused timeout
- discord unidle mode event
- sending a message on discord
- leaving afk vc
- go AFK
-
instead of oop magic, can just have simple if/else's in hierarchy check that. because it is hard to figure out a hierarchical way to add that condition
all enabled via a toggle, and all fail fast
- going AFK
- current status == trigger status
- ongoign discord activity
- not in vc (calls post evaluate callback)
- going unAFK
- afk set by plugin == true opposite = (multi device mode ^)
- current status == afkstatus
- going AFK
-
- post evaluate callback
- post afk callbacks
- change user status
- post unAFK callbacks
global timeout id
onFocus and onBlur both cancel the timeout id and set it null.
- keep track of multiple eval functio being called by a global lock thingy
- enable debug logging
- each component adds to default config in getSettingsPanel
#PoorMansReactSettingsPanel
- can change trigger status to be phase 2 in post afk callback
- or, after 1st AFK, in postAFK set another timeout to change status to 3rd.
set timeout ID in global thingy.
- post unAFK for cleanup
- register [on start action (register event listener, sub event)]
- cleanup [on stop action (remove event listener, unsub from event)]
- getSettings [returns a jsx component that changes that trigger's config, like enabled/disabled]
- selfTest [test whether this trigger is working and something hasn't been broken]
- class: AFKTrigger
- class: UnAFKTrigger
- AFKConditions (called by event)
- unAFK conditions (called by event)
- timeoutIdArray
- postAFKcallbackArray
- postunAFKcallbackArray
-
- runs all the callbacks/methods/hooks/functions in the array
- clears the methods from the array after running them.
- can be abstracted into RunHooks class
- RunPostAFKCallbacks(RunHooks)
- RunPostunAFKCallbacks(RunHooks)
insides: - callBackArray - addHook() - processHooks() / runCallbacks()
- getting zlib from window rather than argument
- putting the boilerplate in index
- having my own class instead