Twine: 2.2.1
SugarCube: 2.29.0
I have a widget (<<msg>>
) that acts as a wrapper for Chapel’s <<message>>
macro.
<!-- <<msg object [owning object]>>-->
<<widget "msg">>
<<set _uniqueid = msgid($args[0].note)>>
<<message $args[0].note btn _uniqueid>>
<<tab>>
<<print $args[0].text>>
<</message>>
/* if this message should not be displayed until other message has been clicked */
<<if def $args[1]>>
<<set _ownerid = msgid($args[1].note)>>
<<script>>
$(function(){
//Hide self
$("#macro-message-" + State.temporary.uniqueid).hide();
//Attach function to show self when owning button is clicked
$("#macro-message-" + State.temporary.ownerid).click(function() {
$("#macro-message-" + State.temporary.uniqueid).show(500);
});
});
<</script>>
<</if>>
<</widget>>
The objects passed contain the properties “note
” which is a simple string < 7 words, as well as “text
” which contain the actual message.
Setting the “Main” msg is as simple as calling <<msg setup.dialogue.chat>>
Setting a “child” msg that only shows after the “main” msg is clicked: <<msg setup.dialogue.secondchat setup.dialogue.chat>>
This works.
The issue now comes when I want to add a “child” msg to the first “child” msg.
<<msg setup.dialogue.thirdchat setup.dialogue.secondchat>>
Suddenly the “secondchat” msg no longer gets hidden at all, and is visible as soon as the passage has finished loaded.
The “thirdchat” msg is still hidden, until “secondchat” is clicked.
Why isn’t the second <<msg>>
being hidden when there’s a third <<msg>>
?