Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook customizable functions to showing card and showing answer #24

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hungriesthippo
Copy link
Contributor

simple first pass for #17
see my comment there for an example custom function

allow custom methods for showing card and answer akrivka#17
@akrivka
Copy link
Owner

akrivka commented Feb 19, 2021

Hey, looks good, though I'm considering a bigger refactor enabling multiple "layers" of button, which should be more agnostic to what the UI is actually trying to done. Like instead of a fixed "question-answer" paradigm, it would be "layer1->layer2->layer3->..."

Not sure if shouldn't just go through your suggestion right now instead, and keep this idea for a next big release (that would probably be called roam/loop because it'd more general).

Can you maybe give an example of something that an onShowAnswer would allow you?

@hungriesthippo
Copy link
Contributor Author

I had a very hacky image occlusion (onShowCard: add rectangle at coords, onShowAnswer: remove it), but your version of that is better.
Another example is playing a sound for a foreign language word.

@hungriesthippo
Copy link
Contributor Author

My strongest argument for doing something like this is that it's a way to appease people who have "card type" ideas that may or may not be worth complicating the code. With this you can just say to go try it and wait to see whether it's worth putting in the core code. (Of course it doesn't cover a variety of uses that e.g. involve changing how history is used, but it seems like that philosophical argument needs to be broached.)

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