comparison Overlay.lua @ 75:06cd74bdc7da

- Cleaned up Bar interface - Move all attribute setting from Bar into State - Separated Moonkin and Tree of Life - Removed PossessBar module - Added some infrastructure for paged/mind control support to Action
author Flick <flickerstreak@gmail.com>
date Mon, 16 Jun 2008 18:46:08 +0000
parents dd01feae0d89
children da8ba8783924
comparison
equal deleted inserted replaced
74:00e28094e1a3 75:06cd74bdc7da
63 local SetButtonSize = Bar.SetButtonSize 63 local SetButtonSize = Bar.SetButtonSize
64 local SetButtonGrid = Bar.SetButtonGrid 64 local SetButtonGrid = Bar.SetButtonGrid
65 local ApplyAnchor = Bar.ApplyAnchor 65 local ApplyAnchor = Bar.ApplyAnchor
66 66
67 local function StoreExtents(bar) 67 local function StoreExtents(bar)
68 local f = bar.frame 68 local f = bar:GetFrame()
69 local point, relativeTo, relativePoint, x, y = f:GetPoint(1) 69 local point, relativeTo, relativePoint, x, y = f:GetPoint(1)
70 relativeTo = relativeTo or f:GetParent() 70 relativeTo = relativeTo or f:GetParent()
71 local anchorTo 71 local anchorTo
72 for name, b in ReAction:IterateBars() do 72 for name, b in ReAction:IterateBars() do
73 if b and b:GetFrame() == relativeTo then 73 if b and b:GetFrame() == relativeTo then
84 c.y = y 84 c.y = y
85 c.width, c.height = f:GetWidth(), f:GetHeight() 85 c.width, c.height = f:GetWidth(), f:GetHeight()
86 end 86 end
87 87
88 local function StoreSize(bar) 88 local function StoreSize(bar)
89 local f = bar.frame 89 local f = bar:GetFrame()
90 local c = bar.config 90 local c = bar.config
91 c.width, c.height = f:GetWidth(), f:GetHeight() 91 c.width, c.height = f:GetWidth(), f:GetHeight()
92 end 92 end
93 93
94 local function RecomputeButtonSize(bar) 94 local function RecomputeButtonSize(bar)
405 si2:Hide() 405 si2:Hide()
406 end 406 end
407 end 407 end
408 408
409 local function CreateControls(bar) 409 local function CreateControls(bar)
410 local f = bar.frame 410 local f = bar:GetFrame()
411 411
412 f:SetMovable(true) 412 f:SetMovable(true)
413 f:SetResizable(true) 413 f:SetResizable(true)
414 f:SetClampedToScreen(true) 414 f:SetClampedToScreen(true)
415 415
491 f:SetMinResize( bw+s+1, bh+s+1 ) 491 f:SetMinResize( bw+s+1, bh+s+1 )
492 f:StartSizing(point) 492 f:StartSizing(point)
493 f:SetScript("OnUpdate", 493 f:SetScript("OnUpdate",
494 function() 494 function()
495 RecomputeGrid(bar) 495 RecomputeGrid(bar)
496 bar:RefreshLayout()
497 end 496 end
498 ) 497 )
499 end 498 end
500 ) 499 )
501 edge:SetScript("OnMouseUp", StopResize) 500 edge:SetScript("OnMouseUp", StopResize)
538 if btn == "LeftButton" then -- button resize 537 if btn == "LeftButton" then -- button resize
539 f:SetMinResize( (s+12)*c+1, (s+12)*r+1 ) 538 f:SetMinResize( (s+12)*c+1, (s+12)*r+1 )
540 f:SetScript("OnUpdate", 539 f:SetScript("OnUpdate",
541 function() 540 function()
542 RecomputeButtonSize(bar) 541 RecomputeButtonSize(bar)
543 bar:RefreshLayout()
544 updateTooltip() 542 updateTooltip()
545 end 543 end
546 ) 544 )
547 elseif btn == "RightButton" then -- spacing resize 545 elseif btn == "RightButton" then -- spacing resize
548 f:SetMinResize( bw*c, bh*r ) 546 f:SetMinResize( bw*c, bh*r )
549 f:SetScript("OnUpdate", 547 f:SetScript("OnUpdate",
550 function() 548 function()
551 RecomputeButtonSpacing(bar) 549 RecomputeButtonSpacing(bar)
552 bar:RefreshLayout()
553 updateTooltip() 550 updateTooltip()
554 end 551 end
555 ) 552 )
556 end 553 end
557 f:StartSizing(point) 554 f:StartSizing(point)