Peacock icon indicating copy to clipboard operation
Peacock copied to clipboard

Document and improve hooks

Open RDIL opened this issue 3 years ago • 7 comments

  • [ ] Document the hooks
  • [ ] Maybe improve the API?
  • [ ] Add new hooks where plugin makers need them

RDIL avatar Nov 13 '22 02:11 RDIL

Areas for hook improvements:

  • Challenges
  • CPD (Maybe allow modders to do some cool stuff with this? May not need hooks.)
  • Mastery
  • Scoring(?)
  • Multiplayer(?)

AnthonyFuller avatar Oct 12 '23 13:10 AnthonyFuller

Additionally, add ability to untap, add priorities, etc

RDIL avatar Oct 12 '23 13:10 RDIL

Can we not untap? Thought we could.

AnthonyFuller avatar Oct 12 '23 13:10 AnthonyFuller

I don't think we can officially right now, you can always hack around it e.g.

let a = true

hooks.example.tap("MyPlugin", () => {
    if (!a) return
    console.log("still tapped")
    a = false
    console.log("untapped for future use")
})

RDIL avatar Oct 12 '23 13:10 RDIL

Ah okay, that's fair. Should we still use tapable or move away from that? I vaguely recall you complaining about it in the past.

AnthonyFuller avatar Oct 12 '23 13:10 AnthonyFuller

We already migrated off tapable because it's codegen at runtime approach could be buggy, this is what we're using rn

RDIL avatar Oct 12 '23 13:10 RDIL

Ah right I forgot about that change, mostly because we kept the API design the same.

AnthonyFuller avatar Oct 12 '23 13:10 AnthonyFuller