flickerstreak@1: flickerstreak@1: -- private constants flickerstreak@1: local insideFrame = 1 flickerstreak@1: local outsideFrame = 2 flickerstreak@1: flickerstreak@1: local pointFindTable = { flickerstreak@1: BOTTOMLEFT = function(f) return f:GetLeft(), f:GetBottom() end, flickerstreak@1: BOTTOM = function(f) return nil, f:GetBottom() end, flickerstreak@1: BOTTOMRIGHT = function(f) return f:GetRight(), f:GetBottom() end, flickerstreak@1: RIGHT = function(f) return f:GetRight(), nil end, flickerstreak@1: TOPRIGHT = function(f) return f:GetRight(), f:GetTop() end, flickerstreak@1: TOP = function(f) return nil, f:GetTop() end, flickerstreak@1: TOPLEFT = function(f) return f:GetLeft(), f:GetTop() end, flickerstreak@1: LEFT = function(f) return f:GetLeft(), nil end, flickerstreak@1: } flickerstreak@1: flickerstreak@1: local oppositePointTable = { flickerstreak@1: BOTTOMLEFT = "TOPRIGHT", flickerstreak@1: BOTTOM = "TOP", flickerstreak@1: BOTTOMRIGHT = "TOPLEFT", flickerstreak@1: RIGHT = "LEFT", flickerstreak@1: TOPRIGHT = "BOTTOMLEFT", flickerstreak@1: TOP = "BOTTOM", flickerstreak@1: TOPLEFT = "BOTTOMRIGHT", flickerstreak@1: LEFT = "RIGHT" flickerstreak@1: } flickerstreak@1: flickerstreak@2: local anchoredLabelColor = { r =0.6, g = 0.2, b = 1.0 } flickerstreak@2: local nonAnchoredLabelColor = { r = 1.0, g = 0.82, b = 0.0 } flickerstreak@2: flickerstreak@1: -- private variables flickerstreak@1: local stickyTargets = { flickerstreak@1: [UIParent] = insideFrame, flickerstreak@1: [WorldFrame] = insideFrame flickerstreak@1: } flickerstreak@1: flickerstreak@1: -- ReBar is an Ace 2 class prototype object. flickerstreak@1: ReBar = AceLibrary("AceOO-2.0").Class("AceEvent-2.0") flickerstreak@1: flickerstreak@1: local dewdrop = AceLibrary("Dewdrop-2.0") flickerstreak@1: flickerstreak@1: function ReBar.prototype:init( config, id ) flickerstreak@1: ReBar.super.prototype.init(self) flickerstreak@1: flickerstreak@2: local buttonClass = config and config.btnConfig and config.btnConfig.type and getglobal(config.btnConfig.type) flickerstreak@1: self.config = config flickerstreak@1: self.barID = id flickerstreak@1: self.class = { button = buttonClass } flickerstreak@1: self.buttons = { } flickerstreak@1: flickerstreak@1: -- create the bar and control widgets flickerstreak@1: self.barFrame = CreateFrame("Frame", "ReBar_"..self.barID, UIParent, "ReBarTemplate") flickerstreak@2: self.controlFrame = getglobal(self.barFrame:GetName().."Controls") flickerstreak@1: self.controlFrame.reBar = self flickerstreak@2: self.barFrame:SetClampedToScreen(true) flickerstreak@1: flickerstreak@1: -- set the text label on the control widget flickerstreak@2: self.labelString = getglobal(self.controlFrame:GetName().."LabelString") flickerstreak@2: self.labelString:SetText(id) flickerstreak@1: flickerstreak@1: -- initialize the bar layout flickerstreak@1: self:ApplySize() flickerstreak@1: self:ApplyAnchor() flickerstreak@1: self:LayoutButtons() flickerstreak@1: self:ApplyVisibility() flickerstreak@1: flickerstreak@1: -- add bar to stickyTargets list flickerstreak@1: stickyTargets[self.barFrame] = outsideFrame flickerstreak@1: flickerstreak@1: -- initialize dewdrop menu flickerstreak@1: dewdrop:Register(self.controlFrame, 'children', function() flickerstreak@1: dewdrop:FeedAceOptionsTable(ReActionGlobalMenuOptions) flickerstreak@1: dewdrop:FeedAceOptionsTable(GenerateReActionBarOptions(self)) flickerstreak@1: dewdrop:FeedAceOptionsTable(GenerateReActionButtonOptions(self)) flickerstreak@1: end, flickerstreak@1: 'cursorX', true, flickerstreak@1: 'cursorY', true flickerstreak@1: ) flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: function ReBar.prototype:Destroy() flickerstreak@1: if self.barFrame == dewdrop:GetOpenedParent() then flickerstreak@1: dewdrop:Close() flickerstreak@1: dewdrop:Unregister(self.barFrame) flickerstreak@1: end flickerstreak@1: flickerstreak@2: self:HideControls() flickerstreak@1: self.barFrame:Hide() flickerstreak@1: self.barFrame:ClearAllPoints() flickerstreak@1: self.barFrame:SetParent(nil) flickerstreak@2: self.barFrame:SetPoint("BOTTOMRIGHT", UIParent, "TOPLEFT", 0, 0) flickerstreak@1: flickerstreak@1: -- need to keep around self.config for dewdrop menus in the process of deleting self flickerstreak@1: flickerstreak@1: while #self.buttons > 0 do flickerstreak@1: self.class.button:release(table.remove(self.buttons)) flickerstreak@1: end flickerstreak@1: flickerstreak@1: -- remove from sticky targets table flickerstreak@1: stickyTargets[self.barFrame] = nil flickerstreak@1: flickerstreak@1: -- remove from global table flickerstreak@1: -- for some reason after a destroy/recreate the globals still reference flickerstreak@1: -- the old frames flickerstreak@1: setglobal(self.barFrame:GetName(), nil) flickerstreak@1: setglobal(self.barFrame:GetName().."Controls", nil) flickerstreak@1: setglobal(self.controlFrame:GetName().."LabelString", nil) flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: -- show/hide the control frame flickerstreak@1: function ReBar.prototype:ShowControls() flickerstreak@1: self.controlFrame:Show() flickerstreak@2: for _, b in ipairs(self.buttons) do flickerstreak@2: b:BarUnlocked() flickerstreak@2: end flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:HideControls() flickerstreak@1: local b = self.barFrame flickerstreak@1: if b.isMoving or b.resizing then flickerstreak@1: b:StopMovingOrSizing() flickerstreak@1: b:SetScript("OnUpdate",nil) flickerstreak@1: end flickerstreak@1: -- close any dewdrop menu owned by us flickerstreak@1: if self.barFrame == dewdrop:GetOpenedParent() then flickerstreak@1: dewdrop:Close() flickerstreak@1: end flickerstreak@2: for _, b in ipairs(self.buttons) do flickerstreak@2: b:BarLocked() flickerstreak@2: end flickerstreak@1: self.controlFrame:Hide() flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: flickerstreak@1: flickerstreak@1: -- accessors flickerstreak@1: function ReBar.prototype:GetVisibility() flickerstreak@1: return self.config.visible flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:ToggleVisibility() flickerstreak@1: self.config.visible = not self.config.visible flickerstreak@1: self:ApplyVisibility() flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:GetOpacity() flickerstreak@1: return self.config.opacity or 100 flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:SetOpacity( o ) flickerstreak@1: self.config.opacity = tonumber(o) flickerstreak@1: self:ApplyVisibility() flickerstreak@1: return self.config.opacity flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: -- layout methods flickerstreak@1: function ReBar.prototype:ApplySize() flickerstreak@1: local buttonSz = self.config.size or 36 flickerstreak@1: local spacing = self.config.spacing or 4 flickerstreak@1: local rows = self.config.rows or 1 flickerstreak@1: local columns = self.config.columns or 12 flickerstreak@1: local w = buttonSz * columns + spacing * (columns + 1) flickerstreak@1: local h = buttonSz * rows + spacing * (rows + 1) flickerstreak@1: local f = self.barFrame flickerstreak@1: flickerstreak@1: -- +1: avoid resizing oddities caused by fractional UI scale setting flickerstreak@1: f:SetMinResize(buttonSz + spacing*2 + 1, buttonSz + spacing*2 + 1) flickerstreak@1: f:SetWidth(w + 1) flickerstreak@1: f:SetHeight(h + 1) flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:ApplyAnchor() flickerstreak@1: local a = self.config.anchor flickerstreak@1: local f = self.barFrame flickerstreak@2: if a then flickerstreak@2: f:ClearAllPoints() flickerstreak@2: f:SetPoint(a.point,getglobal(a.to),a.relPoint,a.x,a.y) flickerstreak@2: local color = anchoredLabelColor flickerstreak@2: if a.to == "UIParent" or a.to == "WorldFrame" then flickerstreak@2: color = nonAnchoredLabelColor flickerstreak@2: end flickerstreak@2: self.labelString:SetTextColor(color.r, color.g, color.b) flickerstreak@2: end flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:ApplyVisibility() flickerstreak@1: local v = self.config.visibility flickerstreak@1: if type(v) == "table" then flickerstreak@1: if v.class then flickerstreak@1: local _, c = UnitClass("player") flickerstreak@1: v = v.class[c] flickerstreak@1: end flickerstreak@1: elseif type(v) == "string" then flickerstreak@1: local value = getglobal(v) flickerstreak@1: v = value flickerstreak@1: end flickerstreak@1: flickerstreak@1: if self.config.opacity then flickerstreak@1: self.barFrame:SetAlpha(self.config.opacity / 100) flickerstreak@1: end flickerstreak@1: flickerstreak@1: if v then flickerstreak@1: self.barFrame:Show() flickerstreak@1: else flickerstreak@1: self.barFrame:Hide() flickerstreak@1: end flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:LayoutButtons() flickerstreak@1: local r = self.config.rows flickerstreak@1: local c = self.config.columns flickerstreak@1: local n = r * c flickerstreak@1: local sp = self.config.spacing flickerstreak@1: local sz = self.config.size flickerstreak@1: local gSize = sp + sz flickerstreak@1: flickerstreak@1: for i = 1, n do flickerstreak@1: if self.buttons[i] == nil then flickerstreak@1: table.insert(self.buttons, self.class.button:acquire(self.barFrame, self.config.btnConfig, i)) flickerstreak@1: end flickerstreak@1: local b = self.buttons[i] flickerstreak@1: if b == nil then flickerstreak@1: break -- handling for button types that support limited numbers flickerstreak@1: end flickerstreak@1: b:PlaceButton("TOPLEFT", sp + gSize * math.fmod(i-1,c), - (sp + gSize * math.floor((i-1)/c)), sz) flickerstreak@1: end flickerstreak@1: flickerstreak@1: -- b == nil, above, should always be the case if and only if i == n. ReBar never monkeys flickerstreak@1: -- with buttons in the middle of the sequence: it always adds or removes on the array end flickerstreak@1: while #self.buttons > n do flickerstreak@1: self.class.button:release(table.remove(self.buttons)) flickerstreak@1: end flickerstreak@1: flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: function ReBar.prototype:StoreAnchor(f, p, rp, x, y) flickerstreak@1: local name = f:GetName() flickerstreak@1: -- no point if we can't store the name or the offsets are incomplete flickerstreak@1: if name and x and y then flickerstreak@1: self.config.anchor = { flickerstreak@1: to = name, flickerstreak@1: point = p, flickerstreak@1: relPoint = rp or p, flickerstreak@1: x = x, flickerstreak@1: y = y flickerstreak@1: } flickerstreak@1: end flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: flickerstreak@1: -- mouse event handlers (clicking/dragging/resizing the bar) flickerstreak@1: function ReBar.prototype:BeginDrag() flickerstreak@1: local f = self.barFrame flickerstreak@1: f:StartMoving() flickerstreak@1: f.isMoving = true flickerstreak@1: f:SetScript("OnUpdate", function() self:StickyIndicatorUpdate() end) flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:FinishDrag() flickerstreak@1: local f, p, rp, x, y flickerstreak@1: local bf = self.barFrame flickerstreak@1: flickerstreak@1: bf:StopMovingOrSizing() flickerstreak@1: bf.isMoving = false flickerstreak@1: flickerstreak@1: bf:SetScript("OnUpdate",nil) flickerstreak@1: if IsShiftKeyDown() then flickerstreak@1: f, p, rp, x, y = self:GetStickyAnchor() flickerstreak@1: ReBarStickyIndicator1:Hide() flickerstreak@1: ReBarStickyIndicator2:Hide() flickerstreak@1: end flickerstreak@1: flickerstreak@1: if f == nil then flickerstreak@1: f = UIParent flickerstreak@1: local _ flickerstreak@1: _, p,rp,x,y = self:GetClosestPointTo(f) flickerstreak@1: end flickerstreak@1: flickerstreak@1: if f then flickerstreak@1: self:StoreAnchor(f,p,rp,x,y) flickerstreak@1: self:ApplyAnchor() flickerstreak@1: end flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:BeginBarResize( sizingPoint ) flickerstreak@1: local f = self.barFrame flickerstreak@1: f:StartSizing(sizingPoint) flickerstreak@1: f.resizing = true flickerstreak@1: f:SetScript("OnUpdate",function() self:ReflowButtons() end) flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:BeginButtonResize( sizingPoint, mouseBtn ) flickerstreak@1: local f = self.barFrame flickerstreak@1: f:StartSizing(sizingPoint) flickerstreak@1: f.resizing = true flickerstreak@1: local r = self.config.rows flickerstreak@1: local c = self.config.columns flickerstreak@1: local s = self.config.spacing flickerstreak@1: local sz = self.config.size flickerstreak@1: if mouseBtn == "LeftButton" then flickerstreak@1: f:SetMinResize(c*(12 + 2*s) +1, r*(12 + 2*s) +1) flickerstreak@1: f:SetScript("OnUpdate",function() self:DragSizeButtons() end) flickerstreak@1: elseif mouseBtn == "RightButton" then flickerstreak@1: f:SetMinResize(c*sz+1, r*sz+1) flickerstreak@1: f:SetScript("OnUpdate",function() self:DragSizeSpacing() end) flickerstreak@1: end flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:FinishResize() flickerstreak@1: local f = self.barFrame flickerstreak@1: f:StopMovingOrSizing() flickerstreak@1: f.resizing = false flickerstreak@1: f:SetScript("OnUpdate",nil) flickerstreak@1: self:ApplySize() flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: flickerstreak@1: flickerstreak@1: -- sticky anchoring functions flickerstreak@1: function ReBar.prototype:StickyIndicatorUpdate() flickerstreak@1: local si1 = ReBarStickyIndicator1 flickerstreak@1: local si2 = ReBarStickyIndicator2 flickerstreak@1: if IsShiftKeyDown() then flickerstreak@1: local f, p, rp, x, y = self:GetStickyAnchor() flickerstreak@1: if f then flickerstreak@1: si1:ClearAllPoints() flickerstreak@1: si2:ClearAllPoints() flickerstreak@1: si1:SetPoint("CENTER",self.barFrame,p,0,0) flickerstreak@1: si2:SetPoint("CENTER",f,rp,x,y) flickerstreak@1: si1:Show() flickerstreak@1: si2:Show() flickerstreak@1: return nil flickerstreak@1: end flickerstreak@1: end flickerstreak@1: si1:Hide() flickerstreak@1: si2:Hide() flickerstreak@1: si1:ClearAllPoints() flickerstreak@1: si2:ClearAllPoints() flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:CheckAnchorable(f) flickerstreak@1: -- can't anchor to self or to a hidden frame flickerstreak@1: if f == self.barFrame or not(f:IsShown()) then return false end flickerstreak@1: flickerstreak@1: -- also can't anchor to frames that are anchored to self flickerstreak@1: for i = 1, f:GetNumPoints() do flickerstreak@1: local _, f2 = f:GetPoint(i) flickerstreak@1: if f2 == self.barFrame then return false end flickerstreak@1: end flickerstreak@1: flickerstreak@1: return true flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: function ReBar.prototype:GetStickyAnchor() flickerstreak@1: local snapRange = (self.config.size + self.config.spacing) flickerstreak@1: local r2, f, p, rp, x, y = self:GetClosestAnchor() flickerstreak@1: flickerstreak@1: if f and p then flickerstreak@1: local xx, yy = pointFindTable[p](f) flickerstreak@1: if r2 and r2 < (snapRange*snapRange) then flickerstreak@1: if xx or math.abs(x) < snapRange then x = 0 end flickerstreak@1: if yy or math.abs(y) < snapRange then y = 0 end flickerstreak@1: elseif not(yy) and math.abs(x) < snapRange then flickerstreak@1: x = 0 flickerstreak@1: elseif not(xx) and math.abs(y) < snapRange then flickerstreak@1: y = 0 flickerstreak@1: else flickerstreak@1: f = nil -- nothing in range flickerstreak@1: end flickerstreak@1: end flickerstreak@1: return f, p, rp, x, y flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:GetClosestAnchor() flickerstreak@1: -- choose the closest anchor point on the list of target frames flickerstreak@1: local range2, frame, point, relPoint, offsetX, offsetY flickerstreak@1: flickerstreak@1: for f, tgtRegion in pairs(stickyTargets) do flickerstreak@1: if self:CheckAnchorable(f) then flickerstreak@1: local r2 ,p, rp, x, y = self:GetClosestPointTo(f,tgtRegion) flickerstreak@1: if r2 then flickerstreak@1: if not(range2 and range2 < r2) then flickerstreak@1: range2, frame, point, relPoint, offsetX, offsetY = r2, f, p, rp, x, y flickerstreak@1: end flickerstreak@1: end flickerstreak@1: end flickerstreak@1: end flickerstreak@1: flickerstreak@1: return range2, frame, point, relPoint, offsetX, offsetY flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:GetClosestPointTo(f,inside) flickerstreak@1: local range2, point, relPoint, offsetX, offsetY flickerstreak@1: local pft = pointFindTable flickerstreak@1: local cx, cy = self.barFrame:GetCenter() flickerstreak@1: local fcx, fcy = f:GetCenter() flickerstreak@1: local fh = f:GetHeight() flickerstreak@1: local fw = f:GetWidth() flickerstreak@1: flickerstreak@1: -- compute whether edge bisector intersects target edge flickerstreak@1: local dcx = math.abs(cx-fcx) < fw/2 and (cx-fcx) flickerstreak@1: local dcy = math.abs(cy-fcy) < fh/2 and (cy-fcy) flickerstreak@1: flickerstreak@1: for p, func in pairs(pft) do flickerstreak@1: local rp, x, y flickerstreak@1: if inside == outsideFrame then flickerstreak@1: rp = oppositePointTable[p] flickerstreak@1: x, y = self:GetOffsetToPoint(f, func, pft[rp]) flickerstreak@1: else flickerstreak@1: rp = p flickerstreak@1: x, y = self:GetOffsetToPoint(f, func, func) flickerstreak@1: end flickerstreak@1: flickerstreak@1: -- if anchoring to an edge, only anchor if the center point overlaps the other edge flickerstreak@1: if (x or dcx) and (y or dcy) then flickerstreak@1: local r2 = (x or 0)^2 + (y or 0)^2 flickerstreak@1: if range2 == nil or r2 < range2 then flickerstreak@1: range2, point, relPoint, offsetX, offsetY = r2, p, rp, x or dcx, y or dcy flickerstreak@1: end flickerstreak@1: end flickerstreak@1: end flickerstreak@1: return range2, point, relPoint, offsetX, offsetY flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:GetOffsetToPoint(f,func,ffunc) flickerstreak@1: local x, y = func(self.barFrame) -- coordinates of the point on this frame flickerstreak@1: local fx, fy = ffunc(f) -- coordinates of the point on the target frame flickerstreak@1: -- guarantees: if x then fx, if y then fy flickerstreak@1: return x and (x-fx), y and (y-fy) flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: flickerstreak@1: flickerstreak@1: flickerstreak@1: flickerstreak@1: -- utility function to get the height, width, and button size attributes flickerstreak@1: function ReBar.prototype:GetLayout() flickerstreak@1: local c = self.config flickerstreak@1: local f = self.barFrame flickerstreak@1: return f:GetWidth(), f:GetHeight(), c.size, c.rows, c.columns, c.spacing flickerstreak@1: end flickerstreak@1: flickerstreak@1: -- add and remove buttons dynamically as the bar is resized flickerstreak@1: function ReBar.prototype:ReflowButtons() flickerstreak@1: local w, h, sz, r, c, sp = self:GetLayout() flickerstreak@1: flickerstreak@1: self.config.rows = math.floor( (h - sp) / (sz + sp) ) flickerstreak@1: self.config.columns = math.floor( (w - sp) / (sz + sp) ) flickerstreak@1: flickerstreak@1: if self.config.rows ~= r or self.config.columns ~= c then flickerstreak@1: self:LayoutButtons() flickerstreak@1: end flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: -- change the size of buttons as the bar is resized flickerstreak@1: function ReBar.prototype:DragSizeButtons() flickerstreak@1: local w, h, sz, r, c, sp = self:GetLayout() flickerstreak@1: flickerstreak@1: local newSzW = math.floor((w - (c+1)*sp)/c) flickerstreak@1: local newSzH = math.floor((h - (r+1)*sp)/r) flickerstreak@1: flickerstreak@1: self.config.size = math.max(12, math.min(newSzW, newSzH)) flickerstreak@1: flickerstreak@1: if self.config.size ~= sz then flickerstreak@1: self:LayoutButtons() flickerstreak@1: self:UpdateResizeTooltip() flickerstreak@1: end flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: -- change the spacing of buttons as the bar is resized flickerstreak@1: function ReBar.prototype:DragSizeSpacing() flickerstreak@1: local w, h, sz, r, c, sp = self:GetLayout() flickerstreak@1: flickerstreak@1: local newSpW = math.floor((w - c*sz)/(c+1)) flickerstreak@1: local newSpH = math.floor((h - r*sz)/(r+1)) flickerstreak@1: flickerstreak@1: self.config.spacing = math.max(0, math.min(newSpW, newSpH)) flickerstreak@1: flickerstreak@1: if self.config.spacing ~= sp then flickerstreak@1: self:LayoutButtons() flickerstreak@1: self:UpdateResizeTooltip() flickerstreak@1: end flickerstreak@1: end flickerstreak@1: flickerstreak@1: flickerstreak@1: -- update the drag tooltip to indicate current sizes flickerstreak@1: function ReBar.prototype:UpdateResizeTooltip() flickerstreak@1: GameTooltipTextRight4:SetText(self.config.size) flickerstreak@1: GameTooltipTextRight5:SetText(self.config.spacing) flickerstreak@1: GameTooltip:Show() flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:ShowTooltip() flickerstreak@1: GameTooltip:SetOwner(self.barFrame, "ANCHOR_TOPRIGHT") flickerstreak@1: GameTooltip:AddLine("Bar "..self.barID) flickerstreak@1: GameTooltip:AddLine("Drag to move") flickerstreak@1: GameTooltip:AddLine("Shift-drag for sticky mode") flickerstreak@1: GameTooltip:AddLine("Right-click for options") flickerstreak@1: GameTooltip:Show() flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:ShowButtonResizeTooltip(point) flickerstreak@1: GameTooltip:SetOwner(self.barFrame, "ANCHOR_"..point) flickerstreak@1: GameTooltip:AddLine("Drag to resize buttons") flickerstreak@1: GameTooltip:AddLine("Right-click-drag") flickerstreak@1: GameTooltip:AddLine("to change spacing") flickerstreak@1: GameTooltip:AddDoubleLine("Size: ", "0") flickerstreak@1: GameTooltip:AddDoubleLine("Spacing: ", "0") flickerstreak@1: self:UpdateResizeTooltip() flickerstreak@1: end flickerstreak@1: flickerstreak@1: function ReBar.prototype:ShowBarResizeTooltip(point) flickerstreak@1: GameTooltip:SetOwner(self.barFrame, "ANCHOR_"..point) flickerstreak@1: GameTooltip:AddLine("Drag to add/remove buttons") flickerstreak@1: GameTooltip:Show() flickerstreak@1: end