Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Add strikethrough to ColorTell() output?

Add strikethrough to ColorTell() output?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Kahenraz   (75 posts)  Bio
Date Wed 31 Aug 2016 11:30 AM (UTC)

Amended on Wed 31 Aug 2016 03:37 PM (UTC) by Kahenraz

Message
I'm using Lua ColourTell() to output text to my client. Is there a way to set the text as strikethrough?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 01 Sep 2016 07:54 AM (UTC)
Message
I haven't implemented strikethrough at this point.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #2 on Thu 01 Sep 2016 07:55 AM (UTC)
Message
I haven't heard of any MUD that sends struck through text.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Kahenraz   (75 posts)  Bio
Date Reply #3 on Thu 01 Sep 2016 07:57 AM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #4 on Thu 01 Sep 2016 08:11 PM (UTC)
Message
Just make it a gray colour to indicate it isn't active.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Kahenraz   (75 posts)  Bio
Date Reply #5 on Fri 02 Sep 2016 03:59 AM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #6 on Fri 02 Sep 2016 11:48 PM (UTC)

Amended on Sat 03 Sep 2016 12:02 AM (UTC) by Nick Gammon

Message
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

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Kahenraz   (75 posts)  Bio
Date Reply #7 on Sat 03 Sep 2016 02:39 AM (UTC)
Message
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?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #8 on Sat 03 Sep 2016 10:21 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


24,192 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.