Using OnPluginScreendraw

Posted by Xavious on Thu 09 Jul 2015 04:56 PM — 4 posts, 15,300 views.

#0
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.
#1
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.
#2
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!
#3
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.