diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index c5c2005..28d7df3 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -215,6 +215,22 @@ do end end +function MOD:GetActiveSize(db) + local width, height, best = 0,0,0 + + if(self.db.grid.enable and db.gridAllowed) then + width = self.db.grid.size + height = width + best = width + else + width = db.width + height = db.height + best = min(width, height); + end + + return width, height, best +end + function MOD:AllowElement(unitFrame) if InCombatLockdown() then return; end if not unitFrame.isForced then @@ -309,7 +325,7 @@ function MOD:RefreshUnitColors() oUF_SuperVillain.SVConfigs.classbackdrop = SuperVillain.db.SVUnit.classbackdrop oUF_SuperVillain.SVConfigs.healthclass = SuperVillain.db.SVUnit.healthclass oUF_SuperVillain.SVConfigs.colorhealthbyvalue = SuperVillain.db.SVUnit.colorhealthbyvalue - oUF_SuperVillain.SVConfigs.gridMode = SuperVillain.db.SVUnit.gridMode + oUF_SuperVillain.SVConfigs.gridMode = SuperVillain.db.SVUnit.grid.enable end function MOD:RefreshAllUnitMedia() @@ -376,7 +392,15 @@ function MOD:RefreshUnitMedia(unitName) local panel = self.InfoPanel if(panel) then if(panel.Name and unitDB.name) then - panel.Name:SetFont(SuperVillain.Shared:Fetch("font", unitDB.name.font), unitDB.name.fontSize, unitDB.name.fontOutline) + if(db.grid.enable and unitDB.gridAllowed) then + panel.Name:SetFont([[Interface\AddOns\SVUI\assets\fonts\Roboto.ttf]], unitDB.name.fontSize, unitDB.name.fontOutline) + panel.Name:SetShadowOffset(1, -1) + panel.Name:SetShadowColor(0, 0, 0, 0.75) + else + panel.Name:SetFont(SuperVillain.Shared:Fetch("font", unitDB.name.font), unitDB.name.fontSize, unitDB.name.fontOutline) + panel.Name:SetShadowOffset(2, -2) + panel.Name:SetShadowColor(0, 0, 0, 1) + end end if(panel.Health) then panel.Health:SetFont(CURRENT_FONT, db.fontSize, db.fontOutline) @@ -443,11 +467,6 @@ end function MOD:RefreshUnitLayout(frame, template) local db = self.db[template] - local UNIT_WIDTH = db.width; - local UNIT_HEIGHT = db.height; - local BEST_SIZE = min(UNIT_WIDTH,UNIT_HEIGHT); - local AURA_HOLDER = db.width - local powerHeight = (db.power and db.power.enable) and (db.power.height - 1) or 1; local TOP_ANCHOR1, TOP_ANCHOR2, TOP_MODIFIER = "TOPRIGHT", "TOPLEFT", 1; local BOTTOM_ANCHOR1, BOTTOM_ANCHOR2, BOTTOM_MODIFIER = "BOTTOMLEFT", "BOTTOMRIGHT", -1; @@ -460,20 +479,19 @@ function MOD:RefreshUnitLayout(frame, template) BOTTOM_MODIFIER = 1 end - local portraitOverlay = false; - local overlayAnimation = false; - local portraitWidth = (1 * TOP_MODIFIER); + local UNIT_WIDTH, UNIT_HEIGHT, BEST_SIZE = self:GetActiveSize(db) + local POWER_HEIGHT = (db.power and db.power.enable) and (db.power.height - 1) or 1; + local PORTRAIT_WIDTH = (1 * TOP_MODIFIER) + local GRID_MODE = (self.db.grid.enable and db.gridAllowed) or false + local healthPanel = frame.HealthPanel local infoPanel = frame.InfoPanel - local calculatedHeight = db.height; - - if(template:find("raid")) then - AURA_HOLDER = 100 - end + local portraitOverlay = false + local overlayAnimation = false if(db.portrait and db.portrait.enable) then if(not db.portrait.overlay) then - portraitWidth = ((db.portrait.width * TOP_MODIFIER) + (1 * TOP_MODIFIER)) + PORTRAIT_WIDTH = ((db.portrait.width * TOP_MODIFIER) + (1 * TOP_MODIFIER)) else portraitOverlay = true overlayAnimation = self.db.overlayAnimation @@ -496,7 +514,7 @@ function MOD:RefreshUnitLayout(frame, template) healthPanel:ClearAllPoints() healthPanel:Point(TOP_ANCHOR1, frame, TOP_ANCHOR1, (1 * BOTTOM_MODIFIER), -1) - healthPanel:Point(BOTTOM_ANCHOR1, frame, BOTTOM_ANCHOR1, portraitWidth, powerHeight) + healthPanel:Point(BOTTOM_ANCHOR1, frame, BOTTOM_ANCHOR1, PORTRAIT_WIDTH, POWER_HEIGHT) if(frame.StatusPanel) then if(template ~= "player" and template ~= "pet" and template ~= "target" and template ~= "targettarget" and template ~= "focus" and template ~= "focustarget") then @@ -532,6 +550,7 @@ function MOD:RefreshUnitLayout(frame, template) --[[ INFO TEXTS ]]-- local point,cX,cY; + if(infoPanel.Name and db.name) then local nametext = infoPanel.Name point = db.name.position @@ -543,34 +562,49 @@ function MOD:RefreshUnitLayout(frame, template) end if(frame.Health and infoPanel.Health and db.health) then - local healthtext = infoPanel.Health - point = db.health.position - cX = db.health.xOffset - cY = db.health.yOffset - healthtext:ClearAllPoints() - SuperVillain:ReversePoint(healthtext, point, infoPanel, cX, cY) - frame:Tag(healthtext, db.health.tags) + if(GRID_MODE) then + infoPanel.Health:Hide() + else + if(not infoPanel.Health:IsShown()) then infoPanel.Health:Show() end + local healthtext = infoPanel.Health + point = db.health.position + cX = db.health.xOffset + cY = db.health.yOffset + healthtext:ClearAllPoints() + SuperVillain:ReversePoint(healthtext, point, infoPanel, cX, cY) + frame:Tag(healthtext, db.health.tags) + end end if(frame.Power and infoPanel.Power and db.power) then - local powertext = infoPanel.Power - if db.power.tags ~= nil and db.power.tags ~= '' then - point = db.power.position - cX = db.power.xOffset - cY = db.power.yOffset - powertext:ClearAllPoints() - SuperVillain:ReversePoint(powertext, point, infoPanel, cX, cY) - if db.power.attachTextToPower then - powertext:SetParent(frame.Power) - else - powertext:SetParent(infoPanel) + if(GRID_MODE) then + infoPanel.Power:Hide() + else + if(not infoPanel.Power:IsShown()) then infoPanel.Power:Show() end + local powertext = infoPanel.Power + if db.power.tags ~= nil and db.power.tags ~= '' then + point = db.power.position + cX = db.power.xOffset + cY = db.power.yOffset + powertext:ClearAllPoints() + SuperVillain:ReversePoint(powertext, point, infoPanel, cX, cY) + if db.power.attachTextToPower then + powertext:SetParent(frame.Power) + else + powertext:SetParent(infoPanel) + end end + frame:Tag(powertext, db.power.tags) end - frame:Tag(powertext, db.power.tags) end if(infoPanel.Misc and db.misc) then - frame:Tag(infoPanel.Misc, db.misc.tags) + if(GRID_MODE) then + infoPanel.Misc:Hide() + else + if(not infoPanel.Misc:IsShown()) then infoPanel.Misc:Show() end + frame:Tag(infoPanel.Misc, db.misc.tags) + end end --[[ HEALTH LAYOUT ]]-- @@ -656,8 +690,8 @@ function MOD:RefreshUnitLayout(frame, template) power.frequentUpdates = db.power.frequentUpdates end power:ClearAllPoints() - power:Height(powerHeight - 2) - power:Point(BOTTOM_ANCHOR1, frame, BOTTOM_ANCHOR1, (portraitWidth - (1 * BOTTOM_MODIFIER)), 2) + power:Height(POWER_HEIGHT - 2) + power:Point(BOTTOM_ANCHOR1, frame, BOTTOM_ANCHOR1, (PORTRAIT_WIDTH - (1 * BOTTOM_MODIFIER)), 2) power:Point(BOTTOM_ANCHOR2, frame, BOTTOM_ANCHOR2, (2 * BOTTOM_MODIFIER), 2) elseif frame:IsElementEnabled('Power')then frame:DisableElement('Power') @@ -670,10 +704,10 @@ function MOD:RefreshUnitLayout(frame, template) if frame.AltPowerBar then local altPower = frame.AltPowerBar; local Alt_OnShow = function() - healthPanel:Point(TOP_ANCHOR2, portraitWidth, -(powerHeight + 1)) + healthPanel:Point(TOP_ANCHOR2, PORTRAIT_WIDTH, -(POWER_HEIGHT + 1)) end local Alt_OnHide = function() - healthPanel:Point(TOP_ANCHOR2, portraitWidth, -1) + healthPanel:Point(TOP_ANCHOR2, PORTRAIT_WIDTH, -1) altPower.text:SetText("") end if db.power.enable then @@ -682,9 +716,9 @@ function MOD:RefreshUnitLayout(frame, template) altPower.text:SetFont(infoPanel.Health:GetFont()) end altPower.text:SetAlpha(1) - altPower:Point(TOP_ANCHOR2, frame, TOP_ANCHOR2, portraitWidth, -1) + altPower:Point(TOP_ANCHOR2, frame, TOP_ANCHOR2, PORTRAIT_WIDTH, -1) altPower:Point(TOP_ANCHOR1, frame, TOP_ANCHOR1, (1 * BOTTOM_MODIFIER), -1) - altPower:SetHeight(powerHeight) + altPower:SetHeight(POWER_HEIGHT) altPower.Smooth = self.db.smoothbars; altPower:HookScript("OnShow", Alt_OnShow) altPower:HookScript("OnHide", Alt_OnHide) diff --git a/Interface/AddOns/SVUI/packages/unit/config.lua b/Interface/AddOns/SVUI/packages/unit/config.lua index 91888ee..81e4119 100644 --- a/Interface/AddOns/SVUI/packages/unit/config.lua +++ b/Interface/AddOns/SVUI/packages/unit/config.lua @@ -69,7 +69,11 @@ CONFIGS["SVUnit"] = { ["auraBarShield"] = true, ["castClassColor"] = false, ["xrayFocus"] = true, - ["gpsLowHealth"] = false, + ["gpsLowHealth"] = false, + ["grid"] = { + ["enable"] = false, + ["size"] = 28, + }, ["player"] = { ["enable"] = true, ["width"] = 215, @@ -1586,10 +1590,10 @@ CONFIGS["SVUnit"] = { ["showPlayer"] = true, ["predict"] = false, ["colorOverride"] = "USE_DEFAULT", - ["gridMode"] = false, ["width"] = 70, ["height"] = 70, ["gps"] = true, + ["gridAllowed"] = true, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -1691,7 +1695,8 @@ CONFIGS["SVUnit"] = { { ["enable"] = false, ["width"] = 30, - ["height"] = 30, + ["height"] = 30, + ["gridAllowed"] = true, ["anchorPoint"] = "BOTTOMLEFT", ["xOffset"] = - 1, ["yOffset"] = 0, @@ -1702,7 +1707,8 @@ CONFIGS["SVUnit"] = { { ["enable"] = false, ["width"] = 30, - ["height"] = 30, + ["height"] = 30, + ["gridAllowed"] = true, ["anchorPoint"] = "TOPLEFT", ["xOffset"] = - 1, ["yOffset"] = 0, @@ -1762,10 +1768,10 @@ CONFIGS["SVUnit"] = { ["showPlayer"] = true, ["predict"] = false, ["colorOverride"] = "USE_DEFAULT", - ["gridMode"] = false, ["width"] = 75, ["height"] = 34, - ["gps"] = false, + ["gps"] = false, + ["gridAllowed"] = true, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -1913,10 +1919,10 @@ CONFIGS["SVUnit"] = { ["showPlayer"] = true, ["predict"] = false, ["colorOverride"] = "USE_DEFAULT", - ["gridMode"] = false, ["width"] = 50, ["height"] = 30, ["gps"] = false, + ["gridAllowed"] = true, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -2063,10 +2069,10 @@ CONFIGS["SVUnit"] = { ["showPlayer"] = true, ["predict"] = false, ["colorOverride"] = "USE_DEFAULT", - ["gridMode"] = false, ["width"] = 50, ["height"] = 30, ["gps"] = false, + ["gridAllowed"] = true, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -2215,9 +2221,9 @@ CONFIGS["SVUnit"] = { ["startFromCenter"] = false, ["predict"] = false, ["colorOverride"] = "USE_DEFAULT", - ["gridMode"] = false, ["width"] = 80, - ["height"] = 30, + ["height"] = 30, + ["gridAllowed"] = true, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -2325,9 +2331,9 @@ CONFIGS["SVUnit"] = { ["enable"] = true, ["threatEnabled"] = true, ["rangeCheck"] = true, - ["gridMode"] = false, ["width"] = 120, - ["height"] = 28, + ["height"] = 28, + ["gridAllowed"] = true, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -2382,9 +2388,9 @@ CONFIGS["SVUnit"] = { ["enable"] = true, ["threatEnabled"] = true, ["rangeCheck"] = true, - ["gridMode"] = false, ["width"] = 120, - ["height"] = 28, + ["height"] = 28, + ["gridAllowed"] = true, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua index 6720fb0..02825c6 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames.lua @@ -1184,14 +1184,17 @@ end local UpdateRaidSubUnit = function(self, key, db) self.colors = oUF_SuperVillain.colors; self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") - if not InCombatLockdown() then self:Size(db.width, db.height) end + local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) + if not InCombatLockdown() then + self:Size(UNIT_WIDTH, UNIT_HEIGHT) + end do local rdBuffs = self.RaidDebuffs; if db.rdebuffs.enable then if not self:IsElementEnabled('RaidDebuffs')then self:EnableElement("RaidDebuffs") end - local actualSz = numMin(db.rdebuffs.size, (db.height - 8)) + local actualSz = numMin(db.rdebuffs.size, (UNIT_HEIGHT - 8)) rdBuffs:Size(actualSz) rdBuffs:Point("CENTER", self, "CENTER", db.rdebuffs.xOffset, db.rdebuffs.yOffset) rdBuffs:Show() @@ -1512,9 +1515,10 @@ local UpdatePartySubUnit = function(self, key, db) end self.originalParent.childList[self] = true; if not InCombatLockdown()then - if altDB.enable then + if altDB.enable then + local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(altDB) self:SetParent(self.originalParent) - self:Size(altDB.width,altDB.height) + self:Size(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() SuperVillain:ReversePoint(self, altDB.anchorPoint, self.originalParent, altDB.xOffset, altDB.yOffset) else @@ -1538,8 +1542,9 @@ local UpdatePartySubUnit = function(self, key, db) self:Tag(nametext, altDB.tags) end else - if not InCombatLockdown() then - self:Size(db.width,db.height) + if not InCombatLockdown() then + local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) + self:Size(UNIT_WIDTH, UNIT_HEIGHT) end MOD:RefreshUnitLayout(self, key) MOD:UpdateAuraWatch(self, key) @@ -1649,17 +1654,19 @@ local UpdateTankSubUnit = function(self, key, db) end self.originalParent.childList[self] = true; if not InCombatLockdown()then - if targets.enable then + if targets.enable then + local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(targets) self:SetParent(self.originalParent) - self:Size(targets.width, targets.height) + self:Size(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() SuperVillain:ReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) else self:SetParent(SuperVillain.Cloaked) end end - elseif not InCombatLockdown()then - self:Size(db.width, db.height) + elseif not InCombatLockdown() then + local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) + self:Size(UNIT_WIDTH, UNIT_HEIGHT) end MOD:RefreshUnitLayout(self, key) do @@ -1746,17 +1753,19 @@ local UpdateAssistSubUnit = function(self, key, db) end self.originalParent.childList[self] = true; if not InCombatLockdown()then - if targets.enable then + if targets.enable then + local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(targets) self:SetParent(self.originalParent) - self:Size(targets.width, targets.height) + self:Size(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() SuperVillain:ReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) else self:SetParent(SuperVillain.Cloaked) end end - elseif not InCombatLockdown()then - self:Size(db.width, db.height) + elseif not InCombatLockdown() then + local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) + self:Size(UNIT_WIDTH, UNIT_HEIGHT) end MOD:RefreshUnitLayout(self, key) @@ -1854,9 +1863,10 @@ end function MOD:ConstructGroupHeader(parentFrame, filter, styleName, headerName, template1, groupName, template2) local db = self.db[groupName] + local UNIT_WIDTH, UNIT_HEIGHT = self:GetActiveSize(db) oUF_SuperVillain:SetActiveStyle(styleName) local groupHeader = oUF_SuperVillain:SpawnHeader(headerName, template2, nil, - "oUF-initialConfigFunction", ("self:SetWidth(%d); self:SetHeight(%d); self:SetFrameLevel(5)"):format(db.width, db.height), + "oUF-initialConfigFunction", ("self:SetWidth(%d); self:SetHeight(%d); self:SetFrameLevel(5)"):format(UNIT_WIDTH, UNIT_HEIGHT), "groupFilter", filter, "showParty", true, "showRaid", true, @@ -1881,6 +1891,7 @@ GROUP HEADER METHODS local GroupSetConfigEnvironment = function(self) local key = self.___groupkey local db = MOD.db[key] + local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) local anchorPoint; local sorting = db.showBy local pointMap = sortMapping[sorting] @@ -1943,13 +1954,13 @@ local GroupSetConfigEnvironment = function(self) if frame then frame:SetPoint(anchorPoint, self, anchorPoint, 0, heightCalc * vertical) end - heightCalc = heightCalc + db.height + db.wrapYOffset; + heightCalc = heightCalc + UNIT_HEIGHT + db.wrapYOffset; yCalc = yCalc + 1 else if frame then frame:SetPoint(anchorPoint, self, anchorPoint, widthCalc * horizontal, 0) end - widthCalc = widthCalc + db.width + db.wrapXOffset; + widthCalc = widthCalc + UNIT_WIDTH + db.wrapXOffset; xCalc = xCalc + 1 end else @@ -1958,27 +1969,27 @@ local GroupSetConfigEnvironment = function(self) if frame then frame:SetPoint(anchorPoint, self, anchorPoint, widthCalc * horizontal, 0) end - widthCalc = widthCalc + (db.width + db.wrapXOffset) * 5; + widthCalc = widthCalc + (UNIT_WIDTH + db.wrapXOffset) * 5; xCalc = xCalc + 1 elseif frame then - frame:SetPoint(anchorPoint, self, anchorPoint, (((db.width + db.wrapXOffset) * 5) * ((i - 1) % db.gRowCol)) * horizontal, ((db.height + db.wrapYOffset) * (yCalc - 1)) * vertical) + frame:SetPoint(anchorPoint, self, anchorPoint, (((UNIT_WIDTH + db.wrapXOffset) * 5) * ((i - 1) % db.gRowCol)) * horizontal, ((UNIT_HEIGHT + db.wrapYOffset) * (yCalc - 1)) * vertical) end else if xCalc == 1 then if frame then frame:SetPoint(anchorPoint, self, anchorPoint, 0, heightCalc * vertical) end - heightCalc = heightCalc + (db.height + db.wrapYOffset) * 5; + heightCalc = heightCalc + (UNIT_HEIGHT + db.wrapYOffset) * 5; yCalc = yCalc + 1 elseif frame then - frame:SetPoint(anchorPoint, self, anchorPoint, ((db.width + db.wrapXOffset) * (xCalc - 1)) * horizontal, (((db.height + db.wrapYOffset) * 5) * ((i - 1) % db.gRowCol)) * vertical) + frame:SetPoint(anchorPoint, self, anchorPoint, ((UNIT_WIDTH + db.wrapXOffset) * (xCalc - 1)) * horizontal, (((UNIT_HEIGHT + db.wrapYOffset) * 5) * ((i - 1) % db.gRowCol)) * vertical) end end end if heightCalc == 0 then - heightCalc = heightCalc + (db.height + db.wrapYOffset) * 5 + heightCalc = heightCalc + (UNIT_HEIGHT + db.wrapYOffset) * 5 elseif widthCalc == 0 then - widthCalc = widthCalc + (db.width + db.wrapXOffset) * 5 + widthCalc = widthCalc + (UNIT_WIDTH + db.wrapXOffset) * 5 end end self:SetSize(widthCalc - db.wrapXOffset, heightCalc - db.wrapYOffset) diff --git a/Interface/AddOns/SVUI/system/presets.lua b/Interface/AddOns/SVUI/system/presets.lua index e7c4380..2640ac3 100644 --- a/Interface/AddOns/SVUI/system/presets.lua +++ b/Interface/AddOns/SVUI/system/presets.lua @@ -493,7 +493,6 @@ local presets = { ["party"] = { width = 75, height = 60, - gridMode = false, wrapXOffset = 9, wrapYOffset = 13, portrait = { @@ -508,21 +507,18 @@ local presets = { ["raid10"] = { width = 50, height = 30, - gridMode = false, wrapXOffset = 6, wrapYOffset = 6, }, ["raid25"] = { width = 50, height = 30, - gridMode = false, wrapXOffset = 6, wrapYOffset = 6, }, ["raid40"] = { width = 50, height = 30, - gridMode = false, wrapXOffset = 6, wrapYOffset = 6, }, @@ -582,7 +578,6 @@ local presets = { ["party"] = { width = 75, height = 60, - gridMode = false, wrapXOffset = 9, wrapYOffset = 13, portrait = { @@ -597,21 +592,18 @@ local presets = { ["raid10"] = { width = 50, height = 30, - gridMode = false, wrapXOffset = 6, wrapYOffset = 6, }, ["raid25"] = { width = 50, height = 30, - gridMode = false, wrapXOffset = 6, wrapYOffset = 6, }, ["raid40"] = { width = 50, height = 30, - gridMode = false, wrapXOffset = 6, wrapYOffset = 6, }, @@ -676,7 +668,6 @@ local presets = { ["party"] = { width = 100, height = 35, - gridMode = false, wrapXOffset = 9, wrapYOffset = 13, portrait = { @@ -692,21 +683,18 @@ local presets = { ["raid10"] = { width = 50, height = 30, - gridMode = false, wrapXOffset = 6, wrapYOffset = 6, }, ["raid25"] = { width = 50, height = 30, - gridMode = false, wrapXOffset = 6, wrapYOffset = 6, }, ["raid40"] = { width = 50, height = 30, - gridMode = false, wrapXOffset = 6, wrapYOffset = 6, }, @@ -756,7 +744,6 @@ local presets = { ["party"] = { width = 70, height = 30, - gridMode = false, wrapXOffset = 9, wrapYOffset = 13, portrait = { @@ -769,21 +756,18 @@ local presets = { ["raid10"] = { width = 50, height = 30, - gridMode = false, wrapXOffset = 6, wrapYOffset = 6, }, ["raid25"] = { width = 50, height = 30, - gridMode = false, wrapXOffset = 6, wrapYOffset = 6, }, ["raid40"] = { width = 50, height = 30, - gridMode = false, wrapXOffset = 6, wrapYOffset = 6, }, @@ -795,7 +779,6 @@ local presets = { ["party"] = { width = 75, height = 60, - gridMode = false, wrapXOffset = 9, wrapYOffset = 13, portrait = { @@ -821,7 +804,6 @@ local presets = { ["raid10"] = { width = 50, height = 30, - gridMode = false, gRowCol = 1, wrapXOffset = 9, wrapYOffset = 13, @@ -846,7 +828,6 @@ local presets = { ["raid25"] = { width = 50, height = 30, - gridMode = false, gRowCol = 1, wrapXOffset = 9, wrapYOffset = 13, @@ -871,7 +852,6 @@ local presets = { ["raid40"] = { width = 50, height = 30, - gridMode = false, gRowCol = 1, wrapXOffset = 9, wrapYOffset = 13, @@ -898,7 +878,6 @@ local presets = { ["party"] = { width = 75, height = 60, - gridMode = false, wrapXOffset = 9, wrapYOffset = 13, portrait = { @@ -924,7 +903,6 @@ local presets = { ["raid10"] = { width = 50, height = 30, - gridMode = false, ["showBy"] = "DOWN_RIGHT", ["gRowCol"] = 1, ["wrapXOffset"] = 4, @@ -949,7 +927,6 @@ local presets = { ["raid25"] = { width = 50, height = 30, - gridMode = false, ["showBy"] = "DOWN_RIGHT", ["gRowCol"] = 1, ["wrapXOffset"] = 4, @@ -974,7 +951,6 @@ local presets = { ["raid40"] = { width = 50, height = 30, - gridMode = false, ["showBy"] = "DOWN_RIGHT", ["gRowCol"] = 1, ["wrapXOffset"] = 4, @@ -1001,7 +977,6 @@ local presets = { ["party"] = { width = 115, height = 25, - gridMode = false, wrapXOffset = 9, wrapYOffset = 13, ["power"] = { diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/dock.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/dock.lua index d9fda7e..b994f81 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/dock.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/dock.lua @@ -163,6 +163,7 @@ local function GetLiveDockletsA() end return t; end + local function GetLiveDockletsB() local test = SuperVillain.db.SVDock.docklets.DockletMain; local t = {["None"] = L["None"]}; diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua index 35272a3..d4268f8 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua @@ -1519,19 +1519,19 @@ SuperVillain.Options.args.SVUnit = { type = "toggle" }, xrayFocus = { - order = 6, + order = 4, name = L["X-Ray Specs"], desc = L["Use handy graphics to focus the current target, or clear the current focus"], type = "toggle" }, gpsLowHealth = { - order = 7, + order = 5, name = "GPS Proximity", desc = "When using GPS tracking with raid/party frames, only show the tracker for the closest injured player. Useful for healers!", type = "toggle" }, OORAlpha = { - order = 8, + order = 6, name = L["Range Fading"], desc = L["The transparency of units that are out of range."], type = "range", @@ -1544,9 +1544,44 @@ SuperVillain.Options.args.SVUnit = { end }, } + }, + gridGroup = { + order = 2, + type = "group", + guiInline = true, + name = L["Grid Mode"], + args = { + enable = { + order = 1, + name = L["Enable Grid Mode"], + desc = L["Converts party, party pet, raid, raid pet, tank and assist frames into symmetrical squares. Ideal for healers."], + type = "toggle", + get = function(key) + return SuperVillain.db.SVUnit.grid.enable + end, + set = function(key, value) + MOD:ChangeDBVar(value, "enable", "grid"); + MOD:RefreshUnitFrames(); + end + }, + size = { + order = 2, + name = L["Grid Size"], + desc = L["The universal size of grid squares."], + type = "range", + min = 10, + max = 70, + step = 1, + width = "full", + set = function(key, value) + MOD:ChangeDBVar(value, "size", "grid"); + MOD:RefreshUnitFrames(); + end + }, + } }, backgroundGroup = { - order = 2, + order = 3, type = "group", guiInline = true, name = "Unit Backgrounds (3D Portraits Only)", @@ -1575,7 +1610,7 @@ SuperVillain.Options.args.SVUnit = { } }, barGroup = { - order = 3, + order = 4, type = "group", guiInline = true, name = L["Bars"], @@ -1612,7 +1647,7 @@ SuperVillain.Options.args.SVUnit = { } }, fontGroup = { - order = 4, + order = 5, type = "group", guiInline = true, name = L["Fonts"], @@ -1688,7 +1723,7 @@ SuperVillain.Options.args.SVUnit = { } }, allColorsGroup = { - order = 5, + order = 6, type = "group", guiInline = true, name = L["Colors"], diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua index cd209c7..f5725b6 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua @@ -34,7 +34,7 @@ local MOD = SuperVillain.SVUnit if(not MOD) then return end; local _, ns = ... -SuperVillain.Options.args.SVUnit.args.party ={ +SuperVillain.Options.args.SVUnit.args.party = { name = L['Party Frames'], type = 'group', order = 11, @@ -42,13 +42,13 @@ SuperVillain.Options.args.SVUnit.args.party ={ get = function(l)return SuperVillain.db.SVUnit['party'][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party");MOD:SetGroupFrame('party')end, - args ={ - enable ={ + args = { + enable = { type = 'toggle', order = 1, name = L['Enable'], }, - configureToggle ={ + configureToggle = { order = 2, type = 'execute', name = L['Display Frames'], @@ -56,24 +56,24 @@ SuperVillain.Options.args.SVUnit.args.party ={ MOD:UpdateGroupConfig(SVUI_Party, SVUI_Party.forceShow ~= true or nil) end, }, - resetSettings ={ + resetSettings = { type = 'execute', order = 3, name = L['Restore Defaults'], func = function(l, m)MOD:ResetUnitOptions('party')SuperVillain:ResetMovables('Party Frames')end, }, - tabGroups={ + tabGroups= { order=3, type='group', name=L['Unit Options'], childGroups="tree", - args={ - common ={ + args= { + common = { order = 4, type = 'group', name = L['General'], - args ={ - hideonnpc ={ + args = { + hideonnpc = { type = 'toggle', order = 2, name = L['Text Toggle On NPC'], @@ -81,7 +81,7 @@ SuperVillain.Options.args.SVUnit.args.party ={ get = function(l)return SuperVillain.db.SVUnit['party']['power'].hideonnpc end, set = function(l, m)SuperVillain.db.SVUnit['party']['power'].hideonnpc = m;MOD:SetGroupFrame('party')end, }, - rangeCheck ={ + rangeCheck = { order = 3, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], @@ -93,43 +93,37 @@ SuperVillain.Options.args.SVUnit.args.party ={ desc = "Show an arrow giving the direction and distance to the frames unit.", type = "toggle", }, - predict ={ + predict = { order = 5, 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', }, - threatEnabled ={ + threatEnabled = { type = 'toggle', order = 6, name = L['Show Threat'], }, - colorOverride ={ + colorOverride = { order = 7, name = L['Class Color Override'], desc = L['Override the default class color setting.'], type = 'select', - values ={ + values = { ['USE_DEFAULT'] = L['Use Default'], ['FORCE_ON'] = L['Force On'], ['FORCE_OFF'] = L['Force Off'], }, }, - positionsGroup ={ + positionsGroup = { order = 100, name = L['Size and Positions'], type = 'group', guiInline = true, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party");MOD:SetGroupFrame('party', nil, nil, true)end, - args ={ - gridMode ={ + args = { + width = { order = 1, - name = L["Enable Grid mode"], - type = 'toggle', - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party");MOD:SetGroupFrame('party')end, - }, - width ={ - order = 2, name = L['Width'], type = 'range', min = 10, @@ -137,8 +131,8 @@ SuperVillain.Options.args.SVUnit.args.party ={ step = 1, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party");MOD:SetGroupFrame('party')end, }, - height ={ - order = 3, + height = { + order = 2, name = L['Height'], type = 'range', min = 10, @@ -146,18 +140,18 @@ SuperVillain.Options.args.SVUnit.args.party ={ step = 1, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party");MOD:SetGroupFrame('party')end, }, - spacer ={ - order = 4, + spacer = { + order = 3, name = '', type = 'description', width = 'full', }, - showBy ={ - order = 5, + showBy = { + order = 4, name = L['Growth Direction'], desc = L['Growth direction from the first unitframe.'], type = 'select', - values ={ + values = { DOWN_RIGHT = format(L['%s and then %s'], L['Down'], L['Right']), DOWN_LEFT = format(L['%s and then %s'], L['Down'], L['Left']), UP_RIGHT = format(L['%s and then %s'], L['Up'], L['Right']), @@ -168,8 +162,8 @@ SuperVillain.Options.args.SVUnit.args.party ={ LEFT_UP = format(L['%s and then %s'], L['Left'], L['Up']), }, }, - groupCount ={ - order = 7, + groupCount = { + order = 5, type = 'range', name = L['Number of Groups'], min = 1, @@ -184,8 +178,8 @@ SuperVillain.Options.args.SVUnit.args.party ={ end end, }, - gRowCol ={ - order = 8, + gRowCol = { + order = 6, type = 'range', name = L['Groups Per Row/Column'], min = 1, @@ -200,16 +194,16 @@ SuperVillain.Options.args.SVUnit.args.party ={ end end, }, - wrapXOffset ={ - order = 9, + wrapXOffset = { + order = 7, type = 'range', name = L['Horizontal Spacing'], min = 0, max = 50, step = 1, }, - wrapYOffset ={ - order = 10, + wrapYOffset = { + order = 8, type = 'range', name = L['Vertical Spacing'], min = 0, @@ -218,20 +212,20 @@ SuperVillain.Options.args.SVUnit.args.party ={ }, }, }, - visibilityGroup ={ + visibilityGroup = { order = 200, name = L['Visibility'], type = 'group', guiInline = true, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party");MOD:SetGroupFrame('party', nil, nil, true)end, - args ={ - showPlayer ={ + args = { + showPlayer = { order = 1, type = 'toggle', name = L['Display Player'], desc = L['When true, the header includes the player when not in a raid.'], }, - visibility ={ + visibility = { order = 2, type = 'input', name = L['Visibility'], @@ -241,14 +235,14 @@ SuperVillain.Options.args.SVUnit.args.party ={ }, }, }, - sortingGroup ={ + sortingGroup = { order = 300, type = 'group', guiInline = true, name = L['Grouping & Sorting'], set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party");MOD:SetGroupFrame('party', nil, nil, true)end, - args ={ - sortMethod ={ + args = { + sortMethod = { order = 1, name = L['Group By'], desc = L['Set the order that the group will sort.'], @@ -263,36 +257,36 @@ SuperVillain.Options.args.SVUnit.args.party ={ ["GROUP"] = GROUP, }, }, - sortDir ={ + sortDir = { order = 2, name = L['Sort Direction'], desc = L['Defines the sort order of the selected sort method.'], type = 'select', - values ={ + values = { ['ASC'] = L['Ascending'], ['DESC'] = L['Descending'], }, }, - spacer ={ + spacer = { order = 3, type = 'description', width = 'full', name = ' ', }, - customSorting ={ + customSorting = { order = 4, name = L['Custom Sorting'], desc = L['Enabling this allows unique sorting.'], type = 'toggle', }, - invertGroupingOrder ={ + invertGroupingOrder = { order = 5, name = L['Invert Grouping Order'], desc = L['Enabling this inverts the sorting order.'], disabled = function()return not SuperVillain.db.SVUnit['party'].customSorting end, type = 'toggle', }, - startFromCenter ={ + startFromCenter = { order = 6, name = L['Start Near Center'], desc = L['The initial group will start near the center and grow out.'], @@ -304,20 +298,20 @@ SuperVillain.Options.args.SVUnit.args.party ={ }, }, - auraWatch ={ + auraWatch = { order = 600, type = 'group', name = L['Aura Watch'], get = function(l)return SuperVillain.db.SVUnit['party']['auraWatch'][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party", "auraWatch");MOD:SetGroupFrame('party')end, - args ={ - enable ={ + args = { + enable = { type = 'toggle', name = L['Enable'], order = 1, }, - size ={ + size = { type = 'range', name = L['Size'], desc = L['Size of the indicator icon.'], @@ -326,7 +320,7 @@ SuperVillain.Options.args.SVUnit.args.party ={ max = 15, step = 1, }, - configureButton ={ + configureButton = { type = 'execute', name = L['Configure Auras'], func = function()ns:SetToFilterConfig('BuffWatch')end, @@ -342,19 +336,19 @@ SuperVillain.Options.args.SVUnit.args.party ={ portrait = ns:SetPortraitConfigGroup(MOD.SetGroupFrame, 'party'), buffs = ns:SetAuraConfigGroup(true, 'buffs', true, MOD.SetGroupFrame, 'party'), debuffs = ns:SetAuraConfigGroup(true, 'debuffs', true, MOD.SetGroupFrame, 'party'), - petsGroup ={ + petsGroup = { order = 800, type = 'group', name = L['Party Pets'], get = function(l)return SuperVillain.db.SVUnit['party']['petsGroup'][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party", "petsGroup");MOD:SetGroupFrame('party')end, - args ={ - enable ={ + args = { + enable = { type = 'toggle', name = L['Enable'], order = 1, }, - width ={ + width = { order = 2, name = L['Width'], type = 'range', @@ -362,7 +356,7 @@ SuperVillain.Options.args.SVUnit.args.party ={ max = 500, step = 1, }, - height ={ + height = { order = 3, name = L['Height'], type = 'range', @@ -370,14 +364,14 @@ SuperVillain.Options.args.SVUnit.args.party ={ max = 250, step = 1, }, - anchorPoint ={ + anchorPoint = { type = 'select', order = 5, name = L['Anchor Point'], desc = L['What point to anchor to the frame you set to attach to.'], values = {TOPLEFT='TOPLEFT',LEFT='LEFT',BOTTOMLEFT='BOTTOMLEFT',RIGHT='RIGHT',TOPRIGHT='TOPRIGHT',BOTTOMRIGHT='BOTTOMRIGHT',CENTER='CENTER',TOP='TOP',BOTTOM='BOTTOM'}, }, - xOffset ={ + xOffset = { order = 6, type = 'range', name = L['xOffset'], @@ -386,7 +380,7 @@ SuperVillain.Options.args.SVUnit.args.party ={ max = 500, step = 1, }, - yOffset ={ + yOffset = { order = 7, type = 'range', name = L['yOffset'], @@ -412,20 +406,20 @@ SuperVillain.Options.args.SVUnit.args.party ={ } }, }, - targetsGroup ={ + targetsGroup = { order = 900, type = 'group', name = L['Party Targets'], get = function(l)return SuperVillain.db.SVUnit['party']['targetsGroup'][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party", "targetsGroup");MOD:SetGroupFrame('party')end, - args ={ - enable ={ + args = { + enable = { type = 'toggle', name = L['Enable'], order = 1, }, - width ={ + width = { order = 2, name = L['Width'], type = 'range', @@ -433,7 +427,7 @@ SuperVillain.Options.args.SVUnit.args.party ={ max = 500, step = 1, }, - height ={ + height = { order = 3, name = L['Height'], type = 'range', @@ -441,14 +435,14 @@ SuperVillain.Options.args.SVUnit.args.party ={ max = 250, step = 1, }, - anchorPoint ={ + anchorPoint = { type = 'select', order = 5, name = L['Anchor Point'], desc = L['What point to anchor to the frame you set to attach to.'], values = {TOPLEFT='TOPLEFT',LEFT='LEFT',BOTTOMLEFT='BOTTOMLEFT',RIGHT='RIGHT',TOPRIGHT='TOPRIGHT',BOTTOMRIGHT='BOTTOMRIGHT',CENTER='CENTER',TOP='TOP',BOTTOM='BOTTOM'}, }, - xOffset ={ + xOffset = { order = 6, type = 'range', name = L['xOffset'], @@ -457,7 +451,7 @@ SuperVillain.Options.args.SVUnit.args.party ={ max = 500, step = 1, }, - yOffset ={ + yOffset = { order = 7, type = 'range', name = L['yOffset'], diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua index c8fb17b..97aa496 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua @@ -125,26 +125,10 @@ for w=10,40,15 do guiInline = true, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raid" .. w);MOD:SetGroupFrame("raid" .. w, nil, nil, true)end, args = - { - gridMode = - { - order = 1, - name = L["Enable Grid mode"], - type = "toggle", - set = function(l, m) - MOD:ChangeDBVar(m, l[#l], "raid" .. w); - MOD:SetGroupFrame("raid" .. w) - MOD:ChangeDBVar(m, l[#l], "raidpet"); - MOD:SetGroupFrame("raidpet") - MOD:ChangeDBVar(m, l[#l], "tank"); - MOD:SetGroupFrame("tank") - MOD:ChangeDBVar(m, l[#l], "assist"); - MOD:SetGroupFrame("assist") - end, - }, + { width = { - order = 2, + order = 1, name = L["Width"], type = "range", min = 10, @@ -154,7 +138,7 @@ for w=10,40,15 do }, height = { - order = 3, + order = 2, name = L["Height"], type = "range", min = 10, @@ -164,14 +148,14 @@ for w=10,40,15 do }, spacer = { - order = 4, + order = 3, name = "", type = "description", width = "full", }, showBy = { - order = 5, + order = 4, name = L["Growth Direction"], desc = L["Growth direction from the first unitframe."], type = "select", @@ -189,7 +173,7 @@ for w=10,40,15 do }, groupCount = { - order = 7, + order = 5, type = "range", name = L["Number of Groups"], min = 1, @@ -206,7 +190,7 @@ for w=10,40,15 do }, gRowCol = { - order = 8, + order = 6, type = "range", name = L["Groups Per Row / Column"], min = 1, @@ -223,7 +207,7 @@ for w=10,40,15 do }, wrapXOffset = { - order = 9, + order = 7, type = "range", name = L["Horizontal Spacing"], min = 0, @@ -232,7 +216,7 @@ for w=10,40,15 do }, wrapYOffset = { - order = 10, + order = 8, type = "range", name = L["Vertical Spacing"], min = 0,