Repository navigation
feat: opt-in export of detected card info to files - #9
Open
leiteszeke wants to merge 1 commit into
Open
leiteszeke wants to merge 1 commit into
leiteszeke wants to merge 1 commit into
Conversation
leiteszeke
force-pushed
the
up/07-card-info
branch
from
June 29, 2026 11:39
52e58f7 to
3903236
Compare
leiteszeke
force-pushed
the
up/06-remote-decklist
branch
2 times, most recently
from
October 13, 2026 10:56
89c24be to
4c51b6d
Compare
leiteszeke
force-pushed
the
up/07-card-info
branch
from
October 15, 2026 08:27
3903236 to
0356e00
Compare
Adds an opt-in "Export detected card info to files" toggle (Feature flags tab, off by default). When on, each backend detector is pointed at a stable per-user folder and writes the currently-detected cards there, for OBS Text sources, bots or overlays. - bridge.h: FEATURE_CARD_INFO key. - plugin-path.h / plugin-main.cpp: get_state_path() helper (per-user plugin_config/draw2-plugin/state dir), mirroring get_decklists_path(). - SettingsDialog: checkbox in the Feature flags tab (QSettings feature_card_info), wired like the other opt-in toggles. - DrawDock: when on, launch each backend with DRAW2_CARD_INFO_DIR (= state dir) and DRAW2_CARD_INFO_LANG (QSettings card_info_lang, default en); with debug logging on, the dock log shows the resolved dir + language. Off -> no env set, backend behaves exactly as upstream. - README + all translations (es/fr/jp/pt-br) document the toggle and the file contract (current_pN.json / events_pN.jsonl / current_card_pN.txt). The backend half (writing the files) lives in the draw2 backend; the plugin only points it at the output folder.
leiteszeke
force-pushed
the
up/07-card-info
branch
from
October 15, 2026 08:29
0356e00 to
aad93f1
Compare
leiteszeke
force-pushed
the
up/06-remote-decklist
branch
from
October 15, 2026 08:29
4c51b6d to
319f10f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an opt-in "Export detected card info to files" toggle (Draw 2 settings → Feature flags, off by default): when on, the plugin points each backend detector at a stable per-user folder and the backend writes the currently-detected cards there, so you can surface them anywhere — an OBS Text source the streamer reads on stream, bots, or HTML/browser overlays. With the flag off, nothing is set and the backend behaves exactly as upstream.
Changes
src/feature_flags.h—FEATURE_CARD_INFOkey.src/plugin-path.h/src/plugin-main.cpp—get_state_path()helper (per-userplugin_config/draw2-plugin/statedir, created on demand), mirroringget_decklists_path().src/SettingsDialog.{cpp,hpp}— in the Feature flags tab: an Export detected card info to files checkbox (QSettingsfeature_card_info), plus a Download full card database for offline use checkbox (QSettingsfeature_card_info_db, on by default) that controls whether the backend uses its local offline DB or resolves lazily per card.src/DrawDock.cpp— when card info is on, each backend process is launched withDRAW2_CARD_INFO_DIR(= the state dir),DRAW2_CARD_INFO_LANG(QSettingscard_info_lang, defaulten) andDRAW2_CARD_INFO_DB(1/0from the toggle). When off, no environment is set. With debug logging on (FEATURE_DEBUG, from feat: opt-in debug logging (plugin-side) HichTala/draw2-plugin#29) the dock log shows the resolved output dir, language andfull_db.es/fr/jp/pt-br) document the toggle and the file contract.File contract (written by the backend, per player
N)current_pN.json— cards currently on screen:{ updated_at, channel, cards: [ { id, name, type, attribute, race, atk, def, desc } ] }(rich fields from YGOPRODeck; missing fields omitted).events_pN.jsonl— append-only, one JSON per line:{ ts, event: "appeared" | "disappeared", card: { … } }.current_card_pN.txt— plain text, names on screen (newline-separated); point an OBS Text source at it (Read from file).Opt-in / default behaviour
Off by default: with it off, no env var is set and the backend writes nothing — identical to upstream.
Backend dependency
This is the plugin half: it only sets the env vars pointing at the output folder. The backend reads
DRAW2_CARD_INFO_DIR/DRAW2_CARD_INFO_LANGand writes the files (thedraw2backend change). With a backend that doesn't support it, the toggle is a no-op (no files written), no crash.How it was tested
cmake --preset macos).