diff --git a/Interface/AddOns/SVUI/data/defaults.lua b/Interface/AddOns/SVUI/data/defaults.lua index e63e146..d874ce6 100644 --- a/Interface/AddOns/SVUI/data/defaults.lua +++ b/Interface/AddOns/SVUI/data/defaults.lua @@ -870,7 +870,7 @@ SV.defaults["SVUnit"] = { ["horizontalGrowth"] = "RIGHT", ["filterPlayer"] = true, ["filterRaid"] = true, - ["filterAllowed"] = false, + ["filterAll"] = false, ["filterInfinite"] = true, ["filterDispellable"] = false, ["useFilter"] = "", @@ -888,7 +888,7 @@ SV.defaults["SVUnit"] = { ["verticalGrowth"] = "UP", ["horizontalGrowth"] = "RIGHT", ["filterPlayer"] = false, - ["filterAllowed"] = false, + ["filterAll"] = false, ["filterInfinite"] = false, ["filterDispellable"] = false, ["useFilter"] = "", @@ -903,7 +903,7 @@ SV.defaults["SVUnit"] = { ["attachTo"] = "DEBUFFS", ["filterPlayer"] = true, ["filterRaid"] = true, - ["filterAllowed"] = false, + ["filterAll"] = false, ["filterInfinite"] = true, ["filterDispellable"] = false, ["useFilter"] = "", @@ -973,7 +973,6 @@ SV.defaults["SVUnit"] = { ["threatEnabled"] = true, ["rangeCheck"] = true, ["predict"] = false, - ["smartAuraDisplay"] = "DISABLED", ["middleClickFocus"] = true, ["formatting"] = { ["power_colored"] = true, @@ -1053,7 +1052,7 @@ SV.defaults["SVUnit"] = { friendly = false, enemy = false, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -1087,7 +1086,7 @@ SV.defaults["SVUnit"] = { friendly = false, enemy = true, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -1117,7 +1116,7 @@ SV.defaults["SVUnit"] = { friendly = true, enemy = true, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -1268,7 +1267,7 @@ SV.defaults["SVUnit"] = { friendly = true, enemy = false, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -1302,7 +1301,7 @@ SV.defaults["SVUnit"] = { friendly = false, enemy = true, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -1341,7 +1340,6 @@ SV.defaults["SVUnit"] = { ["width"] = 170, ["height"] = 30, ["predict"] = false, - ["smartAuraDisplay"] = "DISABLED", ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -1410,7 +1408,7 @@ SV.defaults["SVUnit"] = { friendly = true, enemy = false, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -1444,7 +1442,7 @@ SV.defaults["SVUnit"] = { friendly = false, enemy = true, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -1487,7 +1485,7 @@ SV.defaults["SVUnit"] = { friendly = false, enemy = true, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -1599,7 +1597,7 @@ SV.defaults["SVUnit"] = { friendly = true, enemy = false, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -1633,7 +1631,7 @@ SV.defaults["SVUnit"] = { friendly = false, enemy = true, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -1741,7 +1739,7 @@ SV.defaults["SVUnit"] = { ["horizontalGrowth"] = "LEFT", ["filterPlayer"] = true, ["filterRaid"] = true, - ["filterAllowed"] = true, + ["filterAll"] = true, ["filterInfinite"] = true, ["filterDispellable"] = false, ["useFilter"] = "", @@ -1759,7 +1757,7 @@ SV.defaults["SVUnit"] = { ["verticalGrowth"] = "DOWN", ["horizontalGrowth"] = "RIGHT", ["filterPlayer"] = false, - ["filterAllowed"] = false, + ["filterAll"] = false, ["filterInfinite"] = false, ["filterDispellable"] = false, ["useFilter"] = "", @@ -1860,7 +1858,7 @@ SV.defaults["SVUnit"] = { friendly = true, enemy = false, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -1894,7 +1892,7 @@ SV.defaults["SVUnit"] = { friendly = false, enemy = true, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -1990,7 +1988,7 @@ SV.defaults["SVUnit"] = { ["horizontalGrowth"] = "LEFT", ["filterPlayer"] = false, ["filterRaid"] = false, - ["filterAllowed"] = false, + ["filterAll"] = false, ["filterInfinite"] = false, ["filterDispellable"] = false, ["useFilter"] = "", @@ -2008,7 +2006,7 @@ SV.defaults["SVUnit"] = { ["verticalGrowth"] = "UP", ["horizontalGrowth"] = "LEFT", ["filterPlayer"] = true, - ["filterAllowed"] = false, + ["filterAll"] = false, ["filterInfinite"] = false, ["filterDispellable"] = false, ["useFilter"] = "", @@ -2126,7 +2124,7 @@ SV.defaults["SVUnit"] = { friendly = false, enemy = false, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -2160,7 +2158,7 @@ SV.defaults["SVUnit"] = { friendly = false, enemy = false, }, - ["filterAllowed"] = + ["filterAll"] = { friendly = false, enemy = false, @@ -2288,7 +2286,7 @@ SV.defaults["SVUnit"] = { ["horizontalGrowth"] = "RIGHT", ["filterPlayer"] = true, ["filterRaid"] = true, - ["filterAllowed"] = false, + ["filterAll"] = false, ["filterInfinite"] = true, ["filterDispellable"] = false, ["useFilter"] = "", @@ -2306,7 +2304,7 @@ SV.defaults["SVUnit"] = { ["verticalGrowth"] = "DOWN", ["horizontalGrowth"] = "RIGHT", ["filterPlayer"] = false, - ["filterAllowed"] = false, + ["filterAll"] = false, ["filterInfinite"] = false, ["filterDispellable"] = false, ["useFilter"] = "", @@ -2462,7 +2460,7 @@ SV.defaults["SVUnit"] = { ["horizontalGrowth"] = "RIGHT", ["filterPlayer"] = true, ["filterRaid"] = true, - ["filterAllowed"] = false, + ["filterAll"] = false, ["filterInfinite"] = true, ["filterDispellable"] = false, ["useFilter"] = "", @@ -2480,7 +2478,7 @@ SV.defaults["SVUnit"] = { ["verticalGrowth"] = "UP", ["horizontalGrowth"] = "RIGHT", ["filterPlayer"] = false, - ["filterAllowed"] = false, + ["filterAll"] = false, ["filterInfinite"] = false, ["filterDispellable"] = false, ["useFilter"] = "", @@ -2598,7 +2596,7 @@ SV.defaults["SVUnit"] = { ["horizontalGrowth"] = "RIGHT", ["filterPlayer"] = true, ["filterRaid"] = true, - ["filterAllowed"] = false, + ["filterAll"] = false, ["filterInfinite"] = true, ["filterDispellable"] = false, ["useFilter"] = "", @@ -2616,7 +2614,7 @@ SV.defaults["SVUnit"] = { ["verticalGrowth"] = "UP", ["horizontalGrowth"] = "RIGHT", ["filterPlayer"] = false, - ["filterAllowed"] = false, + ["filterAll"] = false, ["filterInfinite"] = false, ["filterDispellable"] = false, ["useFilter"] = "", diff --git a/Interface/AddOns/SVUI/framework/docks/docks.lua b/Interface/AddOns/SVUI/framework/docks/docks.lua index fbe28f7..ed8cc66 100644 --- a/Interface/AddOns/SVUI/framework/docks/docks.lua +++ b/Interface/AddOns/SVUI/framework/docks/docks.lua @@ -519,7 +519,7 @@ local RefreshBarLayout = function(self) if(nextButton) then offset = (safeIndex - 1) * (size + 6) + 6 nextButton:ClearAllPoints(); - nextButton:Size(size, size); + nextButton:SetSize(size, size); nextButton:SetPoint(anchor, self.ToolBar, anchor, (offset * mod), 0); if(not nextButton:IsShown()) then nextButton:Show(); @@ -650,7 +650,7 @@ local CreateBasicToolButton = function(self, displayName, texture, onclick, glob local button = _G[globalName .. "DockletButton"] or CreateFrame("Button", globalName, self.ToolBar, template) button:ClearAllPoints() - button:Size(size, size) + button:SetSize(size, size) button:SetFramedButtonTemplate() button.Icon:SetTexture(dockIcon) button:SetAttribute("tipText", displayName) @@ -825,7 +825,7 @@ function Dock:NewDocklet(location, globalName, readableName, texture, onclick) local newParent = self[location]; if(not newParent) then return end - local frame = CreateFrame("Frame", globalName, UIParent, "SVUI_DockletWindowTemplate"); + local frame = _G[globalName] or CreateFrame("Frame", globalName, UIParent, "SVUI_DockletWindowTemplate"); frame:SetParent(newParent.Window); frame:SetSize(newParent.Window:GetSize()); frame:SetAllPoints(newParent.Window); @@ -878,7 +878,7 @@ function Dock:NewAdvancedDocklet(location, globalName) local spacing = SV.db.Dock.buttonSpacing; frame.Bar = CreateFrame("Frame", nil, newParent); - frame.Bar:Size(1, height); + frame.Bar:SetSize(1, height); frame.Bar:Point(barAnchor, newParent.Bar.ToolBar, barReverse, (spacing * mod), 0) SV.Mentalo:Add(frame.Bar, globalName .. " Dock Bar"); @@ -946,27 +946,27 @@ function Dock:Refresh() local width, height = self:GetDimensions(location); local dock = self[location]; - dock.Bar:Size(width, buttonsize) + dock.Bar:SetSize(width, buttonsize) dock.Bar.ToolBar:SetHeight(buttonsize) - dock:Size(width, height) - dock.Alert:Size(width, 1) - dock.Window:Size(width, height) + dock:SetSize(width, height) + dock.Alert:SetSize(width, 1) + dock.Window:SetSize(width, height) if(dock.Bar.Button) then - dock.Bar.Button:Size(buttonsize, buttonsize) + dock.Bar.Button:SetSize(buttonsize, buttonsize) end dock.Bar:Update() end end - self.BottomCenter:Size(centerWidth, centerHeight) - self.BottomCenter.Left:Size((centerWidth * 0.5), centerHeight) - self.BottomCenter.Right:Size((centerWidth * 0.5), centerHeight) + self.BottomCenter:SetSize(centerWidth, centerHeight) + self.BottomCenter.Left:SetSize((centerWidth * 0.5), centerHeight) + self.BottomCenter.Right:SetSize((centerWidth * 0.5), centerHeight) - self.TopCenter:Size(centerWidth, centerHeight) - self.TopCenter.Left:Size((centerWidth * 0.5), centerHeight) - self.TopCenter.Right:Size((centerWidth * 0.5), centerHeight) + self.TopCenter:SetSize(centerWidth, centerHeight) + self.TopCenter.Left:SetSize((centerWidth * 0.5), centerHeight) + self.TopCenter.Right:SetSize((centerWidth * 0.5), centerHeight) self:BottomBorderVisibility(); self:TopBorderVisibility(); @@ -1000,7 +1000,7 @@ function Dock:Initialize() -- [[ TOP AND BOTTOM BORDERS ]] -- - self.Border.Top = CreateFrame("Frame", "SVUITopBorder", SV.Screen) + self.Border.Top = CreateFrame("Frame", "SVUITopBorder", UIParent) self.Border.Top:Point("TOPLEFT", SV.Screen, "TOPLEFT", -1, 1) self.Border.Top:Point("TOPRIGHT", SV.Screen, "TOPRIGHT", 1, 1) self.Border.Top:Height(14) @@ -1022,7 +1022,7 @@ function Dock:Initialize() end) self:TopBorderVisibility() - self.Border.Bottom = CreateFrame("Frame", "SVUIBottomBorder", SV.Screen) + self.Border.Bottom = CreateFrame("Frame", "SVUIBottomBorder", UIParent) self.Border.Bottom:Point("BOTTOMLEFT", SV.Screen, "BOTTOMLEFT", -1, -1) self.Border.Bottom:Point("BOTTOMRIGHT", SV.Screen, "BOTTOMRIGHT", 1, -1) self.Border.Bottom:Height(14) @@ -1057,7 +1057,7 @@ function Dock:Initialize() dock.Bar:SetParent(SV.Screen) dock.Bar:ClearAllPoints() - dock.Bar:Size(width, buttonsize) + dock.Bar:SetSize(width, buttonsize) dock.Bar:SetPoint(anchor, SV.Screen, anchor, (2 * mod), (2 * vertMod)) if(not SV.cache.Docks.Order[location]) then @@ -1069,29 +1069,29 @@ function Dock:Initialize() dock.Bar.ToolBar:ClearAllPoints() if(dock.Bar.Button) then - dock.Bar.Button:Size(buttonsize, buttonsize) + dock.Bar.Button:SetSize(buttonsize, buttonsize) dock.Bar.Button:SetFramedButtonTemplate() - dock.Bar.ToolBar:Size(1, buttonsize) + dock.Bar.ToolBar:SetSize(1, buttonsize) dock.Bar.ToolBar:Point(barAnchor, dock.Bar.Button, barReverse, (spacing * mod), 0) InitDockButton(dock.Bar.Button) else - dock.Bar.ToolBar:Size(1, buttonsize) + dock.Bar.ToolBar:SetSize(1, buttonsize) dock.Bar.ToolBar:Point(barAnchor, dock.Bar, barAnchor, 0, 0) end dock:SetParent(SV.Screen) dock:ClearAllPoints() dock:SetPoint(anchor, dock.Bar, reverse, 0, (12 * vertMod)) - dock:Size(width, height) + dock:SetSize(width, height) dock:SetAttribute("buttonSize", buttonsize) dock:SetAttribute("spacingSize", spacing) dock.Alert:ClearAllPoints() - dock.Alert:Size(width, 1) + dock.Alert:SetSize(width, 1) dock.Alert:SetPoint(anchor, dock, anchor, 0, 0) dock.Window:ClearAllPoints() - dock.Window:Size(width, height) + dock.Window:SetSize(width, height) dock.Window:SetPoint(anchor, dock.Alert, reverse, 0, (4 * vertMod)) SV.Mentalo:Add(dock.Bar, location .. " Dock ToolBar"); diff --git a/Interface/AddOns/SVUI/framework/framework.lua b/Interface/AddOns/SVUI/framework/framework.lua index 17cd638..cfc14f1 100644 --- a/Interface/AddOns/SVUI/framework/framework.lua +++ b/Interface/AddOns/SVUI/framework/framework.lua @@ -32,6 +32,7 @@ function SV:LoadFramework() self.Dock:Initialize(); self.Mentalo:Initialize(); self.Graph:Initialize(); + self.Dragger:Initialize(); self.Comix:Initialize(); self.GameMenu:Initialize(); self.AFK:Initialize(); diff --git a/Interface/AddOns/SVUI/framework/movers/mover_dragger.lua b/Interface/AddOns/SVUI/framework/movers/mover_dragger.lua new file mode 100644 index 0000000..275d2fd --- /dev/null +++ b/Interface/AddOns/SVUI/framework/movers/mover_dragger.lua @@ -0,0 +1,383 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local string = _G.string; +local math = _G.math; +--[[ STRING METHODS ]]-- +local format, split = string.format, string.split; +--[[ MATH METHODS ]]-- +local min, floor = math.min, math.floor; +local parsefloat = math.parsefloat; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L; + +local Dragger = CreateFrame("Frame", nil); +Dragger.Frames = {}; + + +local UIPanels = {}; + +UIPanels["AchievementFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["AuctionFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["ArchaeologyFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["BattlefieldMinimap"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["BarberShopFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["BlackMarketFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["CalendarFrame"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["CharacterFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["ClassTrainerFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["DressUpFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["DraenorZoneAbilityFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["EncounterJournal"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["FriendsFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["GMSurveyFrame"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["GossipFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["GuildFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["GuildBankFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["GuildRegistrarFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["GarrisonLandingPage"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["GarrisonMissionFrame"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["GarrisonCapacitiveDisplayFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["HelpFrame"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["InterfaceOptionsFrame"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["ItemUpgradeFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["KeyBindingFrame"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["LFGDungeonReadyPopup"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["MacOptionsFrame"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["MacroFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["MailFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["MerchantFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["PlayerTalentFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["PetJournalParent"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["PetStableFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["PVEFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["PVPFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["QuestFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["QuestLogFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["RaidBrowserFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["ReadyCheckFrame"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["ReforgingFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["ReportCheatingDialog"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["ReportPlayerNameDialog"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["RolePollPopup"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["SpellBookFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["TabardFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["TaxiFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["TimeManagerFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["TradeSkillFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["TradeFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["TransmogrifyFrame"] = { point = 'TBD', snap = false, centered = false }; +UIPanels["TutorialFrame"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["VideoOptionsFrame"] = { point = 'TBD', snap = false, centered = true }; +UIPanels["VoidStorageFrame"] = { point = 'TBD', snap = false, centered = false }; + +UIPanels["ScrollOfResurrectionSelectionFrame"] = { point = 'TBD', snap = false, centered = false }; +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local function Pinpoint(parent) + local centerX, centerY = parent:GetCenter() + local screenWidth = GetScreenWidth() + local screenHeight = GetScreenHeight() + local result; + if not centerX or not centerY then + return "CENTER" + end + local heightTop = screenHeight * 0.75; + local heightBottom = screenHeight * 0.25; + local widthLeft = screenWidth * 0.25; + local widthRight = screenWidth * 0.75; + if(((centerX > widthLeft) and (centerX < widthRight)) and (centerY > heightTop)) then + result = "TOP" + elseif((centerX < widthLeft) and (centerY > heightTop)) then + result = "TOPLEFT" + elseif((centerX > widthRight) and (centerY > heightTop)) then + result = "TOPRIGHT" + elseif(((centerX > widthLeft) and (centerX < widthRight)) and centerY < heightBottom) then + result = "BOTTOM" + elseif((centerX < widthLeft) and (centerY < heightBottom)) then + result = "BOTTOMLEFT" + elseif((centerX > widthRight) and (centerY < heightBottom)) then + result = "BOTTOMRIGHT" + elseif((centerX < widthLeft) and (centerY > heightBottom) and (centerY < heightTop)) then + result = "LEFT" + elseif((centerX > widthRight) and (centerY < heightTop) and (centerY > heightBottom)) then + result = "RIGHT" + else + result = "CENTER" + end + return result +end + +local function CurrentPosition(frame) + if not frame then return end + local anchor1, parent, anchor2, x, y = frame:GetPoint() + if((not anchor1) or (not anchor2) or (not x) or (not y)) then + return "TBD" + end + + local parentName + if(not parent or (parent and (not parent:GetName()))) then + parentName = "UIParent" + else + parentName = parent:GetName() + end + return ("%s\031%s\031%s\031%d\031%d"):format(anchor1, parentName, anchor2, parsefloat(x), parsefloat(y)) +end +--[[ +########################################################## +CONSTRUCTS +########################################################## +]]-- +function Dragger:New(frameName) + if(not UIPanels[frameName]) then + UIPanels[frameName] = { point = 'TBD', snap = false, centered = false }; + if(not self.EventsActive) then + self:RegisterEvent("ADDON_LOADED") + self:RegisterEvent("LFG_UPDATE") + self:RegisterEvent("ROLE_POLL_BEGIN") + self:RegisterEvent("READY_CHECK") + self:RegisterEvent("UPDATE_WORLD_STATES") + self:RegisterEvent("WORLD_STATE_TIMER_START") + self:RegisterEvent("WORLD_STATE_UI_TIMER_UPDATE") + self:SetScript("OnEvent", self.EventHandler) + self.EventsActive = true; + end + end +end + +function Dragger:SavePoint(frameName) + if((not _G[frameName]) or (not SV.cache.UIPanels)) then return end + SV.cache.UIPanels[frameName] = CurrentPosition(_G[frameName]) +end + +function Dragger:SetPositions() + for frameName, point in pairs(Dragger.Frames) do + local frame = _G[frameName]; + local anchor1, parent, anchor2, x, y; + if(frame) then + if (SV.cache.UIPanels and SV.cache.UIPanels[frameName] and (type(SV.cache.UIPanels[frameName]) == "string")) then + local saved = SV.cache.UIPanels[frameName] + if(saved ~= 'TBD') then + local anchor1, parent, anchor2, x, y = split("\031", saved) + frame:ClearAllPoints() + frame:SetPoint(anchor1, parent, anchor2, x, y) + end + elseif(point and (type(point) == "string") and (point ~= 'TBD')) then + anchor1, parent, anchor2, x, y = split("\031", point) + frame:ClearAllPoints() + frame:SetPoint(anchor1, parent, anchor2, x, y) + end + end + end +end + +function Dragger:Reset() + for frameName, point in pairs(self.Frames) do + if(SV.cache.UIPanels and SV.cache.UIPanels[frameName]) then + SV.cache.UIPanels[frameName] = nil + end + end + ReloadUI() +end +--[[ +########################################################## +SCRIPT AND EVENT HANDLERS +########################################################## +]]-- +local DraggerFrame_OnDragStart = function(self) + if(not self:IsMovable()) then return end + self:StartMoving() + self.IsMoving = true +end + +local DraggerFrame_OnDragStop = function(self) + if(not self:IsMovable()) then return end + local frameName = self:GetName(); + self.IsMoving = false; + self.CanUpdate = true; + self:StopMovingOrSizing() + local anchor1, parent, anchor2, x, y = self:GetPoint() + parent = self:GetParent():GetName() + self:ClearAllPoints() + self:SetPoint(anchor1, parent, anchor2, x, y) + Dragger.Frames[frameName] = CurrentPosition(self) + if(UIPanels[frameName] and UIPanels[frameName].saved) then + Dragger:SavePoint(frameName) + end +end + +local DraggerFrame_OnShow = function(self) + if(not self:IsMovable()) then return end + local frameName = self:GetName(); + if(UIPanels[frameName] and UIPanels[frameName].saved and (SV.cache.UIPanels and SV.cache.UIPanels[frameName] and (type(SV.cache.UIPanels[frameName]) == "string"))) then + local saved = SV.cache.UIPanels[frameName] + if(saved ~= 'TBD') then + local anchor1, parent, anchor2, x, y = split("\031", saved) + self:ClearAllPoints() + self:SetPoint(anchor1, parent, anchor2, x, y) + self.CanUpdate = false; + end + else + local defaultPoint = Dragger.Frames[frameName] + if(defaultPoint and (type(defaultPoint) == "string") and (defaultPoint ~= 'TBD')) then + local anchor1, parent, anchor2, x, y = split("\031", defaultPoint) + self:ClearAllPoints() + self:SetPoint(anchor1, parent, anchor2, x, y) + self.CanUpdate = false; + end + end +end + +local DraggerFrame_OnAttributeChanged = function(self) + if(self.IsMoving) then return end + self.CanUpdate = false; +end + +local DraggerFrame_PostSetPoint = function(self) + if(self.IsMoving) then return end + self.CanUpdate = true; +end + +local DraggerFrame_OnUpdate = function(self) + if(InCombatLockdown() or (self.IsMoving)) then return end + local frameName = self:GetName(); + if(self.CanUpdate) then + if(UIPanels[frameName] and UIPanels[frameName].saved and (SV.cache.UIPanels and SV.cache.UIPanels[frameName] and (type(SV.cache.UIPanels[frameName]) == "string"))) then + local saved = SV.cache.UIPanels[frameName] + if(saved ~= 'TBD') then + local anchor1, parent, anchor2, x, y = split("\031", saved) + self:ClearAllPoints() + self:SetPoint(anchor1, parent, anchor2, x, y) + self.CanUpdate = false; + end + else + local defaultPoint = Dragger.Frames[frameName] + if(defaultPoint and (type(defaultPoint) == "string") and (defaultPoint ~= 'TBD')) then + local anchor1, parent, anchor2, x, y = split("\031", defaultPoint) + self:ClearAllPoints() + self:SetPoint(anchor1, parent, anchor2, x, y) + self.CanUpdate = false; + end + end + end +end + +function Dragger:EventHandler(event, ...) + if(InCombatLockdown()) then return end + + local noMoreChanges = true; + + for frameName, data in pairs(UIPanels) do + if((not self.Frames[frameName]) or (self.Frames[frameName] and (self.Frames[frameName] == "TBD"))) then + local frame = _G[frameName] + if(frame) then + frame:EnableMouse(true) + + if(frameName == "LFGDungeonReadyPopup") then + LFGDungeonReadyDialog:EnableMouse(false) + end + + frame:SetMovable(true) + frame:RegisterForDrag("LeftButton") + frame:SetClampedToScreen(true) + frame:HookScript("OnUpdate", DraggerFrame_OnUpdate) + frame:HookScript("OnShow", DraggerFrame_OnShow) + frame:SetScript("OnDragStart", DraggerFrame_OnDragStart) + frame:SetScript("OnDragStop", DraggerFrame_OnDragStop) + + if(self.CenterEverything) then + frame:ClearAllPoints() + frame:SetPoint('TOP', SV.Screen, 'TOP', 0, -180) + end + + self.Frames[frameName] = CurrentPosition(frame) + else + self.Frames[frameName] = 'TBD' + end + noMoreChanges = false; + end + end + + if(noMoreChanges) then + self.EventsActive = false; + self:UnregisterEvent("ADDON_LOADED") + self:UnregisterEvent("LFG_UPDATE") + self:UnregisterEvent("ROLE_POLL_BEGIN") + self:UnregisterEvent("READY_CHECK") + self:UnregisterEvent("UPDATE_WORLD_STATES") + self:UnregisterEvent("WORLD_STATE_TIMER_START") + self:UnregisterEvent("WORLD_STATE_UI_TIMER_UPDATE") + self:SetScript("OnEvent", nil) + end +end +--[[ +########################################################## +Initialize +########################################################## +]]-- +function Dragger:Initialize() + SV.cache.UIPanels = SV.cache.UIPanels or {} + + if(not SV.db.general.questWatch) then + UIPanels["ObjectiveTrackerFrame"] = { point = 'TBD', snap = false, centered = false }; + end + + self.EventsActive = true + self.CenterEverything = SV.db.general.multiMonitor + + self:RegisterEvent("ADDON_LOADED") + self:RegisterEvent("LFG_UPDATE") + self:RegisterEvent("ROLE_POLL_BEGIN") + self:RegisterEvent("READY_CHECK") + self:RegisterEvent("UPDATE_WORLD_STATES") + self:RegisterEvent("WORLD_STATE_TIMER_START") + self:RegisterEvent("WORLD_STATE_UI_TIMER_UPDATE") + + self:EventHandler() + self:SetScript("OnEvent", self.EventHandler) + + if(SV.db.general.saveDraggable) then + for frameName, data in pairs(UIPanels) do + data.saved = true + end + self:SetPositions() + end + + hooksecurefunc("UIParent_ManageFramePositions", Dragger.SetPositions) +end + +SV.Dragger = Dragger \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua b/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua index 364ef14..a2ecc02 100644 --- a/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua +++ b/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua @@ -44,49 +44,6 @@ local L = SV.L; local Mentalo = CreateFrame("Frame", nil) Mentalo.Frames = {} -Mentalo.Blizzard = {} - -local DraggableFrames = { - "AchievementFrame", "AuctionFrame", "ArchaeologyFrame", - "BattlefieldMinimap", "BarberShopFrame", "BlackMarketFrame", - "CalendarFrame", "CharacterFrame", "ClassTrainerFrame", - "DressUpFrame", "DraenorZoneAbilityFrame", - "EncounterJournal", - "FriendsFrame", - "GMSurveyFrame", "GossipFrame", "GuildFrame", "GuildBankFrame", "GuildRegistrarFrame", - "GarrisonLandingPage", "GarrisonMissionFrame", "GarrisonCapacitiveDisplayFrame", - "HelpFrame", - "InterfaceOptionsFrame", - "ItemUpgradeFrame", - "KeyBindingFrame", - "LFGDungeonReadyPopup", - "MacOptionsFrame", "MacroFrame", "MailFrame", "MerchantFrame", - "PlayerTalentFrame", "PetJournalParent", "PetStableFrame", "PVEFrame", "PVPFrame", - "QuestFrame", "QuestLogFrame", - "RaidBrowserFrame", "ReadyCheckFrame", "ReforgingFrame", "ReportCheatingDialog", "ReportPlayerNameDialog", "RolePollPopup", - "ScrollOfResurrectionSelectionFrame", "SpellBookFrame", - "TabardFrame", "TaxiFrame", "TimeManagerFrame", "TradeSkillFrame", "TradeFrame", "TransmogrifyFrame", "TutorialFrame", - "VideoOptionsFrame", "VoidStorageFrame", - --"WorldStateAlwaysUpFrame" -}; - -local CenteredFrames = { - ["BattlefieldMinimap"] = {"TOP", "TOP", 0, -80}, - ["CalendarFrame"] = {"TOP", "TOP", 0, -80}, - ["GameMenuFrame"] = {"TOP", "TOP", 0, -80}, - ["GMSurveyFrame"] = {"TOP", "TOP", 0, -80}, - ["GarrisonLandingPage"] = {"TOP", "TOP", 0, -80}, - ["GarrisonMissionFrame"] = {"TOP", "TOP", 0, -80}, - ["HelpFrame"] = {"TOP", "TOP", 0, -80}, - ["InterfaceOptionsFrame"] = {"TOP", "TOP", 0, -80}, - ["KeyBindingFrame"] = {"TOP", "TOP", 0, -80}, - ["LFGDungeonReadyPopup"] = {"TOP", "TOP", 0, -80}, - ["MacOptionsFrame"] = {"TOP", "TOP", 0, -80}, - ["ReadyCheckFrame"] = {"TOP", "TOP", 0, -80}, - ["RolePollPopup"] = {"TOP", "TOP", 0, -80}, - ["TutorialFrame"] = {"TOP", "TOP", 0, -80}, - ["VideoOptionsFrame"] = {"TOP", "TOP", 0, -80}, -}; --[[ /$$$$$$ /$$ /$$ /$$ /$$__ $$ | $$ |__/ | $$ @@ -282,22 +239,17 @@ local function Pinpoint(parent) end local function CurrentPosition(frame) - if not frame then return end + if not frame then return end + + local parentName local anchor1, parent, anchor2, x, y = frame:GetPoint() + if((not anchor1) or (not anchor2) or (not x) or (not y)) then - local frameName = frame:GetName() - if(CenteredFrames[frameName]) then - anchor1, anchor2, x, y = unpack(CenteredFrames[frameName]) - else - anchor1, anchor2, x, y = "TOPLEFT", "TOPLEFT", 160, -80 - end + anchor1, anchor2, x, y = "TOPLEFT", "TOPLEFT", 160, -80 end - local parentName - if not parent then - parentName = "SVUIParent" - elseif not parent:GetName() then - parentName = "SVUI_Player" + if(not parent or (parent and (not parent:GetName()))) then + parentName = "UIParent" else parentName = parent:GetName() end @@ -365,7 +317,7 @@ end | $$ | $$ | $$| $$$$$$$$ | $$ | $$| $$ | $$| $$ \ $$| $$$$$$$/ |__/ |__/ |__/|________/ |__/ |__/|__/ |__/|__/ \__/|_______/ --]] -local TheHand = CreateFrame("Frame", "SVUI_HandOfMentalo", SV.Screen) +local TheHand = CreateFrame("Frame", "SVUI_HandOfMentalo", UIParent) TheHand:SetFrameStrata("DIALOG") TheHand:SetFrameLevel(99) TheHand:SetClampedToScreen(true) @@ -615,14 +567,14 @@ function Mentalo:New(frame, moveName, title, snap, dragStopFunc) movable.postdrag = dragStopFunc; movable.snapOffset = snap or -2; - local anchor1, anchorParent, anchor2, xPos, yPos = split("\031", CurrentPosition(frame)) + local anchor1, anchorParent, anchor2, xPos, yPos if(SV.cache.Anchors and SV.cache.Anchors[moveName] and (type(SV.cache.Anchors[moveName]) == "string")) then anchor1, anchorParent, anchor2, xPos, yPos = split("\031", SV.cache.Anchors[moveName]) - movable:SetPoint(anchor1, anchorParent, anchor2, xPos, yPos) - else - movable:SetPoint(anchor1, anchorParent, anchor2, xPos, yPos) + else + anchor1, anchorParent, anchor2, xPos, yPos = split("\031", CurrentPosition(frame)) end + movable:SetPoint(anchor1, anchorParent, anchor2, xPos, yPos) movable:SetFixedPanelTemplate("Transparent") movable:SetAlpha(0.4) @@ -706,13 +658,6 @@ function Mentalo:Reset(request) SV.cache.Anchors[frameName] = nil end end - elseif(request == "Blizzard") then - for frameName, point in pairs(self.Blizzard) do - if(SV.cache.Anchors and SV.cache.Anchors[frameName]) then - SV.cache.Anchors[frameName] = nil - end - end - ReloadUI() else for frameName, frameData in pairs(self.Frames) do if(frameData.point and (request == frameData.text)) then @@ -748,22 +693,6 @@ function Mentalo:SetPositions() end end end - - for frameName, point in pairs(self.Blizzard) do - local frame = _G[frameName]; - local anchor1, parent, anchor2, x, y; - if(frame) then - if (SV.cache.Anchors and SV.cache.Anchors[frameName] and (type(SV.cache.Anchors[frameName]) == "string")) then - anchor1, parent, anchor2, x, y = split("\031", SV.cache.Anchors[frameName]) - frame:ClearAllPoints() - frame:SetPoint(anchor1, parent, anchor2, x, y) - elseif(point and (type(point) == "string")) then - anchor1, parent, anchor2, x, y = split("\031", point) - frame:ClearAllPoints() - frame:SetPoint(anchor1, parent, anchor2, x, y) - end - end - end end function Mentalo:Toggle(isConfigMode) @@ -871,153 +800,6 @@ local XML_MentaloPrecisionInputY_EnterPressed = function(self) end --[[ ########################################################## -DRAGGABLE HANDLERS -########################################################## -]]-- -local UIPanelsAdjusted = {}; - -local BlizzardFrame_OnDragStart = function(self) - if not self:IsMovable() then return end - self:StartMoving() - self.IsMoving = true -end ---[[ -########################################################## -SAVED -########################################################## -]]-- -local BlizzardSavedFrame_OnDragStop = function(self) - if(not self:IsMovable()) then return end - local frameName = self:GetName(); - self.IsMoving = false; - self:StopMovingOrSizing() - local anchor1, parent, anchor2, x, y = self:GetPoint() - parent = self:GetParent():GetName() - self:ClearAllPoints() - self:SetPoint(anchor1, parent, anchor2, x, y) - if(frameName == "QuestFrame") then - frameName = "GossipFrame" - end - Mentalo:SaveMovable(frameName) -end - -local BlizzardSavedFrame_OnUpdate = function(self) - local frameName = self:GetName(); - if(InCombatLockdown() or (self.IsMoving)) then return end - if(frameName == "QuestFrame") then - frameName = "GossipFrame" - end - if (SV.cache.Anchors and SV.cache.Anchors[frameName] and (type(SV.cache.Anchors[frameName]) == "string")) then - local anchor1, parent, anchor2, x, y = split("\031", SV.cache.Anchors[frameName]) - self:ClearAllPoints() - self:SetPoint(anchor1, parent, anchor2, x, y) - else - local defaultPoint = Mentalo.Blizzard[frameName] - if(defaultPoint and (type(defaultPoint) == "string")) then - local anchor1, parent, anchor2, x, y = split("\031", defaultPoint) - self:ClearAllPoints() - self:SetPoint(anchor1, parent, anchor2, x, y) - end - end -end - -local SavedDraggablesUpdate = function(self, event, ...) - if(InCombatLockdown()) then return end - for _, frameName in pairs(DraggableFrames) do - if((not self.Blizzard[frameName]) or (self.Blizzard[frameName] and (self.Blizzard[frameName] == "TBD"))) then - local frame = _G[frameName] - if(frame) then - frame:EnableMouse(true) - - if(frameName == "LFGDungeonReadyPopup") then - LFGDungeonReadyDialog:EnableMouse(false) - end - - frame:SetMovable(true) - frame:RegisterForDrag("LeftButton") - frame:SetClampedToScreen(true) - frame:HookScript("OnUpdate", BlizzardSavedFrame_OnUpdate) - frame:SetScript("OnDragStart", BlizzardFrame_OnDragStart) - frame:SetScript("OnDragStop", BlizzardSavedFrame_OnDragStop) - - if(self.CenterEverything and (not UIPanelsAdjusted[panelName])) then - frame:ClearAllPoints() - frame:SetPoint('TOP', SV.Screen, 'TOP', 0, -180) - UIPanelsAdjusted[frameName] = true - end - - self.Blizzard[frameName] = CurrentPosition(frame) - else - self.Blizzard[frameName] = "TBD" - end - end - end -end ---[[ -########################################################## -NOT SAVED -########################################################## -]]-- -local BlizzardFrame_OnDragStop = function(self) - if(not self:IsMovable()) then return end - local frameName = self:GetName(); - self.IsMoving = false; - self:StopMovingOrSizing() - local anchor1, parent, anchor2, x, y = self:GetPoint() - parent = self:GetParent():GetName() - self:ClearAllPoints() - self:SetPoint(anchor1, parent, anchor2, x, y) - Mentalo.Blizzard[frameName] = CurrentPosition(self) -end - -local BlizzardFrame_OnUpdate = function(self) - local frameName = self:GetName(); - if(InCombatLockdown() or (self.IsMoving)) then return end - if(frameName == "QuestFrame") then - frameName = "GossipFrame" - end - local defaultPoint = Mentalo.Blizzard[frameName] - if(defaultPoint and (type(defaultPoint) == "string")) then - local anchor1, parent, anchor2, x, y = split("\031", defaultPoint) - self:ClearAllPoints() - self:SetPoint(anchor1, parent, anchor2, x, y) - end -end - -local DefaultDraggablesUpdate = function(self, event, ...) - if(InCombatLockdown()) then return end - for _, frameName in pairs(DraggableFrames) do - if((not self.Blizzard[frameName]) or (self.Blizzard[frameName] and (self.Blizzard[frameName] == "TBD"))) then - local frame = _G[frameName] - if(frame) then - frame:EnableMouse(true) - - if(frameName == "LFGDungeonReadyPopup") then - LFGDungeonReadyDialog:EnableMouse(false) - end - - frame:SetMovable(true) - frame:RegisterForDrag("LeftButton") - frame:SetClampedToScreen(true) - frame:HookScript("OnUpdate", BlizzardFrame_OnUpdate) - frame:SetScript("OnDragStart", BlizzardFrame_OnDragStart) - frame:SetScript("OnDragStop", BlizzardFrame_OnDragStop) - - if(self.CenterEverything and (not UIPanelsAdjusted[panelName])) then - frame:ClearAllPoints() - frame:SetPoint('TOP', SV.Screen, 'TOP', 0, -180) - UIPanelsAdjusted[frameName] = true - end - - self.Blizzard[frameName] = CurrentPosition(frame) - else - self.Blizzard[frameName] = "TBD" - end - end - end -end ---[[ -########################################################## Initialize ########################################################## ]]-- @@ -1048,30 +830,8 @@ function Mentalo:Initialize() SVUI_MentaloPrecisionRightButton:SetButtonTemplate() SV.cache.Anchors = SV.cache.Anchors or {} - self.CenterEverything = SV.db.general.multiMonitor - - if(not SV.db.general.questWatch) then - tinsert(DraggableFrames, "ObjectiveTrackerFrame") - end - - self:RegisterEvent("ADDON_LOADED") - self:RegisterEvent("LFG_UPDATE") - self:RegisterEvent("ROLE_POLL_BEGIN") - self:RegisterEvent("READY_CHECK") - self:RegisterEvent("UPDATE_WORLD_STATES") - self:RegisterEvent("WORLD_STATE_TIMER_START") - self:RegisterEvent("WORLD_STATE_UI_TIMER_UPDATE") - - if(SV.db.general.saveDraggable) then - self.DraggableUpdate = SavedDraggablesUpdate - else - self.DraggableUpdate = DefaultDraggablesUpdate - end - - self:DraggableUpdate() - + self:SetPositions() - self:SetScript("OnEvent", self.DraggableUpdate) -- PET JOURNAL TAINT FIX (STILL NEEDED?) -- local info = UIPanelWindows["PetJournalParent"]; diff --git a/Interface/AddOns/SVUI/framework/movers/movers.xml b/Interface/AddOns/SVUI/framework/movers/movers.xml index 1c1d332..f9a1e7d 100644 --- a/Interface/AddOns/SVUI/framework/movers/movers.xml +++ b/Interface/AddOns/SVUI/framework/movers/movers.xml @@ -258,4 +258,5 @@ <Script file="mover_graph.lua"/> <Script file="mover_mentalo.lua"/> + <Script file="mover_dragger.lua"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua b/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua index 360b190..7dadb06 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua @@ -408,7 +408,7 @@ end function MOD:LoadKeyBinder() self:RefreshActionBars() - Binder:SetParent(SV.Screen) + -- Binder:SetParent(SV.Screen) Binder:SetFrameStrata("DIALOG") Binder:SetFrameLevel(99) Binder:EnableMouse(true) diff --git a/Interface/AddOns/SVUI/packages/aura/SVAura.lua b/Interface/AddOns/SVUI/packages/aura/SVAura.lua index 8e7ce52..aedb53b 100644 --- a/Interface/AddOns/SVUI/packages/aura/SVAura.lua +++ b/Interface/AddOns/SVUI/packages/aura/SVAura.lua @@ -580,7 +580,7 @@ function MOD:Load() InterfaceOptionsFrameCategoriesButton12:SetScale(0.0001) end - local auras = CreateFrame("Frame", "SVUI_AurasAnchor", SV.Screen) + local auras = CreateFrame("Frame", "SVUI_AurasAnchor", UIParent) auras:SetSize(CB_WIDTH, CB_HEIGHT) auras:Point("TOPRIGHT", Minimap, "TOPLEFT", -8, 0) SV:AddToDisplayAudit(auras) @@ -590,7 +590,7 @@ function MOD:Load() self.DebuffFrame = CreateAuraHeader("HARMFUL") self.DebuffFrame:SetPoint( "BOTTOMRIGHT", auras, "BOTTOMLEFT", -8, 0) - SVUI_ConsolidatedBuffs:SetParent(SV.Screen) + -- SVUI_ConsolidatedBuffs:SetParent(SV.Screen) SVUI_ConsolidatedBuffs:SetAllPoints(auras) SVUI_ConsolidatedBuffs:SetFrameStrata("BACKGROUND") SV:AddToDisplayAudit(SVUI_ConsolidatedBuffs) diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index 5a5d136..47fb070 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -1302,7 +1302,7 @@ do local bagName = "SVUI_ContainerFrame" local uisCount = #UISpecialFrames + 1; local bagsCount = #self.BagFrames + 1; - local frame = CreateFrame("Button", "SVUI_ContainerFrame", SV.Screen) + local frame = CreateFrame("Button", "SVUI_ContainerFrame", UIParent) frame:SetPanelTemplate("Container") frame:SetFrameStrata("HIGH") @@ -1862,7 +1862,7 @@ function MOD:Load() self:ModifyBags() self.BagFrame:UpdateLayout() - BagFilters:SetParent(SV.Screen) + -- BagFilters:SetParent(SV.Screen) BagFilters:SetPanelTemplate("Default") BagFilters.buttons = {} BagFilters:SetFrameStrata("DIALOG") diff --git a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua index 1a0c1e1..002def8 100644 --- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua +++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua @@ -426,8 +426,8 @@ local function CreateHenchmenSubOptions(buttonIndex,optionIndex) end local function CreateHenchmenFrame() - HenchmenFrame:SetParent(SV.Screen) - HenchmenFrame:SetPoint("CENTER",UIParent,"CENTER",0,0) + HenchmenFrame:SetParent(UIParent) + HenchmenFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 0) HenchmenFrame:SetWidth(500) HenchmenFrame:SetHeight(500) HenchmenFrame:SetFrameStrata("DIALOG") @@ -443,7 +443,7 @@ local function CreateHenchmenFrame() HenchmenFrame:Hide() - local HenchmenCalloutFrame = CreateFrame("Frame","HenchmenCalloutFrame",SV.Screen) + local HenchmenCalloutFrame = CreateFrame("Frame", "HenchmenCalloutFrame", UIParent) HenchmenCalloutFrame:SetPoint("BOTTOM",UIParent,"BOTTOM",100,150) HenchmenCalloutFrame:SetWidth(256) HenchmenCalloutFrame:SetHeight(128) @@ -455,7 +455,7 @@ local function CreateHenchmenFrame() HenchmenCalloutFramePic:SetAllPoints(HenchmenCalloutFrame) HenchmenCalloutFrame:Hide() - local HenchmenFrameBG = CreateFrame("Frame","HenchmenFrameBG",SV.Screen) + local HenchmenFrameBG = CreateFrame("Frame", "HenchmenFrameBG", UIParent) HenchmenFrameBG:SetAllPoints(WorldFrame) HenchmenFrameBG:SetBackdrop({bgFile = [[Interface\BUTTONS\WHITE8X8]]}) HenchmenFrameBG:SetBackdropColor(0,0,0,0.9) diff --git a/Interface/AddOns/SVUI/packages/map/SVMap.lua b/Interface/AddOns/SVUI/packages/map/SVMap.lua index d6ec9c2..cfd4012 100644 --- a/Interface/AddOns/SVUI/packages/map/SVMap.lua +++ b/Interface/AddOns/SVUI/packages/map/SVMap.lua @@ -351,7 +351,7 @@ local function SetLargeWorldMap() if InCombatLockdown() then return end if SV.db.SVMap.tinyWorldMap == true then - WorldMapFrame:SetParent(SV.Screen) + -- WorldMapFrame:SetParent(SV.Screen) WorldMapFrame:EnableMouse(false) WorldMapFrame:EnableKeyboard(false) WorldMapFrame:SetScale(1) @@ -722,7 +722,7 @@ function MOD:Load() Minimap:SetClampedToScreen(false) local mapHolder = SVUI_MinimapFrame - mapHolder:SetParent(SV.Screen); + -- mapHolder:SetParent(SV.Screen); mapHolder:SetFrameStrata("BACKGROUND") mapHolder:Point("TOPRIGHT", SV.Screen, "TOPRIGHT", -10, -10) mapHolder:Size(MM_WIDTH, MM_HEIGHT) @@ -841,7 +841,7 @@ function MOD:Load() if(SV.db.SVMap.tinyWorldMap) then setfenv(WorldMapFrame_OnShow, setmetatable({ UpdateMicroButtons = SV.fubar }, { __index = _G })) - WorldMapFrame:SetParent(SV.Screen) + -- WorldMapFrame:SetParent(SV.Screen) WorldMapFrame:HookScript('OnShow', _hook_WorldMapFrame_OnShow) WorldMapFrame:HookScript('OnHide', _hook_WorldMapFrame_OnHide) end diff --git a/Interface/AddOns/SVUI/packages/override/components/loot.lua b/Interface/AddOns/SVUI/packages/override/components/loot.lua index 17813da..a27e706 100644 --- a/Interface/AddOns/SVUI/packages/override/components/loot.lua +++ b/Interface/AddOns/SVUI/packages/override/components/loot.lua @@ -336,7 +336,7 @@ end local function CreateRollFrame() UpdateLootUpvalues() - local rollFrame = CreateFrame("Frame",nil,SV.Screen) + local rollFrame = CreateFrame("Frame", nil, UIParent) rollFrame:Size(LOOT_WIDTH,LOOT_HEIGHT) rollFrame:SetFixedPanelTemplate('Default') rollFrame:SetScript("OnEvent",LootRoll_OnEvent) diff --git a/Interface/AddOns/SVUI/packages/override/components/mirror.lua b/Interface/AddOns/SVUI/packages/override/components/mirror.lua index ffd24a0..8928919 100644 --- a/Interface/AddOns/SVUI/packages/override/components/mirror.lua +++ b/Interface/AddOns/SVUI/packages/override/components/mirror.lua @@ -106,7 +106,7 @@ local function MirrorBarRegistry(barType) if RegisteredMirrorBars[barType] then return RegisteredMirrorBars[barType] end - local bar = CreateFrame('StatusBar', nil, SV.Screen) + local bar = CreateFrame('StatusBar', nil, UIParent) bar:SetPanelTemplate("Bar", false, 3, 3, 3) bar:SetScript("OnUpdate", MirrorBar_OnUpdate) local r, g, b = unpack(mirrorTypeColor[barType]) diff --git a/Interface/AddOns/SVUI/packages/quest/SVQuest.lua b/Interface/AddOns/SVUI/packages/quest/SVQuest.lua deleted file mode 100644 index dda1296..0000000 --- a/Interface/AddOns/SVUI/packages/quest/SVQuest.lua +++ /dev/null @@ -1,311 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local table = _G.table; ---[[ STRING METHODS ]]-- -local format = string.format; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; ---[[ TABLE METHODS ]]-- -local tremove, twipe = table.remove, table.wipe; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local LSM = LibStub("LibSharedMedia-3.0") -local MOD = SV:NewPackage("SVQuest", L['Questing']); ---[[ -########################################################## -EXTRA QUEST ITEM BUTTON -########################################################## -]]-- -local Button = CreateFrame('Button', (...), UIParent, 'SecureActionButtonTemplate, SecureHandlerStateTemplate, SecureHandlerAttributeTemplate') -RegisterStateDriver(Button, 'visible', '[extrabar] hide; show') -Button:SetAttribute('_onattributechanged', [[ - if(name == 'item') then - if(value and not self:IsShown() and not HasExtraActionBar()) then - self:Show() - elseif(not value) then - self:Hide() - self:ClearBindings() - end - elseif(name == 'state-visible') then - if(value == 'show') then - self:CallMethod('Update') - else - self:Hide() - self:ClearBindings() - end - end - - if(self:IsShown() and (name == 'item' or name == 'binding')) then - self:ClearBindings() - - local key = GetBindingKey('EXTRAACTIONBUTTON1') - if(key) then - self:SetBindingClick(1, key, self, 'LeftButton') - end - end -]]) - -local function UpdateCooldown(self) - if(self:IsShown()) then - local start, duration, enable = GetItemCooldown(self.itemID) - if(duration > 0) then - self.Cooldown:SetCooldown(start, duration) - self.Cooldown:Show() - else - self.Cooldown:Hide() - end - end -end - -Button:RegisterEvent('PLAYER_LOGIN') -Button:SetScript('OnEvent', function(self, event) - if(event == 'BAG_UPDATE_COOLDOWN') then - UpdateCooldown(self) - elseif(event == 'PLAYER_REGEN_ENABLED') then - self:SetAttribute('item', self.attribute) - self:UnregisterEvent(event) - UpdateCooldown(self) - elseif(event == 'UPDATE_BINDINGS') then - if(self:IsShown()) then - self:SetItem() - self:SetAttribute('binding', GetTime()) - end - elseif(event == 'PLAYER_LOGIN') then - self:SetPoint('CENTER', ExtraActionButton1) - self:SetSize(ExtraActionButton1:GetSize()) - self:SetScale(ExtraActionButton1:GetScale()) - self:SetHighlightTexture([[Interface\Buttons\ButtonHilight-Square]]) - self:SetPushedTexture([[Interface\Buttons\CheckButtonHilight]]) - self:GetPushedTexture():SetBlendMode('ADD') - self:SetScript('OnLeave', GameTooltip_Hide) - self:SetAttribute('type', 'item') - self.updateTimer = 0 - self.rangeTimer = 0 - self:Hide() - - local Icon = self:CreateTexture('$parentIcon', 'BACKGROUND') - Icon:SetAllPoints() - self.Icon = Icon - - local HotKey = self:CreateFontString('$parentHotKey', nil, 'NumberFontNormal') - HotKey:SetPoint('BOTTOMRIGHT', -5, 5) - self.HotKey = HotKey - - local Cooldown = CreateFrame('Cooldown', '$parentCooldown', self, 'CooldownFrameTemplate') - Cooldown:ClearAllPoints() - Cooldown:SetPoint('TOPRIGHT', -2, -3) - Cooldown:SetPoint('BOTTOMLEFT', 2, 1) - Cooldown:Hide() - self.Cooldown = Cooldown - - local Artwork = self:CreateTexture('$parentArtwork', 'OVERLAY') - Artwork:SetPoint('CENTER', -2, 0) - Artwork:SetSize(256, 128) - Artwork:SetTexture([[Interface\ExtraButton\Default]]) - self.Artwork = Artwork - - self:RegisterEvent('UPDATE_BINDINGS') - self:RegisterEvent('UPDATE_EXTRA_ACTIONBAR') - self:RegisterEvent('BAG_UPDATE_COOLDOWN') - self:RegisterEvent('BAG_UPDATE_DELAYED') - self:RegisterEvent('WORLD_MAP_UPDATE') - self:RegisterEvent('QUEST_LOG_UPDATE') - self:RegisterEvent('QUEST_POI_UPDATE') - else - self:Update() - end -end) - -Button:SetScript('OnEnter', function(self) - GameTooltip:SetOwner(self, 'ANCHOR_LEFT') - GameTooltip:SetHyperlink(self.itemLink) -end) - --- BUG: IsItemInRange() is broken versus friendly npcs (and possibly others) -Button:SetScript('OnUpdate', function(self, elapsed) - if(self.rangeTimer > TOOLTIP_UPDATE_TIME) then - local HotKey = self.HotKey - local inRange = IsItemInRange(self.itemLink, 'target') - if(HotKey:GetText() == RANGE_INDICATOR) then - if(inRange == false) then - HotKey:SetTextColor(1, 0.1, 0.1) - HotKey:Show() - elseif(inRange) then - HotKey:SetTextColor(1, 1, 1) - HotKey:Show() - else - HotKey:Hide() - end - else - if(inRange == false) then - HotKey:SetTextColor(1, 0.1, 0.1) - else - HotKey:SetTextColor(1, 1, 1) - end - end - - self.rangeTimer = 0 - else - self.rangeTimer = self.rangeTimer + elapsed - end - - if(self.updateTimer > 5) then - self:Update() - self.updateTimer = 0 - else - self.updateTimer = self.updateTimer + elapsed - end -end) - -local zoneWide = { - [14108] = 541, - [13998] = 11, - [25798] = 61, -- quest is bugged, has no zone - [25799] = 61, -- quest is bugged, has no zone - [25112] = 161, - [25111] = 161, - [24735] = 201, -} - -local blacklist = { - [113191] = true, - [110799] = true, - [109164] = true, -} - -function Button:SetItem(itemLink, texture) - if(itemLink) then - if(itemLink == self.itemLink and self:IsShown()) then - return - end - - self.Icon:SetTexture(texture) - self.itemID, self.itemName = string.match(itemLink, '|Hitem:(.-):.-|h%[(.+)%]|h') - self.itemLink = itemLink - - if(blacklist[self.itemID]) then - return - end - end - - local HotKey = self.HotKey - local key = GetBindingKey('EXTRAACTIONBUTTON1') - if(key) then - HotKey:SetText(GetBindingText(key, 1)) - HotKey:Show() - elseif(ItemHasRange(self.itemLink)) then - HotKey:SetText(RANGE_INDICATOR) - HotKey:Show() - else - HotKey:Hide() - end - - if(InCombatLockdown()) then - self.attribute = self.itemName - self:RegisterEvent('PLAYER_REGEN_ENABLED') - else - self:SetAttribute('item', self.itemName) - UpdateCooldown(self) - end -end - -function Button:RemoveItem() - if(InCombatLockdown()) then - self.attribute = nil - self:RegisterEvent('PLAYER_REGEN_ENABLED') - else - self:SetAttribute('item', nil) - end -end - -local ticker -function Button:Update() - local numItems = 0 - local shortestDistance = 62500 -- 250 yards² - local closestQuestLink, closestQuestTexture - - for index = 1, GetNumQuestWatches() do - local questID, _, questIndex, _, _, isComplete = GetQuestWatchInfo(index) - if(questID and QuestHasPOIInfo(questID)) then - local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questIndex) - if(link) then - local areaID = zoneWide[questID] - if(areaID and areaID == GetCurrentMapAreaID()) then - closestQuestLink = link - closestQuestTexture = texture - elseif(not isComplete or (isComplete and showCompleted)) then - local distanceSq, onContinent = GetDistanceSqToQuest(questIndex) - if(onContinent and distanceSq < shortestDistance) then - shortestDistance = distanceSq - closestQuestLink = link - closestQuestTexture = texture - end - end - - numItems = numItems + 1 - end - end - end - - if(closestQuestLink and not HasExtraActionBar()) then - self:SetItem(closestQuestLink, closestQuestTexture) - elseif(self:IsShown()) then - self:RemoveItem() - end - - if(numItems > 0 and not ticker) then - ticker = C_Timer.NewTicker(30, function() -- might want to lower this - Button:Update() - end) - elseif(numItems == 0 and ticker) then - ticker:Cancel() - ticker = nil - end -end ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -function MOD:ReLoad() - -- DO STUFF -end - -function MOD:Load() - -- DO STUFF -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/SVStats.lua b/Interface/AddOns/SVUI/packages/stats/SVStats.lua index e58ddf2..e6264ba 100644 --- a/Interface/AddOns/SVUI/packages/stats/SVStats.lua +++ b/Interface/AddOns/SVUI/packages/stats/SVStats.lua @@ -602,7 +602,7 @@ function MOD:Load() self:LoadServerGold() self:CacheRepData() - self.tooltip:SetParent(SV.Screen) + -- self.tooltip:SetParent(SV.Screen) self.tooltip:SetFrameStrata("DIALOG") self.tooltip:HookScript("OnShow", _hook_TooltipOnShow) diff --git a/Interface/AddOns/SVUI/packages/tip/SVTip.lua b/Interface/AddOns/SVUI/packages/tip/SVTip.lua index c871863..ca7f83e 100644 --- a/Interface/AddOns/SVUI/packages/tip/SVTip.lua +++ b/Interface/AddOns/SVUI/packages/tip/SVTip.lua @@ -889,7 +889,7 @@ function MOD:Load() NewHook(BNToastFrame, "SetPoint", _hook_BNToastOnShow) if not SV.db.SVTip.enable then return end - local anchor = CreateFrame("Frame", "SVUI_ToolTip", SV.Screen) + local anchor = CreateFrame("Frame", "SVUI_ToolTip", UIParent) anchor:Point("BOTTOMLEFT", SV.Dock.BottomRight, "TOPLEFT", 0, 24) anchor:Size(130, 20) anchor:SetFrameLevel(anchor:GetFrameLevel() + 50) diff --git a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua index 538f189..2842bf7 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua @@ -66,7 +66,6 @@ local MOD = SV.SVUnit if(not MOD) then return end -local CustomAuraFilter,CustomBarFilter; local AURA_FONT = [[Interface\AddOns\SVUI\assets\fonts\Display.ttf]]; local AURA_FONTSIZE = 11; local AURA_OUTLINE = "OUTLINE"; @@ -92,6 +91,8 @@ local textCounterOffsets = { ["TOP"] = {"RIGHT", "LEFT", 2, 0}, ["BOTTOM"] = {"RIGHT", "LEFT", 2, 0}, } + +local CanSteal = (SV.class == "MAGE") --[[ ########################################################## LOCAL FUNCTIONS @@ -329,179 +330,186 @@ local ColorizeAuraBars = function(self) end end ---[[ AURA FILTERING ]]-- - -do - local function _test(setting, helpful) - local friend, enemy = false, false - if type(setting) == "boolean" then - friend = setting; - enemy = setting - elseif setting and type(setting) ~= "string" then - friend = setting.friendly; - enemy = setting.enemy - end - if((friend and helpful) or (enemy and (not helpful))) then - return true; - end - return false - end - - CustomAuraFilter = function(self, unit, icon, name, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossAura) - local db = SV.db.SVUnit[self.___key] - local auraType = self.type; - if(not auraType) then return true end - if((not db) or (db and not db[auraType])) then - return false; - end - local auraDB = db[auraType] - local isPlayer = caster == "player" or caster == "vehicle" - local filtered = true - local fromPlayer = true; - local pass = false; - local friendly = false; - - if(not UnitIsEnemy("player", unit)) then - friendly = true - end - - icon.isPlayer = isPlayer; - icon.owner = caster; - icon.name = name; - icon.priority = 0; - - if(SV.filters.Blocked[name] and SV.filters.Blocked[name].enable) then - filtered = false; - else - if SV.filters.Defense[name] and SV.filters.Defense[name].enable then - icon.priority = SV.filters.Defense[name].priority; - end +--[[ PLAYER AURA FILTERING ]]-- - if(_test(auraDB.filterPlayer, friendly)) then - filtered = isPlayer - fromPlayer = isPlayer; - pass = true - end +local PlayerAuraFilter = function(self, unit, icon, auraName, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossAura) + local db = SV.db.SVUnit[self.___key] + local auraType = self.type; + if(not auraType) then return true end + if((not db) or (db and not db[auraType])) then + return false; + end + local auraDB = db[auraType]; + local isPlayer = caster == "player" or caster == "vehicle"; + local isEnemy = UnitIsEnemy("player", unit); - if(_test(auraDB.filterDispellable, friendly)) then - if(auraType == "debuffs" and (debuffType and not MOD.Dispellable[debuffType])) then - filtered = false - end - pass = true - end + icon.isPlayer = isPlayer; + icon.owner = caster; + icon.name = auraName; - if(_test(auraDB.filterRaid, friendly)) then - if(shouldConsolidate == 1) then - filtered = false - end - pass = true - end + if(SV.filters.Blocked[auraName] and SV.filters.Blocked[auraName].enable) then + return false + else + if(auraDB.filterPlayer and (not isPlayer)) then + return false + end - if(_test(auraDB.filterInfinite, friendly)) then - if((duration == 0) or (not duration)) then - filtered = false - end - pass = true - end + if(auraDB.filterDispellable and (debuffType and not MOD.Dispellable[debuffType])) then + return false + end - if(_test(auraDB.filterAllowed, friendly)) then - local whiteListSpell = SV.filters.Allowed[name] - if(whiteListSpell and whiteListSpell.enable) then - icon.priority = whiteListSpell.priority; - filtered = true - elseif(not pass) then - filtered = false - end - pass = true - end + if(auraDB.filterRaid and shouldConsolidate) then + return false + end - local active = auraDB.useFilter + if(auraDB.filterInfinite and ((not duration) or (duration and duration == 0))) then + return false + end - if(active and SV.filters[active]) then - local spellDB = SV.filters[active]; - if(spellDB[name] and spellDB[name].enable and fromPlayer) then - filtered = true; - icon.priority = spellDB[name].priority; - elseif(not pass) then - filtered = false; - end - end + local active = auraDB.useFilter + if(active and SV.filters[active]) then + local spellDB = SV.filters[active]; + if(spellDB[auraName] and spellDB[auraName].enable) then + return false + end end + end + return true +end - return filtered +local PlayerBarFilter = function(self, unit, auraName, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID) + local db = SV.db.SVUnit[self.___key] + if((not db) or (db and not db.aurabar)) then + return false; end + local auraDB = db.aurabar; + local isPlayer = caster == "player" or caster == "vehicle"; + local isEnemy = UnitIsEnemy("player", unit); - CustomBarFilter = function(self, unit, name, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID) - local db = SV.db.SVUnit[self.___key] - if((not db) or (db and not db.aurabar)) then - return false; - end - local auraDB = db.aurabar - local isPlayer = caster == "player" or caster == "vehicle" - local filtered = true - local fromPlayer = true - local pass = false; - local friendly = false; - - if(not UnitIsEnemy("player", unit)) then - friendly = true + if(SV.filters.Blocked[auraName] and SV.filters.Blocked[auraName].enable) then + return false + else + if(auraDB.filterPlayer and (not isPlayer)) then + return false end - if(SV.filters.Blocked[name] and SV.filters.Blocked[name].enable) then - filtered = false; - else - if(_test(auraDB.filterPlayer, friendly)) then - filtered = isPlayer - fromPlayer = isPlayer; - pass = true - end + if(auraDB.filterDispellable and (debuffType and not MOD.Dispellable[debuffType])) then + return false + end - if(_test(auraDB.filterDispellable, friendly)) then - if (debuffType and not MOD.Dispellable[debuffType]) or debuffType == nil then - filtered = false - end - pass = true - end + if(auraDB.filterRaid and shouldConsolidate) then + return false + end - if(_test(auraDB.filterRaid, friendly)) then - if(shouldConsolidate == 1) then - filtered = false - end - pass = true - end + if(auraDB.filterInfinite and ((not duration) or (duration and duration == 0))) then + return false + end - if(_test(auraDB.filterInfinite, friendly)) then - if((duration == 0) or (not duration)) then - filtered = false - end - pass = true - end + local active = auraDB.useFilter + if(active and SV.filters[active]) then + local spellDB = SV.filters[active]; + if(spellDB[auraName] and spellDB[auraName].enable) then + return false + end + end + end + return true +end - if(_test(auraDB.filterAllowed, friendly)) then - local whiteListSpell = SV.filters.Allowed[name] - if(whiteListSpell and whiteListSpell.enable) then - filtered = true - elseif(not pass) then - filtered = false - end - pass = true - end +--[[ NON-PLAYER AURA FILTERING ]]-- - local active = auraDB.useFilter +local function filter_test(setting, harmful) + if((not setting) or (setting and type(setting) ~= "table")) then + return false; + end + if((setting.enemy and harmful) or (setting.friendly and (not harmful))) then + return true; + end + return false +end - if(active and SV.filters[active]) then - local spellDB = SV.filters[active]; - if(spellDB[name] and spellDB[name].enable and fromPlayer) then - filtered = true; - elseif(not pass) then - filtered = false; - end - end +local CommonAuraFilter = function(self, unit, icon, auraName, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossAura) + local db = SV.db.SVUnit[self.___key] + local auraType = self.type; + if(not auraType) then return true end + if((not db) or (db and not db[auraType])) then + return false; + end + local auraDB = db[auraType] + local isPlayer = caster == "player" or caster == "vehicle" + local isEnemy = UnitIsEnemy("player", unit); + + icon.isPlayer = isPlayer; + icon.owner = caster; + icon.name = auraName; + + if(filter_test(auraDB.filterAll, isEnemy)) then + return false + elseif(SV.filters.Blocked[auraName] and SV.filters.Blocked[auraName].enable) then + return false + else + if(filter_test(auraDB.filterPlayer, isEnemy) and (not isPlayer)) then + return false + end + if(filter_test(auraDB.filterDispellable, isEnemy)) then + if((CanSteal and (auraType == 'buffs' and isStealable)) or (debuffType and (not MOD.Dispellable[debuffType])) or (not debuffType)) then + return false + end end + if(filter_test(auraDB.filterRaid, isEnemy) and shouldConsolidate) then + return false + end + if(filter_test(auraDB.filterInfinite, isEnemy) and ((not duration) or (duration and duration == 0))) then + return false + end + local active = auraDB.useFilter + if(active and SV.filters[active]) then + local spellDB = SV.filters[active]; + if(spellDB[auraName] and spellDB[auraName].enable) then + return false + end + end + end + return true +end - return filtered +local CommonBarFilter = function(self, unit, auraName, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID) + local db = SV.db.SVUnit[self.___key] + if((not db) or (db and not db.aurabar)) then + return false; end + local auraDB = db.aurabar; + local isPlayer = caster == "player" or caster == "vehicle"; + local isEnemy = UnitIsEnemy("player", unit); + + if(filter_test(auraDB.filterAll, isEnemy)) then + return false + elseif(SV.filters.Blocked[auraName] and SV.filters.Blocked[auraName].enable) then + return false + else + if(filter_test(auraDB.filterPlayer, isEnemy) and (not isPlayer)) then + return false + end + if(filter_test(auraDB.filterDispellable, isEnemy) and (debuffType and not MOD.Dispellable[debuffType])) then + return false + end + if(filter_test(auraDB.filterRaid, isEnemy) and shouldConsolidate) then + return false + end + if(filter_test(auraDB.filterInfinite, isEnemy) and ((not duration) or (duration and duration == 0))) then + return false + end + local active = auraDB.useFilter + if(active and SV.filters[active]) then + local spellDB = SV.filters[active]; + if(spellDB[auraName] and spellDB[auraName].enable) then + return false + end + end + end + return true end + --[[ ########################################################## BUILD FUNCTION @@ -513,7 +521,11 @@ function MOD:CreateBuffs(frame, unit) aura.spacing = 2; aura.CreateIcon = CreateAuraIcon; aura.PostUpdateIcon = PostUpdateAuraIcon; - aura.CustomFilter = CustomAuraFilter; + if(unit == "player") then + aura.CustomFilter = PlayerAuraFilter; + else + aura.CustomFilter = CommonAuraFilter; + end aura:SetFrameLevel(10) aura.type = "buffs" aura.textFont = LSM:Fetch("font", SV.db.SVUnit.auraFont) @@ -528,7 +540,11 @@ function MOD:CreateDebuffs(frame, unit) aura.spacing = 2; aura.CreateIcon = CreateAuraIcon; aura.PostUpdateIcon = PostUpdateAuraIcon; - aura.CustomFilter = CustomAuraFilter; + if(unit == "player") then + aura.CustomFilter = PlayerAuraFilter; + else + aura.CustomFilter = CommonAuraFilter; + end aura.type = "debuffs" aura:SetFrameLevel(10) aura.textFont = LSM:Fetch("font", SV.db.SVUnit.auraFont) @@ -548,14 +564,18 @@ function MOD:CreateAuraWatch(frame, unit) return aWatch end -function MOD:CreateAuraBarHeader(frame, unitName) +function MOD:CreateAuraBarHeader(frame, unit) local auraBarParent = CreateFrame("Frame", nil, frame) auraBarParent.parent = frame; auraBarParent.PostCreateBar = PostCreateAuraBars; auraBarParent.gap = 2; auraBarParent.spacing = 1; auraBarParent.spark = true; - auraBarParent.filter = CustomBarFilter; + if(unit == "player") then + auraBarParent.filter = PlayerBarFilter; + else + auraBarParent.filter = CommonBarFilter; + end auraBarParent.PostUpdate = ColorizeAuraBars; auraBarParent.barTexture = LSM:Fetch("statusbar", SV.db.SVUnit.auraBarStatusbar) auraBarParent.timeFont = LSM:Fetch("font", "Roboto") @@ -563,54 +583,6 @@ function MOD:CreateAuraBarHeader(frame, unitName) auraBarParent.textSize = SV.db.SVUnit.auraFontSize auraBarParent.textOutline = SV.db.SVUnit.auraFontOutline return auraBarParent -end - -function MOD:SmartAuraDisplay() - local unit = self.unit; - local db = SV.db.SVUnit[unit]; - if not db or not db.smartAuraDisplay or db.smartAuraDisplay == 'DISABLED' or not UnitExists(unit) then return end - local buffs = self.Buffs; - local debuffs = self.Debuffs; - local bars = self.AuraBars; - local friendly = UnitIsFriend('player',unit) == 1 and true or false; - - if friendly then - if db.smartAuraDisplay == 'SHOW_DEBUFFS_ON_FRIENDLIES' then - buffs:Hide() - debuffs:Show() - else - buffs:Show() - debuffs:Hide() - end - else - if db.smartAuraDisplay == 'SHOW_DEBUFFS_ON_FRIENDLIES' then - buffs:Show() - debuffs:Hide() - else - buffs:Hide() - debuffs:Show() - end - end - - if buffs:IsShown() then - buffs:ClearAllPoints() - SV:SetReversePoint(buffs, db.buffs.anchorPoint, self, db.buffs.xOffset, db.buffs.yOffset) - if db.aurabar.attachTo ~= 'FRAME' then - bars:ClearAllPoints() - bars:SetPoint('BOTTOMLEFT', buffs, 'TOPLEFT', 0, 1) - bars:SetPoint('BOTTOMRIGHT', buffs, 'TOPRIGHT', 0, 1) - end - end - - if debuffs:IsShown() then - debuffs:ClearAllPoints() - SV:SetReversePoint(debuffs, db.debuffs.anchorPoint, self, db.debuffs.xOffset, db.debuffs.yOffset) - if db.aurabar.attachTo ~= 'FRAME' then - bars:ClearAllPoints() - bars:SetPoint('BOTTOMLEFT', debuffs, 'TOPLEFT', 0, 1) - bars:SetPoint('BOTTOMRIGHT', debuffs, 'TOPRIGHT', 0, 1) - end - end end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua index 91063a1..f483f38 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames.lua @@ -375,7 +375,7 @@ local UpdateTargetFrame = function(self) if db.combobar.autoHide then comboBar:SetParent(self) else - comboBar:SetParent(SV.Screen) + comboBar:SetParent(UIParent) end if comboBar.Grip then @@ -420,8 +420,6 @@ CONSTRUCTORS["target"] = function(self, unit) self.Debuffs = MOD:CreateDebuffs(self, key) self.AuraBars = MOD:CreateAuraBarHeader(self, key) self.Afflicted = MOD:CreateAfflicted(self) - tinsert(self.__elements, MOD.SmartAuraDisplay) - self:RegisterEvent("PLAYER_TARGET_CHANGED", MOD.SmartAuraDisplay) self.RaidIcon = MOD:CreateRaidIcon(self) local isSmall = SV.db.SVUnit[key].combobar.smallIcons if(SV.class == "ROGUE") then @@ -629,8 +627,6 @@ CONSTRUCTORS["focus"] = function(self, unit) self.Buffs = MOD:CreateBuffs(self, key) self.Debuffs = MOD:CreateDebuffs(self, key) self.AuraBars = MOD:CreateAuraBarHeader(self, key) - tinsert(self.__elements, MOD.SmartAuraDisplay) - self:RegisterEvent("PLAYER_FOCUS_CHANGED", MOD.SmartAuraDisplay) self.RaidIcon = MOD:CreateRaidIcon(self) self.Range = { insideAlpha = 1, outsideAlpha = 1 } @@ -1066,4 +1062,7 @@ function MOD:SetEnemyFrame(key, maxCount) frame:Disable() end end -end \ No newline at end of file +end + +-- tinsert(self.__elements, ELEMENT_FUNCTION) +-- self:RegisterEvent(ELEMENT_EVENT, ELEMENT_FUNCTION) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/misc.lua b/Interface/AddOns/SVUI/scripts/misc.lua index eb3ecb4..c5ac8ce 100644 --- a/Interface/AddOns/SVUI/scripts/misc.lua +++ b/Interface/AddOns/SVUI/scripts/misc.lua @@ -490,7 +490,7 @@ end local function CreateTotemBar() if(not SV.db.totems.enable) then return; end local xOffset = SV.db.Dock.dockLeftWidth + 12 - TotemBar = CreateFrame("Frame", "SVUI_TotemBar", SV.Screen) + TotemBar = CreateFrame("Frame", "SVUI_TotemBar", UIParent) TotemBar:SetPoint("BOTTOMLEFT", SV.Screen, "BOTTOMLEFT", xOffset, 40) for i = 1, MAX_TOTEMS do local id = priorities[i] @@ -640,7 +640,7 @@ end local function LoadThreatBar() if(SV.db.general.threatbar == true) then local anchor = _G.SVUI_Target - local ThreatBar = CreateFrame('StatusBar', 'SVUI_ThreatBar', SV.Screen); + local ThreatBar = CreateFrame('StatusBar', 'SVUI_ThreatBar', UIParent); ThreatBar:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Doodads\\THREAT-BAR") ThreatBar:SetSize(50, 100) ThreatBar:SetFrameStrata('MEDIUM') diff --git a/Interface/AddOns/SVUI/setup/presets.lua b/Interface/AddOns/SVUI/setup/presets.lua index e736fbd..d63ea73 100644 --- a/Interface/AddOns/SVUI/setup/presets.lua +++ b/Interface/AddOns/SVUI/setup/presets.lua @@ -180,7 +180,6 @@ local function LoadPresetData() } }, ["target"] = { - ["smartAuraDisplay"] = "DISABLED", ["buffs"] = { enable = true, attachTo = "FRAME", @@ -200,7 +199,6 @@ local function LoadPresetData() } }, ["focus"] = { - ["smartAuraDisplay"] = "DISABLED", ["buffs"] = { enable = false, attachTo = "FRAME", @@ -241,7 +239,6 @@ local function LoadPresetData() } }, ["target"] = { - ["smartAuraDisplay"] = "DISABLED", ["buffs"] = { enable = true, attachTo = "FRAME", @@ -261,7 +258,6 @@ local function LoadPresetData() } }, ["focus"] = { - ["smartAuraDisplay"] = "DISABLED", ["buffs"] = { enable = false, attachTo = "FRAME", @@ -297,7 +293,6 @@ local function LoadPresetData() } }, ["target"] = { - ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", ["buffs"] = { enable = false, attachTo = "FRAME" @@ -312,7 +307,6 @@ local function LoadPresetData() } }, ["focus"] = { - ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", ["buffs"] = { enable = false, attachTo = "FRAME" @@ -349,7 +343,6 @@ local function LoadPresetData() } }, ["target"] = { - ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", ["buffs"] = { enable = true, attachTo = "FRAME", @@ -370,7 +363,6 @@ local function LoadPresetData() } }, ["focus"] = { - ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", ["buffs"] = { enable = true, attachTo = "FRAME", diff --git a/Interface/AddOns/SVUI/system/alerts.lua b/Interface/AddOns/SVUI/system/alerts.lua index 9085efb..160566f 100644 --- a/Interface/AddOns/SVUI/system/alerts.lua +++ b/Interface/AddOns/SVUI/system/alerts.lua @@ -201,7 +201,7 @@ SV.SystemAlert["RESETBLIZZARD_CHECK"] = { text = L["Are you sure you want to all draggable Blizzard frames to their original positions? This will reload your UI."], button1 = ACCEPT, button2 = CANCEL, - OnAccept = function(a)SV.Mentalo:Reset("Blizzard")end, + OnAccept = function(a)SV.Dragger:Reset()end, timeout = 0, whileDead = 1 }; @@ -940,7 +940,7 @@ function SV:LoadSystemAlerts() self.Animate:Orbit(configAlert.bg, 10, false, true) end for i = 1, 4 do - local alert = CreateFrame("Frame", "SVUI_SystemAlert"..i, self.Screen, "StaticPopupTemplate") + local alert = CreateFrame("Frame", "SVUI_SystemAlert"..i, UIParent, "StaticPopupTemplate") alert:SetID(i) alert:SetScript("OnShow", SysPop_Event_Show) alert:SetScript("OnHide", SysPop_Event_Hide) diff --git a/Interface/AddOns/SVUI/system/visibility.lua b/Interface/AddOns/SVUI/system/visibility.lua index bc6f604..4f09406 100644 --- a/Interface/AddOns/SVUI/system/visibility.lua +++ b/Interface/AddOns/SVUI/system/visibility.lua @@ -60,7 +60,7 @@ end function SV:PushDisplayAudit() if(InCombatLockdown()) then return end for frame, parent in pairs(DisplayFrames) do - frame:SetParent(parent or self.Screen) + frame:SetParent(parent or UIParent) end self.NeedsFrameAudit = false end diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/core.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/core.lua index 6fa01ac..6a32d2e 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/core.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/core.lua @@ -968,16 +968,8 @@ local function setAuraFilteringOptions(configTable, unitName, auraType, updateFu type = "group", name = L["Filter Options"], args = { - filterAllowed = { - order = 1, - type = "toggle", - name = L["Force Allowed"], - desc = L["Don't display any auras not found on the Allowed filter."], - get = function(key) return SV.db.SVUnit[unitName][auraType].filterAllowed end, - set = function(key, value) SV.db.SVUnit[unitName][auraType].filterAllowed = value; updateFunction(MOD, unitName) end, - }, filterPlayer = { - order = 2, + order = 1, type = "toggle", name = L["From You"], desc = L["Only show auras that were cast by you."], @@ -985,7 +977,7 @@ local function setAuraFilteringOptions(configTable, unitName, auraType, updateFu set = function(key, value) SV.db.SVUnit[unitName][auraType].filterPlayer = value; updateFunction(MOD, unitName) end, }, filterDispellable = { - order = 3, + order = 2, type = "toggle", name = L["You Can Remove"], desc = L["Only show auras that can be removed by you. (example: Purge, Dispel)"], @@ -993,7 +985,7 @@ local function setAuraFilteringOptions(configTable, unitName, auraType, updateFu set = function(key, value) SV.db.SVUnit[unitName][auraType].filterDispellable = value; updateFunction(MOD, unitName) end, }, filterInfinite = { - order = 4, + order = 3, type = "toggle", name = L["No Duration"], desc = L["Don't display auras that have no duration."], @@ -1001,7 +993,7 @@ local function setAuraFilteringOptions(configTable, unitName, auraType, updateFu set = function(key, value) SV.db.SVUnit[unitName][auraType].filterInfinite = value; updateFunction(MOD, unitName) end, }, filterRaid = { - order = 5, + order = 4, type = "toggle", name = L["Consolidated Buffs"], desc = L["Don't display consolidated buffs"], @@ -1009,7 +1001,7 @@ local function setAuraFilteringOptions(configTable, unitName, auraType, updateFu set = function(key, value) SV.db.SVUnit[unitName][auraType].filterRaid = value; updateFunction(MOD, unitName) end, }, useFilter = { - order = 6, + order = 5, type = "select", name = L["Custom Filter"], desc = L["Select a custom filter to include."], @@ -1039,13 +1031,13 @@ local function setAuraFilteringOptions(configTable, unitName, auraType, updateFu type = "group", name = L["When the unit is friendly..."], args = { - filterAllowed = { + filterAll = { order = 1, type = "toggle", - name = L["Force Allowed"], - desc = L["Don't display any auras not found on the Allowed filter."], - get = function(key) return SV.db.SVUnit[unitName][auraType].filterAllowed.friendly end, - set = function(key, value) SV.db.SVUnit[unitName][auraType].filterAllowed.friendly = value; updateFunction(MOD, unitName) end, + name = L["Hide All"], + desc = L["Don't display any " .. auraType .. "."], + get = function(key) return SV.db.SVUnit[unitName][auraType].filterAll.friendly end, + set = function(key, value) SV.db.SVUnit[unitName][auraType].filterAll.friendly = value; updateFunction(MOD, unitName) end, }, filterPlayer = { order = 2, @@ -1079,13 +1071,13 @@ local function setAuraFilteringOptions(configTable, unitName, auraType, updateFu type = "group", name = L["When the unit is hostile..."], args = { - filterAllowed = { + filterAll = { order = 1, type = "toggle", - name = L["Force Allowed"], - desc = L["Don't display any auras not found on the Allowed filter."], - get = function(key)return SV.db.SVUnit[unitName][auraType].filterAllowed.enemy end, - set = function(key, value)SV.db.SVUnit[unitName][auraType].filterAllowed.enemy = value; updateFunction(MOD, unitName) end, + name = L["Hide All"], + desc = L["Don't display any " .. auraType .. "."], + get = function(key)return SV.db.SVUnit[unitName][auraType].filterAll.enemy end, + set = function(key, value)SV.db.SVUnit[unitName][auraType].filterAll.enemy = value; updateFunction(MOD, unitName) end, }, filterPlayer = { order = 2, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/focus.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/focus.lua index 57c8a24..8c4364f 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/focus.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/focus.lua @@ -72,28 +72,21 @@ SV.Options.args.SVUnit.args.focus = { name = L["Show Auras"], func = function()local U = SVUI_Focus;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("focus")end }, - smartAuraDisplay = { - type = "select", - name = L["Smart Auras"], - desc = L["When set the Buffs and Debuffs will toggle being displayed depending on if the unit is friendly or an enemy. This will not effect the aurabars package."], - order = 2, - values = {["DISABLED"] = L["Disabled"], ["SHOW_DEBUFFS_ON_FRIENDLIES"] = L["Friendlies: Show Debuffs"], ["SHOW_BUFFS_ON_FRIENDLIES"] = L["Friendlies: Show Buffs"]} - }, rangeCheck = { - order = 3, + order = 2, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle" }, predict = { - order = 4, + order = 3, name = L["Heal Prediction"], desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], type = "toggle" }, hideonnpc = { type = "toggle", - order = 5, + order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SV.db.SVUnit["focus"]["power"].hideonnpc end, @@ -101,7 +94,7 @@ SV.Options.args.SVUnit.args.focus = { }, threatEnabled = { type = "toggle", - order = 6, + order = 5, name = L["Show Threat"] } } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/target.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/target.lua index 0ff343b..682a160 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/target.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/target.lua @@ -72,32 +72,21 @@ SV.Options.args.SVUnit.args.target={ name = L["Show Auras"], func = function()local U = SVUI_Target;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("target")end }, - smartAuraDisplay = { - type = "select", - name = L["Smart Auras"], - desc = L["When set the Buffs and Debuffs will toggle being displayed depending on if the unit is friendly or an enemy. This will not effect the aurabars package."], - order = 2, - values = { - ["DISABLED"] = L["Disabled"], - ["SHOW_DEBUFFS_ON_FRIENDLIES"] = L["Friendlies: Show Debuffs"], - ["SHOW_BUFFS_ON_FRIENDLIES"] = L["Friendlies: Show Buffs"] - } - }, gps = { - order = 3, + order = 2, name = "GPS Tracking", desc = "Show an arrow giving the direction and distance to the frames unit.", type = "toggle", }, predict = { - order = 4, + order = 3, name = L["Heal Prediction"], desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], type = "toggle" }, hideonnpc = { type = "toggle", - order = 5, + order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SV.db.SVUnit["target"]["power"].hideonnpc end, @@ -105,11 +94,11 @@ SV.Options.args.SVUnit.args.target={ }, threatEnabled = { type = "toggle", - order = 6, + order = 5, name = L["Show Threat"] }, middleClickFocus = { - order = 7, + order = 6, name = L["Middle Click - Set Focus"], desc = L["Middle clicking the unit frame will cause your focus to match the unit."], type = "toggle", diff --git a/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua b/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua index 59e8eca..017f85b 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua @@ -608,7 +608,7 @@ function PLUGIN:PrepareFarmingTools() local BUTTONSIZE = self.db.farming.buttonsize or 35; -- SEEDS - local farmSeedBarAnchor = CreateFrame("Frame", "FarmSeedBarAnchor", SV.Screen) + local farmSeedBarAnchor = CreateFrame("Frame", "FarmSeedBarAnchor", UIParent) farmSeedBarAnchor:Point("TOPRIGHT", SV.Screen, "TOPRIGHT", -40, -300) farmSeedBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or ((BUTTONSIZE + BUTTONSPACE) * 8), horizontal and ((BUTTONSIZE + BUTTONSPACE) * 8) or ((BUTTONSIZE + BUTTONSPACE) * 10)) for i = 1, NUM_SEED_BARS do @@ -620,7 +620,7 @@ function PLUGIN:PrepareFarmingTools() SV.Mentalo:Add(farmSeedBarAnchor, "Farming Seeds") -- FARM TOOLS - local farmToolBarAnchor = CreateFrame("Frame", "FarmToolBarAnchor", SV.Screen) + local farmToolBarAnchor = CreateFrame("Frame", "FarmToolBarAnchor", UIParent) farmToolBarAnchor:Point("TOPRIGHT", farmSeedBarAnchor, horizontal and "BOTTOMRIGHT" or "TOPLEFT", horizontal and 0 or -(BUTTONSPACE * 2), horizontal and -(BUTTONSPACE * 2) or 0) farmToolBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) local farmToolBar = CreateFrame("Frame", "FarmToolBar", farmToolBarAnchor) @@ -630,7 +630,7 @@ function PLUGIN:PrepareFarmingTools() SV.Mentalo:Add(farmToolBarAnchor, "Farming Tools") -- PORTALS - local farmPortalBarAnchor = CreateFrame("Frame", "FarmPortalBarAnchor", SV.Screen) + local farmPortalBarAnchor = CreateFrame("Frame", "FarmPortalBarAnchor", UIParent) farmPortalBarAnchor:Point("TOPRIGHT", farmToolBarAnchor, horizontal and "BOTTOMRIGHT" or "TOPLEFT", horizontal and 0 or -(BUTTONSPACE * 2), horizontal and -(BUTTONSPACE * 2) or 0) farmPortalBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) local farmPortalBar = CreateFrame("Frame", "FarmPortalBar", farmPortalBarAnchor)