raineaeternal / Quest-SongCore

A library/mod for Quest Beat Saber that handles song loading, song requirements and capabilities.
MIT License
5 stars 5 forks source link

Draft: [Capabilities] Implement capability registration #1

Closed RedBrumbler closed 8 months ago

RedBrumbler commented 8 months ago
RedBrumbler commented 8 months ago

Before merging, we need to have a think about these things:

raineaeternal commented 8 months ago

1) For simplistic use, I would guard against multithreaded access (std::mutex?) 2) Make people unsubscribe properly, but log out whoever is still subscribed and call them the fuck out. 3) The instance is required for non-Zenject access. How it's done past that, I don't mind.

RedBrumbler commented 8 months ago
  1. ic, ok
  2. there is no way to tie a callback back to who registered it I believe, but I could check whether the func ptr is traceable
  3. it currently is, but it doesn't have to be... due to the way this works it means someone who's not zenjecting has to artificially delay registering capabilities because they can't do it in late_load() because zenject hasn't ran at that point
raineaeternal commented 8 months ago

ok, I see. If there is a better way of doing instancing/zenject access, feel free to explore that possibility. So long the API is clean and simple to follow, I don't really care too much.

RedBrumbler commented 8 months ago