I have a section where I offer the player 3 choices and then when one is chosen they all disappear and are replaced by the text for the clicked link. General example of the code below;
The issue I have is that I want a link to a new passage to show up after the replaced text, but not be there before when the player is choosing between the 3 choices. I know I could simply put the link at the end of all 3 replaceTexts, or set a variable in each replaceText that the final link checks for (with an if or unless) before it appears.
I don’t like the duplication and worry about needing to change the code in multiple places if I change anything. Is there a way to have a link only show up when “namedHook1” is gone/replaced? Or that will only show up after either link 1, 2 or 3 have been clicked?
Thanks for any advice you can provide.
note: You don’t need to use the (link-replace:) macro, because you’re replacing the entire contents of the Named Hook those “links” are positioned in.
Thanks for the suggestions, but these are the kind of things I was talking about when I mentioned duplication. I know I can accomplish what I want by putting the same thing at the end of the 3 links (and that’s what I’ll do if there isn’t another way to do it).
I’m specifically asking for a way to keep my code as clean as possible without unnecessary duplication. So instead of having $link or (show: ?link) repeated in all 3 options, I’m trying to see if there’s a way to have a single thing after the 3 that makes the link appear only after one of the 3 is chosen.
Thank you for clarification. I really felt there would be some macro or combination of macros that would basically be able to go “if any 1 of these 3 is clicked, then do X”. I guess I will resort to just putting something in each of the 3 hooks to trigger the thing to show.
Thanks again