-- 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. |
| 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). |
SV:SCTMessage('My message', 0.1, 0.2, 0.3, 'STICKY')
| message | string The dialog to be displayed. |
| message | string The dialog to be displayed. |
-- Kill a function
SomeObject.some_function = SV.fubar
| arg | string Name of the popup |
-- Open the 'Reload UI' popup SV:StaticPopup_Show('RL_CLIENT')
| percentage | number The needed gradient percent. |
| ... | (vararg) remaining arguments are up to 3 sets of numeric color values (r,g,b). |
SV:ColorGradient(50,1,0,0,1,1,0,0,1,0)
| red | number Color, red value. |
| green | number Color, green value. |
| blue | number Color, blue value. |
SV:HexColor(0.1, 0.2, 0.3)
| 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. |
SV:FontManager(FontObject, 'default', false, false, 'OUTLINE', 1, 1, 1)
| 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. |
SV:GenerateFontOptionGroup(groupName, groupCount, groupOverview, groupList)