oUF Lybrial

Addons
556 Downloads Last Updated: Feb 12, 2019 Game Version: 8.1.0

oUF Lybrial is an invisible layout.
It's meant to be used for the Lybrial UI.


It has the following features:

The following units are supported:

  • Player
  • Focus
  • Pet
  • Target
  • Target of Target

This Layout can be used by anyone who creates UnitFrames using WeakAuras

to make them clickable. It is indeed possible to make WeakAuras clickable with 
WeakAuras alone but it is not recommended since it is very hacky and comes 
hand in hand with some bugs.

You can adjust position and size by typing /lmf into the ingame chat.
Alternatively you can adjust position and size directly inside the code.
As you can see in the following code the Player UnitFrame for example
has a width of 200, a height of 30 and is located at x = -230 and y = -250
relative to the CENTER of the screen.

local _, ns = ...
local oUF = ns.oUF

local UnitSpecific = {
	player = function(self)
		self:SetWidth(200)
	end,
	focus = function(self)
		self:SetWidth(100)
	end,
	pet = function(self)
		self:SetWidth(100)
	end,
	target = function(self)
		self:SetWidth(200)
	end,
	targettarget = function(self)
		self:SetWidth(100)
	end
}

local function Shared(self, unit)
	self:RegisterForClicks('AnyUp')
	self:SetScript('OnEnter', UnitFrame_OnEnter)
	self:SetScript('OnLeave', UnitFrame_OnLeave)
	self:SetHeight(30)

	if (UnitSpecific[unit]) then
		return UnitSpecific[unit](self)
	end
end

oUF:RegisterStyle('Lybrial', Shared)
oUF:Factory(function(self)
	self:SetActiveStyle('Lybrial')
	self:Spawn('player'):SetPoint('CENTER', -230, -250)
	self:Spawn('focus'):SetPoint('CENTER', -180, -280)
	self:Spawn('pet'):SetPoint('CENTER', -280, -280)
	self:Spawn('target'):SetPoint('CENTER', 230, -250)
	self:Spawn('targettarget'):SetPoint('CENTER', 280, -280)
end)
 

 

 

Comments

Posts Quoted: