Lunar.registerForAutohide
From WoWWiki
This article is a part of the documentation of the Eclipse function library
--[[
registerForAutohide ( {reglist} )
Registers a frame to be autohidden. This is the main function for interfacing with
Lunar. The function will register the frame, as well as a chat command, and a
GUI option if you provide it the info it needs to do so.
Args:
reglist - the table of options, some options will be listed more than once to show when they are
needed, but only set them once
{
Data required to register a frame for autohiding:
(string) name - The name of this configuration, should be the name of the frame to autohide if
you aren't passing frames
Optional data for autohiding:
(bool) enabled - If this is true, then the option will be enabled by default
(number) time - Sets the default value for the amount of time the mouse must hover to show
(string or table) frames - The name of the frame to autohide, or a list of frames to autohide,
if not specified, name is used.
{
(string or table) - Each entry can be either a string with the name of the frame, or a table
specifying a range of frames
If you pass the table specifying the range it will take the name and tack
on a number at the end based on min, and max.
Ex, {name="PartyFrame", min=1, max=4} will register "PartyFrame1" though
"PartyFrame4" Alternative Ex, {name="Party%dFrame", min=1, max=4} will
register "Party1Frame" though "Party4Frame"
{
(string) name - The base name of this set of frames to to hide. If this contains a format
character such as %d, it will be replaced with the frame number, otherwise
the frame number will be added to the end.
(number) min - The lowest number frame to start with
(number) max - The highest number of frame to end with
}
}
(string or table) checkframes - The name of the frame, or a list of frames to check for mouse,
if not specified, frames is used. These frames are the ones
checked to see if the mouse is over, and will cause poping when
it is. If you pass "" no frames will be checked, and only the
reqs will matter.
{
(string or table) - Each entry can be either a string with the name of the frame, or a table
specifying a range of frames. If you pass the table specifying the range
it will take the name and tack on a number at the end based on min, and max.
Ex, {name="PartyFrame", min=1, max=4} will register "PartyFrame1" though
"PartyFrame4" Alternative Ex, {name="Party%dFrame", min=1, max=4} will
register "Party1Frame" though "Party4Frame"
{
(string) name - The base name of this set of frames to to hide. If this contains a format
character such as %d, it will be replaced with the frame number, otherwise
the frame number will be added to the end.
(number) min - The lowest number frame to start with
(number) max - The highest number of frame to end with
}
}
Data required to register a slash command:
(string or table) slashcom - The slash command, Ex. "framename", or this can be a list of commands
Ex. {"framename", "fname", "fn"}
Optional slash command data:
(string) slashname - The name to display for this option when printing status from a slash command
change, defaults to uiname
(string) slashhelp - Message to show next to the slash command when help is printed, if not
passed then this is generated from uiname, or name if uiname isn't
available.
Data required to register a UI option:
(string) uiname - The name to display for the option in the UI, defaults to slashname
or
(string) uilabel - The label to display for the option in the UI, if this isn't passed, it
it is then generated based on uiname.
Optional data for the UI:
(string) uidesc - The description to display for the option in the UI
(number) uidiff - The difficulty of the option in the UI
(string) uisec - The section to put the option in, if not passed, will put it in VisibilityOptions
(string) uiseclabel - The name of the section to put the option in, only pointful if putting
into a new section.
(string) uisecdesc - The description of the section to put the option in, only pointful if
putting into a new section.
(number) uisecdiff - The difficulty of the section to put the option in, only pointful if
putting into a new section.
(string) uisep - The separator to put the option behind, if not passed, will put it behind
an Autohide separator.
(string) uiseplabel - The name of the separator to put the option behind, only pointful if
putting behind a new separator.
(string) uisepdesc - The description of the separator to put the option behind, only
pointful if putting behind a new section.
(number) uisepdiff - The difficulty of the separator to put the option in, only pointful if
putting into a new separator.
Optional:
(function) callback - A function that can be called to allow for advanced behavior.
This function can either be called instead of the internal
functions for showing/hiding the frame. Or it can be called
just before the frame is about to be shown/hidden. Or it can
be called just after the frame is shown/hidden.
(string) callhow - How/When to call the callback. Here is a list of the options as
as well as the functions that are called:
Eclipse.Lunar.CALL_INSTEAD - This is default. The function will
be called instead of the internal code for checking whether to
show or not. You are responsible for showing the frame in this
case.
function ( whichUI, isEnabled, xPos, yPos )
(string) whichUI - The name of the frame we are checking
(number) isEnabled - 1 if the option is enabled, 0 if not
(number) xPos - The X position of the mouse cursor
(number) yPos - The Y position of the mouse cursor
Eclipse.Lunar.CALL_BEFORE - The function will be called just
before the frame is hidden/shown. If the function returns
true, then the show/hide will be canceled.
function ( whichUI, isEnabled, doShow )
(string) whichUI - The name of the frame we are checking
(number) isEnabled - 1 if the option is enabled, 0 if not
(number) doShow - 1 if it is showing, 0 if it is hiding
Eclipse.Lunar.CALL_AFTER - The function will be called just
after the frame is hidden/shown.
function ( whichUI, isEnabled, isShowing )
(string) whichUI - The name of the frame we are checking
(number) isEnabled - 1 if the option is enabled, 0 if not
(number) isShowing - true if the frame is shown, false if not
The following options are provided as convience wrappers to Eclipses SetFrame function
See Eclipse.SetFrame for further details:
(table) reqs - A table of requirements. The frame(s) will only show if all requirements
are met.
(boolean) manual - Should Eclipse have full control of the frames hiding/showing
(table) state - The default state of the frame
(function) onupdate - the OnUpdate function for the frame, if it needs called while hidden
(multi) top - the distance from the bottom of the screen to the top of the frame
(multi) left - the distance from the left of the screen to the left of the frame
(multi) bottom - the distance from the bottom of the screen to the bottom of the frame
(multi) right - the distance from the left of the screen to the right of the frame
(number) toppad - the amount of padding to add to the top of the frame
(number) leftpad - the amount of padding to add to the left of the frame
(number) bottompad - the amount of padding to add to the bottom of the frame
(number) rightpad - the amount of padding to add to the right of the frame
}
]]--
