flickerstreak@25: --[[ flickerstreak@25: ReAction Configuration UI module flickerstreak@25: flickerstreak@25: This modules creates and manages ReAction configuration flickerstreak@25: elements, including: flickerstreak@25: flickerstreak@30: - Interface Options panel flickerstreak@25: - bar dragging and resizing control overlays flickerstreak@25: - contextual menus flickerstreak@25: flickerstreak@25: Individual modules are responsible for populating these flickerstreak@30: configuration elements via ReAction:RegisterOptions(). The flickerstreak@30: valid values of 'context' are: flickerstreak@30: flickerstreak@30: - 'global' : added to the Global Settings tab flickerstreak@30: - 'module' : added to the Module Settings tab flickerstreak@30: - 'bar' : added to the Bar Settings tab flickerstreak@30: - 'barMenu' : shown on the bar contextual menu flickerstreak@25: flickerstreak@25: --]] flickerstreak@25: flickerstreak@25: -- local imports flickerstreak@25: local ReAction = ReAction flickerstreak@25: local L = ReAction.L flickerstreak@25: local _G = _G flickerstreak@30: local InCombatLockdown = InCombatLockdown flickerstreak@30: flickerstreak@25: local Dewdrop = AceLibrary("Dewdrop-2.0") flickerstreak@25: flickerstreak@25: -- module declaration flickerstreak@25: local moduleID = "ConfigUI" flickerstreak@25: local module = ReAction:NewModule( moduleID, flickerstreak@28: "AceEvent-3.0" flickerstreak@25: ) flickerstreak@25: flickerstreak@25: module.configOptions = { flickerstreak@25: type = "group", flickerstreak@30: childGroups = "tab", flickerstreak@25: args = { flickerstreak@30: desc = { flickerstreak@30: type = "description", flickerstreak@30: name = L["Customizable replacement for Blizzard's Action Bars"], flickerstreak@30: }, flickerstreak@25: global = { flickerstreak@25: type = "group", flickerstreak@25: name = L["Global Settings"], flickerstreak@25: desc = L["Global configuration settings"], flickerstreak@30: args = { flickerstreak@30: unlock = { flickerstreak@30: type = "toggle", flickerstreak@30: handler = module, flickerstreak@30: name = L["Unlock Bars"], flickerstreak@30: desc = L["Unlock bars for dragging and resizing with the mouse"], flickerstreak@30: get = function() return module.configMode end, flickerstreak@30: set = function(info, value) module:SetConfigMode(value) end, flickerstreak@30: disabled = InCombatLockdown, flickerstreak@30: order = 1 flickerstreak@30: }, flickerstreak@30: }, flickerstreak@25: order = 1, flickerstreak@25: }, flickerstreak@25: module = { flickerstreak@25: type = "group", flickerstreak@30: childGroups = "select", flickerstreak@25: name = L["Module Settings"], flickerstreak@25: desc = L["Configuration settings for each module"], flickerstreak@30: args = { flickerstreak@30: configUI = { flickerstreak@30: type = "group", flickerstreak@30: name = "Config UI", flickerstreak@30: desc = "description", flickerstreak@30: args = { flickerstreak@30: foo = { flickerstreak@30: type = "toggle", flickerstreak@30: handler = module, flickerstreak@30: name = "foo", flickerstreak@30: desc = "description", flickerstreak@30: get = function() return true end, flickerstreak@30: set = function() end, flickerstreak@30: } flickerstreak@30: } flickerstreak@30: }, flickerstreak@30: }, flickerstreak@30: order = -1, flickerstreak@25: }, flickerstreak@30: }, flickerstreak@30: plugins = { } flickerstreak@25: } flickerstreak@25: flickerstreak@25: -- module methods flickerstreak@25: function module:OnInitialize() flickerstreak@28: self.db = ReAction.db:RegisterNamespace( moduleID, flickerstreak@25: { flickerstreak@28: profile = { } flickerstreak@25: } flickerstreak@25: ) flickerstreak@30: self:InitializeOptions() flickerstreak@30: LibStub("AceConfig-3.0"):RegisterOptionsTable("ReAction",self.configOptions) flickerstreak@30: LibStub("AceConfigDialog-3.0"):AddToBlizOptions("ReAction", "ReAction") flickerstreak@30: self:RegisterEvent("PLAYER_REGEN_DISABLED") flickerstreak@25: end flickerstreak@25: flickerstreak@30: function module:InitializeOptions() flickerstreak@30: for _, m in pairs(ReAction:GetOptions("global")) do flickerstreak@30: for k, v in pairs(m) do flickerstreak@30: self.configOptions.args.global.args[k] = v flickerstreak@30: end flickerstreak@30: end flickerstreak@30: ReAction.RegisterCallback(self,"OnOptionsRegistered") flickerstreak@25: end flickerstreak@25: flickerstreak@30: function module:OnOptionsRegistered(evt, context, module, opts) flickerstreak@30: if context == "global" then flickerstreak@30: for k, v in pairs(opts) do flickerstreak@30: self.configOptions.args.global.args[k] = v flickerstreak@30: end flickerstreak@30: elseif context == "module" then flickerstreak@30: for k, v in pairs(opts) do flickerstreak@30: self.configOptions.args.module.args[k] = v flickerstreak@30: end flickerstreak@30: elseif context == "bar" then flickerstreak@30: flickerstreak@30: elseif context == "barMenu" then flickerstreak@30: flickerstreak@30: end flickerstreak@25: end flickerstreak@25: flickerstreak@25: function module:PLAYER_REGEN_DISABLED() flickerstreak@25: if self.configMode == true then flickerstreak@25: UIErrorsFrame:AddMessage(L["ReAction config mode disabled during combat."]) flickerstreak@25: self:SetConfigMode(false) flickerstreak@25: end flickerstreak@25: end flickerstreak@25: flickerstreak@25: function module:SetConfigMode( mode ) flickerstreak@28: ReAction:CallMethodOnAllBars("ShowControls",mode) flickerstreak@28: ReAction:CallMethodOnAllModules("ApplyConfigMode",mode,ReAction.bars) flickerstreak@25: self.configMode = mode flickerstreak@25: end flickerstreak@25: flickerstreak@25: function module:ApplyConfigMode( mode, bars ) flickerstreak@25: if not(mode) then flickerstreak@25: -- close open dewdrop menu flickerstreak@25: local p = Dewdrop:GetOpenedParent() flickerstreak@25: if p then flickerstreak@25: for _, bar in pairs(bars) do flickerstreak@25: if bar then flickerstreak@25: if p == bar.controlFrame then flickerstreak@25: Dewdrop:Close() flickerstreak@25: end flickerstreak@25: end flickerstreak@25: end flickerstreak@25: end flickerstreak@25: end flickerstreak@25: end flickerstreak@25: flickerstreak@30: local function safecall(module, method, ...) flickerstreak@28: if module and type(module[method]) == "function" then flickerstreak@30: return module[method](method, ...) flickerstreak@25: end flickerstreak@25: end flickerstreak@25: flickerstreak@25: function module:OpenConfig(bar) flickerstreak@25: Dewdrop:Close() flickerstreak@30: InterfaceOptionsFrame_OpenToFrame("ReAction") flickerstreak@25: end flickerstreak@25: flickerstreak@25: function module:ApplyToBar(bar) flickerstreak@25: if self.configMode then flickerstreak@30: bar:ShowControls(self.configMode) flickerstreak@25: end flickerstreak@25: end flickerstreak@25: flickerstreak@25: function module:RemoveFromBar(bar) flickerstreak@25: if bar.controlFrame then flickerstreak@25: bar.controlFrame:SetParent(UIParent) flickerstreak@25: bar.controlFrame:ClearAllPoints() flickerstreak@25: bar.controlFrame:Hide() flickerstreak@25: bar.controlFrame = nil flickerstreak@25: end flickerstreak@25: end flickerstreak@25: flickerstreak@25: flickerstreak@25: flickerstreak@25: flickerstreak@25: flickerstreak@25: -- flickerstreak@25: -- Bar config overlay flickerstreak@25: -- flickerstreak@25: -- import some of these for small OnUpdate performance boost flickerstreak@28: local Bar = ReAction.Bar.prototype flickerstreak@25: local GetSize = Bar.GetSize flickerstreak@25: local GetButtonSize = Bar.GetButtonSize flickerstreak@25: local GetButtonGrid = Bar.GetButtonGrid flickerstreak@25: local SetSize = Bar.SetSize flickerstreak@25: local SetButtonSize = Bar.SetButtonSize flickerstreak@25: local SetButtonGrid = Bar.SetButtonGrid flickerstreak@25: local ApplyAnchor = Bar.ApplyAnchor flickerstreak@25: local floor = math.floor flickerstreak@25: local min = math.min flickerstreak@25: local format = string.format flickerstreak@25: local GameTooltip = GameTooltip flickerstreak@25: flickerstreak@25: local function StoreExtents(bar) flickerstreak@25: local f = bar.frame flickerstreak@25: local point, relativeTo, relativePoint, x, y = f:GetPoint(1) flickerstreak@25: relativeTo = relativeTo or f:GetParent() flickerstreak@25: local anchorTo flickerstreak@28: for name, b in pairs(ReAction.bars) do flickerstreak@25: if b then flickerstreak@25: if b:GetFrame() == relativeTo then flickerstreak@25: anchorTo = name flickerstreak@25: break flickerstreak@25: end flickerstreak@25: end flickerstreak@25: end flickerstreak@25: anchorTo = anchorTo or relativeTo:GetName() flickerstreak@25: local c = bar.config flickerstreak@25: c.anchor = point flickerstreak@25: c.anchorTo = anchorTo flickerstreak@25: c.relativePoint = relativePoint flickerstreak@25: c.x = x flickerstreak@25: c.y = y flickerstreak@25: c.width, c.height = f:GetWidth(), f:GetHeight() flickerstreak@25: end flickerstreak@25: flickerstreak@25: local function RecomputeButtonSize(bar) flickerstreak@25: local w, h = GetSize(bar) flickerstreak@25: local bw, bh = GetButtonSize(bar) flickerstreak@25: local r, c, s = GetButtonGrid(bar) flickerstreak@25: flickerstreak@25: local scaleW = (floor(w/c) - s) / bw flickerstreak@25: local scaleH = (floor(h/r) - s) / bh flickerstreak@25: local scale = min(scaleW, scaleH) flickerstreak@25: flickerstreak@25: SetButtonSize(bar, scale * bw, scale * bh, s) flickerstreak@25: end flickerstreak@25: flickerstreak@25: local function RecomputeButtonSpacing(bar) flickerstreak@25: local w, h = GetSize(bar) flickerstreak@25: local bw, bh = GetButtonSize(bar) flickerstreak@25: local r, c, s = GetButtonGrid(bar) flickerstreak@25: flickerstreak@25: SetButtonGrid(bar,r,c,min(floor(w/c) - bw, floor(h/r) - bh)) flickerstreak@25: end flickerstreak@25: flickerstreak@25: local function RecomputeGrid(bar) flickerstreak@25: local w, h = GetSize(bar) flickerstreak@25: local bw, bh = GetButtonSize(bar) flickerstreak@25: local r, c, s = GetButtonGrid(bar) flickerstreak@25: flickerstreak@25: SetButtonGrid(bar, floor(h/(bh+s)), floor(w/(bw+s)), s) flickerstreak@25: end flickerstreak@25: flickerstreak@25: local function ClampToButtons(bar) flickerstreak@25: local bw, bh = GetButtonSize(bar) flickerstreak@25: local r, c, s = GetButtonGrid(bar) flickerstreak@25: SetSize(bar, (bw+s)*c, (bh+s)*r ) flickerstreak@25: end flickerstreak@25: flickerstreak@25: local function HideGameTooltip() flickerstreak@25: GameTooltip:Hide() flickerstreak@25: end flickerstreak@25: flickerstreak@25: local function CreateControls(bar) flickerstreak@25: local f = bar.frame flickerstreak@25: flickerstreak@25: f:SetMovable(true) flickerstreak@25: f:SetResizable(true) flickerstreak@25: f:SetClampedToScreen(true) flickerstreak@25: flickerstreak@25: -- buttons on the bar should be direct children of the bar frame. flickerstreak@25: -- The control elements need to float on top of this, which we could flickerstreak@25: -- do with SetFrameLevel() or Raise(), but it's more reliable to do it flickerstreak@25: -- via frame nesting, hence good old foo's appearance here. flickerstreak@25: local foo = CreateFrame("Frame",nil,f) flickerstreak@25: foo:SetAllPoints() flickerstreak@25: flickerstreak@25: local control = CreateFrame("Button", nil, foo) flickerstreak@25: control:EnableMouse(true) flickerstreak@25: control:SetToplevel(true) flickerstreak@25: control:SetPoint("TOPLEFT", -4, 4) flickerstreak@25: control:SetPoint("BOTTOMRIGHT", 4, -4) flickerstreak@25: control:SetBackdrop({ flickerstreak@25: edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", flickerstreak@25: tile = true, flickerstreak@25: tileSize = 16, flickerstreak@25: edgeSize = 16, flickerstreak@25: insets = { left = 0, right = 0, top = 0, bottom = 0 }, flickerstreak@25: }) flickerstreak@25: flickerstreak@25: -- textures flickerstreak@25: local bgTex = control:CreateTexture(nil,"BACKGROUND") flickerstreak@25: bgTex:SetTexture(0.7,0.7,1.0,0.2) flickerstreak@25: bgTex:SetPoint("TOPLEFT",4,-4) flickerstreak@25: bgTex:SetPoint("BOTTOMRIGHT",-4,4) flickerstreak@25: local hTex = control:CreateTexture(nil,"HIGHLIGHT") flickerstreak@25: hTex:SetTexture(0.7,0.7,1.0,0.2) flickerstreak@25: hTex:SetPoint("TOPLEFT",4,-4) flickerstreak@25: hTex:SetPoint("BOTTOMRIGHT",-4,4) flickerstreak@25: hTex:SetBlendMode("ADD") flickerstreak@25: flickerstreak@25: -- label flickerstreak@25: local label = control:CreateFontString(nil,"OVERLAY","GameFontNormalLarge") flickerstreak@25: label:SetAllPoints() flickerstreak@25: label:SetJustifyH("CENTER") flickerstreak@25: label:SetShadowColor(0,0,0,1) flickerstreak@25: label:SetShadowOffset(2,-2) flickerstreak@25: label:SetTextColor(1,1,1,1) flickerstreak@25: label:SetText(bar:GetName()) flickerstreak@25: label:Show() flickerstreak@25: bar.controlLabelString = label -- so that bar:SetName() can update it flickerstreak@25: flickerstreak@25: local StopResize = function() flickerstreak@25: f:StopMovingOrSizing() flickerstreak@25: f.isMoving = false flickerstreak@25: f:SetScript("OnUpdate",nil) flickerstreak@25: StoreExtents(bar) flickerstreak@25: ClampToButtons(bar) flickerstreak@25: ApplyAnchor(bar) flickerstreak@25: end flickerstreak@25: flickerstreak@25: -- edge drag handles flickerstreak@25: for _, point in pairs({"LEFT","TOP","RIGHT","BOTTOM"}) do flickerstreak@25: local edge = CreateFrame("Frame",nil,control) flickerstreak@25: edge:EnableMouse(true) flickerstreak@25: edge:SetWidth(8) flickerstreak@25: edge:SetHeight(8) flickerstreak@25: if point == "TOP" or point == "BOTTOM" then flickerstreak@25: edge:SetPoint(point.."LEFT") flickerstreak@25: edge:SetPoint(point.."RIGHT") flickerstreak@25: else flickerstreak@25: edge:SetPoint("TOP"..point) flickerstreak@25: edge:SetPoint("BOTTOM"..point) flickerstreak@25: end flickerstreak@25: local tex = edge:CreateTexture(nil,"HIGHLIGHT") flickerstreak@25: tex:SetTexture(1.0,0.82,0,0.7) flickerstreak@25: tex:SetBlendMode("ADD") flickerstreak@25: tex:SetAllPoints() flickerstreak@25: edge:RegisterForDrag("LeftButton") flickerstreak@25: edge:SetScript("OnMouseDown", flickerstreak@25: function() flickerstreak@25: local bw, bh = GetButtonSize(bar) flickerstreak@25: local r, c, s = GetButtonGrid(bar) flickerstreak@25: f:SetMinResize( bw+s+1, bh+s+1 ) flickerstreak@25: f:StartSizing(point) flickerstreak@25: f:SetScript("OnUpdate", flickerstreak@25: function() flickerstreak@25: RecomputeGrid(bar) flickerstreak@25: bar:RefreshLayout() flickerstreak@25: end flickerstreak@25: ) flickerstreak@25: end flickerstreak@25: ) flickerstreak@25: edge:SetScript("OnMouseUp", StopResize) flickerstreak@25: edge:SetScript("OnEnter", flickerstreak@25: function() flickerstreak@25: GameTooltip:SetOwner(f, "ANCHOR_"..point) flickerstreak@25: GameTooltip:AddLine(L["Drag to add/remove buttons"]) flickerstreak@25: GameTooltip:Show() flickerstreak@25: end flickerstreak@25: ) flickerstreak@25: edge:SetScript("OnLeave", HideGameTooltip) flickerstreak@25: edge:Show() flickerstreak@25: end flickerstreak@25: flickerstreak@25: -- corner drag handles, again nested in an anonymous frame so that they are on top flickerstreak@25: local foo2 = CreateFrame("Frame",nil,control) flickerstreak@25: foo2:SetAllPoints(true) flickerstreak@25: for _, point in pairs({"BOTTOMLEFT","TOPLEFT","BOTTOMRIGHT","TOPRIGHT"}) do flickerstreak@25: local corner = CreateFrame("Frame",nil,foo2) flickerstreak@25: corner:EnableMouse(true) flickerstreak@25: corner:SetWidth(12) flickerstreak@25: corner:SetHeight(12) flickerstreak@25: corner:SetPoint(point) flickerstreak@25: local tex = corner:CreateTexture(nil,"HIGHLIGHT") flickerstreak@25: tex:SetTexture(1.0,0.82,0,0.7) flickerstreak@25: tex:SetBlendMode("ADD") flickerstreak@25: tex:SetAllPoints() flickerstreak@25: corner:RegisterForDrag("LeftButton","RightButton") flickerstreak@25: local updateTooltip = function() flickerstreak@25: local size, size2 = bar:GetButtonSize() flickerstreak@25: local rows, cols, spacing = bar:GetButtonGrid() flickerstreak@25: size = (size == size2) and tostring(size) or format("%dx%d",size,size2) flickerstreak@25: GameTooltipTextRight4:SetText(size) flickerstreak@25: GameTooltipTextRight5:SetText(tostring(spacing)) flickerstreak@25: end flickerstreak@25: corner:SetScript("OnMouseDown", flickerstreak@25: function(_,btn) flickerstreak@25: local bw, bh = GetButtonSize(bar) flickerstreak@25: local r, c, s = GetButtonGrid(bar) flickerstreak@25: if btn == "LeftButton" then -- button resize flickerstreak@25: f:SetMinResize( (s+12)*c+1, (s+12)*r+1 ) flickerstreak@25: f:SetScript("OnUpdate", flickerstreak@25: function() flickerstreak@25: RecomputeButtonSize(bar) flickerstreak@25: bar:RefreshLayout() flickerstreak@25: updateTooltip() flickerstreak@25: end flickerstreak@25: ) flickerstreak@25: elseif btn == "RightButton" then -- spacing resize flickerstreak@25: f:SetMinResize( bw*c, bh*r ) flickerstreak@25: f:SetScript("OnUpdate", flickerstreak@25: function() flickerstreak@25: RecomputeButtonSpacing(bar) flickerstreak@25: bar:RefreshLayout() flickerstreak@25: updateTooltip() flickerstreak@25: end flickerstreak@25: ) flickerstreak@25: end flickerstreak@25: f:StartSizing(point) flickerstreak@25: end flickerstreak@25: ) flickerstreak@25: corner:SetScript("OnMouseUp",StopResize) flickerstreak@25: corner:SetScript("OnEnter", flickerstreak@25: function() flickerstreak@25: GameTooltip:SetOwner(f, "ANCHOR_"..point) flickerstreak@25: GameTooltip:AddLine(L["Drag to resize buttons"]) flickerstreak@25: GameTooltip:AddLine(L["Right-click-drag"]) flickerstreak@25: GameTooltip:AddLine(L["to change spacing"]) flickerstreak@25: local size, size2 = bar:GetButtonSize() flickerstreak@25: local rows, cols, spacing = bar:GetButtonGrid() flickerstreak@25: size = (size == size2) and tostring(size) or format("%dx%d",size,size2) flickerstreak@25: GameTooltip:AddDoubleLine(L["Size:"], size) flickerstreak@25: GameTooltip:AddDoubleLine(L["Spacing:"], tostring(spacing)) flickerstreak@25: GameTooltip:Show() flickerstreak@25: end flickerstreak@25: ) flickerstreak@25: corner:SetScript("OnLeave", flickerstreak@25: function() flickerstreak@25: GameTooltip:Hide() flickerstreak@25: f:SetScript("OnUpdate",nil) flickerstreak@25: end flickerstreak@25: ) flickerstreak@25: flickerstreak@25: end flickerstreak@25: flickerstreak@25: control:RegisterForDrag("LeftButton") flickerstreak@25: control:RegisterForClicks("RightButtonDown") flickerstreak@25: flickerstreak@25: control:SetScript("OnDragStart", flickerstreak@25: function() flickerstreak@25: f:StartMoving() flickerstreak@25: f.isMoving = true flickerstreak@25: -- TODO: snap indicator update install flickerstreak@25: end flickerstreak@25: ) flickerstreak@25: flickerstreak@25: control:SetScript("OnDragStop", flickerstreak@25: function() flickerstreak@25: f:StopMovingOrSizing() flickerstreak@25: f.isMoving = false flickerstreak@25: f:SetScript("OnUpdate",nil) flickerstreak@25: -- TODO: snap frame here flickerstreak@25: StoreExtents(bar) flickerstreak@25: end flickerstreak@25: ) flickerstreak@25: flickerstreak@25: control:SetScript("OnEnter", flickerstreak@25: function() flickerstreak@25: -- add bar type and status information to name flickerstreak@25: local name = bar.name flickerstreak@28: for _, m in ReAction:IterateModules() do flickerstreak@30: local suffix = safecall(m,"GetBarNameModifier",bar) flickerstreak@25: if suffix then flickerstreak@30: name = ("%s %s"):format(name,suffix) flickerstreak@25: end flickerstreak@25: end flickerstreak@25: flickerstreak@25: GameTooltip:SetOwner(f, "ANCHOR_TOPRIGHT") flickerstreak@25: GameTooltip:AddLine(name) flickerstreak@25: GameTooltip:AddLine(L["Drag to move"]) flickerstreak@25: --GameTooltip:AddLine(L["Shift-drag for sticky mode"]) flickerstreak@25: GameTooltip:AddLine(L["Right-click for options"]) flickerstreak@25: GameTooltip:Show() flickerstreak@25: end flickerstreak@25: ) flickerstreak@25: flickerstreak@25: control:SetScript("OnLeave", HideGameTooltip) flickerstreak@25: flickerstreak@25: control:SetScript("OnClick", flickerstreak@25: function() flickerstreak@25: bar:ShowMenu() flickerstreak@25: end flickerstreak@25: ) flickerstreak@25: flickerstreak@25: return control flickerstreak@25: end flickerstreak@25: flickerstreak@25: function Bar:ShowControls(show) flickerstreak@25: if show then flickerstreak@25: if not self.controlFrame then flickerstreak@25: self.controlFrame = CreateControls(self) flickerstreak@25: end flickerstreak@25: self.controlFrame:Show() flickerstreak@25: elseif self.controlFrame then flickerstreak@25: self.controlFrame:Hide() flickerstreak@25: end flickerstreak@25: end flickerstreak@25: flickerstreak@25: function Bar:ShowMenu() flickerstreak@25: if not self.menuOpts then flickerstreak@25: self.menuOpts = { flickerstreak@25: type = "group", flickerstreak@25: args = { flickerstreak@25: openConfig = { flickerstreak@25: type = "execute", flickerstreak@25: name = L["Configure..."], flickerstreak@25: desc = L["Open the configuration dialogue for this bar"], flickerstreak@25: func = function() module:OpenConfig(self) end, flickerstreak@25: disabled = InCombatLockdown, flickerstreak@25: order = 1 flickerstreak@28: }, flickerstreak@28: delete = { flickerstreak@28: type = "execute", flickerstreak@28: name = L["Delete Bar"], flickerstreak@28: desc = L["Remove the bar from the current profile"], flickerstreak@28: func = function() ReAction:EraseBar(self) end, flickerstreak@28: order = 2 flickerstreak@28: }, flickerstreak@25: } flickerstreak@25: } flickerstreak@25: end flickerstreak@25: if self.modMenuOpts == nil then flickerstreak@25: self.modMenuOpts = { } flickerstreak@25: end flickerstreak@28: for _, m in ReAction:IterateModules() do flickerstreak@30: local opts = safecall(m,"GetBarMenuOptions",self,module) flickerstreak@28: if opts then flickerstreak@28: for k, v in pairs(opts) do flickerstreak@28: self.menuOpts.args[k] = v flickerstreak@28: end flickerstreak@25: end flickerstreak@25: end flickerstreak@25: Dewdrop:Open(self.controlFrame, "children", self.menuOpts, "cursorX", true, "cursorY", true) flickerstreak@25: end flickerstreak@25: flickerstreak@25: local Bar_SuperSetName = Bar.SetName flickerstreak@25: function Bar:SetName(name) flickerstreak@25: Bar_SuperSetName(self,name) flickerstreak@25: if self.controlLabelString then flickerstreak@25: self.controlLabelString:SetText(self.name) flickerstreak@25: end flickerstreak@25: end