I'm using Lua ColourTell() to output text to my client. Is there a way to set the text as strikethrough?
Add strikethrough to ColorTell() output?
Posted by Kahenraz on Wed 31 Aug 2016 11:30 AM — 9 posts, 34,418 views.
I haven't implemented strikethrough at this point.
I haven't heard of any MUD that sends struck through text.
This would be for my benefit. In a quest log the MUD puts a star next to a completed entry which is hard to see. I wanted to replace it with a strikethrough as a visual aid.
Just make it a gray colour to indicate it isn't active.
I am using gray at the moment but my eyes are bad and this only kind-of-sort-of helps. I would really like it if strikethrough was implemented. I could use normal text color with strikethrough which is both clear and easy for me to see.
Ah well, it wasn't as hard as I thought. That will be available in version 5.03.
To use it call NoteStyle (32).
Eg.
The other style bits can be "or"ed in, that is:
As far as I can make out from the code, the style reverts to normal anyway at the end of a line. You might save and restore the style if you are doing a Tell ("something") and want to switch to not strike-through on the same line.
https://github.com/nickgammon/mushclient/commit/08382b6
To use it call NoteStyle (32).
Eg.
oldStyle = GetNoteStyle () -- save old style if wanted
NoteStyle (32) -- set strike-through
Note ("Test 1 2 3") -- output something
NoteStyle (oldStyle) -- revert to normal if needed
The other style bits can be "or"ed in, that is:
1 = bold
2 = underline
4 = italic
8 = inverse
32 = strike-through
As far as I can make out from the code, the style reverts to normal anyway at the end of a line. You might save and restore the style if you are doing a Tell ("something") and want to switch to not strike-through on the same line.
https://github.com/nickgammon/mushclient/commit/08382b6
Thank you for adding this feature!
As I use multiple ColourTell() to format single lines based on a regex, can you confirm that I can specify strikethrough for only part of the line and then revert back to normal?
As I use multiple ColourTell() to format single lines based on a regex, can you confirm that I can specify strikethrough for only part of the line and then revert back to normal?
For a given line, the strikethrough applies from when you do NoteStyle (32) to when you change it to something else (eg. NoteStyle (0) ) - it just affects the style of a "style run" which can be part of a line.