Documentation
Contents
Menu
SVUI_Core
SVUI is our global addon object.
  • SuperVillain UI Core Module.
  • Release: 1.0.0
  • Author: Steven Jackson (2014)

    -- Every other file will set a reference to the addon using this variable. Here is how we set it.

    -- METHOD 1 ----------------------------------------------------------------
    -- if we are setting this inside the core.lua file then use this method
    local global = "SVUI_Global"    -- reference to SavedVariables
    local errors = "SVUI_Errors"    -- reference to SavedVariables
    local private = "SVUI_Private"  -- reference to SavedVariables
    local media = "SVUI_Media"      -- reference to SavedVariables
    local shared = "SVUI_Shared"    -- reference to SavedVariables

    local Registry = Librarian("Registry")  -- now pull down the Registry object
    -- finally we use the 'NewCore' function specifically for this
    local SV = Registry:NewCore(global, errors, private, media, shared)

    -- METHOD 2 ----------------------------------------------------------------
    -- if we are setting the variable in any other file then use this method
    local SV = _G['SVUI']

SCTMessage (message, red, green, blue, displayType) Send messages to the scrolling message frame (combat text).
AddonMessage (message) Send messages to the chat frame prefixed with the addon branding.
CharacterMessage (message) Send messages to the chat frame as if they came from your character.
fubar () Dummy function used to override existing methods, effectively killing them.
StaticPopup_Show (arg) Request specific ‘Static Popup’ windows.
ResetAllUI () Reset all SVUI created settings to defaults.
ResetUI () Reset layout positions back to their default.
ToggleConfig () Open the config menu (‘/sv’).
VersionCheck () Checks to see which (if any) version of the core that the client has installed.
RefreshEverything () Reloads all current packages and modules.
ColorGradient (percentage, ...) Returns a color value based on percentages.
HexColor (red, green, blue) Returns a hexadecimal color value.
FontManager (obj, template, abstract, sizeMod, styleOverride, red, green, blue) Adds a font object to the custom SVUI font manager.
GenerateFontOptionGroup (groupName, groupCount, groupOverview, groupList) Create an add-in set of specific font configuration options.



SCTMessage (message, red, green, blue, displayType)
Send messages to the scrolling message frame (combat text).
Parameters:
message string The dialog to be displayed.
red Text coloring, red value.
green Text coloring, green value.
blue Text coloring, blue value.
displayType Special animation type (STICKY, CRITICAL or nil).
Usage:
    SV:SCTMessage('My message', 0.1, 0.2, 0.3, 'STICKY')
AddonMessage (message)
Send messages to the chat frame prefixed with the addon branding.
Parameters:
message string The dialog to be displayed.
CharacterMessage (message)
Send messages to the chat frame as if they came from your character.
Parameters:
message string The dialog to be displayed.
fubar ()
Dummy function used to override existing methods, effectively killing them.
Returns:
    nothing.
Usage:
       -- Kill a function
       SomeObject.some_function = SV.fubar
StaticPopup_Show (arg)
Request specific ‘Static Popup’ windows.
Parameters:
arg string Name of the popup
Usage:
       -- Open the 'Reload UI' popup
       SV:StaticPopup_Show('RL_CLIENT')
ResetAllUI ()
Reset all SVUI created settings to defaults.
ResetUI ()
Reset layout positions back to their default.
ToggleConfig ()
Open the config menu (‘/sv’).
VersionCheck ()
Checks to see which (if any) version of the core that the client has installed.
RefreshEverything ()
Reloads all current packages and modules.
ColorGradient (percentage, ...)
Returns a color value based on percentages.
Parameters:
percentage number The needed gradient percent.
... (vararg) remaining arguments are up to 3 sets of numeric color values (r,g,b).
Returns:
    red value, green value, blue value
Usage:
    SV:ColorGradient(50,1,0,0,1,1,0,0,1,0)
HexColor (red, green, blue)
Returns a hexadecimal color value.
Parameters:
red number Color, red value.
green number Color, green value.
blue number Color, blue value.
Returns:
    Hexadecimal string color
Usage:
    SV:HexColor(0.1, 0.2, 0.3)
FontManager (obj, template, abstract, sizeMod, styleOverride, red, green, blue)
Adds a font object to the custom SVUI font manager.
Parameters:
obj Font object.
template string Internal name of the media-font to be assigned.
abstract A multi-use flag.
sizeMod Font size override.
styleOverride Outline override.
red number Color, red value.
green number Color, green value.
blue number Color, blue value.
Usage:
    SV:FontManager(FontObject, 'default', false, false, 'OUTLINE', 1, 1, 1)
GenerateFontOptionGroup (groupName, groupCount, groupOverview, groupList)
Create an add-in set of specific font configuration options.
Parameters:
groupName string Options group to insert into.
groupCount number Option order for this option.
groupOverview string Option group name for this option.
groupList table Array of relevant font data.
Usage:
    SV:GenerateFontOptionGroup(groupName, groupCount, groupOverview, groupList)