obsidian-initiative-tracker
obsidian-initiative-tracker copied to clipboard
📓 Tracker API
What are we changing or adding?
- [x] Repository
- [X] Publish Documentation
Location
I'm not really sure as to where this should go, since the API is AFAIK just the pluging being accessible, I'm looking more for guidance on how to find the data within the plugin.
The issue is...
I'm creating an app that ideally would sync with the initiative tracker in obsidian, I'm already able to send information to the app about the encounter, but I don't know where to find information about who's turn it is. I also was wondering, where the names are stored (if they are) for multiple of the same creature that were to the encounter with numbers, right now if I have 3 orcs they're all named Orc in the encounter data in the plugin but labelled Orc 1, Orc 2, Orc 3, in the tracker panel
Suggestions?
No particular suggestions as I'm not sure how useful this would be to others, I just have a very niche use case.
Anything else?
Nope
Hi, the plugin doesn’t really have an API. You are correct that what you are seeing is the plugin class.
Everything dealing with the tracker and its state is in a Svelte store, in this file:
https://github.com/javalent/initiative-tracker/blob/main/src/tracker/stores/tracker.ts
This is exposed on the plugin as the tracker
property. You might be able to get what you need through that.
I will leave this open however as an API is probably a good idea :)
What kind of API are you thinking of, maybe I can help out with some PRs