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 ➜ Using OnPluginScreendraw

Using OnPluginScreendraw

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


Posted by Xavious   (41 posts)  Bio
Date Thu 09 Jul 2015 04:56 PM (UTC)
Message
Will styles work with this function?

I am trying to make an adapted version of Current_Output_Window.xml that supports colors and operates a little differently.

I've found a work around by matching the output lines like a chat redirector would, however, it doesn't adhere to the echo gags used on my miniwindows, which is where OnPluginScreendraw shines. The only issue being that this function doesn't appear to support styles.
Top

Posted by Xavious   (41 posts)  Bio
Date Reply #1 on Thu 09 Jul 2015 05:45 PM (UTC)
Message
I actually found a strange work around. I still use the OnPluginScreendraw() function to trigger updates to the split screen display.

However, now I use the following to grab the style information:


  last_line = GetLinesInBufferCount ()
  line = GetLineInfo(last_line, 1)
  styles = GetStyleInfo(last_line) 


I'm guessing OnPluginScreenDraw doesn't allow for style grabs because it was originally designed for screen readers, according to the documentation, making colors/styles rather pointless.
Top

Posted by Xavious   (41 posts)  Bio
Date Reply #2 on Thu 09 Jul 2015 05:53 PM (UTC)
Message
On second thought.. this solution is far from ideal.

If the line is too long it will only add the trailer part of it to the slit window. Continuing my search for a way to do this effectively!
Top

Posted by Xavious   (41 posts)  Bio
Date Reply #3 on Thu 09 Jul 2015 07:29 PM (UTC)
Message
I think I got it.. really this time :D


function OnPluginScreendraw (type, log, line)
  --require "tprint"
  local line, total_lines
  total_lines = GetLinesInBufferCount ()
  for line = total_lines - 20, total_lines do
    FillWindow(GetLineInfo (line, 1), GetStyleInfo(line))
  end
  
end 


Then FillWindow() becomes the rest of the function that use to be contained within OnpluginScreendraw.
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.


11,300 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.