Hello all. I'm new to Decker. I'm building a deck that has differently themed groups of cards. I'd like to intercept field hyperlink clicks such that clicking a link from one card to another card within the same group navigates as normal, while clicking a link to a card in a different group plays a transition. How can I achieve this? Thanks!
Viewing post in General Decker Question and Answer Thread
Since you're overriding this behavior on many cards, it's easiest to define an overload for the link[] event at the deck level; see Deck -> Properies... -> Script... via the menu. I'll assume for the sake of this example that cards are named with a "group_cardname" convention, so we can use the portion of the name preceding the underscore to determine whether two cards belong to the same group:
on link x do on groupname x do first "_" split x end if groupname[deck.card.name]~groupname[x] send link[x] else go[x "BoxIn"] end end
Make sense?
You may have a different method of distinguishing groups, like invisible metadata fields on cards; I'd be happy to clarify how to adapt this approach to your deck, if needed.