Skip to content

feat: option to export detected cards to files - #36

Open
leiteszeke wants to merge 1 commit into
HichTala:masterfrom
leiteszeke:up/10-card-info
Open

leiteszeke wants to merge 1 commit into
HichTala:masterfrom
leiteszeke:up/10-card-info

Conversation

@leiteszeke

Copy link
Copy Markdown
Contributor

This is the plugin side of HichTala/draw2#40: an option to have the backend write the detected cards to files, so you can show the card name in an OBS Text source (or feed an overlay / bot).

It's built on top of #31 because it touches the same Feature flags tab, so the diff here includes those commits until #31 is merged. The commit for this PR is the last one.

There are two new checkboxes in Feature flags, both only matter when the first one is on (it's off by default):

feature flags

When it's on, the plugin passes DRAW2_CARD_INFO_DIR to each backend, pointing to a state folder next to decklists in plugin_config, plus the language and whether to download the full card db. When it's off nothing is passed and the backend runs as before.

Then in OBS you add a Text source, tick "Read from file" and pick state/current_card_p1.txt:

text source demo

The JSON files (current_pN.json, events_pN.jsonl) have the rest of the card info, there are examples in the backend PR. README and translations explain the files.

Tested on macOS with two players, toggling it on and off and restarting DRAW.

@HichTala

Copy link
Copy Markdown
Owner

Nice feature, I think we will add it in the next release!

New "Export detected card info to files" checkbox in Feature flags (off by
default). When it's on, the plugin passes DRAW2_CARD_INFO_DIR (a state
folder next to decklists), the language and the full-db option to each
backend, and the backend writes the current cards there. Useful for an OBS
Text source with the card name, an overlay or a bot.

Needs the matching change in the draw2 backend. README and translations
updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants