I’ve got the following code for a custom widget, which disables clickable links for the duration specified in the first argument. Often, this ends up being put within a passage using the <<type>> macro.
I initially included the event macro by chapel to detect when typing had finished with :typingcomplete, but I removed it for simplicity. The widget worked as expected in a vacuum, but I encountered two problems when trying to implement it into the rest of my game.
The widget interfered with spacing, adding line breaks where there were none. This doesn’t seem to affect the <<cycle>> macro, but it happened in this section that uses <<link>>.
The widget stops working if multiple instances of it are used in the same passage. I’d like to increment the div id, but I couldn’t figure it out.
Sorry for the delayed response, but I managed to figure it out! I ended up taking a completely different approach. Still, I appreciate your help; it definitely steered me in the right direction.
I managed to achieve this same effect using only CSS through an animation. Here’s the relevant portion of the stylesheet:
I faded colors because I wanted the links to appear as if they were normal text, then only reveal themselves as links after typing was completed. They still needed to be readable before becoming interactive.