I have a mod that has several cards that have button that puts them back in the deck were they came from, when they are in the discard pile. However, the button only shows if the card is not in a deck object, so players need to know to pull the card off the deck to press the button.
It would be nice if there was some way to automatically have the UI appear on the deck, when the card is the top face-up card of the deck. It would be possible to emulate this with scripting, but to be resilient to things like reordering it would probably need to poll to ensure the correct UI (if any) is displayed.
Some care may be needed to handle events from the UI; likely the solution is to require XML UI and have the event code tied to
Global or otherwise not on the card/deck.
 It might be possiblle to use a combination of of
onObjectRandomize instead, of polling; but 1) I don’t know if that is exhaustive 2) additional ways of reordering a deck may be added without corresponding events to detect them.