Folding/collapsing output?

Posted by George on Wed 25 May 2016 12:09 AM — 2 posts, 12,705 views.

#0
I'm wondering if anyone has tips on how I could go about folding/collapsing text in the output window. In other words something that normally would display like this:

Quote:

This is a long paragraph of text from a mud that describes many different things like the color of the sky and the wind and the sunlight and some animals running around and some people riding horses with strange hats on their heads


Would instead display in summary like:

Quote:

+ This is a long paragraph of text from a mud ....


What I was thinking is that I would match the text as necessary, strip it, and then replace it with the summary line. When the player clicks on the '+' symbol I would replace the summary line with the full text.

What I'm unsure about is the second part. What's a good way to make space for the expanded text? Likewise I'll have to collapse space when the player clicks the + symbol again to fold the text back. Hope that makes sense.
Amended on Wed 25 May 2016 12:10 AM by George
Australia Forum Administrator #1
The design doesn't really allow for collapsing lines like in a text editor. However you could use a trigger to replace the desired text with your example of a shorter version and make the "+" with the Hyperlink function.

Template:function=Hyperlink
Hyperlink

The documentation for the Hyperlink script function is available online. It is also in the MUSHclient help file.



If you click on the hyperlink you could display a dialog box which has the expanded text in it (or just append it to the output window with a Note function).

See: http://www.gammon.com.au/scripts/doc.php?lua=utils.msgbox