Mercurial > wow > buffalo2
comparison BuffFrame/BuffAnchors.lua @ 49:16465f3fd919
- remove UpdateAnchorAnchors and use hardlink for the one frame that this applied to
| author | Nenue |
|---|---|
| date | Fri, 29 Apr 2016 10:50:27 -0400 |
| parents | 9837069e366a |
| children | d7655c4e6e06 |
comparison
equal
deleted
inserted
replaced
| 48:9837069e366a | 49:16465f3fd919 |
|---|---|
| 132 print(frame:GetName(), frame:GetSize()) | 132 print(frame:GetName(), frame:GetSize()) |
| 133 print(frame:GetPoint(1)) | 133 print(frame:GetPoint(1)) |
| 134 end | 134 end |
| 135 | 135 |
| 136 --- Handles placement of anchors embedded within anchors (consolidated buffs, maybe temp enchant) | 136 --- Handles placement of anchors embedded within anchors (consolidated buffs, maybe temp enchant) |
| 137 buffFrame.UpdateAnchorAnchors = function() | |
| 138 local displays = buffFrame.displays | |
| 139 local c = buffFrame.Conf | |
| 140 local guides = buffFrame.guides | |
| 141 local print = fprint() | |
| 142 for buttonName, d in pairs(displays) do | |
| 143 local c = displays[buttonName].conf | |
| 144 local frame = buffFrame.anchors[buttonName] | |
| 145 local parent, child = c.Parent, c.Position | |
| 146 | |
| 147 frame.parent = nil | |
| 148 if c[buttonName .. 'Parent'] and _G[c[buttonName .. 'Parent']..'Anchor'] then | |
| 149 | |
| 150 local anchorAnchor = _G[c[buttonName .. 'Parent']..'Anchor'] | |
| 151 local anchorTarget = guides[parent][child] | |
| 152 if anchorTarget then | |
| 153 print('link', buttonName, 'to', parent, child) | |
| 154 print(parent, child, displays[parent].guides[child]) | |
| 155 local ac = displays[parent].conf | |
| 156 local anchorFrom, anchorTo = unpack(ac.Point) | |
| 157 frame:ClearAllPoints() | |
| 158 frame:SetPoint(anchorFrom, anchorTarget, anchorTo) | |
| 159 frame.parent = anchorTarget | |
| 160 anchorTarget.contains = frame | |
| 161 anchorAnchor.contains = frame | |
| 162 anchorAnchor.containPosition = child | |
| 163 else | |
| 164 frame.parent = anchorAnchor | |
| 165 anchorAnchor.contains = frame | |
| 166 anchorAnchor.containPosition = nil | |
| 167 end | |
| 168 else | |
| 169 frame.parent = nil | |
| 170 end | |
| 171 | |
| 172 end | |
| 173 end | |
| 174 | 137 |
| 175 -- if facing key direction, anchor point [1] to parent's point [2] | 138 -- if facing key direction, anchor point [1] to parent's point [2] |
| 176 local childFacing = { | 139 local childFacing = { |
| 177 ['TOP'] = {'TOP', 'BOTTOM'}, | 140 ['TOP'] = {'TOP', 'BOTTOM'}, |
| 178 ['BOTTOM'] = {'BOTTOM', 'TOP'}, | 141 ['BOTTOM'] = {'BOTTOM', 'TOP'}, |
