PGUI System API
The PGUI System is a pseudo-graphical user interface created with html tags. It is used to wrap output data from the bot such as messages, images, etc and neatly present it to the server in the form of an html table with clean formatting.
Simple Pre-Configured PGUI
Use one of the two commands below:
-
Simple PGUI with only text content:
quick_gui(...)
-
Simple PGUI with only text content and 1 image (with an optional caption):
quick_gui_img(...)
Custom PGUI - 5 Step Guide
-
Open the PGUI Container:
open_box(...)
-
Prepare PGUI Content:
make_content(...)
-
Fill the PGUI Container with PGUI Content:
append_row(...)
-
Close the PGUI Container:
close_box(...)
-
Display the PGUI:
display_box(...)
PGUI API Quick Start For Custom Plugins:
Most plugins will probably only need the quick_gui
and quick_img_gui
methods to get pgui
integration.
To send output data wrapped in a PGUI, you have the following methods available:
quick_gui(...)
- This method creates a quick pgui using the default pgui properties set in the config.ini file. It wraps text content in a pgui and sends it to the server to display. Refer to any built-in plugin that displays data to see how this method is used.- Required Parameters:
content
: This can be either a string or a list of strings. The string(s) provided here will be the text displayed in the pgui.
- Override Parameters:
channel
: None or "channel name". Sends the pgui message to the specified channel. 'None' echoes it to the current channel the bot is in. (default=None)user
: None or "user name". Sends the pgui message to a specified user. (default=None)ignore_whisper
: Decide if the echo message should ignore whisper targets. (default=False)text_type
: "data" for normal text, "header" for header text. (default="data")text_color
: "red", "white", "blue" and any other Qt supported color strings which overrides the text color of the pgui. (default="white")text_font
: None, "Calibri", "Impact", "Comic Sans" and any other Qt supported font. (default=set in config.ini)text_align
: "center", "left", or "right" for text alignment formatting in html. (default="center")bg_color
: "red", "white", "blue" and any other Qt supported color strings which overrides the background canvas color of the pgui. (default="black")border
: None or float/int value. Works the same as table borders in html. (default=None)row_align
: "center", "left", or "right" for table row alignment formatting in html. (default="center")cellpadding
: "1, 2, 3, etc". Works the same as table cell padding in html. (default="5")cellspacing
: "1, 2, 3, etc". Works the same as table cell spacing in html. (default="5")
- Required Parameters:
quick_gui_img(...)
- This method creates a quick pgui with image support using the default pgui properties set in the config.ini file. It wraps image content in a pgui and sends it to the server to display. Refer to the youtube plugin to see how this method is used for youtube thumbnails.Overrides
:format
: True/False, use True if the image needs to be formatted for mumble or False if it is already pre-processed. (default=False)caption
: None or "caption_text". Appends a text caption to the image. (default=None)caption_font
: None or "Calibri", "Impact", "Comic Sans" and any other Qt supported font. (default=set in config.ini)caption_align
: "center", "left", or "right" for text alignment formatting in html.bg_color
: "red", "white", "blue" and any other Qt supported color strings which overrides the background canvas color of the pgui. (default="black")channel
: None or "channel name". Sends the pgui message to the specified channel. 'None' echoes it to the current channel the bot is in. (default=None)user
: None or "user name". Sends the pgui message to a specified user. (default=None)ignore_whisper
: Decide if the echo message should ignore whisper targets. (default=False)img_size
: Set the finalized image size goal after processing. (default=65536 (65Kb))cellspacing
: "1, 2, 3, etc". Works the same as table cell spacing in html. (default="5")
open_box(...)
- This method opens a container for pgui allowing full customization of what the pgui contains. Refer to the help plugin to see how this method is used.- Overrides:
bg_color
: "red", "white", "blue" and any other Qt supported color strings which overrides the background canvas color of the pgui. (default="black")border
: None or float/int value. Works the same as table borders in html. (default=None)align
: None, "center", "left", "right". Works the same as table alignment in html. (default=None)cellpadding
: "1, 2, 3, etc". Works the same as table cell padding in html. (default="5")cellspacing
: "1, 2, 3, etc". Works the same as table cell spacing in html. (default="5")
- Overrides:
make_content(...)
- This method takes in text-content and prepares it so that it is ready to use for the PGUI. This is used when a custom gui is being made after the open_box() method.- Overrides:
text
: Any string text-content.text_type
: "data" or "header". "data" content is formatted like regular text and "header" content is bold.text_color
: "red", "white", "blue" and any other Qt supported color strings which overrides the text color of the pgui. (default="white")text_font
: None, "Calibri", "Impact", "Comic Sans" and any other Qt supported font. (default=set in config.ini)text_align
: None, "center", "left", "right". Works the same as text alignment in html. (default="center")image
: True/False. Sets the image flag so that the PGUI can format the image into a usable format.
- Overrides:
append_row(...)
- This method takes in prepared PGUI content and appends it to the PGUI with appropriate table formatting. This is used when a custom gui is being made after the open_box() method.- Overrides:
content
: Any string text-content.align
: None, "center", "left", "right". Works the same as table row alignment in html. (default="center")
- Overrides:
append_content(...)
- This method takes in non-prepared text-content and appends it directly to the PGUI content without any formatting. For most cases, I recommend using the append_row() method as it creates a cleaner gui.- Overrides
content
: Any string text-content.
- Overrides
close_box()
- This method closes a pgui container to prepare it for displaying.display_box(...)
- This method displays uses a closed pgui container and sends it to the server to display.- Overrides:
user
: None or "user name". Sends the pgui message to a specified user. (default=None)
- Overrides:
get_box_content()
: Returns the contents of the currently open PGUI container.clear_display()
: Clears the contents of the currently open PGUI container.