Add strikethrough to ColorTell() output?

Posted by Kahenraz on Wed 31 Aug 2016 11:30 AM — 9 posts, 34,418 views.

#0
I'm using Lua ColourTell() to output text to my client. Is there a way to set the text as strikethrough?
Amended on Wed 31 Aug 2016 03:37 PM by Kahenraz
Australia Forum Administrator #1
I haven't implemented strikethrough at this point.
Australia Forum Administrator #2
I haven't heard of any MUD that sends struck through text.
#3
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.
Australia Forum Administrator #4
Just make it a gray colour to indicate it isn't active.
#5
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.
Australia Forum Administrator #6
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.


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
Amended on Sat 03 Sep 2016 12:02 AM by Nick Gammon
#7
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?
Australia Forum Administrator #8
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.