Mercurial > wow > buffalo2
comparison Veneer.lua @ 79:0784b87f9722
- adjust top anchors for OrderHallCommandBar
author | Nenue |
---|---|
date | Sun, 11 Sep 2016 18:46:30 -0400 |
parents | 83b3cdaae6a5 |
children | bb6b532c5d2f |
comparison
equal
deleted
inserted
replaced
78:08951972041a | 79:0784b87f9722 |
---|---|
15 } | 15 } |
16 } | 16 } |
17 local configMode | 17 local configMode |
18 local veneers = {} | 18 local veneers = {} |
19 | 19 |
20 do | 20 local anonID = 0 |
21 local anonID = 0 | 21 |
22 local AnonymousName = function() | 22 local tostring = tostring |
23 local IsFrameHandle = IsFrameHandle | |
24 local GetAnonymousName = function(key) | |
25 if not key then | |
23 anonID = anonID + 1 | 26 anonID = anonID + 1 |
24 return 'VN' .. anonID | 27 key = anonID |
25 end | 28 end |
29 return 'VN' .. key | |
26 end | 30 end |
31 local GetTableName = function(table) | |
32 return (IsFrameHandle(table) and table:GetName()) or tostring(table) | |
33 end | |
34 | |
35 | |
27 | 36 |
28 local anchor_coefficients = { | 37 local anchor_coefficients = { |
29 ['TOP'] = function(x, y) return x, y end, | 38 ['TOP'] = function(x, y) return x, y end, |
30 ['BOTTOM'] = function(x, y) return x,y end, | 39 ['BOTTOM'] = function(x, y) return x,y end, |
31 ['LEFT'] = function(x, y) return x,y end, | 40 ['LEFT'] = function(x, y) return x,y end, |
133 if not frame then | 142 if not frame then |
134 print('|cFFFF4400Unable to acquire frame...|r') | 143 print('|cFFFF4400Unable to acquire frame...|r') |
135 return | 144 return |
136 end | 145 end |
137 | 146 |
138 | |
139 if veneers[frame] then | 147 if veneers[frame] then |
140 return veneers[frame] | 148 return veneers[frame] |
141 end | 149 end |
142 | 150 |
143 local name = (frame:GetName() or AnonymousName())..'Veneer' | 151 local name = type(frame) == 'table' and GetTableName(frame) or GetAnonymousName() |
144 local veneer = CreateFrame('Frame', name, frame, template or 'VeneerTemplate') | 152 local veneer = CreateFrame('Frame', name, frame, template or 'VeneerTemplate') |
145 print('+veneer', name) | 153 print('+veneer', name) |
146 | 154 |
147 veneer:SetAllPoints(frame) | 155 veneer:SetAllPoints(frame) |
148 veneer:SetParent(frame) | 156 veneer:SetParent(frame) |