Frame:SetSecureMode()

From Riftui Wiki

Jump to: navigation, search

Sets the security mode of a frame. Frame:EventMacroSet and Frame:SetMouseoverUnit require a frame in 'restricted' mode and for Inspect.System.Secure to be false (i.e. not in combat). Some other functions such as positioning can operate in 'normal' or 'restricted' mode, but not if in 'restricted' mode when Inspect.System.Secure is true. This allows you to create 'UnitFrames' but prevents addons from making changes in combat that would allow the creation of addons with a single button that heals the raid member with the lowest health for an example.

The parents of 'restricted' frame must be 'restricted' themselves, but they can have 'normal' children.

Contents

Signature

Frame:SetSecureMode(mode)

Parameters

mode(string) - Either "normal" or "restricted"

Return Value

None

Example

local ctx = UI.CreateContext("SampleContext")
local frame = UI.CreateFrame("Frame", "SampleFrame", ctx)
frame:SetPoint("CENTER", UIParent, "CENTER")-- centered in game
frame:SetBackgroundColor(0,1,0) -- green
 
ctx:SetSecureMode("restricted")
frame:SetSecureMode("restricted") -- set restricted mode to allow further changes
 
frame:SetMouseoverUnit("player") -- unit for mouseover is player
frame:EventMacroSet(Event.UI.Input.Mouse.Left.Click, "target @mouseover") -- target player when clicked
Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox