This repository has been archived by the owner on Mar 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
layout.lua
70 lines (54 loc) · 2.24 KB
/
layout.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
--[[ LAYOUT
Contains the layout
]]
local ADDON_NAME, ns = ...
-- grab other files from the namespace
local settings = ns.settings
local lib = ns.lib
local core = ns.core
-- Let's get it on!
local Splash = CreateFrame('Frame')
SplashSettings = nil
-- *********************************************************************************
--[[
]]
local function createPlayer(self)
core.CreateUnitFrame(self, 'player')
self.Buffs = CreateFrame('Frame', nil, self)
self.Buffs:SetSize(floor(cfg.width/(cfg.auraSize+cfg.auraSpacing))*(cfg.auraSize+cfg.auraSpacing)-cfg.auraSpacing, cfg.auraSize)
self.Buffs:SetPoint('TOP', self, 'BOTTOM', 0, -10)
self.Buffs.size = cfg.auraSize
self.Buffs.spacing = cfg.auraSpacing
self.Buffs.num = floor(cfg.width/(cfg.auraSize+cfg.auraSpacing))
self.Buffs.PostCreateIcon = core.PostCreateIcon
self.Debuffs = CreateFrame('Frame', nil, self)
self.Debuffs:SetSize(floor(cfg.width/(cfg.auraSize+cfg.auraSpacing))*(cfg.auraSize+cfg.auraSpacing)-cfg.auraSpacing, cfg.auraSize)
self.Debuffs:SetPoint('BOTTOM', self, 'TOP', 0, 7)
self.Debuffs.size = cfg.auraSize
self.Debuffs.spacing = cfg.auraSpacing
self.Debuffs.num = floor(cfg.width/(cfg.auraSize+cfg.auraSpacing))
self.Debuffs.PostCreateIcon = core.PostCreateIcon
self.Health.PostUpdate = core.UpdateHealth_player
end
--[[
]]
local function createTarget(self)
core.CreateUnitFrameCastbar(self, 'target')
self.Castbar.Text:SetPoint('RIGHT', -15, 0)
self.Castbar.Time = lib.CreateFontObject(self.Castbar, 16, settings.fonts.clear)
self.Castbar.Time:SetPoint('RIGHT', -3, 0)
self.Castbar.Time:SetTextColor(1, 1, 1)
self.Castbar.Time:SetJustifyH('RIGHT')
end
-- *********************************************************************************
Splash:RegisterEvent('ADDON_LOADED')
Splash:SetScript('OnEvent', function(self, event, addon)
if ( addon ~= ADDON_NAME ) then return end
SplashSettings = settings.init
oUF:RegisterStyle('oUF_Splash_player', createPlayer)
oUF:RegisterStyle('oUF_Splash_target', createTarget)
oUF:SetActiveStyle('oUF_Splash_player')
oUF:Spawn('player', 'oUF_Splash_player'):SetPoint('RIGHT', UIParent, 'CENTER', -100, -200)
oUF:SetActiveStyle('oUF_Splash_target')
oUF:Spawn('target', 'oUF_Splash_target'):SetPoint('LEFT', UIParent, 'CENTER', 100, -200)
end)