diff --git a/Interface/AddOns/SVUI/Bindings.xml b/Interface/AddOns/SVUI/Bindings.xml index a3c5818..4071d30 100644 --- a/Interface/AddOns/SVUI/Bindings.xml +++ b/Interface/AddOns/SVUI/Bindings.xml @@ -3,21 +3,24 @@ RaidMark_HotkeyPressed(keystate) </Binding> <Binding name="Fishing Mode" runOnUp="false"> - FishingMode() + SVUIFishingMode() </Binding> <Binding name="Farming Mode" runOnUp="false"> - FarmingMode() + SVUIFarmingMode() </Binding> <Binding name="Archaeology Mode" runOnUp="false"> - ArchaeologyMode() + SVUIArchaeologyMode() </Binding> <Binding name="Cooking Mode" runOnUp="false"> - CookingMode() + SVUICookingMode() </Binding> <Binding name="Toggle Docks" runOnUp="false"> HideSuperDocks() </Binding> <Binding name="Lets Ride" runOnUp="false"> - LetsRide() + SVUILetsRide() + </Binding> + <Binding name="Call Out Incoming" runOnUp="false"> + SVUISayIncoming() </Binding> </Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/assets/artwork/Template/Tooltip/MINITIP-BG.blp b/Interface/AddOns/SVUI/assets/artwork/Template/Tooltip/MINITIP-BG.blp new file mode 100644 index 0000000..45c6751 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Template/Tooltip/MINITIP-BG.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Template/Tooltip/MINITIP-LEFT.blp b/Interface/AddOns/SVUI/assets/artwork/Template/Tooltip/MINITIP-LEFT.blp new file mode 100644 index 0000000..8a2a8cc Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Template/Tooltip/MINITIP-LEFT.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Template/Tooltip/MINITIP-RIGHT.blp b/Interface/AddOns/SVUI/assets/artwork/Template/Tooltip/MINITIP-RIGHT.blp new file mode 100644 index 0000000..842e349 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Template/Tooltip/MINITIP-RIGHT.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Template/Tooltip/TOOLTIP.blp b/Interface/AddOns/SVUI/assets/artwork/Template/Tooltip/TOOLTIP.blp new file mode 100644 index 0000000..b2fe857 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Template/Tooltip/TOOLTIP.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Border/STATUS-BG.blp b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Border/STATUS-BG.blp deleted file mode 100644 index 45c6751..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Border/STATUS-BG.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Border/STATUS-LEFT.blp b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Border/STATUS-LEFT.blp deleted file mode 100644 index 8a2a8cc..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Border/STATUS-LEFT.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Border/STATUS-RIGHT.blp b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Border/STATUS-RIGHT.blp deleted file mode 100644 index 842e349..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Border/STATUS-RIGHT.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua index 370016e..670122e 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua @@ -36,7 +36,6 @@ GET ADDON DATA local SuperVillain, L = unpack(select(2, ...)); local MOD = {}; local LibAB = LibStub("LibActionButton-1.0"); -local LSM = LibStub("LibSharedMedia-3.0"); MOD.Storage = {}; MOD.Storage["Cache"] = {}; MOD.Storage["Bar1"] = {}; @@ -419,7 +418,7 @@ local function ModifyActionButton(parent) count:ClearAllPoints() count:SetPoint("BOTTOMRIGHT",1,1) count:SetShadowOffset(1,-1) - count:SetFontTemplate(LSM:Fetch("font",MOD.db.countFont),MOD.db.countFontSize,MOD.db.countFontOutline) + count:SetFontTemplate(SuperVillain.Shared:Fetch("font",MOD.db.countFont),MOD.db.countFontSize,MOD.db.countFontOutline) end; if icon then icon:SetTexCoord(.1,.9,.1,.9) @@ -430,7 +429,7 @@ local function ModifyActionButton(parent) if MOD.db.hotkeytext then hotkey:ClearAllPoints() hotkey:SetAllPoints() - hotkey:SetFontTemplate(LSM:Fetch("font",MOD.db.font),MOD.db.fontSize,MOD.db.fontOutline) + hotkey:SetFontTemplate(SuperVillain.Shared:Fetch("font",MOD.db.font),MOD.db.fontSize,MOD.db.fontOutline) hotkey:SetJustifyH("RIGHT") hotkey:SetJustifyV("TOP") hotkey:SetShadowOffset(1,-1) diff --git a/Interface/AddOns/SVUI/packages/aura/SVAura.lua b/Interface/AddOns/SVUI/packages/aura/SVAura.lua index 2d33312..4b3f33d 100644 --- a/Interface/AddOns/SVUI/packages/aura/SVAura.lua +++ b/Interface/AddOns/SVUI/packages/aura/SVAura.lua @@ -4,11 +4,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# ############################################################################## S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## @@ -44,16 +44,14 @@ GET ADDON DATA ]]-- local SuperVillain, L = unpack(select(2, ...)); local MOD = {}; -local LSM = LibStub("LibSharedMedia-3.0") --[[ ########################################################## LOCAL VARS ########################################################## ]]-- -local invertMap1 = {DOWN_RIGHT="TOPLEFT",DOWN_LEFT="TOPRIGHT",UP_RIGHT="BOTTOMLEFT",UP_LEFT="BOTTOMRIGHT",RIGHT_DOWN="TOPLEFT",RIGHT_UP="BOTTOMLEFT",LEFT_DOWN="TOPRIGHT",LEFT_UP="BOTTOMRIGHT"}; -local showMap1 = {DOWN_RIGHT=1,DOWN_LEFT=-1,UP_RIGHT=1,UP_LEFT=-1,RIGHT_DOWN=1,RIGHT_UP=1,LEFT_DOWN=-1,LEFT_UP=-1}; -local showMap2 = {DOWN_RIGHT=-1,DOWN_LEFT=-1,UP_RIGHT=1,UP_LEFT=1,RIGHT_DOWN=-1,RIGHT_UP=1,LEFT_DOWN=-1,LEFT_UP=1}; -local toggleMap = {RIGHT_DOWN=true,RIGHT_UP=true,LEFT_DOWN=true,LEFT_UP=true}; +local invertMap1 = {DOWN_RIGHT = "TOPLEFT", DOWN_LEFT = "TOPRIGHT", UP_RIGHT = "BOTTOMLEFT", UP_LEFT = "BOTTOMRIGHT", RIGHT_DOWN = "TOPLEFT", RIGHT_UP = "BOTTOMLEFT", LEFT_DOWN = "TOPRIGHT", LEFT_UP = "BOTTOMRIGHT"}; +local showMap1 = {DOWN_RIGHT = 1, DOWN_LEFT = -1, UP_RIGHT = 1, UP_LEFT = -1, RIGHT_DOWN = 1, RIGHT_UP = 1, LEFT_DOWN = -1, LEFT_UP = -1}; +local showMap2 = {DOWN_RIGHT = -1, DOWN_LEFT = -1, UP_RIGHT = 1, UP_LEFT = 1, RIGHT_DOWN = -1, RIGHT_UP = 1, LEFT_DOWN = -1, LEFT_UP = 1}; local AURA_FADE_TIME = 5; local AURA_ICONS = { [[Interface\Addons\SVUI\assets\artwork\Icons\AURA-STATS]], @@ -82,28 +80,28 @@ local CB_HEIGHT = 228; local function CreateHyperBuff(index) local buff = CreateFrame("Button", nil, SVUI_ConsolidatedBuffs) local texture = AURA_ICONS[index] - local bar = CreateFrame('StatusBar',nil,buff) + local bar = CreateFrame("StatusBar", nil, buff) bar:SetAllPoints(buff) bar:SetStatusBarTexture(texture) bar:SetOrientation("VERTICAL") - bar:SetMinMaxValues(0,100) + bar:SetMinMaxValues(0, 100) bar:SetValue(0) - local bg = bar:CreateTexture(nil,"BACKGROUND",nil,-2) - bg:WrapOuter(buff,1,1) + local bg = bar:CreateTexture(nil, "BACKGROUND", nil, -2) + bg:WrapOuter(buff, 1, 1) bg:SetTexture(texture) - bg:SetVertexColor(0,0,0,0.5) - local empty = bar:CreateTexture(nil,"BACKGROUND",nil,-1) + bg:SetVertexColor(0, 0, 0, 0.5) + local empty = bar:CreateTexture(nil, "BACKGROUND", nil, -1) empty:SetAllPoints(buff) empty:SetTexture(texture) empty:SetDesaturated(true) - empty:SetVertexColor(0.5,0.5,0.5) + empty:SetVertexColor(0.5, 0.5, 0.5) empty:SetBlendMode("ADD") buff.bar = bar; buff.bg = bg; buff.empty = empty; buff:SetAlpha(0.1) return buff -end; +end --[[ ########################################################## CORE FUNCTIONS @@ -120,12 +118,12 @@ do end else self.timeLeft = self.timeLeft - elapsed - end; + end if(self.nextUpdate > 0) then self.nextUpdate = self.nextUpdate - elapsed; return - end; + end local expires = self.timeLeft local calc = 0; @@ -160,9 +158,9 @@ do if(self.timeLeft > AURA_FADE_TIME) then SuperVillain.Animate:StopFlash(self) else - SuperVillain.Animate:Flash(self,1) + SuperVillain.Animate:Flash(self, 1) end - end; + end local Aura_OnAttributeChanged = function(self, attribute, auraIndex) if(attribute == "index") then @@ -177,49 +175,49 @@ do self:SetScript("OnUpdate", RefreshAuraTime) else self.timeLeft = timeLeft - end; + end self.nextUpdate = -1; RefreshAuraTime(self, 0) else self.timeLeft = nil; self.time:SetText("") self:SetScript("OnUpdate", nil) - end; + end if count > 1 then self.count:SetText(count) else self.count:SetText("") - end; + end if filter == "HARMFUL" then local color = DebuffTypeColor[dispelType or ""] self:SetBackdropBorderColor(color.r, color.g, color.b) else - self:SetBackdropBorderColor(0,0,0); - end; + self:SetBackdropBorderColor(0, 0, 0); + end self.texture:SetTexture(icon) self.offset = nil - end; + end elseif(attribute == "target-slot") then - local quality = GetInventoryItemQuality("player",auraIndex) - self.texture:SetTexture(GetInventoryItemTexture("player",auraIndex)) - local offset=2; + local quality = GetInventoryItemQuality("player", auraIndex) + self.texture:SetTexture(GetInventoryItemTexture("player", auraIndex)) + local offset = 2; local enchantIndex = self:GetName():sub(-1) if enchantIndex:match("2") then - offset=5 - end; + offset = 5 + end if quality then self:SetBackdropBorderColor(GetItemQualityColor(quality)) - end; - local enchantInfo=select(offset,GetWeaponEnchantInfo()) + end + local enchantInfo = select(offset, GetWeaponEnchantInfo()) if enchantInfo then self.offset = offset; - self:SetScript("OnUpdate",MOD. RefreshAuraTime) + self:SetScript("OnUpdate", MOD. RefreshAuraTime) self.nextUpdate = -1; - RefreshAuraTime(self,0) + RefreshAuraTime(self, 0) else self.timeLeft = nil; self.offset = nil; - self:SetScript("OnUpdate",nil) + self:SetScript("OnUpdate", nil) self.time:SetText("") end end @@ -231,45 +229,45 @@ do if aura.SetHighlightTexture then aura:SetHighlightTexture("") end if aura.SetPushedTexture then aura:SetPushedTexture("") end if aura.SetDisabledTexture then aura:SetDisabledTexture("") end - aura:SetBackdrop({ - bgFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - edgeSize = 2, - insets = { - left = 0, - right = 0, - top = 0, - bottom = 0 - } - }) - aura:SetBackdropColor(0, 0, 0, 0) - aura:SetBackdropBorderColor(0, 0, 0) - local cd = aura:GetName() and _G[aura:GetName().."Cooldown"] - if cd then - cd:ClearAllPoints() - cd:FillInner(aura,0,0) - end; + aura:SetBackdrop({ + bgFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + edgeSize = 2, + insets = { + left = 0, + right = 0, + top = 0, + bottom = 0 + } + }) + aura:SetBackdropColor(0, 0, 0, 0) + aura:SetBackdropBorderColor(0, 0, 0) + local cd = aura:GetName() and _G[aura:GetName().."Cooldown"] + if cd then + cd:ClearAllPoints() + cd:FillInner(aura, 0, 0) + end aura.Skinned = true end - local font = LSM:Fetch("font",MOD.db.font) - aura.texture = aura:CreateTexture(nil,"BORDER") + local font = SuperVillain.Shared:Fetch("font", MOD.db.font) + aura.texture = aura:CreateTexture(nil, "BORDER") aura.texture:FillInner(aura, 2, 2) - aura.texture:SetTexCoord(0.1,0.9,0.1,0.9) - aura.count = aura:CreateFontString(nil,"ARTWORK") - aura.count:SetPoint("BOTTOMRIGHT",(-1 + MOD.db.countOffsetH),(1 + MOD.db.countOffsetV)) + aura.texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) + aura.count = aura:CreateFontString(nil, "ARTWORK") + aura.count:SetPoint("BOTTOMRIGHT", (-1 + MOD.db.countOffsetH), (1 + MOD.db.countOffsetV)) aura.count:SetFontTemplate(font, MOD.db.fontSize, MOD.db.fontOutline) - aura.time = aura:CreateFontString(nil,"ARTWORK") + aura.time = aura:CreateFontString(nil, "ARTWORK") aura.time:SetPoint("TOP", aura, "BOTTOM", 1 + MOD.db.timeOffsetH, 0 + MOD.db.timeOffsetV) aura.time:SetFontTemplate(font, MOD.db.fontSize, MOD.db.fontOutline) aura.highlight = aura:CreateTexture(nil, "HIGHLIGHT") - aura.highlight:SetTexture(0,0,0,0.45) + aura.highlight:SetTexture(0, 0, 0, 0.45) aura.highlight:FillInner() SuperVillain.Animate:Flash(aura) aura:SetScript("OnAttributeChanged", Aura_OnAttributeChanged) - end; -end; + end +end do local ConsolidatedBuff_OnUpdate = function(self, current) @@ -280,11 +278,11 @@ do if self.nextUpdate > 0 then self.nextUpdate = self.nextUpdate - current; return - end; + end if self.expiration <= 0 then - self:SetScript("OnUpdate",nil) + self:SetScript("OnUpdate", nil) return - end; + end if expires < 60 then if expires >= AURA_FADE_TIME then @@ -302,37 +300,37 @@ do calc = floor((expires / 86400) + .5); self.nextUpdate = calc > 1 and ((expires - calc) * 43199.5) or (expires - 86400); end - end; + end local UpdateConsolidatedReminder = function(self, event, arg) - if(event == "UNIT_AURA" and arg ~= "player") then return end; - for i=1,NUM_LE_RAID_BUFF_TYPES do - local name,_,_,duration,expiration = GetRaidBuffTrayAuraInfo(i) + if(event == "UNIT_AURA" and arg ~= "player") then return end + for i = 1, NUM_LE_RAID_BUFF_TYPES do + local name, _, _, duration, expiration = GetRaidBuffTrayAuraInfo(i) local buff = SVUI_ConsolidatedBuffs[i] if name then local timeLeft = expiration - GetTime() buff.expiration = timeLeft; buff.duration = duration; buff.nextUpdate = 0; - buff.bar:SetMinMaxValues(0,duration) + buff.bar:SetMinMaxValues(0, duration) buff.bar:SetValue(timeLeft) buff:SetAlpha(0.1) if(duration == 0 and expiration == 0) then - buff:SetScript('OnUpdate',nil) + buff:SetScript("OnUpdate", nil) buff.spellName = nil; buff.empty:SetAlpha(0) else buff:SetAlpha(1) - buff:SetScript('OnUpdate',ConsolidatedBuff_OnUpdate) + buff:SetScript("OnUpdate", ConsolidatedBuff_OnUpdate) buff.spellName = name buff.empty:SetAlpha(1) - end; + end else buff.spellName = nil; buff.bar:SetValue(0) buff:SetAlpha(0.1) buff.empty:SetAlpha(0) - buff:SetScript('OnUpdate',nil) + buff:SetScript("OnUpdate", nil) end end end @@ -343,7 +341,7 @@ do CB_WIDTH = (CB_HEIGHT / 5) + 4 SVUI_AurasAnchor:SetSize(CB_WIDTH, CB_HEIGHT) SVUI_ConsolidatedBuffs:Show() - BuffFrame:RegisterUnitEvent('UNIT_AURA',"player") + BuffFrame:RegisterUnitEvent("UNIT_AURA", "player") MOD:RegisterEvent("UNIT_AURA", UpdateConsolidatedReminder) MOD:RegisterEvent("GROUP_ROSTER_UPDATE", UpdateConsolidatedReminder) MOD:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED", UpdateConsolidatedReminder) @@ -351,14 +349,14 @@ do UpdateConsolidatedReminder() else SVUI_ConsolidatedBuffs:Hide() - BuffFrame:UnregisterEvent('UNIT_AURA') + BuffFrame:UnregisterEvent("UNIT_AURA") MOD:UnregisterEvent("UNIT_AURA") MOD:UnregisterEvent("GROUP_ROSTER_UPDATE") MOD:UnregisterEvent("PLAYER_SPECIALIZATION_CHANGED") SuperVillain.RoleChangedCallback = function() end end - end; -end; + end +end do local AuraButton_OnEnter = function(self) @@ -370,14 +368,14 @@ do if parent.spellName then GameTooltip:SetUnitConsolidatedBuff("player",id) GameTooltip:AddLine("________________________") - end; + end GameTooltip:AddLine("Consolidated Buff: ".._G[("RAID_BUFF_%d"):format(id)]) GameTooltip:Show() - end; + end local AuraButton_OnLeave = function(self) GameTooltip:Hide() - end; + end function MOD:Update_ConsolidatedBuffsSettings(event) SVUI_ConsolidatedBuffs:SetAllPoints(SVUI_AurasAnchor) @@ -409,14 +407,14 @@ do lastGoodFrame = buff else buff:Point("TOP", lastGoodFrame, "BOTTOM", 0, -4) - end; + end if((hideIndex1 and i == hideIndex1) or (hideIndex2 and i == hideIndex2)) then buff:Hide() else buff:Show() lastGoodFrame = buff - end; + end buff:SetSize(buffSize,buffSize) @@ -433,97 +431,98 @@ do MOD:ToggleConsolidatedBuffs() end end -end; +end function MOD:UpdateAuraHeader(auraHeader) if(InCombatLockdown() or not auraHeader) then return end - local db = MOD.db.debuffs; - local font=LSM:Fetch("font",MOD.db.font) - if auraHeader:GetAttribute('filter') == 'HELPFUL' then + local db = MOD.db.debuffs + local showBy = db.showBy + local font = SuperVillain.Shared:Fetch("font", MOD.db.font) + if auraHeader:GetAttribute("filter") == "HELPFUL" then db = MOD.db.buffs; - auraHeader:SetAttribute("consolidateTo",MOD.db.hyperBuffs.enable==true and 1 or 0) - auraHeader:SetAttribute('weaponTemplate',("SVUI_AuraTemplate%d"):format(db.size)) - end; - auraHeader:SetAttribute("separateOwn",db.isolate) - auraHeader:SetAttribute("sortMethod",db.sortMethod) - auraHeader:SetAttribute("sortDir",db.sortDir) - auraHeader:SetAttribute("maxWraps",db.maxWraps) - auraHeader:SetAttribute("wrapAfter",db.wrapAfter) - auraHeader:SetAttribute("point",invertMap1[db.showBy]) - if toggleMap[db.showBy]then - auraHeader:SetAttribute("minWidth", ((db.wrapAfter==1 and 0 or db.wrapXOffset) + db.size) * db.wrapAfter) + auraHeader:SetAttribute("consolidateTo", MOD.db.hyperBuffs.enable == true and 1 or 0) + auraHeader:SetAttribute("weaponTemplate", ("SVUI_AuraTemplate%d"):format(db.size)) + end + auraHeader:SetAttribute("separateOwn", db.isolate) + auraHeader:SetAttribute("sortMethod", db.sortMethod) + auraHeader:SetAttribute("sortDir", db.sortDir) + auraHeader:SetAttribute("maxWraps", db.maxWraps) + auraHeader:SetAttribute("wrapAfter", db.wrapAfter) + auraHeader:SetAttribute("point", invertMap1[showBy]) + if(showBy == "RIGHT_DOWN" or showBy == "RIGHT_UP" or showBy == "LEFT_DOWN" or showBy == "LEFT_UP") then + auraHeader:SetAttribute("minWidth", ((db.wrapAfter == 1 and 0 or db.wrapXOffset) + db.size) * db.wrapAfter) auraHeader:SetAttribute("minHeight", (db.wrapYOffset + db.size) * db.maxWraps) - auraHeader:SetAttribute("xOffset", showMap1[db.showBy] * (db.wrapXOffset + db.size)) + auraHeader:SetAttribute("xOffset", showMap1[showBy] * (db.wrapXOffset + db.size)) auraHeader:SetAttribute("yOffset", 0) auraHeader:SetAttribute("wrapOffsetH", 0) - auraHeader:SetAttribute("wrapOffsetV", showMap2[db.showBy] * (db.wrapYOffset + db.size)) + auraHeader:SetAttribute("wrapOffsetV", showMap2[showBy] * (db.wrapYOffset + db.size)) else - auraHeader:SetAttribute("minWidth", (db.wrapXOffset + db.size)*db.maxWraps) - auraHeader:SetAttribute("minHeight", ((db.wrapAfter==1 and 0 or db.wrapYOffset) + db.size) * db.wrapAfter) + auraHeader:SetAttribute("minWidth", (db.wrapXOffset + db.size) * db.maxWraps) + auraHeader:SetAttribute("minHeight", ((db.wrapAfter == 1 and 0 or db.wrapYOffset) + db.size) * db.wrapAfter) auraHeader:SetAttribute("xOffset", 0) - auraHeader:SetAttribute("yOffset", showMap2[db.showBy] * (db.wrapYOffset + db.size)) - auraHeader:SetAttribute("wrapOffsetH", showMap1[db.showBy] * (db.wrapXOffset + db.size)) + auraHeader:SetAttribute("yOffset", showMap2[showBy] * (db.wrapYOffset + db.size)) + auraHeader:SetAttribute("wrapOffsetH", showMap1[showBy] * (db.wrapXOffset + db.size)) auraHeader:SetAttribute("wrapOffsetV", 0) - end; - auraHeader:SetAttribute("template",("SVUI_AuraTemplate%d"):format(db.size)) - local i=1; - local auraChild=select(i,auraHeader:GetChildren()) + end + auraHeader:SetAttribute("template", ("SVUI_AuraTemplate%d"):format(db.size)) + local i = 1; + local auraChild = select(i, auraHeader:GetChildren()) while(auraChild) do if ((floor(auraChild:GetWidth() * 100 + 0.5) / 100) ~= db.size) then - auraChild:SetSize(db.size,db.size) - end; + auraChild:SetSize(db.size, db.size) + end if(auraChild.time) then auraChild.time:ClearAllPoints() - auraChild.time:SetPoint("TOP", auraChild, 'BOTTOM', 1 + MOD.db.timeOffsetH, MOD.db.timeOffsetV) + auraChild.time:SetPoint("TOP", auraChild, "BOTTOM", 1 + MOD.db.timeOffsetH, MOD.db.timeOffsetV) auraChild.count:ClearAllPoints() auraChild.count:SetPoint("BOTTOMRIGHT", -1 + MOD.db.countOffsetH, MOD.db.countOffsetV) - end; + end if (i > (db.maxWraps * db.wrapAfter) and auraChild:IsShown()) then auraChild:Hide() - end; + end i = i + 1; auraChild = select(i, auraHeader:GetChildren()) end -end; +end local function CreateAuraHeader(filter) - local frameName="SVUI_PlayerDebuffs" - if filter=="HELPFUL" then frameName="SVUI_PlayerBuffs" end; - local auraHeader=CreateFrame("Frame", frameName, SVUI_AurasAnchor, "SecureAuraHeaderTemplate") + local frameName = "SVUI_PlayerDebuffs" + if filter == "HELPFUL" then frameName = "SVUI_PlayerBuffs" end + local auraHeader = CreateFrame("Frame", frameName, SVUI_AurasAnchor, "SecureAuraHeaderTemplate") auraHeader:SetClampedToScreen(true) - auraHeader:SetAttribute("unit","player") - auraHeader:SetAttribute("filter",filter) - RegisterStateDriver(auraHeader,"visibility","[petbattle] hide; show") - RegisterAttributeDriver(auraHeader,"unit","[vehicleui] vehicle; player") - if filter=="HELPFUL" then - auraHeader:SetAttribute('consolidateDuration',-1) - auraHeader:SetAttribute("includeWeapons",1) - end; + auraHeader:SetAttribute("unit", "player") + auraHeader:SetAttribute("filter", filter) + RegisterStateDriver(auraHeader, "visibility", "[petbattle] hide; show") + RegisterAttributeDriver(auraHeader, "unit", "[vehicleui] vehicle; player") + if filter == "HELPFUL" then + auraHeader:SetAttribute("consolidateDuration", -1) + auraHeader:SetAttribute("includeWeapons", 1) + end MOD:UpdateAuraHeader(auraHeader) auraHeader:Show() return auraHeader -end; +end function MOD:UpdateThisPackage() CB_HEIGHT = Minimap:GetHeight() CB_WIDTH = (CB_HEIGHT / 5) + 4 SVUI_AurasAnchor:SetSize(CB_WIDTH, CB_HEIGHT) AURA_FADE_TIME = MOD.db.fadeBy - MOD:UpdateAuraHeader(SVUI_PlayerBuffs); - MOD:UpdateAuraHeader(SVUI_PlayerDebuffs); -end; + MOD:UpdateAuraHeader(SVUI_PlayerBuffs); + MOD:UpdateAuraHeader(SVUI_PlayerDebuffs); +end function MOD:ConstructThisPackage() CB_HEIGHT = Minimap:GetHeight() CB_WIDTH = (CB_HEIGHT / 5) + 4 - if not SuperVillain.db.SVAura.enable then return end; + if not SuperVillain.db.SVAura.enable then return end if SuperVillain.db.SVAura.disableBlizzard then BuffFrame:MUNG() ConsolidatedBuffs:MUNG() TemporaryEnchantFrame:MUNG() InterfaceOptionsFrameCategoriesButton12:SetScale(0.0001) - end; - local auras = CreateFrame('Frame', 'SVUI_AurasAnchor', SuperVillain.UIParent) + end + local auras = CreateFrame("Frame", "SVUI_AurasAnchor", SuperVillain.UIParent) auras:SetSize(CB_WIDTH, CB_HEIGHT) auras:Point("TOPRIGHT", Minimap, "TOPLEFT", -8, 0) self.BuffFrame = CreateAuraHeader("HELPFUL") @@ -534,13 +533,13 @@ function MOD:ConstructThisPackage() SVUI_ConsolidatedBuffs:SetParent(SuperVillain.UIParent) SVUI_ConsolidatedBuffs:SetAllPoints(auras) - for i=1,NUM_LE_RAID_BUFF_TYPES do + for i = 1, NUM_LE_RAID_BUFF_TYPES do SVUI_ConsolidatedBuffs[i] = CreateHyperBuff(i) SVUI_ConsolidatedBuffs[i]:SetID(i) - end; + end self:Update_ConsolidatedBuffsSettings() SuperVillain:SetSVMovable(auras, "SVUI_Auras_MOVE", L["Auras Frame"]) -end; +end SuperVillain.Registry:NewPackage(MOD, "SVAura") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index b921b91..1a56306 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -45,7 +45,6 @@ GET ADDON DATA local SuperVillain, L = unpack(select(2, ...)); local MOD = {}; local DOCK = SuperVillain.Registry:Expose('SVDock'); -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## LOCAL VARS @@ -645,17 +644,17 @@ do CHAT_ALLOW_URL = MOD.db.url; CHAT_HOVER_URL = MOD.db.hyperlinkHover; CHAT_STICKY = MOD.db.sticky; - CHAT_FONT = LSM:Fetch("font", MOD.db.font); + CHAT_FONT = SuperVillain.Shared:Fetch("font", MOD.db.font); CHAT_FONTSIZE = SuperVillain.db.media.fonts.size or 12; CHAT_FONTOUTLINE = MOD.db.fontOutline; TAB_WIDTH = MOD.db.tabWidth; TAB_HEIGHT = MOD.db.tabHeight; TAB_SKINS = MOD.db.tabStyled; - TAB_FONT = LSM:Fetch("font", MOD.db.tabFont); + TAB_FONT = SuperVillain.Shared:Fetch("font", MOD.db.tabFont); TAB_FONTSIZE = MOD.db.tabFontSize; TAB_FONTOUTLINE = MOD.db.tabFontOutline; CHAT_FADING = MOD.db.fade; - CHAT_PSST = LSM:Fetch("sound", MOD.db.psst); + CHAT_PSST = SuperVillain.Shared:Fetch("sound", MOD.db.psst); TIME_STAMP_MASK = MOD.db.timeStampFormat; if(throttle and throttle == 0) then twipe(THROTTLE_CACHE) diff --git a/Interface/AddOns/SVUI/packages/map/SVMap.lua b/Interface/AddOns/SVUI/packages/map/SVMap.lua index ff8e66b..ad304a0 100644 --- a/Interface/AddOns/SVUI/packages/map/SVMap.lua +++ b/Interface/AddOns/SVUI/packages/map/SVMap.lua @@ -264,7 +264,7 @@ local function UpdateMinimapNarration() end; local function UpdateMinimapLocation() - SVUI_MinimapZonetext.Text:SetText(MOD.locationPrefix .. strsub(GetMinimapZoneText(),1,25)) + SVUI_MinimapZonetext.Text:SetText(MOD.locationPrefix .. strsub(GetMinimapZoneText(), 1, 25)) end; function MOD:UpdateMinimapTexts() diff --git a/Interface/AddOns/SVUI/packages/override/common/mirror.lua b/Interface/AddOns/SVUI/packages/override/common/mirror.lua index 21ea30b..d80d0ab 100644 --- a/Interface/AddOns/SVUI/packages/override/common/mirror.lua +++ b/Interface/AddOns/SVUI/packages/override/common/mirror.lua @@ -95,33 +95,9 @@ local function MirrorBarRegistry(barType) return RegisteredMirrorBars[barType] end; local bar = CreateFrame('StatusBar', nil, SuperVillain.UIParent) - bar:SetFixedPanelTemplate("Inset") + bar:SetPanelTemplate("Bar", false, 3, 3, 3) bar:SetScript("OnUpdate", MirrorBar_OnUpdate) local r, g, b = unpack(mirrorTypeColor[barType]) - local bg = bar:CreateTexture(nil, 'BACKGROUND') - bg:SetAllPoints(bar) - bg:SetTexture([[Interface\BUTTONS\WHITE8X8]]) - bg:SetVertexColor(r, g, b) - bg:SetAlpha(0.2) - local border = CreateFrame("Frame", nil, bar) - border:WrapOuter(bar,3,3) - border:SetFrameLevel(0) - border:SetBackdrop({ - bgFile = [[Interface\BUTTONS\WHITE8X8]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = - { - left = 0, - right = 0, - top = 0, - bottom = 0, - }, - }) - border:SetBackdropColor(0,0,0,0.5) - border:SetBackdropBorderColor(0,0,0,0.5) bar.text = bar:CreateFontString(nil, 'OVERLAY') bar.text:SetFontTemplate(SuperVillain.Media.font.roboto, 12, 'OUTLINE') bar.text:SetJustifyH('CENTER') @@ -150,36 +126,9 @@ local function SetTimerStyle(bar) child:SetFontTemplate(SuperVillain.Media.font.roboto, 12, 'OUTLINE') end end; - local border = CreateFrame("Frame", nil, bar) - border:WrapOuter(bar,3,3) - border:SetFrameLevel(0) - border:SetBackdrop({ - bgFile = [[Interface\BUTTONS\WHITE8X8]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = - { - left = 0, - right = 0, - top = 0, - bottom = 0, - }, - }) - border:SetBackdropColor(0,0,0,0.5) - border:SetBackdropBorderColor(0,0,0,0.5) bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - bar:SetStatusBarColor(unpack(SuperVillain.Media.color.highlight)) - local tempBG = CreateFrame("Frame", nil, bar) - tempBG:WrapOuter(bar) - if (bar:GetFrameLevel() - 1) >= 0 then - tempBG:SetFrameLevel(bar:GetFrameLevel() - 1) - else - tempBG:SetFrameLevel(0) - end; - tempBG:SetFixedPanelTemplate("Transparent") - tempBG:SetAlpha(1) + bar:SetStatusBarColor(0.37, 0.92, 0.08) + bar:SetPanelTemplate("Bar", false, 3, 3, 3) end; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua index 6d816e2..c8f1357 100644 --- a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua +++ b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua @@ -51,7 +51,6 @@ GET ADDON DATA ]]-- local SuperVillain, L = unpack(select(2, ...)); local MOD = {}; -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## LOCALIZED GLOBALS @@ -1038,11 +1037,11 @@ function MOD:UpdateDataLocals() NPBaseAlpha = db.nonTargetAlpha; NPCombatHide = db.combatHide; - NPFont = LSM:Fetch("font", db.font); + NPFont = SuperVillain.Shared:Fetch("font", db.font); NPFSize = db.fontSize; NPFOutline = db.fontOutline; - AuraFont = LSM:Fetch("font", db.auras.font); + AuraFont = SuperVillain.Shared:Fetch("font", db.auras.font); AuraFSize = db.auras.fontSize; AuraFOutline = db.auras.fontOutline; AuraMaxCount = db.auras.numAuras; diff --git a/Interface/AddOns/SVUI/packages/plates/common/auras.lua b/Interface/AddOns/SVUI/packages/plates/common/auras.lua index afcbecd..f576111 100644 --- a/Interface/AddOns/SVUI/packages/plates/common/auras.lua +++ b/Interface/AddOns/SVUI/packages/plates/common/auras.lua @@ -49,7 +49,6 @@ GET ADDON DATA ]]-- local SuperVillain, L = unpack(select(2, ...)); local MOD = SuperVillain.Registry:Expose('SVPlate'); -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## LOCALS AND TRACKER FRAME @@ -419,7 +418,7 @@ MODULE FUNCTIONS ########################################################## ]]-- function MOD:UpdateAuraLocals() - AuraFont = LSM:Fetch("font", self.db.auras.font); + AuraFont = SuperVillain.Shared:Fetch("font", self.db.auras.font); AuraFSize = self.db.auras.fontSize; AuraFOutline = self.db.auras.fontOutline; AuraExtraFilter = self.db.auras.additionalFilter; diff --git a/Interface/AddOns/SVUI/packages/stats/SVStats.lua b/Interface/AddOns/SVUI/packages/stats/SVStats.lua index 4b5878d..3d2789d 100644 --- a/Interface/AddOns/SVUI/packages/stats/SVStats.lua +++ b/Interface/AddOns/SVUI/packages/stats/SVStats.lua @@ -52,7 +52,6 @@ LOCAL VARIABLES ########################################################## ]]-- --local LDB = LibStub:GetLibrary("LibDataBroker-1.1"); -local LSM = LibStub("LibSharedMedia-3.0"); local hexString = "|cffFFFFFF"; local myName = UnitName("player"); local myClass = select(2,UnitClass("player")); @@ -185,7 +184,7 @@ function MOD:NewAnchor(parent, maxCount, tipAnchor, x, y) parent.holders[this].textframe:SetFrameStrata("HIGH") parent.holders[this].text = parent.holders[this].textframe:CreateFontString(nil, "OVERLAY", nil, 7) parent.holders[this].text:SetAllPoints() - parent.holders[this].text:SetFontTemplate(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + parent.holders[this].text:SetFontTemplate(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) parent.holders[this].text:SetJustifyH("CENTER") parent.holders[this].text:SetJustifyV("middle") end; @@ -469,7 +468,7 @@ do parent.holders[this]:SetScript("OnEnter", nil) parent.holders[this]:SetScript("OnLeave", nil) parent.holders[this]:SetScript("OnClick", nil) - parent.holders[this].text:SetFontTemplate(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + parent.holders[this].text:SetFontTemplate(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) parent.holders[this].text:SetText(nil) if parent.holders[this].barframe then parent.holders[this].barframe:Hide() diff --git a/Interface/AddOns/SVUI/packages/stats/common/durability.lua b/Interface/AddOns/SVUI/packages/stats/common/durability.lua index f6224d5..30af897 100644 --- a/Interface/AddOns/SVUI/packages/stats/common/durability.lua +++ b/Interface/AddOns/SVUI/packages/stats/common/durability.lua @@ -51,7 +51,6 @@ GET ADDON DATA ]]-- local SuperVillain, L = unpack(select(2, ...)); local MOD = SuperVillain.Registry:Expose('SVStats'); -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## DURABILITY STATS @@ -83,7 +82,7 @@ local function Durability_OnEvent(self, ...) self.text:SetAllPoints(self) self.text:SetJustifyH("CENTER") self.barframe:Hide() - self.text:SetFontTemplate(LSM:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,SuperVillain.db.SVStats.fontOutline) + self.text:SetFontTemplate(SuperVillain.Shared:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,SuperVillain.db.SVStats.fontOutline) end; for slot,name in pairs(inventoryMap)do local slotID = GetInventorySlotInfo(slot) @@ -104,7 +103,7 @@ local function DurabilityBar_OnEvent(self, ...) if not self.barframe:IsShown() then self.barframe:Show() self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-DUR") - self.text:SetFontTemplate(LSM:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,"NONE") + self.text:SetFontTemplate(SuperVillain.Shared:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,"NONE") end; for slot,name in pairs(inventoryMap)do local slotID = GetInventorySlotInfo(slot) diff --git a/Interface/AddOns/SVUI/packages/stats/common/experience.lua b/Interface/AddOns/SVUI/packages/stats/common/experience.lua index 1c2a668..773407b 100644 --- a/Interface/AddOns/SVUI/packages/stats/common/experience.lua +++ b/Interface/AddOns/SVUI/packages/stats/common/experience.lua @@ -34,7 +34,6 @@ GET ADDON DATA ]]-- local SuperVillain, L = unpack(select(2, ...)); local MOD = SuperVillain.Registry:Expose('SVStats'); -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## EXPERIENCE STATS @@ -67,7 +66,7 @@ local function Experience_OnEvent(self, ...) self.text:SetAllPoints(self) self.text:SetJustifyH("CENTER") self.barframe:Hide() - self.text:SetFontTemplate(LSM:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,SuperVillain.db.SVStats.fontOutline) + self.text:SetFontTemplate(SuperVillain.Shared:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,SuperVillain.db.SVStats.fontOutline) end; local f, g = getUnitXP("player") local h = GetXPExhaustion() @@ -84,7 +83,7 @@ local function ExperienceBar_OnEvent(self, ...) if ((UnitLevel("player") ~= GetMaxPlayerLevel()) and not self.barframe:IsShown())then self.barframe:Show() self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-XP") - self.text:SetFontTemplate(LSM:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,"NONE") + self.text:SetFontTemplate(SuperVillain.Shared:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,"NONE") end; if not self.barframe.bar.extra:IsShown() then self.barframe.bar.extra:Show() diff --git a/Interface/AddOns/SVUI/packages/stats/common/reputation.lua b/Interface/AddOns/SVUI/packages/stats/common/reputation.lua index 23e53bd..61278e2 100644 --- a/Interface/AddOns/SVUI/packages/stats/common/reputation.lua +++ b/Interface/AddOns/SVUI/packages/stats/common/reputation.lua @@ -35,7 +35,6 @@ GET ADDON DATA ]]-- local SuperVillain, L = unpack(select(2, ...)); local MOD = SuperVillain.Registry:Expose('SVStats'); -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## REPUTATION STATS @@ -86,7 +85,7 @@ local function Reputation_OnEvent(self, ...) self.text:SetJustifyH("CENTER") self.barframe:Hide() self.text:SetAlpha(1) - self.text:SetFontTemplate(LSM:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,SuperVillain.db.SVStats.fontOutline) + self.text:SetFontTemplate(SuperVillain.Shared:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,SuperVillain.db.SVStats.fontOutline) end; local ID = 100 local isFriend, friendText @@ -118,7 +117,7 @@ local function ReputationBar_OnEvent(self, ...) self.barframe:Show() self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-REP") self.text:SetAlpha(0.5) - self.text:SetFontTemplate(LSM:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,"NONE") + self.text:SetFontTemplate(SuperVillain.Shared:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,"NONE") end; local bar = self.barframe.bar; local name, reaction, min, max, value = GetWatchedFactionInfo() diff --git a/Interface/AddOns/SVUI/packages/tip/SVTip.lua b/Interface/AddOns/SVUI/packages/tip/SVTip.lua index f8e9561..2d6f54d 100644 --- a/Interface/AddOns/SVUI/packages/tip/SVTip.lua +++ b/Interface/AddOns/SVUI/packages/tip/SVTip.lua @@ -38,7 +38,6 @@ GET ADDON DATA ]]-- local SuperVillain, L = unpack(select(2, ...)); local MOD = {}; -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## LOCAL VARIABLES @@ -51,20 +50,22 @@ local playerGUID = UnitGUID("player"); local targetList, inspectCache = {}, {}; local NIL_COLOR = { r = 1, g = 1, b = 1 }; local TAPPED_COLOR = { r = .6, g = .6, b = .6 }; -local tooltips={ - GameTooltip,ItemRefTooltip,ItemRefShoppingTooltip1, - ItemRefShoppingTooltip2,ItemRefShoppingTooltip3,AutoCompleteBox, - FriendsTooltip,ConsolidatedBuffsTooltip,ShoppingTooltip1, - ShoppingTooltip2,ShoppingTooltip3,WorldMapTooltip, - WorldMapCompareTooltip1,WorldMapCompareTooltip2, - WorldMapCompareTooltip3,DropDownList1MenuBackdrop, - DropDownList2MenuBackdrop,DropDownList3MenuBackdrop,BNToastFrame +local SKULL_ICON = "|TInterface\\TARGETINGFRAME\\UI-TargetingFrame-Skull.blp:20:20|t"; +local TAMABLE_INDICATOR = "|TInterface\\PetPaperDollFrame\\PetStable-DietIcon.blp:20:20|t |cffFFFF00Tamable|r"; +local tooltips = { + GameTooltip, ItemRefTooltip, ItemRefShoppingTooltip1, + ItemRefShoppingTooltip2, ItemRefShoppingTooltip3, AutoCompleteBox, + FriendsTooltip, ConsolidatedBuffsTooltip, ShoppingTooltip1, + ShoppingTooltip2, ShoppingTooltip3, WorldMapTooltip, + WorldMapCompareTooltip1, WorldMapCompareTooltip2, + WorldMapCompareTooltip3, DropDownList1MenuBackdrop, + DropDownList2MenuBackdrop, DropDownList3MenuBackdrop, BNToastFrame }; -local classification={ - worldboss = format("|cffAF5050 %s|r",BOSS), - rareelite = format("|cffAF5050+ %s|r",ITEM_QUALITY3_DESC), - elite = "|cffAF5050+|r", - rare = format("|cffAF5050 %s|r",ITEM_QUALITY3_DESC) +local classification = { + worldboss = format("|cffAF5050%s|r", BOSS), + rareelite = format("|cffAF5050+%s|r", ITEM_QUALITY3_DESC), + elite = "|cffAF5050+|r", + rare = format("|cffAF5050%s|r", ITEM_QUALITY3_DESC) }; --[[ ########################################################## @@ -117,26 +118,6 @@ local function TruncateString(value) end end -local function GetLevelLine(this, start) - for i = start, this:NumLines() do - local tip = _G["GameTooltipTextLeft"..i] - if tip:GetText() and tip:GetText():find(LEVEL) then - return tip - end - end -end - -local function RemoveTrashLines(this) - for i=3,this:NumLines() do - local tip = _G["GameTooltipTextLeft"..i] - local tipText = tip:GetText() - if tipText:find(PVP) or tipText:find(FACTION_ALLIANCE) or tipText:find(FACTION_HORDE) then - tip:SetText(nil) - tip:Hide() - end - end -end - local function GetTalentSpec(unit,isPlayer) local spec; if isPlayer then @@ -298,8 +279,29 @@ local function ShowInspectInfo(this,unit,unitLevel,r,g,b,iteration) end end +local function tipcleaner(this) + for i=3, this:NumLines() do + local tip = _G["GameTooltipTextLeft"..i] + local tipText = tip:GetText() + if tipText:find(PVP) or tipText:find(FACTION_ALLIANCE) or tipText:find(FACTION_HORDE) then + tip:SetText(nil) + tip:Hide() + end + end +end + +local function tiplevel(this, start) + for i = start, this:NumLines() do + local tip = _G["GameTooltipTextLeft"..i] + if tip:GetText() and tip:GetText():find(LEVEL) then + return tip + end + end +end + local _hook_GameTooltip_OnTooltipSetUnit = function(self) local unit = select(2, self:GetUnit()) + local TamablePet; if self:GetOwner() ~= UIParent and MOD.db.visibility.unitFrames ~= "NONE" then local vis = MOD.db.visibility.unitFrames; if vis == "ALL" or not (vis == "SHIFT" and IsShiftKeyDown() or vis == "CTRL" and IsControlKeyDown() or vis == "ALT" and IsAltKeyDown()) then @@ -314,50 +316,73 @@ local _hook_GameTooltip_OnTooltipSetUnit = function(self) end if not unit or not UnitExists(unit) then return end end - RemoveTrashLines(self) + tipcleaner(self) local unitLevel = UnitLevel(unit) local colors, qColor, totColor; local lvlLine; + local isShiftKeyDown = IsShiftKeyDown() + if UnitIsPlayer(unit) then local className, classToken = UnitClass(unit) local unitName, unitRealm = UnitName(unit) - local guildName, guildRankName, guildRankIndex = GetGuildInfo(unit) + local guildName, guildRankName, _, guildRealm = GetGuildInfo(unit) local pvpName = UnitPVPName(unit) local realmRelation = UnitRealmRelationship(unit) colors = RAID_CLASS_COLORS[classToken] + if MOD.db.playerTitles and pvpName then unitName = pvpName end - if unitRealm and unitRealm ~= "" then - if IsShiftKeyDown() then + if unitRealm and unitRealm ~= "" then + if(isShiftKeyDown) then unitName = unitName.."-"..unitRealm - elseif realmRelation == LE_REALM_RELATION_COALESCED then + elseif(realmRelation == LE_REALM_RELATION_COALESCED) then unitName = unitName..FOREIGN_SERVER_LABEL - elseif realmRelation == LE_REALM_RELATION_VIRTUAL then + elseif(realmRelation == LE_REALM_RELATION_VIRTUAL) then unitName = unitName..INTERACTIVE_SERVER_LABEL end - end + end + + if(UnitIsAFK(unit)) then + -- GameTooltip.mini.text:SetText(L["AFK"]) + -- GameTooltip.mini.text:SetTextColor(1, 0, 0) + -- GameTooltip:SetMiniColor(1, 1, 0) + unitName = unitName .. "" + elseif(UnitIsDND(unit)) then + -- GameTooltip.mini.text:SetText(L["DND"]) + -- GameTooltip.mini.text:SetTextColor(1, 0, 0) + -- GameTooltip:SetMiniColor(1, 1, 0) + unitName = unitName .. "" + end GameTooltipTextLeft1:SetFormattedText("|c%s%s|r", colors.colorStr, unitName) - if guildName then - if guildRankIndex and IsShiftKeyDown() and MOD.db.guildRanks then + if(guildName) then + if(guildRealm and isShiftKeyDown) then + guildName = guildName.."-"..guildRealm + end + + if guildRankName and MOD.db.guildRanks then GameTooltipTextLeft2:SetText(("<|cff00ff10%s|r> [|cff00ff10%s|r]"):format(guildName, guildRankName)) else GameTooltipTextLeft2:SetText(("<|cff00ff10%s|r>"):format(guildName)) end - lvlLine = GetLevelLine(self, 3) + lvlLine = tiplevel(self, 3) else - lvlLine = GetLevelLine(self, 2) + lvlLine = tiplevel(self, 2) end - if lvlLine then + if(lvlLine) then qColor = GetQuestDifficultyColor(unitLevel) - local race, _ = UnitRace(unit) - lvlLine:SetFormattedText("|cff%02x%02x%02x%s|r %s |c%s%s|r", qColor.r * 255, qColor.g * 255, qColor.b * 255, unitLevel > 0 and unitLevel or "??", race, colors.colorStr, className) + local race, englishRace = UnitRace(unit) + local _, factionGroup = UnitFactionGroup(unit) + if(factionGroup and englishRace == "Pandaren") then + race = factionGroup.." "..race + end + lvlLine:SetFormattedText("|cff%02x%02x%02x%s|r %s |c%s%s|r", qColor.r * 255, qColor.g * 255, qColor.b * 255, unitLevel > 0 and unitLevel or SKULL_ICON, race or "", colors.colorStr, className) end - if MOD.db.inspectInfo and IsShiftKeyDown() then + if MOD.db.inspectInfo and isShiftKeyDown then ShowInspectInfo(self, unit, unitLevel, colors.r, colors.g, colors.b, 0) end else @@ -367,10 +392,10 @@ local _hook_GameTooltip_OnTooltipSetUnit = function(self) colors = FACTION_BAR_COLORS[UnitReaction(unit, "player")] end - lvlLine = GetLevelLine(self, 2) + lvlLine = tiplevel(self, 2) - if lvlLine then - local unitType = UnitClassification(unit) + if(lvlLine) then + local creatureClassification = UnitClassification(unit) local creatureType = UnitCreatureType(unit) local temp = "" if(UnitIsWildBattlePet(unit) or UnitIsBattlePetCompanion(unit)) then @@ -391,34 +416,42 @@ local _hook_GameTooltip_OnTooltipSetUnit = function(self) if(creatureType) then local family = UnitCreatureFamily(unit) or creatureType - if(creatureType == PET_TYPE_SUFFIX[8] and SuperVillain.class == "HUNTER") then - unitCreature = family .. " |cffFFFF00Tamable|r" - else - unitCreature = family + if(SuperVillain.class == "HUNTER" and creatureType == PET_TYPE_SUFFIX[8]) then + local hunterLevel = UnitLevel("player") + if(unitLevel <= hunterLevel and IsSpellInRange("Tame Beast", unit)) then + TamablePet = true + end end + creatureType = family else - unitCreature = "" + creatureType = "" end - lvlLine:SetFormattedText("|cff%02x%02x%02x%s|r%s %s%s", qColor.r * 255, qColor.g * 255, qColor.b * 255, unitLevel > 0 and unitLevel or "??", classification[unitType] or "", unitCreature, temp) + lvlLine:SetFormattedText("|cff%02x%02x%02x%s|r%s %s%s", qColor.r * 255, qColor.g * 255, qColor.b * 255, unitLevel > 0 and unitLevel or "??", classification[creatureClassification] or "", creatureType, temp) end - end + end + if(TamablePet) then + -- GameTooltip.mini.text:SetText("Tamable") + -- GameTooltip.mini.text:SetTextColor(0.1, 1, 0.1) + -- GameTooltip:SetMiniColor(0, 0.68, 0) + GameTooltip:AddLine(TAMABLE_INDICATOR) + end if MOD.db.targetInfo then - if unit ~= "player" and UnitExists(targettarget) then - local targettarget = unit.."target" - if UnitIsPlayer(targettarget) and not UnitHasVehicleUI(targettarget) then - totColor = RAID_CLASS_COLORS[select(2, UnitClass(targettarget))] + local unitTarget = unit.."target" + if(unit ~= "player" and UnitExists(unitTarget)) then + if UnitIsPlayer(unitTarget) and not UnitHasVehicleUI(unitTarget) then + totColor = RAID_CLASS_COLORS[select(2, UnitClass(unitTarget))] else - totColor = FACTION_BAR_COLORS[UnitReaction(targettarget, "player")] + totColor = FACTION_BAR_COLORS[UnitReaction(unitTarget, "player")] end - GameTooltip:AddDoubleLine(format("%s:", TARGET), format("|cff%02x%02x%02x%s|r", totColor.r * 255, totColor.g * 255, totColor.b * 255, UnitName(targettarget))) + GameTooltip:AddDoubleLine(format("%s:", TARGET), format("|cff%02x%02x%02x%s|r", totColor.r * 255, totColor.g * 255, totColor.b * 255, UnitName(unitTarget))) end if IsInGroup() then for i = 1, GetNumGroupMembers() do - local grouptarget = IsInRaid() and "raid"..i or "party"..i; - if UnitIsUnit(grouptarget.."target", unit) and not UnitIsUnit(grouptarget, "player") then - local _, classToken = UnitClass(grouptarget) - tinsert(targetList, format("|c%s%s|r", RAID_CLASS_COLORS[classToken].colorStr, UnitName(grouptarget))) + local groupedUnit = IsInRaid() and "raid"..i or "party"..i; + if UnitIsUnit(groupedUnit.."target", unit) and not UnitIsUnit(groupedUnit, "player") then + local _, classToken = UnitClass(groupedUnit) + tinsert(targetList, format("|c%s%s|r", RAID_CLASS_COLORS[classToken].colorStr, UnitName(groupedUnit))) end end local maxTargets = #targetList; @@ -531,14 +564,14 @@ end local _hook_GameTooltip_OnTooltipSetSpell = function(self) local ref = select(3, self:GetSpell()) - if not ref or not MOD.db.spellID then return end - local text = ("|cFFCA3C3C%s|r %d"):format(ID,ref) + if not ref then return end + local text = ("|cFFCA3C3C%s|r%d"):format(ID, ref) local max = self:NumLines() local check; - for i=1,max do - local tip=_G[("GameTooltipTextLeft%d"):format(i)] + for i = 1, max do + local tip = _G[("GameTooltipTextLeft%d"):format(i)] if tip and tip:GetText() and tip:GetText():find(text) then - check=true; + check = true; break end end @@ -613,14 +646,12 @@ local _hook_OnTipCleared = function(self) end local _hook_OnTipShow = function(self) - self:SetBackdrop({ - bgFile=[[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], - edgeFile=[[Interface\BUTTONS\WHITE8X8]], - tile=false, - edgeSize=1 - }) - self:SetBackdropColor(0,0,0,0.8) - self:SetBackdropBorderColor(0,0,0) + local shown = self.mini:IsShown() + if(self.mini.text ~= "" and not shown) then + self.mini:Show() + elseif(shown) then + self.mini:Hide() + end end local _hook_OnItemRef = function(link,text,button,chatFrame) @@ -650,7 +681,8 @@ function MOD:ConstructThisPackage() GameTooltipStatusBar:SetPoint("TOPRIGHT", GameTooltip, "BOTTOMRIGHT", -1, -3) GameTooltipStatusBar.text = GameTooltipStatusBar:CreateFontString(nil, "OVERLAY") GameTooltipStatusBar.text:Point("CENTER", GameTooltipStatusBar, 0, -3) - GameTooltipStatusBar.text:SetFontTemplate(LSM:Fetch("font", MOD.db.healthBar.font), MOD.db.healthBar.fontSize, "OUTLINE") + GameTooltipStatusBar.text:SetFontTemplate(SuperVillain.Shared:Fetch("font", MOD.db.healthBar.font), MOD.db.healthBar.fontSize, "OUTLINE") + if not GameTooltipStatusBar.border then local border = CreateFrame("Frame", nil, GameTooltipStatusBar) border:WrapOuter(GameTooltipStatusBar, 1, 1) @@ -658,7 +690,8 @@ function MOD:ConstructThisPackage() border:SetBackdrop({edgeFile = [[Interface\BUTTONS\WHITE8X8]], edgeSize = 1}) border:SetBackdropBorderColor(0, 0, 0, 1) GameTooltipStatusBar.border = border - end + end + local anchor = CreateFrame("Frame", "GameTooltipAnchor", SuperVillain.UIParent) anchor:Point("BOTTOMRIGHT", RightSuperDock, "TOPRIGHT", 0, 60) anchor:Size(130, 20) @@ -672,18 +705,60 @@ function MOD:ConstructThisPackage() NewHook(GameTooltip, "SetUnitBuff", _hook_OnSetUnitAura) NewHook(GameTooltip, "SetUnitDebuff", _hook_OnSetUnitAura) NewHook(GameTooltip, "SetUnitConsolidatedBuff", _hook_OnSetHyperUnitAura) + if self.db.spellID then NewHook("SetItemRef", _hook_OnItemRef) + GameTooltip:HookScript("OnTooltipSetSpell", _hook_GameTooltip_OnTooltipSetSpell) end - GameTooltip:HookScript("OnTooltipSetSpell", _hook_GameTooltip_OnTooltipSetSpell) GameTooltip:HookScript("OnTooltipCleared", _hook_OnTipCleared) GameTooltip:HookScript("OnTooltipSetItem", _hook_GameTooltip_OnTooltipSetItem) GameTooltip:HookScript("OnTooltipSetUnit", _hook_GameTooltip_OnTooltipSetUnit) GameTooltipStatusBar:HookScript("OnValueChanged", _hook_GameTooltipStatusBar_OnValueChanged) self:RegisterEvent("MODIFIER_STATE_CHANGED", TooltipModifierChangeHandler) - for _, tooltip in pairs(tooltips)do - tooltip:HookScript("OnShow", _hook_OnTipShow) + local MINI_BG = [[Interface\Addons\SVUI\assets\artwork\Template\Tooltip\MINITIP-BG]] + local MINI_LEFT = [[Interface\Addons\SVUI\assets\artwork\Template\Tooltip\MINITIP-LEFT]] + local MINI_RIGHT = [[Interface\Addons\SVUI\assets\artwork\Template\Tooltip\MINITIP-RIGHT]] + for _, tooltip in pairs(tooltips) do + local mini = CreateFrame("Frame", nil, tooltip) + mini:Size(60,15) + mini:Point("LEFT", tooltip, "TOPLEFT", -7, 0) + mini.text = mini:CreateFontString(nil, "OVERLAY") + mini.text:FillInner(mini, 2, 2) + mini.text:SetFont(SuperVillain.Media.font.alert, 14, "OUTLINE") + mini.text:SetShadowOffset(2, -2) + mini.text:SetShadowColor(0, 0, 0, 1) + mini.bg = mini:CreateTexture(nil, "BORDER") + mini.bg:SetAllPoints(mini) + mini.bg:SetTexture(MINI_BG) + mini.left = mini:CreateTexture(nil, "BORDER") + mini.left:Size(15,15) + mini.left:Point("RIGHT", mini, "LEFT", 0, 0) + mini.left:SetTexture(MINI_LEFT) + mini.right = mini:CreateTexture(nil, "BORDER") + mini.right:Size(15,15) + mini.right:Point("LEFT", mini, "RIGHT", 0, 0) + mini.right:SetTexture(MINI_RIGHT) + tooltip.mini = mini + tooltip.mini:Hide() + tooltip:SetBackdrop({ + bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\Tooltip\TOOLTIP]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + edgeSize = 1 + }) + tooltip:SetBackdropColor(0, 0, 0, 0.8) + tooltip:SetBackdropBorderColor(0, 0, 0) + tooltip.SetBackdrop = function() end + tooltip.SetBackdropColor = function() end + tooltip.SetBackdropBorderColor = function() end + tooltip.SetMiniColor = function(self, r, g, b) + self.mini.bg:SetVertexColor(r,g,b) + self.mini.left:SetVertexColor(r,g,b) + self.mini.right:SetVertexColor(r,g,b) + end + + --tooltip:HookScript("OnShow", _hook_OnTipShow) end end SuperVillain.Registry:NewPackage(MOD, "SVTip") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index 3cf92cf..3c7f616 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -31,120 +31,141 @@ local find, format, upper = string.find, string.format, string.upper; local match, gsub = string.match, string.gsub; --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; +--[[ LOCALIZED BLIZZ FUNCTIONS ]]-- +local NewHook = hooksecurefunc; --[[ ########################################################## -GET ADDON DATA +GET ADDON DATA AND TEST FOR oUF ########################################################## ]]-- local SuperVillain, L = unpack(select(2, ...)); local _, ns = ... local oUF_SuperVillain = ns.oUF assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local MOD = {} -local LSM = LibStub("LibSharedMedia-3.0") -local NewHook = hooksecurefunc; ---[[ -########################################################## -MODULE DATA -########################################################## -]]-- -local LoadedBasicFrames, LoadedGroupFrames, LoadedExtraFrames; --[[ ########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- -local dummy = CreateFrame("Frame") -dummy:Hide() -local KillBlizzardUnit = function(unit) - local frame; - if type(unit) == "string" then frame = _G[unit] else frame = unit end - if frame then - frame:UnregisterAllEvents() - frame:Hide() - frame:SetParent(dummy) - local h = frame.healthbar; - if h then h:UnregisterAllEvents()end - local m = frame.manabar; - if m then m:UnregisterAllEvents()end - local s = frame.spellbar; - if s then s:UnregisterAllEvents()end - local p = frame.powerBarAlt; - if p then p:UnregisterAllEvents()end - end -end ---[[ -########################################################## -INNER CLASSES +MODULE AND INNER CLASSES ########################################################## ]]-- +local MOD = {} MOD.Units = {} MOD.Headers = {} MOD.Construct = {} MOD.FrameUpdate = {} MOD.HeaderUpdate = {} -MOD.VisibilityUpdate = {} +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local LoadedUnitFrames, LoadedGroupHeaders; --[[ ########################################################## CORE FUNCTIONS ########################################################## ]]-- -function oUF_SuperVillain:DisableBlizzard(unit) - if (not unit) or InCombatLockdown() then return end - if (unit == "player") then - KillBlizzardUnit(PlayerFrame) - PlayerFrame:RegisterUnitEvent("UNIT_ENTERING_VEHICLE", "player") - PlayerFrame:RegisterUnitEvent("UNIT_ENTERED_VEHICLE", "player") - PlayerFrame:RegisterUnitEvent("UNIT_EXITING_VEHICLE", "player") - PlayerFrame:RegisterUnitEvent("UNIT_EXITED_VEHICLE", "player") - PlayerFrame:RegisterEvent("PLAYER_ENTERING_WORLD") - PlayerFrame:SetUserPlaced(true) - PlayerFrame:SetDontSavePosition(true) - RuneFrame:SetParent(PlayerFrame) - elseif(unit == "pet") then - KillBlizzardUnit(PetFrame) - elseif(unit == "target") then - KillBlizzardUnit(TargetFrame) - KillBlizzardUnit(ComboFrame) - elseif(unit == "focus") then - KillBlizzardUnit(FocusFrame) - KillBlizzardUnit(TargetofFocusFrame) - elseif(unit == "targettarget") then - KillBlizzardUnit(TargetFrameToT) - elseif(unit:match("(boss)%d?$") == "boss") then - local id = unit:match("boss(%d)") - if(id) then - KillBlizzardUnit("Boss"..id.."TargetFrame") - else - for i = 1, 4 do - KillBlizzardUnit(("Boss%dTargetFrame"):format(i)) +do + local dummy = CreateFrame("Frame", nil) + dummy:Hide() + + local function deactivate(unitName) + local frame; + if type(unitName) == "string" then frame = _G[unitName] else frame = unitName end + if frame then + frame:UnregisterAllEvents() + frame:Hide() + frame:SetParent(dummy) + if frame.healthbar then frame.healthbar:UnregisterAllEvents() end + if frame.manabar then frame.manabar:UnregisterAllEvents() end + if frame.spellbar then frame.spellbar:UnregisterAllEvents() end + if frame.powerBarAlt then frame.powerBarAlt:UnregisterAllEvents() end + end + end + + function oUF_SuperVillain:DisableBlizzard(unit) + if (not unit) or InCombatLockdown() then return end + + if (unit == "player") then + deactivate(PlayerFrame) + PlayerFrame:RegisterUnitEvent("UNIT_ENTERING_VEHICLE", "player") + PlayerFrame:RegisterUnitEvent("UNIT_ENTERED_VEHICLE", "player") + PlayerFrame:RegisterUnitEvent("UNIT_EXITING_VEHICLE", "player") + PlayerFrame:RegisterUnitEvent("UNIT_EXITED_VEHICLE", "player") + PlayerFrame:RegisterEvent("PLAYER_ENTERING_WORLD") + + PlayerFrame:SetUserPlaced(true) + PlayerFrame:SetDontSavePosition(true) + RuneFrame:SetParent(PlayerFrame) + elseif(unit == "pet") then + deactivate(PetFrame) + elseif(unit == "target") then + deactivate(TargetFrame) + deactivate(ComboFrame) + elseif(unit == "focus") then + deactivate(FocusFrame) + deactivate(TargetofFocusFrame) + elseif(unit == "targettarget") then + deactivate(TargetFrameToT) + elseif(unit:match("(boss)%d?$") == "boss") then + local id = unit:match("boss(%d)") + if(id) then + deactivate("Boss"..id.."TargetFrame") + else + for i = 1, 4 do + deactivate(("Boss%dTargetFrame"):format(i)) + end end - end - elseif(unit:match("(party)%d?$") == "party") then - local id = unit:match("party(%d)") - if(id) then - KillBlizzardUnit("PartyMemberFrame"..id) - else - for i = 1, 4 do - KillBlizzardUnit(("PartyMemberFrame%d"):format(i)) + elseif(unit:match("(party)%d?$") == "party") then + local id = unit:match("party(%d)") + if(id) then + deactivate("PartyMemberFrame"..id) + else + for i = 1, 4 do + deactivate(("PartyMemberFrame%d"):format(i)) + end end - end - elseif(unit:match("(arena)%d?$") == "arena") then - local id = unit:match("arena(%d)") - if(id) then - KillBlizzardUnit("ArenaEnemyFrame"..id) - KillBlizzardUnit("ArenaPrepFrame"..id) - KillBlizzardUnit("ArenaEnemyFrame"..id.."PetFrame") - else - for i = 1, 5 do - KillBlizzardUnit(("ArenaEnemyFrame%d"):format(i)) - KillBlizzardUnit(("ArenaPrepFrame%d"):format(i)) - KillBlizzardUnit(("ArenaEnemyFrame%dPetFrame"):format(i)) + elseif(unit:match("(arena)%d?$") == "arena") then + local id = unit:match("arena(%d)") + if(id) then + deactivate("ArenaEnemyFrame"..id) + deactivate("ArenaPrepFrame"..id) + deactivate("ArenaEnemyFrame"..id.."PetFrame") + else + for i = 1, 5 do + deactivate(("ArenaEnemyFrame%d"):format(i)) + deactivate(("ArenaPrepFrame%d"):format(i)) + deactivate(("ArenaEnemyFrame%dPetFrame"):format(i)) + end end end end end +local StandardUnitStyle = function(self, unit) + self:SetScript("OnEnter", UnitFrame_OnEnter) + self:SetScript("OnLeave", UnitFrame_OnLeave) + self:SetFrameLevel(2) + self.unit = unit + local key = unit:gsub("%d", "") + self.___key = key + MOD.Construct[key](self); + return self +end + +local EnemyUnitStyle = function(self, unit) + self:SetScript("OnEnter", UnitFrame_OnEnter) + self:SetScript("OnLeave", UnitFrame_OnLeave) + self:SetFrameLevel(2) + self.unit = unit + local index = unit:match("(%d)") + self.index = index + self:SetID(index) + local key = unit:gsub("%d", "") + self.___key = key + MOD.Construct[key](self); + return self +end + function MOD:DetachSubFrames(...) for i = 1, select("#", ...) do local frame = select(i,...) @@ -244,22 +265,21 @@ function MOD:RefreshUnitColors() oUF_SuperVillain.colors.smooth = {1, 0, 0, 1, 1, 0, r, g, b} end -function MOD:RefreshUnitMedia(frame) - local db = self.db - if(not (db and db.enable) or not frame) then return end - local CURRENT_BAR_TEXTURE = LSM:Fetch("statusbar", db.statusbar) - local CURRENT_AURABAR_TEXTURE = LSM:Fetch("statusbar", db.auraBarStatusbar); - local CURRENT_FONT = LSM:Fetch("font", db.font) - local CURRENT_AURABAR_FONT = LSM:Fetch("font", db.auraFont); +local RefreshUnitMedia = function(self) + local db = MOD.db + if(not (db and db.enable) or not self) then return end + local CURRENT_BAR_TEXTURE = SuperVillain.Shared:Fetch("statusbar", db.statusbar) + local CURRENT_AURABAR_TEXTURE = SuperVillain.Shared:Fetch("statusbar", db.auraBarStatusbar); + local CURRENT_FONT = SuperVillain.Shared:Fetch("font", db.font) + local CURRENT_AURABAR_FONT = SuperVillain.Shared:Fetch("font", db.auraFont); local CURRENT_AURABAR_FONTSIZE = db.auraFontSize local CURRENT_AURABAR_FONTOUTLINE = db.auraFontOutline - local key = frame.datakey - local unitDB = db[key] + local unitDB = db[self.___key] if(unitDB and unitDB.enable) then - local panel = frame.InfoPanel + local panel = self.InfoPanel if(panel) then if(panel.Name and unitDB.name) then - panel.Name:SetFont(LSM:Fetch("font", unitDB.name.font), unitDB.name.fontSize, unitDB.name.fontOutline) + panel.Name:SetFont(SuperVillain.Shared:Fetch("font", unitDB.name.font), unitDB.name.fontSize, unitDB.name.fontOutline) end if(panel.Health) then panel.Health:SetFont(CURRENT_FONT, db.fontSize, db.fontOutline) @@ -271,64 +291,66 @@ function MOD:RefreshUnitMedia(frame) panel.Misc:SetFont(CURRENT_FONT, db.fontSize, db.fontOutline) end end - if(frame.Power and (unitDB.power and unitDB.power.enable)) then - frame.Power:SetStatusBarTexture(CURRENT_BAR_TEXTURE) + if(self.Health and (unitDB.health and unitDB.health.enable)) then + self.Health:SetStatusBarTexture(CURRENT_BAR_TEXTURE) end - if(frame.AuraBars and (unitDB.aurabar and unitDB.aurabar.enable)) then - local ab = frame.AuraBars + if(self.Power and (unitDB.power and unitDB.power.enable)) then + self.Power:SetStatusBarTexture(CURRENT_BAR_TEXTURE) + end + if(self.AuraBars and (unitDB.aurabar and unitDB.aurabar.enable)) then + local ab = self.AuraBars ab.auraBarTexture = CURRENT_AURABAR_TEXTURE ab.textFont = CURRENT_AURABAR_FONT ab.textSize = db.auraFontSize ab.textOutline = db.auraFontOutline end - if(frame.Buffs and (unitDB.buffs and unitDB.buffs.enable)) then - local buffs = frame.Buffs + if(self.Buffs and (unitDB.buffs and unitDB.buffs.enable)) then + local buffs = self.Buffs buffs.textFont = CURRENT_AURABAR_FONT buffs.textSize = db.auraFontSize buffs.textOutline = db.auraFontOutline end - if(frame.Debuffs and (unitDB.debuffs and unitDB.debuffs.enable)) then - local debuffs = frame.Debuffs + if(self.Debuffs and (unitDB.debuffs and unitDB.debuffs.enable)) then + local debuffs = self.Debuffs debuffs.textFont = CURRENT_AURABAR_FONT debuffs.textSize = db.auraFontSize debuffs.textOutline = db.auraFontOutline end + if(self.RaidDebuffs) then + local rdebuffs = self.RaidDebuffs; + if db.rdebuffs.enable then + rdebuffs.count:SetFontTemplate(CURRENT_AURABAR_FONT, db.auraFontSize, db.auraFontOutline) + rdebuffs.time:SetFontTemplate(CURRENT_AURABAR_FONT, db.auraFontSize, db.auraFontOutline) + end + end end end function MOD:RefreshAllUnitMedia() if(not self.db or (self.db and self.db.enable ~= true)) then return end self:RefreshUnitColors() - -- [[ FRAMES ]] -- - for _,frame in pairs(self.Units)do - local key = frame.datakey - if self.db[key].enable then + for unit,frame in pairs(self.Units)do + if self.db[frame.___key].enable then frame:MediaUpdate() end end - for _,group in pairs(self.Headers) do group:MediaUpdate() end - collectgarbage("collect") - INIT_UPDATE = false end function MOD:RefreshUnitFrames() if SuperVillain.db['SVUnit'].enable~=true then return end self:RefreshUnitColors() - for unit,frame in pairs(self.Units)do - local key = frame.datakey - if self.db[key].enable then + if self.db[frame.___key].enable then frame:Enable() frame:Update() else frame:Disable() end end - local _,groupType = IsInInstance() local raidDebuffs = ns.oUF_RaidDebuffs or oUF_RaidDebuffs; if raidDebuffs then @@ -339,75 +361,72 @@ function MOD:RefreshUnitFrames() raidDebuffs:RegisterDebuffs(SuperVillain.Filters["CC"]) end end - for _,group in pairs(self.Headers) do group:Update() if group.SetConfigEnvironment then group:SetConfigEnvironment() end end - if SuperVillain.db.SVUnit.disableBlizzard then oUF_SuperVillain:DisableBlizzard('party') end - collectgarbage("collect") end -function MOD:SetBasicFrame(unit) - assert(unit, "No unit provided to create or update.") +function MOD:SetUnitFrame(unitKey) if InCombatLockdown() then self:FrameForge() return end - local realName = unit:gsub("(.)", upper, 1); - realName = realName:gsub("t(arget)", "T%1"); - if not self.Units[unit] then - self.Units[unit] = oUF_SuperVillain:Spawn(unit, "SVUI_"..realName) - end - self.Units[unit].Update = function() - self.FrameUpdate[unit](MOD, unit, MOD.Units[unit], MOD.db[unit]) - end - self.Units[unit].MediaUpdate = function() - self:RefreshUnitMedia(MOD.Units[unit]) - end - if self.Units[unit]:GetParent() ~= SVUI_UnitFrameParent then - self.Units[unit]:SetParent(SVUI_UnitFrameParent) - end - if self.db[unit].enable then - self.Units[unit]:Enable() - self.Units[unit].Update() + local unit = unitKey + local realName = unit:gsub("(.)", upper, 1) + realName = realName:gsub("t(arget)", "T%1") + local frame = self.Units[unit] + if not frame then + oUF_SuperVillain:SetActiveStyle("SVUI_UnitFrame") + frame = oUF_SuperVillain:Spawn(unit, "SVUI_"..realName) + frame.Update = self.FrameUpdate[unitKey] + frame.MediaUpdate = RefreshUnitMedia + self.Units[unit] = frame + end + if frame:GetParent() ~= SVUI_UnitFrameParent then + frame:SetParent(SVUI_UnitFrameParent) + end + if self.db[unitKey].enable then + frame:Enable() + frame:Update() else - self.Units[unit]:Disable() - end + frame:Disable() + end end -function MOD:SetExtraFrame(name, count) +function MOD:SetEnemyFrames(unitKey, maxCount) if InCombatLockdown() then self:FrameForge() return end - - for i = 1, count do - local unit = name..i; + for i = 1, maxCount do + local unit = unitKey..i local realName = unit:gsub("(.)", upper, 1) realName = realName:gsub("t(arget)", "T%1") - if not self.Units[unit] then - self.Units[unit] = oUF_SuperVillain:Spawn(unit, "SVUI_"..realName) - self.Units[unit].index = i; - self.Units[unit]:SetParent(SVUI_UnitFrameParent) - self.Units[unit]:SetID(i) + local frame = self.Units[unit] + if not frame then + oUF_SuperVillain:SetActiveStyle("SVUI_EnemyFrame") + frame = oUF_SuperVillain:Spawn(unit, "SVUI_"..realName) + frame.___key = unitKey + frame.Update = self.FrameUpdate[unitKey] + frame.MediaUpdate = RefreshUnitMedia + frame.i = i; + frame:SetID(i) + self.Units[unit] = frame end - self.Units[unit].Update = function() - self.FrameUpdate[name](MOD, unit, MOD.Units[unit], MOD.db[name]) + if frame:GetParent() ~= SVUI_UnitFrameParent then + frame:SetParent(SVUI_UnitFrameParent) end - self.Units[unit].MediaUpdate = function() - self:RefreshUnitMedia(MOD.Units[unit]) + if frame.isForced then + self:AllowElement(frame) end - if self.db[name].enable then - self.Units[unit]:Enable() - self.Units[unit].Update() - if self.Units[unit].isForced then - self:AllowElement(MOD.Units[unit]) - end + if self.db[unitKey].enable then + frame:Enable() + frame:Update() else - self.Units[unit]:Disable() - end - end + frame:Disable() + end + end end do @@ -439,56 +458,56 @@ do }; local _GSORT = { - ['CLASS']=function(frame) - frame:SetAttribute("groupingOrder","DEATHKNIGHT,DRUID,HUNTER,MAGE,PALADIN,PRIEST,SHAMAN,WARLOCK,WARRIOR,MONK") - frame:SetAttribute('sortMethod','NAME') - frame:SetAttribute("sortMethod",'CLASS') + ['CLASS']=function(self) + self:SetAttribute("groupingOrder","DEATHKNIGHT,DRUID,HUNTER,MAGE,PALADIN,PRIEST,SHAMAN,WARLOCK,WARRIOR,MONK") + self:SetAttribute('sortMethod','NAME') + self:SetAttribute("sortMethod",'CLASS') end, - ['MTMA']=function(frame) - frame:SetAttribute("groupingOrder","MAINTANK,MAINASSIST,NONE") - frame:SetAttribute('sortMethod','NAME') - frame:SetAttribute("sortMethod",'ROLE') + ['MTMA']=function(self) + self:SetAttribute("groupingOrder","MAINTANK,MAINASSIST,NONE") + self:SetAttribute('sortMethod','NAME') + self:SetAttribute("sortMethod",'ROLE') end, - ['ROLE']=function(frame) - frame:SetAttribute("groupingOrder","TANK,HEALER,DAMAGER,NONE") - frame:SetAttribute('sortMethod','NAME') - frame:SetAttribute("sortMethod",'ASSIGNEDROLE') + ['ROLE']=function(self) + self:SetAttribute("groupingOrder","TANK,HEALER,DAMAGER,NONE") + self:SetAttribute('sortMethod','NAME') + self:SetAttribute("sortMethod",'ASSIGNEDROLE') end, - ['ROLE_TDH']=function(frame) - frame:SetAttribute("groupingOrder","TANK,DAMAGER,HEALER,NONE") - frame:SetAttribute('sortMethod','NAME') - frame:SetAttribute("sortMethod",'ASSIGNEDROLE') + ['ROLE_TDH']=function(self) + self:SetAttribute("groupingOrder","TANK,DAMAGER,HEALER,NONE") + self:SetAttribute('sortMethod','NAME') + self:SetAttribute("sortMethod",'ASSIGNEDROLE') end, - ['ROLE_HTD']=function(frame) - frame:SetAttribute("groupingOrder","HEALER,TANK,DAMAGER,NONE") - frame:SetAttribute('sortMethod','NAME') - frame:SetAttribute("sortMethod",'ASSIGNEDROLE') + ['ROLE_HTD']=function(self) + self:SetAttribute("groupingOrder","HEALER,TANK,DAMAGER,NONE") + self:SetAttribute('sortMethod','NAME') + self:SetAttribute("sortMethod",'ASSIGNEDROLE') end, - ['ROLE_HDT']=function(frame) - frame:SetAttribute("groupingOrder","HEALER,DAMAGER,TANK,NONE") - frame:SetAttribute('sortMethod','NAME') - frame:SetAttribute("sortMethod",'ASSIGNEDROLE') + ['ROLE_HDT']=function(self) + self:SetAttribute("groupingOrder","HEALER,DAMAGER,TANK,NONE") + self:SetAttribute('sortMethod','NAME') + self:SetAttribute("sortMethod",'ASSIGNEDROLE') end, - ['NAME']=function(frame) - frame:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") - frame:SetAttribute('sortMethod','NAME') - frame:SetAttribute("sortMethod",nil) + ['NAME']=function(self) + self:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") + self:SetAttribute('sortMethod','NAME') + self:SetAttribute("sortMethod",nil) end, - ['GROUP']=function(frame) - frame:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") - frame:SetAttribute('sortMethod','INDEX') - frame:SetAttribute("sortMethod",'GROUP') + ['GROUP']=function(self) + self:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") + self:SetAttribute('sortMethod','INDEX') + self:SetAttribute("sortMethod",'GROUP') end, - ['PETNAME']=function(frame) - frame:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") - frame:SetAttribute('sortMethod','NAME') - frame:SetAttribute("sortMethod",nil) - frame:SetAttribute("filterOnPet",true) + ['PETNAME']=function(self) + self:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") + self:SetAttribute('sortMethod','NAME') + self:SetAttribute("sortMethod",nil) + self:SetAttribute("filterOnPet",true) end }; - local function dbMapping(frame) - local db = MOD.db[frame.NameKey] + local function dbMapping(self) + local db = MOD.db[self.___key] if(db.showBy == "UP") then db.showBy = "UP_RIGHT" end @@ -497,58 +516,11 @@ do end end - local function AppendUpdateHandler(unit) - return function() - local header = MOD.Headers[unit] - local db = MOD.db[unit] - if db.enable ~= true then - UnregisterAttributeDriver(header, "state-visibility") - header:Hide() - return - end - MOD.HeaderUpdate[unit](MOD, header, db) - for i = 1, header:GetNumChildren()do - local childFrame = select(i, header:GetChildren()) - MOD.FrameUpdate[unit](MOD, childFrame, MOD.db[unit]) - if _G[childFrame:GetName().."Target"]then - MOD.FrameUpdate[unit](MOD, _G[childFrame:GetName().."Target"], MOD.db[unit]) - end - if _G[childFrame:GetName().."Pet"]then - MOD.FrameUpdate[unit](MOD, _G[childFrame:GetName().."Pet"], MOD.db[unit]) - end - end - end - end - - local SecureHeaderUpdate = function(self) - local unit = self.NameKey; - local db = MOD.db[unit] - MOD.HeaderUpdate[unit](MOD, self, db) - - local index = 1; - local childFrame = self:GetAttribute("child"..index) - while childFrame do - MOD.FrameUpdate[unit](MOD, childFrame, db) - if _G[childFrame:GetName().."Pet"] then - MOD.FrameUpdate[unit](MOD, _G[childFrame:GetName().."Pet"], db) - end - - if _G[childFrame:GetName().."Target"] then - MOD.FrameUpdate[unit](MOD, _G[childFrame:GetName().."Target"], db) - end - - index = index + 1; - childFrame = self:GetAttribute("child"..index) - end - end - local SecureHeaderMediaUpdate = function(self) - local unit = self.NameKey; - local db = MOD.db[unit] local index = 1; local childFrame = self:GetAttribute("child"..index) while childFrame do - MOD:RefreshUnitMedia(childFrame) + RefreshUnitMedia(childFrame) index = index + 1; childFrame = self:GetAttribute("child"..index) end @@ -577,11 +549,10 @@ do self:SetAttribute("yOffset", nil) end - function MOD:SpawnGroupHeader(parentFrame, filter, realName, template1, secureName, template2) - local name = parentFrame.NameKey or secureName; - local db = MOD.db[name] - local frameName = name:gsub("(.)", upper, 1) - oUF_SuperVillain:SetActiveStyle("SVUI_" .. frameName) + function MOD:SpawnGroupHeader(parentFrame, filter, realName, template1, headerName, template2) + local db = MOD.db[headerName] + local selfName = headerName:gsub("(.)", upper, 1) + oUF_SuperVillain:SetActiveStyle("SVUI_" .. selfName) local groupUnit = oUF_SuperVillain:SpawnHeader(realName, template2, nil, "oUF-initialConfigFunction", ("self:SetWidth(%d); self:SetHeight(%d); self:SetFrameLevel(5)"):format(db.width, db.height), "groupFilter", filter, @@ -590,24 +561,23 @@ do "showSolo", true, template1 and "template", template1 ); - groupUnit.NameKey = name; + groupUnit.___key = headerName; groupUnit:SetParent(parentFrame) groupUnit:Show() - groupUnit.Update = SecureHeaderUpdate + groupUnit.Update = self.HeaderUpdate[headerName] groupUnit.MediaUpdate = SecureHeaderMediaUpdate groupUnit.ClearAllAttributes = SecureHeaderClear return groupUnit end local GroupSetConfigEnvironment = function(self) - local headerName = self.NameKey - local db = MOD.db[headerName] + local db = MOD.db[self.___key] local anchorPoint; local widthCalc, heightCalc, xCalc, yCalc = 0, 0, 0, 0; local sorting = db.showBy; local pointMap = _POINTMAP[sorting] local point1, point2, point3, point4, point5, horizontal, vertical, isHorizontal = pointMap[1], pointMap[2], pointMap[3], pointMap[4], pointMap[5], pointMap[6], pointMap[7], pointMap[8]; - for i = 1, db.gCount do + for i = 1, db.groupCount do local frame = self.subunits[i] --<< if frame then dbMapping(frame) @@ -622,14 +592,14 @@ do end if not frame.isForced then if not frame.initialized then - frame:SetAttribute("startingIndex", db.rSort and (-min(db.gCount * db.gRowCol * 5, MAX_RAID_MEMBERS) + 1) or -4) + frame:SetAttribute("startingIndex", db.customSorting and (-min(db.groupCount * db.gRowCol * 5, MAX_RAID_MEMBERS) + 1) or -4) frame:Show() frame.initialized = true end frame:SetAttribute("startingIndex", 1) end frame:ClearAllPoints() - if db.rSort and db.invertGroupingOrder then + if db.customSorting and db.invertGroupingOrder then frame:SetAttribute("columnAnchorPoint", point4) else frame:SetAttribute("columnAnchorPoint", point3) @@ -637,20 +607,20 @@ do MOD:DetachSubFrames(frame:GetChildren()) frame:SetAttribute("point", point1) if not frame.isForced then - frame:SetAttribute("maxColumns", db.rSort and db.gCount or 1) - frame:SetAttribute("unitsPerColumn", db.rSort and (db.gRowCol * 5) or 5) + frame:SetAttribute("maxColumns", db.customSorting and db.groupCount or 1) + frame:SetAttribute("unitsPerColumn", db.customSorting and (db.gRowCol * 5) or 5) _GSORT[db.sortMethod](frame) frame:SetAttribute("sortDir", db.sortDir) frame:SetAttribute("showPlayer", db.showPlayer) end - if i == 1 and db.rSort then + if i == 1 and db.customSorting then frame:SetAttribute("groupFilter", "1, 2, 3, 4, 5, 6, 7, 8") else frame:SetAttribute("groupFilter", tostring(i)) end end local anchorPoint = point2 - if db.rSort and db.startFromCenter then + if db.customSorting and db.startFromCenter then anchorPoint = point5 end if (i - 1) % db.gRowCol == 0 then @@ -699,41 +669,39 @@ do self:SetSize(widthCalc - db.wrapXOffset, heightCalc - db.wrapYOffset) end - local GroupUpdate = function(self) --<< - local headerName = self.NameKey - local header = MOD.Headers[headerName] - if MOD.db[headerName].enable ~= true then - UnregisterAttributeDriver(header, "state-visibility") - header:Hide() + local GroupUpdate = function(group) --<< + local key = group.___key + if MOD.db[key].enable ~= true then + UnregisterAttributeDriver(group, "state-visibility") + group:Hide() return end - for i=1,#self.subunits do - self.subunits[i]:Update() + for i=1,#group.subunits do + group.subunits[i]:Update() end end - local GroupMediaUpdate = function(self) --<< - for i=1,#self.subunits do - self.subunits[i]:MediaUpdate() + local GroupMediaUpdate = function(group) + for i=1,#group.subunits do + group.subunits[i]:MediaUpdate() end end - local GroupSetActiveState = function(self) --<< + local GroupSetActiveState = function(self) if not self.isForced then - local key = self.NameKey - local db = MOD.db[key] + local db = MOD.db[self.___key] if(db) then for i=1,#self.subunits do - local frame = self.subunits[i] - if i <= db.gCount and db.rSort and i <= 1 or not db.rSort then - frame:Show() + local self = self.subunits[i] + if i <= db.groupCount and db.customSorting and i <= 1 or not db.customSorting then + self:Show() else - if frame.forceShow then - frame:Hide() - MOD:RestrictChildren(frame, frame:GetChildren()) - frame:SetAttribute('startingIndex',1) + if self.forceShow then + self:Hide() + MOD:RestrictChildren(self, self:GetChildren()) + self:SetAttribute('startingIndex',1) else - frame:ClearAllAttributes() + self:ClearAllAttributes() end end end @@ -745,49 +713,56 @@ do if not self.db[header] then return end local db = self.db[header] - local realName + local realName = header:gsub("(.)", upper, 1) - if not self.Headers[header] then - realName = header:gsub("(.)", upper, 1) - oUF_SuperVillain:RegisterStyle("SVUI_"..realName, MOD.Construct[header]) + local frame = self.Headers[header] + if(not frame) then + oUF_SuperVillain:RegisterStyle("SVUI_"..realName, function(self, unit) + self.unit = unit + self.___key = header + MOD.Construct[header](self) + return self + end) oUF_SuperVillain:SetActiveStyle("SVUI_"..realName) - if db.gCount then - self.Headers[header] = CreateFrame("Frame", "SVUI_"..realName, SVUI_UnitFrameParent, "SecureHandlerStateTemplate") - self.Headers[header].subunits = {} - self.Headers[header].NameKey = header; - self.Headers[header].SetConfigEnvironment = GroupSetConfigEnvironment - self.Headers[header].Update = GroupUpdate - self.Headers[header].MediaUpdate = GroupMediaUpdate - self.Headers[header].SetActiveState = GroupSetActiveState - else - self.Headers[header] = self:SpawnGroupHeader(SVUI_UnitFrameParent, filter, "SVUI_"..realName, template1, header, template2) + if(header == "tank" or header == "assist") then + frame = self:SpawnGroupHeader(SVUI_UnitFrameParent, filter, "SVUI_"..realName, template1, header, template2) + frame.___key = header + frame.Update = self.HeaderUpdate[header] + frame.MediaUpdate = GroupMediaUpdate + else + frame = CreateFrame("Frame", "SVUI_"..realName, SVUI_UnitFrameParent, "SecureHandlerStateTemplate") + frame.subunits = {} + if db.customSorting then + if not frame.subunits[1] then + frame.subunits[1] = self:SpawnGroupHeader(frame, 1, "SVUI_" .. realName .. "Group1", template1, header, template2) + end + else + for i = 1, db.groupCount do + if(not frame.subunits[i]) then + frame.subunits[i] = self:SpawnGroupHeader(frame, i, "SVUI_" .. realName .. "Group"..i, template1, header, template2) + end + end + end + frame.___key = header; + frame.SetConfigEnvironment = GroupSetConfigEnvironment + frame.Update = GroupUpdate + frame.MediaUpdate = GroupMediaUpdate + frame.SetActiveState = GroupSetActiveState end - self.Headers[header]:Show() + frame:Show() + self.Headers[header] = frame end - local frame = self.Headers[header] - - if db.gCount then - local xname = frame.NameKey - realName = xname:gsub("(.)", upper, 1) + if(header == "tank" or header == "assist") then + frame:Update() + else if(db.enable ~= true and header ~= "raidpet") then UnregisterStateDriver(frame, "visibility") frame:Hide() return end - if db.rSort then - if not frame.subunits[1] then - frame.subunits[1] = MOD:SpawnGroupHeader(frame, 1, "SVUI_" .. realName .. "Group1", template1, nil, template2) - end - else - while db.gCount > #frame.subunits do - local index = tostring(#frame.subunits + 1) - tinsert(frame.subunits, MOD:SpawnGroupHeader(frame, index, "SVUI_" .. realName .. "Group"..index, template1, nil, template2)) - end - end - if frame.SetActiveState then frame:SetActiveState() end @@ -802,42 +777,30 @@ do frame:Update() end - if(db.enable ~= true and header == "raidpet") then + if(db.enable ~= true and header == "raidpet") then UnregisterStateDriver(frame, "visibility") frame:Hide() return end - else - frame.Update = AppendUpdateHandler(header) - - if forceUpdate then - self.HeaderUpdate[xname](MOD, frame, db) - else - frame.Update() - end end end end function MOD:FrameForge() - if not LoadedBasicFrames then - self:SetBasicFrame("player") - self:SetBasicFrame("pet") - self:SetBasicFrame("pettarget") - self:SetBasicFrame("target") - self:SetBasicFrame("targettarget") - self:SetBasicFrame("focus") - self:SetBasicFrame("focustarget") - LoadedBasicFrames = true; - end - - if not LoadedExtraFrames then - self:SetExtraFrame("boss", MAX_BOSS_FRAMES) - self:SetExtraFrame("arena", 5) - LoadedExtraFrames = true; - end - - if not LoadedGroupFrames then + if not LoadedUnitFrames then + self:SetUnitFrame("player") + self:SetUnitFrame("pet") + self:SetUnitFrame("pettarget") + self:SetUnitFrame("target") + self:SetUnitFrame("targettarget") + self:SetUnitFrame("focus") + self:SetUnitFrame("focustarget") + self:SetEnemyFrames("boss", MAX_BOSS_FRAMES) + self:SetEnemyFrames("arena", 5) + LoadedUnitFrames = true; + end + + if not LoadedGroupHeaders then self:SetGroupFrame("raid10") self:SetGroupFrame("raid25") self:SetGroupFrame("raid40") @@ -845,11 +808,11 @@ function MOD:FrameForge() self:SetGroupFrame("party", nil, "SVUI_UNITPET, SVUI_UNITTARGET") self:SetGroupFrame("tank", "MAINTANK", "SVUI_UNITTARGET") self:SetGroupFrame("assist", "MAINASSIST", "SVUI_UNITTARGET") - LoadedGroupFrames = true + LoadedGroupHeaders = true end - MOD:UnProtect("FrameForge"); - MOD:Protect("RefreshUnitFrames"); + self:UnProtect("FrameForge"); + self:Protect("RefreshUnitFrames"); end function MOD:KillBlizzardRaidFrames() @@ -899,7 +862,7 @@ BUILD FUNCTION / UPDATE ########################################################## ]]-- function MOD:UpdateThisPackage() - self:RefreshUnitFrames() + --self:RefreshUnitFrames() end function MOD:ConstructThisPackage() @@ -908,16 +871,8 @@ function MOD:ConstructThisPackage() local SVUI_UnitFrameParent = CreateFrame("Frame", "SVUI_UnitFrameParent", SuperVillain.UIParent, "SecureHandlerStateTemplate") RegisterStateDriver(SVUI_UnitFrameParent, "visibility", "[petbattle] hide; show") - oUF_SuperVillain:RegisterStyle("oUF_SuperVillain", function(frame, unit) - frame:SetScript("OnEnter", UnitFrame_OnEnter) - frame:SetScript("OnLeave", UnitFrame_OnLeave) - frame:SetFrameLevel(2) - local frameName = unit - if(unit:find("arena")) then frameName = "arena" end - if(unit:find("boss")) then frameName = "boss" end - MOD.Construct[frameName](MOD, frame, unit); - return frame - end) + oUF_SuperVillain:RegisterStyle("SVUI_UnitFrame", StandardUnitStyle) + oUF_SuperVillain:RegisterStyle("SVUI_EnemyFrame", EnemyUnitStyle) self:Protect("FrameForge", true) self:RegisterEvent("PLAYER_ENTERING_WORLD") diff --git a/Interface/AddOns/SVUI/packages/unit/class/deathknight.lua b/Interface/AddOns/SVUI/packages/unit/class/deathknight.lua index 3e94076..2a9709f 100644 --- a/Interface/AddOns/SVUI/packages/unit/class/deathknight.lua +++ b/Interface/AddOns/SVUI/packages/unit/class/deathknight.lua @@ -61,8 +61,7 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local key = self.datakey - local db = MOD.db[key] + local db = MOD.db.player local bar = self.Runes; local max = self.MaxClassPower; local height = db.classbar.height diff --git a/Interface/AddOns/SVUI/packages/unit/class/druid.lua b/Interface/AddOns/SVUI/packages/unit/class/druid.lua index b7c550a..59a9872 100644 --- a/Interface/AddOns/SVUI/packages/unit/class/druid.lua +++ b/Interface/AddOns/SVUI/packages/unit/class/druid.lua @@ -42,7 +42,6 @@ local oUF_SuperVillain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local LSM = LibStub("LibSharedMedia-3.0") --[[ ########################################################## DRUID ALT MANA @@ -86,7 +85,7 @@ local function CreateAltMana(playerFrame, eclipse) bar.bg.multiplier = 0.3; bar.Text = bar.ManaBar:CreateFontString(nil, "OVERLAY") bar.Text:SetAllPoints(bar.ManaBar) - bar.Text:SetFont(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + bar.Text:SetFont(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) return bar end --[[ @@ -96,8 +95,7 @@ POSITIONING ]]-- local Reposition = function(self) local bar = self.EclipseBar - local key = self.datakey - local db = MOD.db[key] + local db = MOD.db.player if not bar or not db then print("Error") return end local height = db.classbar.height local offset = (height - 10) @@ -307,8 +305,7 @@ local HideSmallPoint = function(self) end local RepositionCombo = function(self) - local key = self.datakey - local db = MOD.db[key] + local db = MOD.db.target local bar = self.HyperCombo.CPoints; local max = MAX_COMBO_POINTS; local height = db.combobar.height diff --git a/Interface/AddOns/SVUI/packages/unit/class/mage.lua b/Interface/AddOns/SVUI/packages/unit/class/mage.lua index 3853f7d..b5c0f0e 100644 --- a/Interface/AddOns/SVUI/packages/unit/class/mage.lua +++ b/Interface/AddOns/SVUI/packages/unit/class/mage.lua @@ -48,8 +48,7 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local key = self.datakey - local db = MOD.db[key] + local db = MOD.db.player local bar = self.ArcaneChargeBar; local max = self.MaxClassPower; local height = db.classbar.height diff --git a/Interface/AddOns/SVUI/packages/unit/class/monk.lua b/Interface/AddOns/SVUI/packages/unit/class/monk.lua index cf50de9..367cc84 100644 --- a/Interface/AddOns/SVUI/packages/unit/class/monk.lua +++ b/Interface/AddOns/SVUI/packages/unit/class/monk.lua @@ -48,8 +48,7 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local key = self.datakey - local db = MOD.db[key] + local db = MOD.db.player local bar = self.MonkHarmony; local max = self.MaxClassPower; local height = db.classbar.height diff --git a/Interface/AddOns/SVUI/packages/unit/class/paladin.lua b/Interface/AddOns/SVUI/packages/unit/class/paladin.lua index ea6aad0..5430490 100644 --- a/Interface/AddOns/SVUI/packages/unit/class/paladin.lua +++ b/Interface/AddOns/SVUI/packages/unit/class/paladin.lua @@ -54,8 +54,7 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local key = self.datakey - local db = MOD.db[key] + local db = MOD.db.player local bar = self.HolyPower; local max = self.MaxClassPower; local height = db.classbar.height diff --git a/Interface/AddOns/SVUI/packages/unit/class/priest.lua b/Interface/AddOns/SVUI/packages/unit/class/priest.lua index 639cab3..320b27f 100644 --- a/Interface/AddOns/SVUI/packages/unit/class/priest.lua +++ b/Interface/AddOns/SVUI/packages/unit/class/priest.lua @@ -49,8 +49,7 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local key = self.datakey - local db = MOD.db[key] + local db = MOD.db.player local bar = self.PriestOrbs; local max = self.MaxClassPower; local height = db.classbar.height diff --git a/Interface/AddOns/SVUI/packages/unit/class/rogue.lua b/Interface/AddOns/SVUI/packages/unit/class/rogue.lua index ae04b01..1840f7e 100644 --- a/Interface/AddOns/SVUI/packages/unit/class/rogue.lua +++ b/Interface/AddOns/SVUI/packages/unit/class/rogue.lua @@ -67,8 +67,7 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local key = self.datakey - local db = MOD.db[key] + local db = MOD.db.target local bar = self.HyperCombo.CPoints; local max = MAX_COMBO_POINTS; local height = db.combobar.height @@ -168,8 +167,7 @@ ROGUE COMBO TRACKER ########################################################## ]]-- local RepositionTracker = function(self) - local key = self.datakey - local db = MOD.db[key] + local db = MOD.db.player local bar = self.HyperCombo; if not db then return end local height = db.classbar.height diff --git a/Interface/AddOns/SVUI/packages/unit/class/shaman.lua b/Interface/AddOns/SVUI/packages/unit/class/shaman.lua index 8eb7861..2fd1cb3 100644 --- a/Interface/AddOns/SVUI/packages/unit/class/shaman.lua +++ b/Interface/AddOns/SVUI/packages/unit/class/shaman.lua @@ -59,8 +59,7 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local key = self.datakey - local db = MOD.db[key] + local db = MOD.db.player local bar = self.TotemBars; local max = self.MaxClassPower; local height = db.classbar.height diff --git a/Interface/AddOns/SVUI/packages/unit/class/warlock.lua b/Interface/AddOns/SVUI/packages/unit/class/warlock.lua index 453bf50..07dc459 100644 --- a/Interface/AddOns/SVUI/packages/unit/class/warlock.lua +++ b/Interface/AddOns/SVUI/packages/unit/class/warlock.lua @@ -76,8 +76,7 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local key = self.datakey - local db = MOD.db[key] + local db = MOD.db.player local bar = self.WarlockShards; local max = self.MaxClassPower; local height = db.classbar.height diff --git a/Interface/AddOns/SVUI/packages/unit/common/actionpanel.lua b/Interface/AddOns/SVUI/packages/unit/common/actionpanel.lua index e8ad6c7..f702abc 100644 --- a/Interface/AddOns/SVUI/packages/unit/common/actionpanel.lua +++ b/Interface/AddOns/SVUI/packages/unit/common/actionpanel.lua @@ -20,15 +20,10 @@ local oUF_SuperVillain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); -local LSM = LibStub("LibSharedMedia-3.0"); local ELITE_TOP = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\ELITE-TOP]] local ELITE_BOTTOM = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\ELITE-BOTTOM]] local ELITE_RIGHT = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\ELITE-RIGHT]] - --- local STATUS_BG = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\STATUS-BG]] --- local STATUS_LEFT = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\STATUS-LEFT]] --- local STATUS_RIGHT = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\STATUS-RIGHT]] --[[ ########################################################## LOCAL FUNCTIONS @@ -198,7 +193,7 @@ local function CreateNameText(frame, unitName) db = MOD.db[unitName].name end local name = frame:CreateFontString(nil, "OVERLAY") - name:SetFont(LSM:Fetch("font", db.font), db.fontSize, db.fontOutline) + name:SetFont(SuperVillain.Shared:Fetch("font", db.font), db.fontSize, db.fontOutline) name:SetShadowOffset(2, -2) name:SetShadowColor(0, 0, 0, 1) if unitNmae == "target" then @@ -214,7 +209,6 @@ ACTIONPANEL / INFOPANEL ########################################################## ]]-- function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) - frame.datakey = unit if(unit and (unit == "target" or unit == "player")) then frame.ActionPanel = CreateActionPanel(frame, 3) frame.Threat = CreateThreat(frame.ActionPanel, unit) @@ -281,7 +275,7 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) if(not noHealthText) then frame.InfoPanel.Health = frame.InfoPanel:CreateFontString(nil, "OVERLAY") - frame.InfoPanel.Health:SetFont(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + frame.InfoPanel.Health:SetFont(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) offset = reverse and 2 or -2; direction = reverse and "LEFT" or "RIGHT"; frame.InfoPanel.Health:Point(direction, frame.InfoPanel, direction, offset, 0) @@ -289,7 +283,7 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) if(not noPowerText) then frame.InfoPanel.Power = frame.InfoPanel:CreateFontString(nil, "OVERLAY") - frame.InfoPanel.Power:SetFont(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + frame.InfoPanel.Power:SetFont(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) offset = reverse and -2 or 2; direction = reverse and "RIGHT" or "LEFT"; frame.InfoPanel.Power:Point(direction, frame.InfoPanel, direction, offset, 0) @@ -297,7 +291,7 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) if(not noMiscText) then frame.InfoPanel.Misc = frame.InfoPanel:CreateFontString(nil, "OVERLAY") - frame.InfoPanel.Misc:SetFont(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + frame.InfoPanel.Misc:SetFont(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) frame.InfoPanel.Misc:Point("CENTER", frame, "CENTER", 0, 0) end diff --git a/Interface/AddOns/SVUI/packages/unit/common/aurabars.lua b/Interface/AddOns/SVUI/packages/unit/common/aurabars.lua index 5a004d6..d4af6ba 100644 --- a/Interface/AddOns/SVUI/packages/unit/common/aurabars.lua +++ b/Interface/AddOns/SVUI/packages/unit/common/aurabars.lua @@ -20,13 +20,13 @@ local oUF_SuperVillain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## LOCAL VARIABLES ########################################################## ]]-- local tsort,floor,sub = table.sort, math.floor, string.sub; +local CustomBarFilter; --[[ ########################################################## BUILD FUNCTION @@ -71,80 +71,83 @@ local function ColorizeAuraBars(self) end end -local function CheckAuraFilter(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 +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 - if (friend and helpful) or (enemy and not helpful) then - return true; - end - return false -end -local function AuraBarFilter(self, unit, name, _, _, _, debuffType, duration, _, unitCaster, isStealable, shouldConsolidate, spellID) - local key = self.datakey - if((not MOD.db[key]) or (MOD.db[key] and not MOD.db[key].aurabar) or (spellID == 65148)) then - return false; - end - local db = MOD.db[key].aurabar - local filtered = (unitCaster == "player" or unitCaster == "vehicle") and true or false; - local allowed = true; - local pass = false; - local friendly = UnitIsFriend("player", unit) == 1 and true or false; + CustomBarFilter = function(self, unit, name, _, _, _, debuffType, duration, _, unitCaster, isStealable, shouldConsolidate, spellID) + local db = MOD.db[self.db] + if((not db) or (db and not db.aurabar) or (spellID == 65148)) then + return false; + end + local barDB = db.aurabar + local filtered = (unitCaster == "player" or unitCaster == "vehicle") and true or false; + local allowed = true; + local pass = false; + local friendly = UnitIsFriend("player", unit) == 1 and true or false; - if CheckAuraFilter(db.filterPlayer, friendly) then - allowed = filtered; - pass = true - end - if CheckAuraFilter(db.filterDispellable, friendly) then - if (debuffType and not SuperVillain.Dispellable[debuffType]) or debuffType == nil then - filtered = false + if _test(barDB.filterPlayer, friendly) then + allowed = filtered; + pass = true end - pass = true - end - if CheckAuraFilter(db.filterRaid, friendly) then - if shouldConsolidate == 1 then filtered = false end - pass = true - end - if CheckAuraFilter(db.filterInfinite, friendly) then - if duration == 0 or not duration then - filtered = false + if _test(barDB.filterDispellable, friendly) then + if (debuffType and not SuperVillain.Dispellable[debuffType]) or debuffType == nil then + filtered = false + end + pass = true end - pass = true - end - if CheckAuraFilter(db.filterBlocked, friendly) then - local blackList = SuperVillain.Filters["Blocked"][name] - if blackList and blackList.enable then filtered = false end - pass = true - end - if CheckAuraFilter(db.filterAllowed, friendly) then - local whiteList = SuperVillain.Filters["Allowed"][name] - if whiteList and whiteList.enable then - filtered = true - elseif not pass then - filtered = false + if _test(barDB.filterRaid, friendly) then + if shouldConsolidate == 1 then filtered = false end + pass = true end - pass = true - end - if db.useFilter and SuperVillain.Filters[db.useFilter] then - local spellsDB = SuperVillain.Filters[db.useFilter]; - if db.useFilter ~= "Blocked" then - if spellsDB[name] and spellsDB[name].enable and allowed then + if _test(barDB.filterInfinite, friendly) then + if duration == 0 or not duration then + filtered = false + end + pass = true + end + if _test(barDB.filterBlocked, friendly) then + local blackList = SuperVillain.Filters["Blocked"][name] + if blackList and blackList.enable then filtered = false end + pass = true + end + if _test(barDB.filterAllowed, friendly) then + local whiteList = SuperVillain.Filters["Allowed"][name] + if whiteList and whiteList.enable then filtered = true elseif not pass then - filtered = false + filtered = false + end + pass = true + end + local active = barDB.useFilter + if active and SuperVillain.Filters[active] then + local spellsDB = SuperVillain.Filters[active]; + if active ~= "Blocked" then + if spellsDB[name] and spellsDB[name].enable and allowed then + filtered = true + elseif not pass then + filtered = false + end + elseif spellsDB[name] and spellsDB[name].enable then + filtered = false end - elseif spellsDB[name] and spellsDB[name].enable then - filtered = false end - end - return filtered -end + return filtered + end +end --[[ ########################################################## UTILITY @@ -152,15 +155,16 @@ UTILITY ]]-- function MOD:CreateAuraBarHeader(frame, unitName) local auraBarParent = CreateFrame("Frame", nil, frame) + auraBarParent.db = unitName auraBarParent.parent = frame; auraBarParent.PostCreateBar = PostCreateAuraBars; auraBarParent.gap = 1; auraBarParent.spacing = 1; auraBarParent.spark = true; - auraBarParent.filter = AuraBarFilter; + auraBarParent.filter = CustomBarFilter; auraBarParent.PostUpdate = ColorizeAuraBars; - auraBarParent.barTexture = LSM:Fetch("statusbar", MOD.db.auraBarStatusbar) - auraBarParent.textFont = LSM:Fetch("font", MOD.db.auraFont) + auraBarParent.barTexture = SuperVillain.Shared:Fetch("statusbar", MOD.db.auraBarStatusbar) + auraBarParent.textFont = SuperVillain.Shared:Fetch("font", MOD.db.auraFont) auraBarParent.textSize = MOD.db.auraFontSize auraBarParent.textOutline = MOD.db.auraFontOutline return auraBarParent diff --git a/Interface/AddOns/SVUI/packages/unit/common/auras.lua b/Interface/AddOns/SVUI/packages/unit/common/auras.lua index 35faa04..8702495 100644 --- a/Interface/AddOns/SVUI/packages/unit/common/auras.lua +++ b/Interface/AddOns/SVUI/packages/unit/common/auras.lua @@ -49,7 +49,6 @@ local oUF_SuperVillain = ns.oUF --[[ MUNGLUNCH"s FASTER ASSERT FUNCTION ]]-- local assert = enforce; assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); -local LSM = LibStub("LibSharedMedia-3.0"); local CustomAuraFilter; local AURA_FONT = [[Interface\AddOns\SVUI\assets\fonts\Display.ttf]]; @@ -242,23 +241,22 @@ do end CustomAuraFilter = function(self, unit, icon, name, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossAura) - local key = self.datakey - if((not MOD.db[key]) or (spellID == 65148)) then + local auraDB = MOD.db[self.db] + if((not auraDB) or (spellID == 65148)) then return false; end local auraType = self.type; - if(not auraType or not MOD.db[key][auraType]) then return true end; + if(not auraType) then return true end; local isPlayer, friendly; - local db = MOD.db[key][auraType] local filtered = true; local allowed = true; local pass = false; local isPlayer = caster == "player"or caster == "vehicle" local friendly = UnitIsFriend("player", unit) == 1 and true or false; - local filterType = friendly and db.friendlyAuraType or db.enemyAuraType; + local filterType = friendly and auraDB.friendlyAuraType or auraDB.enemyAuraType; icon.isPlayer = isPlayer; icon.owner = caster; icon.name = name; @@ -267,35 +265,35 @@ do if shieldSpell and shieldSpell.enable then icon.priority = shieldSpell.priority end - if _test(db.filterPlayer, friendly) then + if _test(auraDB.filterPlayer, friendly) then if isPlayer then filtered = true else filtered = false end allowed = filtered; pass = true end - if _test(db.filterDispellable, friendly) then + if _test(auraDB.filterDispellable, friendly) then if (auraType == "buffs" and not isStealable) or (auraType == "debuffs" and debuffType and not SuperVillain.Dispellable[debuffType]) or debuffType == nil then filtered = false end pass = true end - if _test(db.filterRaid, friendly) then + if _test(auraDB.filterRaid, friendly) then if shouldConsolidate == 1 then filtered = false end pass = true end - if _test(db.filterInfinite, friendly)then + if _test(auraDB.filterInfinite, friendly)then if duration == 0 or not duration then filtered = false end pass = true end - if _test(db.useBlocked, friendly) then + if _test(auraDB.useBlocked, friendly) then local blackListSpell = SuperVillain.Filters["Blocked"][name] if blackListSpell and blackListSpell.enable then filtered = false end pass = true end - if _test(db.useAllowed, friendly) then + if _test(auraDB.useAllowed, friendly) then local whiteListSpell = SuperVillain.Filters["Allowed"][name] if whiteListSpell and whiteListSpell.enable then filtered = true; @@ -305,14 +303,14 @@ do end pass = true end - - if db.useFilter and SuperVillain.Filters[db.useFilter] then - local spellDB = SuperVillain.Filters[db.useFilter]; - if db.useFilter ~= "Blocked" then + local active = auraDB.useFilter + if active and SuperVillain.Filters[active] then + local spellDB = SuperVillain.Filters[active]; + if active ~= "Blocked" then if spellDB[name] and spellDB[name].enable and allowed then filtered = true; icon.priority = spellDB[name].priority; - if db.useFilter == "Shield" and (spellID == 86698 or spellID == 86669) then + if active == "Shield" and (spellID == 86698 or spellID == 86669) then filtered = false end elseif not pass then @@ -330,39 +328,39 @@ end BUILD FUNCTION ########################################################## ]]-- -function MOD:CreateBuffs(frame) +function MOD:CreateBuffs(frame, unit) local aura = CreateFrame("Frame", nil, frame) - aura.datakey = frame.datakey + aura.db = unit aura.spacing = 2; aura.PostCreateIcon = PostCreateAuraIcon; aura.PostUpdateIcon = PostUpdateAuraIcon; aura.CustomFilter = CustomAuraFilter; aura:SetFrameLevel(10) aura.type = "buffs" - aura.textFont = LSM:Fetch("font", MOD.db.auraFont) + aura.textFont = SuperVillain.Shared:Fetch("font", MOD.db.auraFont) aura.textSize = MOD.db.auraFontSize aura.textOutline = MOD.db.auraFontOutline return aura end -function MOD:CreateDebuffs(frame) +function MOD:CreateDebuffs(frame, unit) local aura = CreateFrame("Frame", nil, frame) - aura.datakey = frame.datakey + aura.db = unit aura.spacing = 2; aura.PostCreateIcon = PostCreateAuraIcon; aura.PostUpdateIcon = PostUpdateAuraIcon; aura.CustomFilter = CustomAuraFilter; aura.type = "debuffs" aura:SetFrameLevel(10) - aura.textFont = LSM:Fetch("font", MOD.db.auraFont) + aura.textFont = SuperVillain.Shared:Fetch("font", MOD.db.auraFont) aura.textSize = MOD.db.auraFontSize aura.textOutline = MOD.db.auraFontOutline return aura end -function MOD:CreateAuraWatch(frame) +function MOD:CreateAuraWatch(frame, unit) local aWatch = CreateFrame("Frame", nil, frame) - aWatch.datakey = frame.datakey + aWatch.db = unit aWatch:SetFrameLevel(frame:GetFrameLevel() + 25) aWatch:FillInner(frame.Health) aWatch.presentAlpha = 1; @@ -374,8 +372,7 @@ end function MOD:SmartAuraDisplay() local unit = self.unit; - local key = self.datakey - local db = MOD.db[key]; + local db = MOD.db[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; @@ -429,7 +426,8 @@ local temp = {} function MOD:UpdateAuraWatch(frame, override) local AW = frame.AuraWatch; local unit = frame.unit - local key = frame.datakey + local key = frame.___key + if not MOD.db[key] then return end local db = MOD.db[key].buffIndicator; if not db then return end if not db.enable then @@ -563,7 +561,7 @@ function MOD:UpdateAuraWatch(frame, override) watchedAura.count:SetPoint("CENTER", unpack(counterOffsets[temp[i].point])) end - local fontFile = LSM:Fetch("font", MOD.db.auraFont) + local fontFile = SuperVillain.Shared:Fetch("font", MOD.db.auraFont) local fontSize = MOD.db.auraFontSize local fontOutline = MOD.db.auraFontOutline diff --git a/Interface/AddOns/SVUI/packages/unit/common/castbar.lua b/Interface/AddOns/SVUI/packages/unit/common/castbar.lua index f6ebcaa..8d054c2 100644 --- a/Interface/AddOns/SVUI/packages/unit/common/castbar.lua +++ b/Interface/AddOns/SVUI/packages/unit/common/castbar.lua @@ -47,7 +47,6 @@ local oUF_SuperVillain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## LOCAL VARIABLES diff --git a/Interface/AddOns/SVUI/packages/unit/common/health.lua b/Interface/AddOns/SVUI/packages/unit/common/health.lua index 91a076e..2b14a46 100644 --- a/Interface/AddOns/SVUI/packages/unit/common/health.lua +++ b/Interface/AddOns/SVUI/packages/unit/common/health.lua @@ -33,14 +33,12 @@ local oUF_SuperVillain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## LOCAL FUNCTIONS ########################################################## ]]-- local HEALTH_ANIM_FILE = [[Interface\Addons\SVUI\assets\artwork\Unitframe\UNIT-HEALTH-ANIMATION]]; -local DEAD_MODEL_FILE = [[Spells\Monk_travelingmist_missile.m2]]; local Anim_OnUpdate = function(self) local parent = self.parent @@ -212,22 +210,6 @@ local CustomUpdate = function(self, event, unit) if self.isForced then local current = random(1,max) health:SetValue(-current) - end - - local portrait = self.Portrait - if(portrait and portrait:IsObjectType'Model') then - if(UnitIsDeadOrGhost(unit) and not portrait.isdead) then - portrait:SetCamDistanceScale(1) - portrait:SetPortraitZoom(0) - portrait:SetPosition(4,-1,1) - portrait:ClearModel() - portrait:SetModel(DEAD_MODEL_FILE) - portrait.isdead = true - portrait.guid = nil - elseif(not UnitIsDeadOrGhost(unit) and portrait.isdead == true) then - portrait.isdead = nil - MOD.Update3DPortrait(self, event, unit) - end end end @@ -310,22 +292,6 @@ local Update = function(self, event, unit) if(db.gridMode) then health:SetOrientation("VERTICAL") end - - local portrait = self.Portrait - if(portrait and portrait:IsObjectType'Model') then - if(UnitIsDeadOrGhost(unit) and not portrait.isdead) then - portrait:SetCamDistanceScale(1) - portrait:SetPortraitZoom(0) - portrait:SetPosition(4,-1,1) - portrait:ClearModel() - portrait:SetModel(DEAD_MODEL_FILE) - portrait.isdead = true - portrait.guid = nil - elseif(not UnitIsDeadOrGhost(unit) and portrait.isdead == true) then - portrait.isdead = nil - MOD.Update3DPortrait(self, event, unit) - end - end end --[[ ########################################################## @@ -371,18 +337,10 @@ function MOD:CreateHealthBar(frame, hasbg, reverse) return healthBar end -function MOD:RefreshHealthBar(frame) - local key = frame.datakey - local db = MOD.db[key] - if(db and db.portrait) then - db = db.portrait - local useOverlayHealth = (db.enable and db.overlay); - if useOverlayHealth then - frame.Health:SetStatusBarTexture(SuperVillain.Media.bar.default) - frame.Health.Override = CustomUpdate; - else - frame.Health:SetStatusBarTexture(LSM:Fetch("statusbar", MOD.db.statusbar)) - frame.Health.Override = Update; - end +function MOD:RefreshHealthBar(frame, overlay) + if(overlay) then + frame.Health.Override = CustomUpdate; + else + frame.Health.Override = Update; end end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/common/misc.lua b/Interface/AddOns/SVUI/packages/unit/common/misc.lua index d4ed8b6..a47f453 100644 --- a/Interface/AddOns/SVUI/packages/unit/common/misc.lua +++ b/Interface/AddOns/SVUI/packages/unit/common/misc.lua @@ -20,7 +20,6 @@ local oUF_SuperVillain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## LOCAL VARIABLES @@ -125,34 +124,21 @@ function MOD:CreateRaidIcon(frame) return rIcon end -function MOD:CreateRoleIcon(frame) - local parent = frame.InfoPanel or frame; - local rIconHolder = CreateFrame("Frame", nil, parent) - rIconHolder:SetAllPoints() - local rIcon = rIconHolder:CreateTexture(nil, "ARTWORK", nil, 2) - rIcon:Size(14) - rIcon:Point("BOTTOMRIGHT", rIconHolder, "BOTTOMRIGHT") - rIcon.Override = MOD.UpdateRoleIcon; - frame:RegisterEvent("UNIT_CONNECTION", MOD.UpdateRoleIcon) - return rIcon -end - -function MOD:UpdateRoleIcon() - local lfd = self.LFDRole - local key = self.datakey +local UpdateRoleIcon = function(self) + local key = self.___key local db = MOD.db[key] - if not db or not db.icons then return end - local db = db.icons.roleIcon; - if(not db or (db and not db.enable)) then lfd:Hide()return end + if(not db or not db.icons or (db.icons and not db.icons.roleIcon)) then return end + local lfd = self.LFDRole + if(not db.icons.roleIcon.enable) then lfd:Hide() return end local unitRole = UnitGroupRolesAssigned(self.unit) - if self.isForced and unitRole == "NONE"then + if(self.isForced and unitRole == "NONE") then local rng = random(1, 3) unitRole = rng == 1 and "TANK" or rng == 2 and "HEALER" or rng == 3 and "DAMAGER" end - if(unitRole ~= "NONE" and (self.isForced or UnitIsConnected(self.unit))) then + if(unitRole ~= "NONE" and (self.isForced or UnitIsConnected(self.unit))) then local coords = ROLE_ICON_DATA[unitRole] lfd:SetTexture(ROLE_ICON_FILE) - if(lfd:GetHeight() <= 13) then + if(lfd:GetHeight() <= 13) then lfd:SetTexCoord(coords[5], coords[6], coords[7], coords[8]) else lfd:SetTexCoord(coords[1], coords[2], coords[3], coords[4]) @@ -163,12 +149,24 @@ function MOD:UpdateRoleIcon() end end +function MOD:CreateRoleIcon(frame) + local parent = frame.InfoPanel or frame; + local rIconHolder = CreateFrame("Frame", nil, parent) + rIconHolder:SetAllPoints() + local rIcon = rIconHolder:CreateTexture(nil, "ARTWORK", nil, 2) + rIcon:Size(14) + rIcon:Point("BOTTOMRIGHT", rIconHolder, "BOTTOMRIGHT") + rIcon.Override = UpdateRoleIcon; + frame:RegisterEvent("UNIT_CONNECTION", UpdateRoleIcon) + return rIcon +end + function MOD:CreateRaidRoleFrames(frame) local parent = frame.InfoPanel or frame; local raidRoles = CreateFrame("Frame", nil, frame) raidRoles:Size(24, 12) raidRoles:Point("TOPLEFT", frame.ActionPanel, "TOPLEFT", -2, 4) - raidRoles:SetFrameLevel(parent:GetFrameLevel() + 50) + raidRoles:SetFrameLevel(parent:GetFrameLevel() + 50) frame.Leader = raidRoles:CreateTexture(nil, "OVERLAY") frame.Leader:Size(12, 12) @@ -194,7 +192,7 @@ function MOD:RaidRoleUpdate() local leaderIcon = frame.Leader; local looterIcon = frame.MasterLooter; if not leaderIcon or not looterIcon then return end - local key = frame.datakey; + local key = frame.___key; local db = MOD.db[key]; local leaderShown = leaderIcon:IsShown() local looterShown = looterIcon:IsShown() diff --git a/Interface/AddOns/SVUI/packages/unit/common/portrait.lua b/Interface/AddOns/SVUI/packages/unit/common/portrait.lua index 66fc13d..2d4f98c 100644 --- a/Interface/AddOns/SVUI/packages/unit/common/portrait.lua +++ b/Interface/AddOns/SVUI/packages/unit/common/portrait.lua @@ -20,50 +20,78 @@ local oUF_SuperVillain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## LOCAL VARIABLES ########################################################## ]]-- --- local MYSTERY_MODEL_FILE = [[Spells\Blackmagic_precast_base.m2]]; --- local MYSTERY_MODEL_FILE = [[Spells\Crow_baked.m2]]; -local WORKING_MODEL_FILE = [[Spells\Monk_travelingmist_missile.m2]]; --- local WORKING_MODEL_FILE = [[Spells\monsterlure01.m2]]; --- local WORKING_MODEL_FILE = [[interface\buttons\talktome_gears.m2]]; --- local DEAD_MODEL_FILE = [[creature\Ghostlyskullpet\ghostlyskullpet.m2]]; --- local DEAD_MODEL_FILE = [[creature\ghost\ghost.m2]]; +-- local MISSING_MODEL_FILE = [[Spells\Blackmagic_precast_base.m2]]; +-- local MISSING_MODEL_FILE = [[Spells\Crow_baked.m2]]; +-- local MISSING_MODEL_FILE = [[Spells\monsterlure01.m2]]; +-- local MISSING_MODEL_FILE = [[interface\buttons\talktome_gears.m2]]; +-- local MISSING_MODEL_FILE = [[creature\Ghostlyskullpet\ghostlyskullpet.m2]]; +-- local MISSING_MODEL_FILE = [[creature\ghost\ghost.m2]]; +local MISSING_MODEL_FILE = [[Spells\Monk_travelingmist_missile.m2]]; --[[ ########################################################## UPDATE ########################################################## ]]-- -local function UpdatePortraitColors(portrait, unit) - local r,g,b = 0.25,0.25,0.25 - if (UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then - r,g,b = 0.5,0.5,0.5 - elseif not UnitIsPlayer(unit)then - local unitReact = oUF_SuperVillain.colors.reaction[UnitReaction(unit,"player")] - if(unitReact ~= nil) then - r,g,b = unitReact[1], unitReact[2], unitReact[3] - end; - else - local unitClass = select(2,UnitClass(unit)) - if unitClass then - r,g,b = unpack(oUF_SuperVillain.colors.class[unitClass]) - end - end - portrait:SetBackdropColor(r,g,b) - if portrait.UpdateColor then - portrait:UpdateColor(r,g,b) - end -end; - -local UpdatePortrait = function(self, event, unit) +local Update2DPortrait = function(self, event, unit) if(not unit or not UnitIsUnit(self.unit, unit)) then return end local portrait = self.Portrait SetPortraitTexture(portrait, unit) end + +local Update3DPortrait = function(self, event, unit) + if(not unit or not UnitIsUnit(self.unit, unit)) then return end + local portrait = self.Portrait + if(not portrait:IsObjectType'Model') then return; end + local guid = UnitGUID(unit) + local camera = portrait.UserCamDistance or 1 + local rotate = portrait.UserRotation + if(not UnitExists(unit) or not UnitIsConnected(unit) or not UnitIsVisible(unit)) then + portrait:SetCamDistanceScale(1) + portrait:SetPortraitZoom(0) + portrait:SetPosition(4,-1,1) + portrait:ClearModel() + portrait:SetModel(MISSING_MODEL_FILE) + portrait.guid = nil + portrait:SetBackdropColor(0.25,0.25,0.25) + if portrait.UpdateColor then + portrait:UpdateColor(0.25,0.25,0.25) + end + elseif(portrait.guid ~= guid or event == 'UNIT_MODEL_CHANGED') then + portrait:SetCamDistanceScale(camera) + portrait:SetPortraitZoom(1) + portrait:SetPosition(0,0,0) + portrait:ClearModel() + portrait:SetUnit(unit) + portrait.guid = guid + + if(rotate and portrait:GetFacing() ~= rotate / 60) then + portrait:SetFacing(rotate / 60) + end + + local r, g, b, color = 0.25, 0.25, 0.25 + if not UnitIsPlayer(unit)then + color = oUF_SuperVillain.colors.reaction[UnitReaction(unit,"player")] + if(color ~= nil) then + r,g,b = color[1], color[2], color[3] + end; + else + local _,unitClass = UnitClass(unit) + if unitClass then + color = oUF_SuperVillain.colors.class[unitClass] + r,g,b = color[1], color[2], color[3] + end + end + portrait:SetBackdropColor(r,g,b) + if portrait.UpdateColor then + portrait:UpdateColor(r,g,b) + end + end +end --[[ ########################################################## BUILD FUNCTION @@ -110,44 +138,10 @@ function MOD:CreatePortrait(frame,smallUnit,isPlayer) portrait2D.overlay = overlay; -- Set Updates - portrait2D.Override = UpdatePortrait - portrait3D.Override = MOD.Update3DPortrait + portrait2D.Override = Update2DPortrait + portrait3D.Override = Update3DPortrait -- Assign To Frame frame.PortraitModel = portrait3D; frame.PortraitTexture = portrait2D; -end; - -function MOD:Update3DPortrait(event, unit) - if(not unit or not UnitIsUnit(self.unit, unit)) then return end - local portrait = self.Portrait - if(not portrait:IsObjectType'Model') then return; end - local guid = UnitGUID(unit) - local camera = portrait.UserCamDistance or 1 - local rotate = portrait.UserRotation - if(not UnitExists(unit) or not UnitIsConnected(unit) or not UnitIsVisible(unit) or (unit ~= "player" and UnitIsDeadOrGhost(unit))) then - portrait:SetCamDistanceScale(1) - portrait:SetPortraitZoom(0) - portrait:SetPosition(4,-1,1) - portrait:ClearModel() - portrait:SetModel(WORKING_MODEL_FILE) - portrait.guid = nil - else - portrait.isdead = nil - portrait:SetAlpha(1) - if(portrait.guid ~= guid or event == 'UNIT_MODEL_CHANGED') then - portrait:SetCamDistanceScale(camera) - portrait:SetPortraitZoom(1) - portrait:SetPosition(0,0,0) - portrait:ClearModel() - portrait:SetUnit(unit) - portrait.guid = guid - - if(rotate and portrait:GetFacing() ~= rotate / 60) then - portrait:SetFacing(rotate / 60) - end; - end - - end - UpdatePortraitColors(portrait, unit) end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/common/power.lua b/Interface/AddOns/SVUI/packages/unit/common/power.lua index e8831b8..a62e8b7 100644 --- a/Interface/AddOns/SVUI/packages/unit/common/power.lua +++ b/Interface/AddOns/SVUI/packages/unit/common/power.lua @@ -20,7 +20,6 @@ local oUF_SuperVillain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## LOCAL VARIABLES @@ -73,7 +72,7 @@ BUILD FUNCTION function MOD:CreatePowerBar(frame, bg) local power = CreateFrame("StatusBar", nil, frame) power:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) - power:SetPanelTemplate("Inset") + power:SetPanelTemplate("Bar") if bg then power.bg = power:CreateTexture(nil, "BORDER") power.bg:SetAllPoints() @@ -89,13 +88,13 @@ end function MOD:CreateAltPowerBar(frame) local altPower = CreateFrame("StatusBar", nil, frame) altPower:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) - altPower:SetPanelTemplate("Inset") + altPower:SetPanelTemplate("Bar") altPower:GetStatusBarTexture():SetHorizTile(false) altPower:SetFrameStrata("MEDIUM") altPower.text = altPower:CreateFontString(nil, "OVERLAY") altPower.text:SetPoint("CENTER") altPower.text:SetJustifyH("CENTER") - altPower.text:SetFont(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + altPower.text:SetFont(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) altPower.PostUpdate = PostUpdateAltPower; return altPower end @@ -107,8 +106,7 @@ UPDATE local function PowerUpdateNamePosition(frame, unit) local panel = frame.InfoPanel if(not panel.Power or (panel.Power and not panel.Power:IsShown()) or not panel.Name) then return end - local key = frame.datakey - local db = MOD.db[key] + local db = MOD.db[unit] local parent = panel.Name:GetParent() if UnitIsPlayer(unit)then local point = db.name.position; @@ -123,6 +121,7 @@ local function PowerUpdateNamePosition(frame, unit) end function MOD:PostUpdatePower(unit, value, max) + local db = MOD.db[unit] local powerType, _, _, _, _ = UnitPowerType(unit) local parent = self:GetParent() if parent.isForced then @@ -143,9 +142,7 @@ function MOD:PostUpdatePower(unit, value, max) if not colors then return end self:SetStatusBarColor(colors[1], colors[2], colors[3]) self.bg:SetVertexColor(colors[1] * mult, colors[2] * mult, colors[3] * mult) - local key = parent.datakey - local db = MOD.db[key] if db and db.power and db.power.hideonnpc then PowerUpdateNamePosition(parent, unit) - end + end end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/common/secure.lua b/Interface/AddOns/SVUI/packages/unit/common/secure.lua index 269ec0e..762b3e3 100644 --- a/Interface/AddOns/SVUI/packages/unit/common/secure.lua +++ b/Interface/AddOns/SVUI/packages/unit/common/secure.lua @@ -119,10 +119,10 @@ local function ChangeGroupIndex(self) if not self:IsShown() then return end local max = MAX_RAID_MEMBERS; - local key = self.NameKey + local key = self.___key local db = MOD.db[key] - local newIndex = db.rSort and -(min(db.gCount * (db.gRowCol * 5), max) + 1 ) or -4; + local newIndex = db.customSorting and -(min(db.groupCount * (db.gRowCol * 5), max) + 1 ) or -4; if self:GetAttribute("startingIndex") ~= newIndex then self:SetAttribute("startingIndex", newIndex) self.isForced = true; @@ -137,10 +137,10 @@ CORE FUNCTIONS function MOD:SwapElement(unit, numGroup) if InCombatLockdown()then return end for i=1, numGroup do - local unitName = unitGroup..i - local frame = self.Units[unit] + local unitName = unit..i + local frame = self.Units[unitName] if(frame) then - if frame.isForced then + if(not frame.isForced) then self:AllowElement(frame) else self:RestrictElement(frame) @@ -159,7 +159,8 @@ function MOD:UpdateGroupConfig(headerFrame, setForced) if InCombatLockdown()then return end SetProxyEnv() - + local key = headerFrame.___key + local db = MOD.db[key] headerFrame.forceShow = setForced; headerFrame.forceShowAuras = setForced; headerFrame.isForced = setForced; @@ -179,8 +180,6 @@ function MOD:UpdateGroupConfig(headerFrame, setForced) setfenv(func, fenv) definedEnvs[func] = nil end - local key = headerFrame.NameKey - local db = MOD.db[key] RegisterStateDriver(headerFrame, "visibility", db.visibility) headerFrame:GetScript("OnEvent")(headerFrame, "PLAYER_ENTERING_WORLD") end diff --git a/Interface/AddOns/SVUI/packages/unit/common/unique.lua b/Interface/AddOns/SVUI/packages/unit/common/unique.lua index 99643e9..1a4cc6c 100644 --- a/Interface/AddOns/SVUI/packages/unit/common/unique.lua +++ b/Interface/AddOns/SVUI/packages/unit/common/unique.lua @@ -15,7 +15,6 @@ S U P E R - V I L L A I N - U I By: Munglunch # --]] local SuperVillain, L = unpack(select(2, ...)); local MOD = SuperVillain.Registry:Expose('SVUnit'); -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## LOCAL VARS diff --git a/Interface/AddOns/SVUI/packages/unit/frames/_load.xml b/Interface/AddOns/SVUI/packages/unit/frames/_load.xml index 2769f90..41dc39e 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames/_load.xml +++ b/Interface/AddOns/SVUI/packages/unit/frames/_load.xml @@ -1,17 +1,11 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> <Script file='all_units.lua'/> - <Script file='basic\player.lua'/> - <Script file='basic\target.lua'/> - <Script file='basic\tot.lua'/> - <Script file='basic\focus.lua'/> - <Script file='basic\ft.lua'/> - <Script file='basic\pet.lua'/> - <Script file='basic\pt.lua'/> - <Script file='group\party.lua'/> - <Script file='group\raid.lua'/> - <Script file='extra\arena.lua'/> - <Script file='extra\boss.lua'/> - <Script file='group\tank.lua'/> - <Script file='group\assist.lua'/> - <Script file='group\rpet.lua'/> + <Script file='player.lua'/> + <Script file='target.lua'/> + <Script file='focus.lua'/> + <Script file='pet.lua'/> + <Script file='arenaboss.lua'/> + <Script file='party.lua'/> + <Script file='raid.lua'/> + <Script file='tankassist.lua'/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/all_units.lua b/Interface/AddOns/SVUI/packages/unit/frames/all_units.lua index e101f72..8c3d09b 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames/all_units.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames/all_units.lua @@ -46,7 +46,6 @@ local MOD = SuperVillain.Registry:Expose('SVUnit'); local _, ns = ... local oUF_SuperVillain = ns.oUF assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); -local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## LOCALS @@ -128,7 +127,6 @@ CORE FUNCTIONS ]]-- function MOD:RefreshUnitLayout(frame, template) local db = MOD.db[template] - local GAP = SuperVillain:Scale(3); local UNIT_WIDTH = db.width; local UNIT_HEIGHT = db.height; local BEST_SIZE = min(UNIT_WIDTH,UNIT_HEIGHT); @@ -157,7 +155,9 @@ function MOD:RefreshUnitLayout(frame, template) AURA_HOLDER = 100 end - MOD:RefreshUnitMedia(frame) + if(frame.MediaUpdate) then + frame:MediaUpdate() + end if(db.portrait and db.portrait.enable) then if(not db.portrait.overlay) then @@ -213,12 +213,12 @@ function MOD:RefreshUnitLayout(frame, template) --[[ TARGETGLOW LAYOUT ]]-- if frame.TargetGlow then - local glow=frame.TargetGlow; + local glow = frame.TargetGlow; glow:ClearAllPoints() - glow:Point("TOPLEFT",-GAP,GAP) - glow:Point("TOPRIGHT",GAP,GAP) - glow:Point("BOTTOMLEFT",-GAP,-GAP) - glow:Point("BOTTOMRIGHT",GAP,-GAP) + glow:Point("TOPLEFT", -3, 3) + glow:Point("TOPRIGHT", 3, 3) + glow:Point("BOTTOMLEFT", -3, -3) + glow:Point("BOTTOMRIGHT", 3, -3) end --[[ INFO TEXTS ]]-- @@ -318,8 +318,8 @@ function MOD:RefreshUnitLayout(frame, template) if db.health and db.health.orientation then health:SetOrientation(db.health.orientation) end - self:RefreshHealthBar(frame) + self:RefreshHealthBar(frame, portraitOverlay) end --[[ POWER LAYOUT ]]-- @@ -445,8 +445,12 @@ function MOD:RefreshUnitLayout(frame, template) if db.castbar and frame.Castbar then local castbar = frame.Castbar; local castHeight = db.castbar.height; - local castWidth = db.castbar.width; - + local castWidth + if(db.castbar.matchFrameWidth) then + castWidth = UNIT_WIDTH + else + castWidth = db.castbar.width + end local sparkSize = castHeight * 4; local adjustedWidth = castWidth - 2; local lazerScale = castHeight * 1.8; diff --git a/Interface/AddOns/SVUI/packages/unit/frames/arenaboss.lua b/Interface/AddOns/SVUI/packages/unit/frames/arenaboss.lua new file mode 100644 index 0000000..0796033 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/unit/frames/arenaboss.lua @@ -0,0 +1,269 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +--]] +local SuperVillain, L = unpack(select(2, ...)); +local MOD = SuperVillain.Registry:Expose('SVUnit'); +local _, ns = ... +local oUF_SuperVillain = ns.oUF +--[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- +local assert = enforce; +assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +local ceil,tinsert = math.ceil,table.insert +local lastArenaFrame, lastBossFrame +--[[ +########################################################## +BOSS HANDLERS +########################################################## +]]-- +function MOD.Construct:boss() + local frame = self + MOD:SetActionPanel(frame, "boss") + frame.Health = MOD:CreateHealthBar(frame, true, true) + frame.Power = MOD:CreatePowerBar(frame, true, true) + MOD:CreatePortrait(frame) + frame.Buffs = MOD:CreateBuffs(frame, "boss") + frame.Debuffs = MOD:CreateDebuffs(frame, "boss") + frame.Afflicted = MOD:CreateAfflicted(frame) + frame.Castbar = MOD:CreateCastbar(frame, true, nil, true, nil, true) + frame.RaidIcon = MOD:CreateRaidIcon(frame) + frame.AltPowerBar = MOD:CreateAltPowerBar(frame) + frame.Range = { insideAlpha = 1, outsideAlpha = 1 } + frame:SetAttribute("type2", "focus") + + if(not _G["SVUI_Boss_MOVE"]) then + frame:Point("RIGHT", SuperVillain.UIParent, "RIGHT", -105, 0) + SuperVillain:SetSVMovable(frame, "SVUI_Boss_MOVE", L["Boss Frames"], nil, nil, nil, "ALL, PARTY, RAID10, RAID25, RAID40") + else + frame:Point("TOPRIGHT", lastBossFrame, "BOTTOMRIGHT", 0, -20) + end + lastBossFrame = frame +end + +function MOD.FrameUpdate:boss() + local frame = self + local db = MOD.db["boss"] + local INDEX = frame.index; + local holder = _G["SVUI_Boss_MOVE"] + local UNIT_WIDTH = db.width; + local UNIT_HEIGHT = db.height; + frame.colors = oUF_SuperVillain.colors; + frame:Size(UNIT_WIDTH, UNIT_HEIGHT) + frame:ClearAllPoints() + if(tonumber(INDEX) == 1) then + holder:Width(UNIT_WIDTH) + holder:Height(UNIT_HEIGHT + (UNIT_HEIGHT + 12 + db.castbar.height) * 4) + if db.showBy == "UP"then + frame:Point("BOTTOMRIGHT", holder, "BOTTOMRIGHT") + else + frame:Point("TOPRIGHT", holder, "TOPRIGHT") + end + else + local yOffset = (UNIT_HEIGHT + 12 + db.castbar.height) * (INDEX - 1) + if db.showBy == "UP"then + frame:Point("BOTTOMRIGHT", holder, "BOTTOMRIGHT", 0, yOffset) + else + frame:Point("TOPRIGHT", holder, "TOPRIGHT", 0, -yOffset) + end + end + frame:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + MOD:RefreshUnitLayout(frame, "boss") + frame:UpdateAllElements() +end +--[[ +########################################################## +ARENA HANDLERS +########################################################## +]]-- +function MOD.Construct:arena() + local frame = self + local selfName = frame:GetName() + local prepName = selfName.."PrepFrame"; + local selfID = frame:GetID() + + MOD:SetActionPanel(frame, "arena") + frame.Health = MOD:CreateHealthBar(frame, true, true) + frame.Power = MOD:CreatePowerBar(frame, true) + MOD:CreatePortrait(frame) + frame.Buffs = MOD:CreateBuffs(frame, "arena") + frame.Debuffs = MOD:CreateDebuffs(frame, "arena") + frame.Castbar = MOD:CreateCastbar(frame, true, nil, true, nil, true) + frame.Trinket = MOD:CreateTrinket(frame) + frame.PVPSpecIcon = MOD:CreatePVPSpecIcon(frame) + frame.Range = { insideAlpha = 1, outsideAlpha = 1 } + frame:SetAttribute("type2", "focus") + + if not _G[prepName] then + local prep = CreateFrame("Frame", prepName, UIParent) + prep:SetFrameStrata("MEDIUM") + prep:SetAllPoints(frame) + prep:SetID(selfID) + prep:SetPanelTemplate("Bar", true, 3, 3, 3) + prep.Health = CreateFrame("StatusBar", nil, prep) + prep.Health:SetAllPoints(prep) + prep.Health:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) + prep.Health:SetPanelTemplate("Bar", true, 3, 3, 3) + prep.Icon = prep:CreateTexture(nil, "OVERLAY") + prep.Icon.bg = CreateFrame("Frame", nil, prep) + prep.Icon.bg:Point("TOPLEFT", prep, "TOPRIGHT", 1, 0) + prep.Icon.bg:Point("BOTTOMRIGHT", prep, "BOTTOMRIGHT", 1, 0) + prep.Icon.bg:SetFixedPanelTemplate("Default", true) + prep.Icon:SetParent(prep.Icon.bg) + prep.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + prep.Icon:FillInner(prep.Icon.bg) + prep.SpecClass = prep.Health:CreateFontString(nil, "OVERLAY") + prep.SpecClass:SetFont(SuperVillain.Media.font.names, 12, "OUTLINE") + prep.SpecClass:SetTextColor(1, 1, 1) + prep.SpecClass:SetPoint("CENTER") + prep:Hide() + end + + if(not _G["SVUI_Arena_MOVE"]) then + frame:Point("RIGHT", SuperVillain.UIParent, "RIGHT", -105, 0) + SuperVillain:SetSVMovable(frame, "SVUI_Arena_MOVE", L["Arena Frames"], nil, nil, nil, "ALL, ARENA") + else + frame:Point("TOPRIGHT", lastArenaFrame, "BOTTOMRIGHT", 0, -20) + end + lastArenaFrame = frame +end + +function MOD.FrameUpdate:arena() + local frame = self + local db = MOD.db["arena"] + local INDEX = frame.index; + local holder = _G["SVUI_Arena_MOVE"] + local UNIT_WIDTH = db.width; + local UNIT_HEIGHT = db.height; + frame.colors = oUF_SuperVillain.colors; + frame:Size(UNIT_WIDTH, UNIT_HEIGHT) + frame:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + do + local trinket = frame.Trinket; + trinket.bg:Size(db.pvpTrinket.size) + trinket.bg:ClearAllPoints() + if(db.pvpTrinket.position == "RIGHT") then + trinket.bg:Point("LEFT", frame, "RIGHT", db.pvpTrinket.xOffset, db.pvpTrinket.yOffset) + else + trinket.bg:Point("RIGHT", frame, "LEFT", db.pvpTrinket.xOffset, db.pvpTrinket.yOffset) + end + if db.pvpTrinket.enable and not frame:IsElementEnabled("Trinket")then + frame:EnableElement("Trinket") + elseif not db.pvpTrinket.enable and frame:IsElementEnabled("Trinket")then + frame:DisableElement("Trinket") + end + end + do + local pvp = frame.PVPSpecIcon; + pvp.bg:Point("RIGHT", frame, "RIGHT") + pvp.bg:Size(UNIT_HEIGHT, UNIT_HEIGHT) + if db.pvpSpecIcon then + frame.InfoPanel:Point("TOPLEFT", frame, "TOPLEFT", 0, 0) + frame.InfoPanel:Point("BOTTOMRIGHT", frame.PVPSpecIcon, "BOTTOMLEFT", 0, 0) + if frame:IsElementEnabled("PVPSpecIcon")then + frame:EnableElement("PVPSpecIcon") + end + elseif frame:IsElementEnabled("PVPSpecIcon")then + frame:DisableElement("PVPSpecIcon") + end + end + MOD:RefreshUnitLayout(frame, "arena") + frame:ClearAllPoints() + if(tonumber(INDEX) == 1) then + holder:Width(UNIT_WIDTH) + holder:Height(UNIT_HEIGHT + (UNIT_HEIGHT + 12 + db.castbar.height) * 4) + if(db.showBy == "UP") then + frame:Point("BOTTOMRIGHT", holder, "BOTTOMRIGHT") + else + frame:Point("TOPRIGHT", holder, "TOPRIGHT") + end + else + local yOffset = (UNIT_HEIGHT + 12 + db.castbar.height) * (INDEX - 1) + if(db.showBy == "UP") then + frame:Point("BOTTOMRIGHT", holder, "BOTTOMRIGHT", 0, yOffset) + else + frame:Point("TOPRIGHT", holder, "TOPRIGHT", 0, -yOffset) + end + end + frame:UpdateAllElements() +end +--[[ +########################################################## +PREP FRAME HANDLER +########################################################## +]]-- +local ArenaPrepHandler = CreateFrame("Frame") +local ArenaPrepHandler_OnEvent = function(self, event) + local _, instanceType = IsInInstance() + if(not MOD.db.arena.enable or instanceType ~= "arena") then return end + if event == "PLAYER_LOGIN" then + for i = 1, 5 do + local prepframe = _G["SVUI_Arena"..i.."PrepFrame"] + if(prepframe) then + prepframe:SetAllPoints(_G["SVUI_Arena"..i]) + end + end + elseif event == "ARENA_OPPONENT_UPDATE" then + for i = 1, 5 do + local prepframe = _G["SVUI_Arena"..i.."PrepFrame"] + if(prepframe and prepframe:IsShown()) then + prepframe:Hide() + end + end + else + local numOpps = GetNumArenaOpponentSpecs() + if numOpps > 0 then + for i = 1, 5 do + local prepframe = _G["SVUI_Arena"..i.."PrepFrame"] + if i <= numOpps then + local s = GetArenaOpponentSpec(i) + local _, spec, class = nil, "UNKNOWN", "UNKNOWN" + if s and s > 0 then + _, spec, _, icon, _, _, class = GetSpecializationInfoByID(s) + end + if class and spec then + prepframe.SpecClass:SetText(spec .. " - " .. LOCALIZED_CLASS_NAMES_MALE[class]) + prepframe.Icon:SetTexture(icon or [[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]) + + local color = RAID_CLASS_COLORS[class] + local textcolor = SVUI_CLASS_COLORS[class] or color + if color then + prepframe.Health:SetStatusBarColor(color.r, color.g, color.b) + prepframe.SpecClass:SetTextColor(color.r, color.g, color.b) + else + prepframe.Health:SetStatusBarColor(0.25, 0.25, 0.25) + prepframe.SpecClass:SetTextColor(1, 1, 1) + end + + prepframe:Show() + end + else + prepframe:Hide() + end + end + else + for i = 1, 5 do + local prepframe = _G["SVUI_Arena"..i.."PrepFrame"] + if(prepframe and prepframe:IsShown()) then + prepframe:Hide() + end + end + end + end +end + +ArenaPrepHandler:RegisterEvent("PLAYER_LOGIN") +ArenaPrepHandler:RegisterEvent("PLAYER_ENTERING_WORLD") +ArenaPrepHandler:RegisterEvent("ARENA_OPPONENT_UPDATE") +ArenaPrepHandler:RegisterEvent("ARENA_PREP_OPPONENT_SPECIALIZATIONS") +ArenaPrepHandler:SetScript("OnEvent", ArenaPrepHandler_OnEvent) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/basic/focus.lua b/Interface/AddOns/SVUI/packages/unit/frames/basic/focus.lua deleted file mode 100644 index f334d5e..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/basic/focus.lua +++ /dev/null @@ -1,78 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## ---]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ... -local oUF_SuperVillain = ns.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local ceil,tinsert = math.ceil,table.insert ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -function MOD.Construct:focus(frame) - MOD:SetActionPanel(frame, "focus") - - frame.Health = MOD:CreateHealthBar(frame, true, true) - frame.Health.frequentUpdates = true - - frame.HealPrediction = MOD:CreateHealPrediction(frame, true) - frame.Power = MOD:CreatePowerBar(frame, true) - - frame.Castbar = MOD:CreateCastbar(frame, false, L["Focus Castbar"]) - frame.Castbar.SafeZone = nil - - frame.Castbar.LatencyTexture:Hide() - frame.Buffs = MOD:CreateBuffs(frame) - frame.Debuffs = MOD:CreateDebuffs(frame) - frame.AuraBars = MOD:CreateAuraBarHeader(frame, "focus") - tinsert(frame.__elements, MOD.SmartAuraDisplay) - frame:RegisterEvent("PLAYER_FOCUS_CHANGED", MOD.SmartAuraDisplay) - - frame.RaidIcon = MOD:CreateRaidIcon(frame) - frame.Range = { insideAlpha = 1, outsideAlpha = 1 } - frame.XRay = MOD:CreateXRay_Closer(frame) - frame.XRay:SetPoint("BOTTOMRIGHT", 20, -10) - frame:Point("BOTTOMRIGHT", SVUI_Target, "TOPRIGHT", 0, 220) - SuperVillain:SetSVMovable(frame, frame:GetName().."_MOVE", L["Focus Frame"], nil, nil, nil, "ALL, SOLO") -end ---[[ -########################################################## -UPDATE -########################################################## -]]-- -function MOD.FrameUpdate:focus(unit, frame, db) - local UNIT_WIDTH = db.width; - local UNIT_HEIGHT = db.height; - frame.unit = unit; - frame:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") - frame.colors = oUF_SuperVillain.colors; - frame:Size(UNIT_WIDTH, UNIT_HEIGHT) - _G[frame:GetName().."_MOVE"]:Size(frame:GetSize()) - MOD:RefreshUnitLayout(frame, "focus") - - if(MOD.db.xrayFocus) then - frame.XRay:Show() - else - frame.XRay:Hide() - end - - MOD:UpdateAuraWatch(frame) - frame:UpdateAllElements() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/basic/ft.lua b/Interface/AddOns/SVUI/packages/unit/frames/basic/ft.lua deleted file mode 100644 index cbc9cfa..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/basic/ft.lua +++ /dev/null @@ -1,55 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## ---]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ... -local oUF_SuperVillain = ns.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local ceil,tinsert = math.ceil,table.insert ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -function MOD.Construct:focustarget(frame) - MOD:SetActionPanel(frame, "focustarget") - frame.Health = MOD:CreateHealthBar(frame, true) - frame.Power = MOD:CreatePowerBar(frame, true) - frame.Buffs = MOD:CreateBuffs(frame) - frame.RaidIcon = MOD:CreateRaidIcon(frame) - frame.Debuffs = MOD:CreateDebuffs(frame) - frame.Range = { insideAlpha = 1, outsideAlpha = 1 } - frame:Point("BOTTOM", SVUI_Focus, "TOP", 0, 7) - SuperVillain:SetSVMovable(frame, frame:GetName().."_MOVE", L["FocusTarget Frame"], nil, -7, nil, "ALL, SOLO") -end ---[[ -########################################################## -UPDATE -########################################################## -]]-- -function MOD.FrameUpdate:focustarget(unit, frame, db) - local UNIT_WIDTH = db.width; - local UNIT_HEIGHT = db.height; - frame.unit = unit; - frame:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") - frame.colors = oUF_SuperVillain.colors; - frame:Size(UNIT_WIDTH, UNIT_HEIGHT) - _G[frame:GetName().."_MOVE"]:Size(frame:GetSize()) - MOD:RefreshUnitLayout(frame, "focustarget") - frame:UpdateAllElements() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/basic/pet.lua b/Interface/AddOns/SVUI/packages/unit/frames/basic/pet.lua deleted file mode 100644 index f192a51..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/basic/pet.lua +++ /dev/null @@ -1,67 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## ---]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ... -local oUF_SuperVillain = ns.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local ceil,tinsert = math.ceil,table.insert ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -function MOD.Construct:pet(frame) - MOD:SetActionPanel(frame, "pet") - frame.Health = MOD:CreateHealthBar(frame, true) - frame.Health.frequentUpdates = true; - frame.Power = MOD:CreatePowerBar(frame, true) - frame.Power.frequentUpdates = false; - MOD:CreatePortrait(frame, true) - frame.Buffs = MOD:CreateBuffs(frame) - frame.RaidIcon = MOD:CreateRaidIcon(frame) - frame.Debuffs = MOD:CreateDebuffs(frame) - frame.Castbar = MOD:CreateCastbar(frame, false, nil, false) - frame.HealPrediction = MOD:CreateHealPrediction(frame) - frame.AuraWatch = MOD:CreateAuraWatch(frame) - frame.Range = { insideAlpha = 1, outsideAlpha = 1 } - frame:Point("BOTTOM", SuperVillain.UIParent, "BOTTOM", 0, 182) - SuperVillain:SetSVMovable(frame, frame:GetName().."_MOVE", L["Pet Frame"], nil, nil, nil, "ALL, SOLO") -end ---[[ -########################################################## -UPDATE -########################################################## -]]-- -function MOD.FrameUpdate:pet(unit, frame, db) - local UNIT_WIDTH = db.width; - local UNIT_HEIGHT = db.height; - frame.unit = unit; - frame:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") - frame.colors = oUF_SuperVillain.colors; - frame:Size(UNIT_WIDTH, UNIT_HEIGHT) - _G[frame:GetName().."_MOVE"]:Size(frame:GetSize()) - MOD:RefreshUnitLayout(frame, "pet") - do - if SVUI_Player and not InCombatLockdown()then - frame:SetParent(SVUI_Player) - end - end - MOD:UpdateAuraWatch(frame) - frame:UpdateAllElements() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/basic/player.lua b/Interface/AddOns/SVUI/packages/unit/frames/basic/player.lua deleted file mode 100644 index 907b318..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/basic/player.lua +++ /dev/null @@ -1,214 +0,0 @@ - --[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - --]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ... -local oUF_SuperVillain = ns.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local ceil,tinsert = math.ceil,table.insert -local LSM = LibStub("LibSharedMedia-3.0") ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -function MOD.Construct:player(frame) - MOD:SetActionPanel(frame, "player") - frame.Health = MOD:CreateHealthBar(frame, true) - frame.Health.frequentUpdates = true - frame.Power = MOD:CreatePowerBar(frame, true) - frame.Power.frequentUpdates = true - MOD:CreatePortrait(frame, false, true) - frame.Buffs = MOD:CreateBuffs(frame) - frame.Debuffs = MOD:CreateDebuffs(frame) - frame.Castbar = MOD:CreateCastbar(frame, false, L["Player Castbar"], true, true) - MOD:CreateExperienceRepBar(frame) - MOD:GetClassResources(frame) - frame.RaidIcon = MOD:CreateRaidIcon(frame) - frame.Resting = MOD:CreateRestingIndicator(frame) - frame.Combat = MOD:CreateCombatIndicator(frame) - frame.PvPText = frame.InfoPanel:CreateFontString(nil,'OVERLAY') - frame.PvPText:SetFontTemplate(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) - frame.Afflicted = MOD:CreateAfflicted(frame) - frame.HealPrediction = MOD:CreateHealPrediction(frame, true) - frame.AuraBars = MOD:CreateAuraBarHeader(frame, "player") - frame.CombatFade = true; - frame:Point("BOTTOMLEFT", SuperVillain.UIParent, "BOTTOM", -413, 182) - SuperVillain:SetSVMovable(frame, frame:GetName().."_MOVE", L["Player Frame"], nil, nil, nil, "ALL, SOLO") -end ---[[ -########################################################## -UPDATE -########################################################## -]]-- -function MOD.FrameUpdate:player(unit, frame, db) - local UNIT_WIDTH = db.width; - local UNIT_HEIGHT = db.height; - local USE_CLASSBAR = db.classbar.enable; - local classBarHeight = db.classbar.height; - local classBarWidth = db.width * 0.4; - local healthPanel = frame.HealthPanel - local iconDB = db.icons - - frame.unit = unit - frame:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") - frame.colors = oUF_SuperVillain.colors; - frame:Size(UNIT_WIDTH, UNIT_HEIGHT) - _G[frame:GetName().."_MOVE"]:Size(frame:GetSize()) - - MOD:RefreshUnitLayout(frame, "player") - - do - local resting = frame.Resting; - if resting then - if iconDB and iconDB.restIcon and iconDB.restIcon.enable then - local size = iconDB.restIcon.size; - resting:ClearAllPoints() - resting:Size(size) - SuperVillain:ReversePoint(resting, iconDB.restIcon.attachTo, healthPanel, iconDB.restIcon.xOffset, iconDB.restIcon.yOffset) - if not frame:IsElementEnabled("Resting")then - frame:EnableElement("Resting") - end - elseif frame:IsElementEnabled("Resting")then - frame:DisableElement("Resting") - resting:Hide() - end - end - end - do - local combat = frame.Combat; - if combat then - if iconDB and iconDB.combatIcon and iconDB.combatIcon.enable then - local size = iconDB.combatIcon.size; - combat:ClearAllPoints() - combat:Size(size) - SuperVillain:ReversePoint(combat, iconDB.combatIcon.attachTo, healthPanel, iconDB.combatIcon.xOffset, iconDB.combatIcon.yOffset) - if not frame:IsElementEnabled("Combat")then - frame:EnableElement("Combat") - end - elseif frame:IsElementEnabled("Combat")then - frame:DisableElement("Combat") - combat:Hide() - end - end - end - do - local pvp = frame.PvPText; - local point = db.pvp.position; - pvp:ClearAllPoints() - pvp:Point(db.pvp.position, healthPanel, db.pvp.position) - frame:Tag(pvp, db.pvp.tags) - end - do - local power = frame.Power; - if SuperVillain.class == "DRUID" and frame.DruidAltMana then - if db.power.druidMana then - frame:EnableElement("DruidAltMana") - else - frame:DisableElement("DruidAltMana") - frame.DruidAltMana:Hide() - end - end - if SuperVillain.class == "MONK" then - local stagger = frame.DrunkenMaster; - if db.stagger.enable then - if not frame:IsElementEnabled("DrunkenMaster")then - frame:EnableElement("DrunkenMaster") - end - else - if frame:IsElementEnabled("DrunkenMaster")then - frame:DisableElement("DrunkenMaster") - end - end - end - end - do - if(frame.DruidAltMana) then - if db.power.druidMana then - frame:EnableElement("DruidAltMana") - else - frame:DisableElement("DruidAltMana") - frame.DruidAltMana:Hide() - end - end - if(frame.DrunkenMaster) then - if db.stagger.enable then - if not frame:IsElementEnabled("DrunkenMaster")then - frame:EnableElement("DrunkenMaster") - end - else - if frame:IsElementEnabled("DrunkenMaster")then - frame:DisableElement("DrunkenMaster") - end - end - end - - if(frame.ClassBar or frame.HyperCombo) then - if frame.ClassBarRefresh then - frame.ClassBarRefresh(frame) - end - if(frame.ClassBar) then - local classBar = frame[frame.ClassBar]; - if not db.classbar.detachFromFrame then - if classBar.Avatar then - classBar.Avatar:SetScale(0.000001) - classBar.Avatar:SetAlpha(0) - end - else - classBarWidth = db.classbar.detachedWidth; - if not classBar.Avatar then - classBar:Point("TOPLEFT", frame, "BOTTOMLEFT", 0, -2) - SuperVillain:SetSVMovable(classBar, "ClassBar_MOVE", L["Classbar"], nil, nil, nil, "ALL, SOLO") - else - classBar.Avatar:SetScale(1) - classBar.Avatar:SetAlpha(1) - end - end - if USE_CLASSBAR then - if(not frame:IsElementEnabled(frame.ClassBar)) then - frame:EnableElement(frame.ClassBar) - end - classBar:Show() - else - if(frame:IsElementEnabled(frame.ClassBar)) then - frame:DisableElement(frame.ClassBar) - end - classBar:Hide() - end - end - if(frame.HyperCombo) then - if not frame:IsElementEnabled("HyperCombo") then - frame:EnableElement("HyperCombo") - end - else - if frame:IsElementEnabled("HyperCombo") then - frame:DisableElement("HyperCombo") - end - end - end - end - do - if db.combatfade and not frame:IsElementEnabled("CombatFade")then - frame:EnableElement("CombatFade") - elseif - not db.combatfade and frame:IsElementEnabled("CombatFade")then - frame:DisableElement("CombatFade") - end - end - frame:UpdateAllElements() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/basic/pt.lua b/Interface/AddOns/SVUI/packages/unit/frames/basic/pt.lua deleted file mode 100644 index 36b521d..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/basic/pt.lua +++ /dev/null @@ -1,55 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## ---]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ... -local oUF_SuperVillain = ns.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local ceil,tinsert = math.ceil,table.insert ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -function MOD.Construct:pettarget(frame) - MOD:SetActionPanel(frame, "pettarget") - frame.Health = MOD:CreateHealthBar(frame, true) - frame.Power = MOD:CreatePowerBar(frame, true) - frame.Buffs = MOD:CreateBuffs(frame) - frame.Debuffs = MOD:CreateDebuffs(frame) - frame.Range = { insideAlpha = 1, outsideAlpha = 1 } - frame:Point("BOTTOM", SVUI_Pet, "TOP", 0, 7) - SuperVillain:SetSVMovable(frame, frame:GetName().."_MOVE", L["PetTarget Frame"], nil, -7, nil, "ALL, SOLO") -end ---[[ -########################################################## -UPDATE -########################################################## -]]-- -function MOD.FrameUpdate:pettarget(unit, frame, db) - local UNIT_WIDTH = db.width; - local UNIT_HEIGHT = db.height; - - frame.unit = unit; - frame:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") - frame.colors = oUF_SuperVillain.colors; - frame:Size(UNIT_WIDTH, UNIT_HEIGHT) - _G[frame:GetName().."_MOVE"]:Size(frame:GetSize()) - MOD:RefreshUnitLayout(frame, "pettarget") - frame:UpdateAllElements() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/basic/target.lua b/Interface/AddOns/SVUI/packages/unit/frames/basic/target.lua deleted file mode 100644 index e9caf8a..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/basic/target.lua +++ /dev/null @@ -1,132 +0,0 @@ - --[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - --]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ... -local oUF_SuperVillain = ns.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local ceil,tinsert = math.ceil,table.insert ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -function MOD.Construct:target(frame) - MOD:SetActionPanel(frame, "target") - - frame.Health = MOD:CreateHealthBar(frame, true, true) - frame.Health.frequentUpdates = true - frame.HealPrediction = MOD:CreateHealPrediction(frame, true) - - frame.Power = MOD:CreatePowerBar(frame, true, true) - frame.Power.frequentUpdates = true - - MOD:CreatePortrait(frame) - - frame.Castbar = MOD:CreateCastbar(frame, true, L["Target Castbar"], true) - - frame.Buffs = MOD:CreateBuffs(frame) - frame.Debuffs = MOD:CreateDebuffs(frame) - frame.AuraBars = MOD:CreateAuraBarHeader(frame, "target") - frame.Afflicted = MOD:CreateAfflicted(frame) - tinsert(frame.__elements, MOD.SmartAuraDisplay) - frame:RegisterEvent("PLAYER_TARGET_CHANGED", MOD.SmartAuraDisplay) - - frame.RaidIcon = MOD:CreateRaidIcon(frame) - local isSmall = MOD.db.target.combobar.smallIcons - if(SuperVillain.class == "ROGUE") then - frame.HyperCombo = MOD:CreateRogueCombobar(frame, isSmall) - elseif(SuperVillain.class == "DRUID") then - frame.HyperCombo = MOD:CreateDruidCombobar(frame, isSmall) - end - - frame.GPS = MOD:CreateGPS(frame) - frame.Range = { insideAlpha = 1, outsideAlpha = 1 } - frame.XRay = MOD:CreateXRay(frame) - frame.XRay:SetPoint("TOPRIGHT", 12, 12) - frame:Point("BOTTOMRIGHT", SuperVillain.UIParent, "BOTTOM", 413, 182) - SuperVillain:SetSVMovable(frame, frame:GetName().."_MOVE", L["Target Frame"], nil, nil, nil, "ALL, SOLO") -end ---[[ -########################################################## -UPDATE -########################################################## -]]-- -function MOD.FrameUpdate:target(unit, frame, db) - local UNIT_WIDTH = db.width; - local UNIT_HEIGHT = db.height; - local USE_COMBOBAR = db.combobar.enable; - local comboBarHeight = db.combobar.height; - - frame.unit = unit; - frame:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") - frame.colors = oUF_SuperVillain.colors; - frame:Size(UNIT_WIDTH, UNIT_HEIGHT) - _G[frame:GetName().."_MOVE"]:Size(frame:GetSize()) - if not frame:IsElementEnabled("ActionPanel")then - frame:EnableElement("ActionPanel") - end - MOD:RefreshUnitLayout(frame, "target") - - if(MOD.db.xrayFocus) then - frame.XRay:Show() - else - frame.XRay:Hide() - end - - if not IsAddOnLoaded("Clique")then - if db.middleClickFocus then - frame:SetAttribute("type3", "focus") - elseif frame:GetAttribute("type3") == "focus"then - frame:SetAttribute("type3", nil) - end - end - - if (SuperVillain.class == "ROGUE" or SuperVillain.class == "DRUID") and frame.HyperCombo then - local comboBar = frame.HyperCombo; - if frame.ComboRefresh then - frame.ComboRefresh(frame) - end - if db.combobar.autoHide then - comboBar:SetParent(frame) - else - comboBar:SetParent(SuperVillain.UIParent) - end - - if comboBar.Avatar then - comboBar.Avatar:SetScale(0.000001) - comboBar.Avatar:SetAlpha(0) - end - - if USE_COMBOBAR and not frame:IsElementEnabled("HyperCombo")then - frame:EnableElement("HyperCombo") - elseif not USE_COMBOBAR and frame:IsElementEnabled("HyperCombo")then - frame:DisableElement("HyperCombo") - comboBar:Hide() - end - end - - do - local gps = frame.GPS; - if not frame:IsElementEnabled("GPS") then - frame:EnableElement("GPS") - end - end - - frame:UpdateAllElements() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/basic/tot.lua b/Interface/AddOns/SVUI/packages/unit/frames/basic/tot.lua deleted file mode 100644 index 41a6bcc..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/basic/tot.lua +++ /dev/null @@ -1,57 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## ---]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ... -local oUF_SuperVillain = ns.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local ceil,tinsert = math.ceil,table.insert ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -function MOD.Construct:targettarget(frame) - MOD:SetActionPanel(frame, "targettarget") - frame.Health = MOD:CreateHealthBar(frame, true) - frame.Power = MOD:CreatePowerBar(frame, true) - MOD:CreatePortrait(frame, true) - frame.Buffs = MOD:CreateBuffs(frame) - frame.RaidIcon = MOD:CreateRaidIcon(frame) - frame.Debuffs = MOD:CreateDebuffs(frame) - frame.Range = { insideAlpha = 1, outsideAlpha = 1 } - frame:Point("BOTTOM", SuperVillain.UIParent, "BOTTOM", 0, 213) - SuperVillain:SetSVMovable(frame, frame:GetName().."_MOVE", L["TargetTarget Frame"], nil, nil, nil, "ALL, SOLO") -end ---[[ -########################################################## -UPDATE -########################################################## -]]-- -function MOD.FrameUpdate:targettarget(unit, frame, db) - local UNIT_WIDTH = db.width; - local UNIT_HEIGHT = db.height; - - frame.unit = unit; - frame:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") - frame.colors = oUF_SuperVillain.colors; - frame:Size(UNIT_WIDTH, UNIT_HEIGHT) - _G[frame:GetName().."_MOVE"]:Size(frame:GetSize()) - MOD:RefreshUnitLayout(frame, "targettarget") - frame:UpdateAllElements() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/extra/arena.lua b/Interface/AddOns/SVUI/packages/unit/frames/extra/arena.lua deleted file mode 100644 index e889cf3..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/extra/arena.lua +++ /dev/null @@ -1,177 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## ---]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ... -local oUF_SuperVillain = ns.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local ceil,tinsert = math.ceil,table.insert -local lastFrame ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -local function PrepFrame_OnUpdate(self, event, unit, arg) - if((event == "ARENA_OPPONENT_UPDATE" or event == "UNIT_NAME_UPDATE") and unit ~= self.unit) then return end - local _, check = IsInInstance() - if(not MOD.db.arena.enable or check ~= "arena" or UnitExists(self.unit) and arg ~= "unseen") then - self:Hide() - return - end - - local frame = self:GetParent() - if(frame and frame.GetParent) then - local id = frame:GetID() - local spec = GetArenaOpponentSpec(id) - local _, x, y, z; - if spec and spec > 0 then - _, x, _, y, _, _, z = GetSpecializationInfoByID(spec) - end - - if z and x then - local color = RAID_CLASS_COLORS[z] - self.SpecClass:SetText(x .. " - " .. LOCALIZED_CLASS_NAMES_MALE[z]) - self.Health:SetStatusBarColor(color.r, color.g, color.b) - self.Icon:SetTexture(y or [[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]) - self:Show() - else - self:Hide() - end - end -end - -function MOD.Construct:arena(frame) - MOD:SetActionPanel(frame, "arena") - frame.Health = MOD:CreateHealthBar(frame, true, true) - frame.Power = MOD:CreatePowerBar(frame, true) - MOD:CreatePortrait(frame) - frame.Buffs = MOD:CreateBuffs(frame) - frame.Debuffs = MOD:CreateDebuffs(frame) - frame.Castbar = MOD:CreateCastbar(frame, true, nil, true, nil, true) - --frame.HealPrediction = MOD:CreateHealPrediction(frame) - frame.Trinket = MOD:CreateTrinket(frame) - frame.PVPSpecIcon = MOD:CreatePVPSpecIcon(frame) - frame.Range = { insideAlpha = 1, outsideAlpha = 1 } - frame:SetAttribute("type2", "focus") - - if not frame.prepFrame then - frame.prepFrame = CreateFrame("Frame", frame:GetName().."PrepFrame", UIParent) - frame.prepFrame:SetFrameStrata("MEDIUM") - frame.prepFrame:SetAllPoints(frame) - frame.prepFrame:SetID(frame:GetID()) - frame.prepFrame.Health = CreateFrame("StatusBar", nil, frame.prepFrame) - frame.prepFrame.Health:Point("BOTTOMLEFT", frame.prepFrame, "BOTTOMLEFT", 1, 1) - frame.prepFrame.Health:Point("TOPRIGHT", frame.prepFrame, "TOPRIGHT", -(1 + MOD.db.arena.height), -1) - frame.prepFrame.Health:SetPanelTemplate() - frame.prepFrame.Icon = frame.prepFrame:CreateTexture(nil, "OVERLAY") - frame.prepFrame.Icon.bg = CreateFrame("Frame", nil, frame.prepFrame) - frame.prepFrame.Icon.bg:Point("TOPLEFT", frame.prepFrame, "TOPRIGHT", 1, 0) - frame.prepFrame.Icon.bg:Point("BOTTOMRIGHT", frame.prepFrame, "BOTTOMRIGHT", 1, 0) - frame.prepFrame.Icon.bg:SetFixedPanelTemplate() - frame.prepFrame.Icon:SetParent(frame.prepFrame.Icon.bg) - frame.prepFrame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - frame.prepFrame.Icon:FillInner(frame.prepFrame.Icon.bg) - frame.prepFrame.SpecClass = frame.prepFrame.Health:CreateFontString(nil, "OVERLAY", "NumberFont_Outline_Large") - frame.prepFrame.SpecClass:SetPoint("CENTER") - frame.prepFrame.unit = frame.unit; - frame.prepFrame:RegisterEvent("PLAYER_ENTERING_WORLD") - frame.prepFrame:RegisterEvent("ARENA_OPPONENT_UPDATE") - frame.prepFrame:RegisterEvent("UNIT_NAME_UPDATE") - frame.prepFrame:RegisterEvent("ARENA_PREP_OPPONENT_SPECIALIZATIONS") - frame.prepFrame:SetScript("OnEvent", PrepFrame_OnUpdate) - frame.prepFrame.Health:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) - end - - local frameName = frame:GetName() - if(not _G["SVUI_Arena_MOVE"]) then - frame:Point("RIGHT", SuperVillain.UIParent, "RIGHT", -105, 0) - SuperVillain:SetSVMovable(frame, "SVUI_Arena_MOVE", L["Arena Frames"], nil, nil, nil, "ALL, ARENA") - else - frame:Point("TOPRIGHT", lastFrame, "BOTTOMRIGHT", 0, -20) - end - lastFrame = frame -end ---[[ -########################################################## -UPDATE -########################################################## -]]-- -function MOD.FrameUpdate:arena(unit, frame, db) - local INDEX = frame.index; - local holder = _G["SVUI_Arena_MOVE"] - local UNIT_WIDTH = db.width; - local UNIT_HEIGHT = db.height; - MOD:RefreshUnitMedia(frame, db) - frame.unit = unit - frame.colors = oUF_SuperVillain.colors; - frame:Size(UNIT_WIDTH, UNIT_HEIGHT) - frame:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") - - do - local trinket = frame.Trinket; - trinket.bg:Size(db.pvpTrinket.size) - trinket.bg:ClearAllPoints() - if(db.pvpTrinket.position == "RIGHT") then - trinket.bg:Point("LEFT", frame, "RIGHT", db.pvpTrinket.xOffset, db.pvpTrinket.yOffset) - else - trinket.bg:Point("RIGHT", frame, "LEFT", db.pvpTrinket.xOffset, db.pvpTrinket.yOffset) - end - if db.pvpTrinket.enable and not frame:IsElementEnabled("Trinket")then - frame:EnableElement("Trinket") - elseif not db.pvpTrinket.enable and frame:IsElementEnabled("Trinket")then - frame:DisableElement("Trinket") - end - end - do - local pvp = frame.PVPSpecIcon; - pvp.bg:Point("RIGHT", frame, "RIGHT") - pvp.bg:Size(UNIT_HEIGHT, UNIT_HEIGHT) - if db.pvpSpecIcon then - frame.InfoPanel:Point("TOPLEFT", frame, "TOPLEFT", 0, 0) - frame.InfoPanel:Point("BOTTOMRIGHT", frame.PVPSpecIcon, "BOTTOMLEFT", 0, 0) - if frame:IsElementEnabled("PVPSpecIcon")then - frame:EnableElement("PVPSpecIcon") - end - elseif frame:IsElementEnabled("PVPSpecIcon")then - frame:DisableElement("PVPSpecIcon") - end - end - - MOD:RefreshUnitLayout(frame, "arena") - - frame:ClearAllPoints() - if(INDEX == 1) then - holder:Width(UNIT_WIDTH) - holder:Height(UNIT_HEIGHT + (UNIT_HEIGHT + 12 + db.castbar.height) * 4) - if(db.showBy == "UP") then - frame:Point("BOTTOMRIGHT", holder, "BOTTOMRIGHT") - else - frame:Point("TOPRIGHT", holder, "TOPRIGHT") - end - else - local yOffset = (UNIT_HEIGHT + 12 + db.castbar.height) * (INDEX - 1) - if(db.showBy == "UP") then - frame:Point("BOTTOMRIGHT", holder, "BOTTOMRIGHT", 0, yOffset) - else - frame:Point("TOPRIGHT", holder, "TOPRIGHT", 0, -yOffset) - end - end - - frame:UpdateAllElements() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/extra/boss.lua b/Interface/AddOns/SVUI/packages/unit/frames/extra/boss.lua deleted file mode 100644 index 1f4e94b..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/extra/boss.lua +++ /dev/null @@ -1,89 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## ---]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ... -local oUF_SuperVillain = ns.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local ceil,tinsert = math.ceil,table.insert -local frameNumber, lastFrame = 0 ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -function MOD.Construct:boss(frame) - MOD:SetActionPanel(frame, "boss") - frame.Health = MOD:CreateHealthBar(frame, true, true) - frame.Power = MOD:CreatePowerBar(frame, true, true) - MOD:CreatePortrait(frame) - frame.Buffs = MOD:CreateBuffs(frame) - frame.Debuffs = MOD:CreateDebuffs(frame) - frame.Afflicted = MOD:CreateAfflicted(frame) - frame.Castbar = MOD:CreateCastbar(frame, true, nil, true, nil, true) - frame.RaidIcon = MOD:CreateRaidIcon(frame) - frame.AltPowerBar = MOD:CreateAltPowerBar(frame) - frame.Range = { insideAlpha = 1, outsideAlpha = 1 } - frame:SetAttribute("type2", "focus") - local frameName = frame:GetName() - frameNumber = frameNumber + 1 - if(not _G["SVUI_Boss_MOVE"]) then - frame:Point("RIGHT", SuperVillain.UIParent, "RIGHT", -105, 0) - SuperVillain:SetSVMovable(frame, "SVUI_Boss_MOVE", L["Boss Frames"], nil, nil, nil, "ALL, PARTY, RAID10, RAID25, RAID40") - else - frame:Point("TOPRIGHT", lastFrame, "BOTTOMRIGHT", 0, -20) - end - lastFrame = frame -end ---[[ -########################################################## -UPDATE -########################################################## -]]-- -function MOD.FrameUpdate:boss(unit, frame, db) - frameNumber = frame.index; - local holder = _G["SVUI_Boss_MOVE"] - local UNIT_WIDTH = db.width; - local UNIT_HEIGHT = db.height; - - frame.unit = unit; - frame.colors = oUF_SuperVillain.colors; - frame:Size(UNIT_WIDTH, UNIT_HEIGHT) - frame:ClearAllPoints() - if frameNumber == 1 then - holder:Width(UNIT_WIDTH) - holder:Height(UNIT_HEIGHT + (UNIT_HEIGHT + 12 + db.castbar.height) * 4) - if db.showBy == "UP"then - frame:Point("BOTTOMRIGHT", holder, "BOTTOMRIGHT") - else - frame:Point("TOPRIGHT", holder, "TOPRIGHT") - end - else - local yOffset = (UNIT_HEIGHT + 12 + db.castbar.height) * (frameNumber - 1) - if db.showBy == "UP"then - frame:Point("BOTTOMRIGHT", holder, "BOTTOMRIGHT", 0, yOffset) - else - frame:Point("TOPRIGHT", holder, "TOPRIGHT", 0, -yOffset) - end - end - - frame:RegisterForClicks(MOD.db.fastClickTarget and"AnyDown"or"AnyUp") - - MOD:RefreshUnitLayout(frame, "boss") - frame:UpdateAllElements() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/focus.lua b/Interface/AddOns/SVUI/packages/unit/frames/focus.lua new file mode 100644 index 0000000..2ab9bb6 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/unit/frames/focus.lua @@ -0,0 +1,102 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +--]] +local SuperVillain, L = unpack(select(2, ...)); +local MOD = SuperVillain.Registry:Expose('SVUnit'); +local _, ns = ... +local oUF_SuperVillain = ns.oUF +--[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- +local assert = enforce; +assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +local ceil,tinsert = math.ceil,table.insert +--[[ +########################################################## +BUILD FUNCTION +########################################################## +]]-- +function MOD.Construct:focus() + MOD:SetActionPanel(self, "focus") + + self.Health = MOD:CreateHealthBar(self, true, true) + self.Health.frequentUpdates = true + + self.HealPrediction = MOD:CreateHealPrediction(self, true) + self.Power = MOD:CreatePowerBar(self, true) + + self.Castbar = MOD:CreateCastbar(self, false, L["Focus Castbar"]) + self.Castbar.SafeZone = nil + + self.Castbar.LatencyTexture:Hide() + self.Buffs = MOD:CreateBuffs(self, "focus") + self.Debuffs = MOD:CreateDebuffs(self, "focus") + self.AuraBars = MOD:CreateAuraBarHeader(self, "focus") + tinsert(self.__elements, MOD.SmartAuraDisplay) + self:RegisterEvent("PLAYER_FOCUS_CHANGED", MOD.SmartAuraDisplay) + + self.RaidIcon = MOD:CreateRaidIcon(self) + self.Range = { insideAlpha = 1, outsideAlpha = 1 } + self.XRay = MOD:CreateXRay_Closer(self) + self.XRay:SetPoint("BOTTOMRIGHT", 20, -10) + self:Point("BOTTOMRIGHT", SVUI_Target, "TOPRIGHT", 0, 220) + SuperVillain:SetSVMovable(self, self:GetName().."_MOVE", L["Focus Frame"], nil, nil, nil, "ALL, SOLO") +end + +function MOD.Construct:focustarget() + MOD:SetActionPanel(self, "focustarget") + self.Health = MOD:CreateHealthBar(self, true) + self.Power = MOD:CreatePowerBar(self, true) + self.Buffs = MOD:CreateBuffs(self, "focustarget") + self.Debuffs = MOD:CreateDebuffs(self, "focustarget") + self.RaidIcon = MOD:CreateRaidIcon(self) + self.Range = { insideAlpha = 1, outsideAlpha = 1 } + self:Point("BOTTOM", SVUI_Focus, "TOP", 0, 7) + SuperVillain:SetSVMovable(self, self:GetName().."_MOVE", L["FocusTarget Frame"], nil, -7, nil, "ALL, SOLO") +end +--[[ +########################################################## +UPDATE +########################################################## +]]-- +function MOD.FrameUpdate:focus() + local db = MOD.db["focus"] + local UNIT_WIDTH = db.width; + local UNIT_HEIGHT = db.height; + self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self.colors = oUF_SuperVillain.colors; + self:Size(UNIT_WIDTH, UNIT_HEIGHT) + _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + MOD:RefreshUnitLayout(self, "focus") + + if(MOD.db.xrayFocus) then + self.XRay:Show() + else + self.XRay:Hide() + end + + MOD:UpdateAuraWatch(self) + self:UpdateAllElements() +end + +function MOD.FrameUpdate:focustarget() + local db = MOD.db["focustarget"] + local UNIT_WIDTH = db.width; + local UNIT_HEIGHT = db.height; + self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self.colors = oUF_SuperVillain.colors; + self:Size(UNIT_WIDTH, UNIT_HEIGHT) + _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + MOD:RefreshUnitLayout(self, "focustarget") + self:UpdateAllElements() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/group/assist.lua b/Interface/AddOns/SVUI/packages/unit/frames/group/assist.lua deleted file mode 100644 index 1c1a6ab..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/group/assist.lua +++ /dev/null @@ -1,106 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## ---]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ...; -local oUF_SuperVillain = ns.oUF; ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); -local tinsert = table.insert; -local StealthFrame = CreateFrame("Frame"); -StealthFrame:Hide(); ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -function MOD.Construct:assist(...) - self:SetScript("OnEnter", UnitFrame_OnEnter) - self:SetScript("OnLeave", UnitFrame_OnLeave) - MOD:SetActionPanel(self, "assist") - self.Health = MOD:CreateHealthBar(self, true) - self.RaidIcon = MOD:CreateRaidIcon(self) - self.RaidIcon:SetPoint("BOTTOMRIGHT") - self.Range = { insideAlpha = 1, outsideAlpha = 1 } - MOD.FrameUpdate:assist(self, MOD.db["assist"]) - self.originalParent = self:GetParent() - return self -end ---[[ -########################################################## -UPDATE -########################################################## -]]-- -function MOD.HeaderUpdate:assist(frame, db) - frame:Hide() - MOD:DetachSubFrames(frame:GetChildren()) - frame:SetAttribute("startingIndex", -1) - RegisterAttributeDriver(frame, "state-visibility", "show") - frame.dirtyWidth, frame.dirtyHeight = frame:GetSize() - RegisterAttributeDriver(frame, "state-visibility", "[@raid1, exists] show;hide") - frame:SetAttribute("startingIndex", 1) - frame:SetAttribute("point", "BOTTOM") - frame:SetAttribute("columnAnchorPoint", "LEFT") - MOD:DetachSubFrames(frame:GetChildren()) - frame:SetAttribute("yOffset", 7) - if not frame.positioned then - frame:ClearAllPoints() - frame:Point("TOPLEFT", SuperVillain.UIParent, "TOPLEFT", 4, -140) - SuperVillain:SetSVMovable(frame, frame:GetName().."_MOVE", L["Assist Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") - frame.Avatar.positionOverride = "TOPLEFT" - frame:SetAttribute("minHeight", frame.dirtyHeight) - frame:SetAttribute("minWidth", frame.dirtyWidth) - frame.positioned = true - end -end - -function MOD.FrameUpdate:assist(frame, db) - - frame.colors = oUF_SuperVillain.colors; - frame:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") - if frame.isChild and frame.originalParent then - local targets = db.targetsGroup; - if not frame.originalParent.childList then - frame.originalParent.childList = {} - end - frame.originalParent.childList[frame] = true; - if not InCombatLockdown()then - if targets.enable then - frame:SetParent(frame.originalParent) - frame:Size(targets.width, targets.height) - frame:ClearAllPoints() - SuperVillain:ReversePoint(frame, targets.anchorPoint, frame.originalParent, targets.xOffset, targets.yOffset) - else - frame:SetParent(StealthFrame) - end - end - elseif not InCombatLockdown()then - frame:Size(db.width, db.height) - end - - MOD:RefreshUnitLayout(frame, "assist") - - do - local nametext = frame.InfoPanel.Name; - if oUF_SuperVillain.colors.healthclass then - frame:Tag(nametext, "[name:10]") - else - frame:Tag(nametext, "[name:color][name:10]") - end - end - frame:UpdateAllElements() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/group/party.lua b/Interface/AddOns/SVUI/packages/unit/frames/group/party.lua deleted file mode 100644 index da20133..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/group/party.lua +++ /dev/null @@ -1,197 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## ---]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ... -local oUF_SuperVillain = ns.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local ceil,tinsert = math.ceil,table.insert -local StealthFrame = CreateFrame("Frame"); -StealthFrame:Hide(); - -local UpdateTargetGlow = function(self) - if not self.unit then return end - local unit = self.unit; - if(UnitIsUnit(unit, "target")) then - self.TargetGlow:Show() - local reaction = UnitReaction(unit, "player") - if(UnitIsPlayer(unit)) then - local _, class = UnitClass(unit) - if class then - local colors = SVUI_CLASS_COLORS[class] - self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) - else - self.TargetGlow:SetBackdropBorderColor(1, 1, 1) - end - elseif(reaction) then - local colors = FACTION_BAR_COLORS[reaction] - self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) - else - self.TargetGlow:SetBackdropBorderColor(1, 1, 1) - end - else - self.TargetGlow:Hide() - end -end ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -function MOD.Construct:party(frame) - MOD:SetActionPanel(self, "party") - - self:SetScript("OnEnter", UnitFrame_OnEnter) - self:SetScript("OnLeave", UnitFrame_OnLeave) - - if self.isChild then - self.Health = MOD:CreateHealthBar(self, true) - self.originalParent = self:GetParent() - else - self.Health = MOD:CreateHealthBar(self, true) - self.Power = MOD:CreatePowerBar(self, true) - self.Power.frequentUpdates = false - MOD:CreatePortrait(self, true) - self.Buffs = MOD:CreateBuffs(self) - self.Debuffs = MOD:CreateDebuffs(self) - self.AuraWatch = MOD:CreateAuraWatch(self) - self.Afflicted = MOD:CreateAfflicted(self) - self.ResurrectIcon = MOD:CreateResurectionIcon(self) - self.LFDRole = MOD:CreateRoleIcon(self) - self.RaidRoleFramesAnchor = MOD:CreateRaidRoleFrames(self) - self.RaidIcon = MOD:CreateRaidIcon(self) - self.ReadyCheck = MOD:CreateReadyCheckIcon(self) - self.HealPrediction = MOD:CreateHealPrediction(self) - - local shadow = CreateFrame("Frame", nil, self) - shadow:SetFrameLevel(1) - shadow:SetFrameStrata(self:GetFrameStrata()) - shadow:WrapOuter(self, 3, 3) - shadow:SetBackdrop({ - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = SuperVillain:Scale(3), - insets = { - left = SuperVillain:Scale(5), - right = SuperVillain:Scale(5), - top = SuperVillain:Scale(5), - bottom = SuperVillain:Scale(5) - } - }) - shadow:SetBackdropColor(0, 0, 0, 0) - shadow:SetBackdropBorderColor(0, 0, 0, 0.9) - shadow:Hide() - self.TargetGlow = shadow - tinsert(self.__elements, UpdateTargetGlow) - self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) - self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) - self:RegisterEvent("GROUP_ROSTER_UPDATE", UpdateTargetGlow) - end - - self.Range = { insideAlpha = 1, outsideAlpha = 1 } - - return self -end ---[[ -########################################################## -UPDATE -########################################################## -]]-- -function MOD.HeaderUpdate:party(frame) - local group = frame:GetParent() - if not group.positioned then - group:ClearAllPoints() - group:Point("LEFT",SuperVillain.UIParent,"LEFT",40,0) - - SuperVillain:SetSVMovable(group, group:GetName()..'_MOVE', L['Party Frames'], nil, nil, nil, 'ALL,PARTY,ARENA'); - group.positioned = true; - - group:RegisterEvent("PLAYER_ENTERING_WORLD") - group:RegisterEvent("ZONE_CHANGED_NEW_AREA") - group:SetScript("OnEvent", MOD.VisibilityUpdate.party) - end - - MOD.VisibilityUpdate.party(group) -end - -function MOD.VisibilityUpdate:party(event) - local db = MOD.db["party"] - if (not db or (db and not db.enable) or not MOD.db.smartRaidFilter or self.isForced) then return end - local instance, instanceType = IsInInstance() - if(event == "PLAYER_REGEN_ENABLED") then - self:UnregisterEvent("PLAYER_REGEN_ENABLED") - end - if(not InCombatLockdown()) then - if(instance and instanceType == "raid") then - UnregisterStateDriver(self,"visibility") - self:Hide() - elseif db.visibility then - RegisterStateDriver(self, "visibility", db.visibility) - end - else - self:RegisterEvent("PLAYER_REGEN_ENABLED") - end -end - -function MOD.FrameUpdate:party(frame,db) - frame.colors = oUF_SuperVillain.colors; - frame:RegisterForClicks(MOD.db.fastClickTarget and 'AnyDown' or 'AnyUp') - if frame.isChild then - local altDB = db.petsGroup; - if frame == _G[frame.originalParent:GetName()..'Target'] then - altDB = db.targetsGroup - end - if not frame.originalParent.childList then - frame.originalParent.childList = {} - end - frame.originalParent.childList[frame] = true; - if not InCombatLockdown()then - if altDB.enable then - frame:SetParent(frame.originalParent) - frame:Size(altDB.width,altDB.height) - frame:ClearAllPoints() - SuperVillain:ReversePoint(frame, altDB.anchorPoint, frame.originalParent, altDB.xOffset, altDB.yOffset) - else - frame:SetParent(StealthFrame) - end - end - do - local health = frame.Health; - health.Smooth = nil; - health.frequentUpdates = nil; - health.colorSmooth = nil; - health.colorHealth = nil; - health.colorClass = true; - health.colorReaction = true; - health:ClearAllPoints() - health:Point("TOPRIGHT", frame, "TOPRIGHT", -1, -1) - health:Point("BOTTOMLEFT", frame, "BOTTOMLEFT", 1, 1) - end - do - local nametext = frame.InfoPanel.Name - frame:Tag(nametext, altDB.tags) - end - else - if not InCombatLockdown() then - frame:Size(db.width,db.height) - end - MOD:RefreshUnitLayout(frame,"party") - MOD:UpdateAuraWatch(frame) - end - frame:EnableElement('ReadyCheck') - frame:UpdateAllElements() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/group/raid.lua b/Interface/AddOns/SVUI/packages/unit/frames/group/raid.lua deleted file mode 100644 index 1c91fad..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/group/raid.lua +++ /dev/null @@ -1,163 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## ---]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ... -local oUF_SuperVillain = ns.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local ceil,tinsert = math.ceil,table.insert -local LSM = LibStub("LibSharedMedia-3.0") - -local UpdateTargetGlow = function(self) - if not self.unit then return end; - local unit = self.unit; - if(UnitIsUnit(unit, "target")) then - self.TargetGlow:Show() - local reaction = UnitReaction(unit, "player") - if(UnitIsPlayer(unit)) then - local _, class = UnitClass(unit) - if class then - local colors = SVUI_CLASS_COLORS[class] - self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) - else - self.TargetGlow:SetBackdropBorderColor(1, 1, 1) - end - elseif(reaction) then - local colors = FACTION_BAR_COLORS[reaction] - self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) - else - self.TargetGlow:SetBackdropBorderColor(1, 1, 1) - end - else - self.TargetGlow:Hide() - end -end ---[[ -########################################################## -BUILD FUNCTION & UPDATE -########################################################## -]]-- -for i = 10, 40, 15 do - local raidGroupName = "raid"..i - MOD.Construct[raidGroupName] = function(self) - self:SetScript("OnEnter", UnitFrame_OnEnter) - self:SetScript("OnLeave", UnitFrame_OnLeave) - MOD:SetActionPanel(self, raidGroupName) - self.Health = MOD:CreateHealthBar(self, true) - self.Power = MOD:CreatePowerBar(self, true) - self.Power.frequentUpdates = false - self.Buffs = MOD:CreateBuffs(self) - self.Debuffs = MOD:CreateDebuffs(self) - self.AuraWatch = MOD:CreateAuraWatch(self) - self.RaidDebuffs = MOD:CreateRaidDebuffs(self) - self.Afflicted = MOD:CreateAfflicted(self) - self.ResurrectIcon = MOD:CreateResurectionIcon(self) - self.LFDRole = MOD:CreateRoleIcon(self) - self.RaidRoleFramesAnchor = MOD:CreateRaidRoleFrames(self) - self.RaidIcon = MOD:CreateRaidIcon(self) - self.ReadyCheck = MOD:CreateReadyCheckIcon(self) - self.HealPrediction = MOD:CreateHealPrediction(self) - self.Range = { insideAlpha = 1, outsideAlpha = 1 } - - local shadow = CreateFrame("Frame", nil, self) - shadow:SetFrameLevel(1) - shadow:SetFrameStrata(self:GetFrameStrata()) - shadow:WrapOuter(self, 3, 3) - shadow:SetBackdrop({ - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = SuperVillain:Scale(3), - insets = { - left = SuperVillain:Scale(5), - right = SuperVillain:Scale(5), - top = SuperVillain:Scale(5), - bottom = SuperVillain:Scale(5) - } - }) - shadow:SetBackdropColor(0, 0, 0, 0) - shadow:SetBackdropBorderColor(0, 0, 0, 0.9) - shadow:Hide() - self.TargetGlow = shadow - tinsert(self.__elements, UpdateTargetGlow) - self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) - self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) - - return frame - end; - - MOD.VisibilityUpdate[raidGroupName] = function(self, event) - if (not self.db or (self.db and not SuperVillain.db.SVUnit.enable) or (MOD.db and not MOD.db.smartRaidFilter) or self.isForced) then return end; - local instance, group = IsInInstance() - local _, _, _, _, info, _, _ = GetInstanceInfo() - if event == "PLAYER_REGEN_ENABLED"then - self:UnregisterEvent("PLAYER_REGEN_ENABLED") - end; - if not InCombatLockdown()then - if(instance and (group == "raid") and (info == i)) then - UnregisterStateDriver(self, "visibility") - self:Show() - elseif(instance and (group == "raid")) then - UnregisterStateDriver(self, "visibility") - self:Hide() - elseif self.db.visibility then - RegisterStateDriver(self, "visibility", self.db.visibility) - end - else - self:RegisterEvent("PLAYER_REGEN_ENABLED") - return - end - end; - - MOD.HeaderUpdate[raidGroupName] = function(_, unit, db) - local frame = unit:GetParent() - if not frame.positioned then - frame:ClearAllPoints() - frame:Point("LEFT", SuperVillain.UIParent, "LEFT", 4, 0) - SuperVillain:SetSVMovable(frame, frame:GetName().."_MOVE", L["Raid 1-"]..i..L[" Frames"], nil, nil, nil, "ALL, RAID"..i) - frame:RegisterEvent("PLAYER_ENTERING_WORLD") - frame:RegisterEvent("ZONE_CHANGED_NEW_AREA") - frame:SetScript("OnEvent", MOD.VisibilityUpdate[raidGroupName]) - frame.positioned = true - end; - MOD.VisibilityUpdate[raidGroupName](frame) - end; - - MOD.FrameUpdate[raidGroupName] = function(_, frame, db) - local rdSize = MOD.db.auraFontSize; - local rdFont = LSM:Fetch("font", MOD.db.auraFont) - frame.colors = oUF_SuperVillain.colors; - frame:RegisterForClicks(MOD.db.fastClickTarget and"AnyDown"or"AnyUp") - if not InCombatLockdown()then frame:Size(db.width, db.height)end; - MOD:RefreshUnitLayout(frame, raidGroupName) - do - local rdBuffs = frame.RaidDebuffs; - if db.rdebuffs.enable then - frame:EnableElement("RaidDebuffs") - rdBuffs:Size(db.rdebuffs.size) - rdBuffs:Point("CENTER", frame, "CENTER", db.rdebuffs.xOffset, db.rdebuffs.yOffset) - rdBuffs.count:SetFontTemplate(rdFont, rdSize, "OUTLINE") - rdBuffs.time:SetFontTemplate(rdFont, rdSize, "OUTLINE") - else - frame:DisableElement("RaidDebuffs") - rdBuffs:Hide() - end - end; - MOD:UpdateAuraWatch(frame) - frame:EnableElement("ReadyCheck") - frame:UpdateAllElements() - end; -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/group/rpet.lua b/Interface/AddOns/SVUI/packages/unit/frames/group/rpet.lua deleted file mode 100644 index ef30291..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/group/rpet.lua +++ /dev/null @@ -1,166 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## ---]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ... -local oUF_SuperVillain = ns.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local ceil,tinsert = math.ceil,table.insert - -local UpdateTargetGlow = function(self) - if not self.unit then return end - local unit = self.unit; - if(UnitIsUnit(unit, "target")) then - self.TargetGlow:Show() - local reaction = UnitReaction(unit, "player") - if(UnitIsPlayer(unit)) then - local _, class = UnitClass(unit) - if class then - local colors = SVUI_CLASS_COLORS[class] - self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) - else - self.TargetGlow:SetBackdropBorderColor(1, 1, 1) - end - elseif(reaction) then - local colors = FACTION_BAR_COLORS[reaction] - self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) - else - self.TargetGlow:SetBackdropBorderColor(1, 1, 1) - end - else - self.TargetGlow:Hide() - end -end - -local RaidPets_OnEvent = function(self, event) - if not self.db or (self.db and not self.db.enable) or (MOD.db and not MOD.db.smartRaidFilter) or self.isForced then return; end - local inInstance, instanceType = IsInInstance() - local _, _, _, _, maxPlayers, _, _ = GetInstanceInfo() - if event == "PLAYER_REGEN_ENABLED" then self:UnregisterEvent("PLAYER_REGEN_ENABLED") end - - if not InCombatLockdown() then - if inInstance and instanceType == "raid" then - UnregisterStateDriver(self, "visibility") - self:Show() - elseif self.db.visibility then - RegisterStateDriver(self, "visibility", self.db.visibility) - end - else - self:RegisterEvent("PLAYER_REGEN_ENABLED") - return - end -end ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -function MOD.Construct:raidpet(frame) - self:SetScript("OnEnter", UnitFrame_OnEnter) - self:SetScript("OnLeave", UnitFrame_OnLeave) - MOD:SetActionPanel(self, "raidpet") - self.Health = MOD:CreateHealthBar(self, true) - self.Debuffs = MOD:CreateDebuffs(self) - self.AuraWatch = MOD:CreateAuraWatch(self) - self.RaidDebuffs = MOD:CreateRaidDebuffs(self) - self.Afflicted = MOD:CreateAfflicted(self) - self.RaidIcon = MOD:CreateRaidIcon(self) - self.Range = { insideAlpha = 1, outsideAlpha = 1 } - - local shadow = CreateFrame("Frame", nil, self) - shadow:SetFrameLevel(1) - shadow:SetFrameStrata(self:GetFrameStrata()) - shadow:WrapOuter(self, 3, 3) - shadow:SetBackdrop({ - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = SuperVillain:Scale(3), - insets = { - left = SuperVillain:Scale(5), - right = SuperVillain:Scale(5), - top = SuperVillain:Scale(5), - bottom = SuperVillain:Scale(5) - } - }) - shadow:SetBackdropColor(0, 0, 0, 0) - shadow:SetBackdropBorderColor(0, 0, 0, 0.9) - shadow:Hide() - self.TargetGlow = shadow - tinsert(self.__elements, UpdateTargetGlow) - self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) - self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) - - return self -end ---[[ -########################################################## -UPDATE -########################################################## -]]-- -function MOD.VisibilityUpdate:raidpet(arg) - if (not MOD.db or (MOD.db and not SuperVillain.db.SVUnit.enable) or (MOD.db and not MOD.db.smartRaidFilter) or self.isForced) then return end - local instance, group = IsInInstance() - if arg == "PLAYER_REGEN_ENABLED"then - self:UnregisterEvent("PLAYER_REGEN_ENABLED") - end - if not InCombatLockdown()then - if instance and group == "raid" then - UnregisterStateDriver(self, "visibility") - self:Hide() - elseif MOD.db.visibility then - RegisterStateDriver(self, "visibility", MOD.db.visibility) - end - else - self:RegisterEvent("PLAYER_REGEN_ENABLED") - end -end - -function MOD.HeaderUpdate:raidpet(frame, db) - local raidPets = frame:GetParent() - if not raidPets.positioned then - raidPets:ClearAllPoints() - raidPets:Point("BOTTOMLEFT", SuperVillain.UIParent, "BOTTOMLEFT", 4, 433) - SuperVillain:SetSVMovable(raidPets, raidPets:GetName().."_MOVE", L["Raid Pet Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") - raidPets.positioned = true; - raidPets:RegisterEvent("PLAYER_ENTERING_WORLD") - raidPets:RegisterEvent("ZONE_CHANGED_NEW_AREA") - raidPets:SetScript("OnEvent", RaidPets_OnEvent) - end - RaidPets_OnEvent(raidPets) -end - -function MOD.FrameUpdate:raidpet(frame, db) - frame.colors = oUF_SuperVillain.colors; - frame:RegisterForClicks(MOD.db.fastClickTarget and"AnyDown"or"AnyUp") - if not InCombatLockdown()then frame:Size(db.width, db.height)end - MOD:RefreshUnitLayout(frame, "raidpet") - do - local rdBuffs = frame.RaidDebuffs; - if db.rdebuffs.enable then - frame:EnableElement("RaidDebuffs") - rdBuffs:Size(db.rdebuffs.size) - rdBuffs:Point("CENTER", frame, "CENTER", db.rdebuffs.xOffset, db.rdebuffs.yOffset) - rdBuffs.count:SetFontTemplate(nil, db.rdebuffs.fontSize, "OUTLINE") - rdBuffs.time:SetFontTemplate(nil, db.rdebuffs.fontSize, "OUTLINE") - else - frame:DisableElement("RaidDebuffs") - rdBuffs:Hide() - end - end - MOD:UpdateAuraWatch(frame, true) - frame:UpdateAllElements() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/group/tank.lua b/Interface/AddOns/SVUI/packages/unit/frames/group/tank.lua deleted file mode 100644 index 487d192..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/group/tank.lua +++ /dev/null @@ -1,106 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## ---]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.Registry:Expose('SVUnit'); -local _, ns = ... -local oUF_SuperVillain = ns.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local ceil,tinsert = math.ceil,table.insert -local StealthFrame = CreateFrame("Frame"); -StealthFrame:Hide(); ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -function MOD.Construct:tank(...) - self:SetScript("OnEnter", UnitFrame_OnEnter) - self:SetScript("OnLeave", UnitFrame_OnLeave) - MOD:SetActionPanel(self, "tank") - self.Health = MOD:CreateHealthBar(self, true) - self.RaidIcon = MOD:CreateRaidIcon(self) - self.RaidIcon:SetPoint("BOTTOMRIGHT") - self.Range = { insideAlpha = 1, outsideAlpha = 1 } - MOD.FrameUpdate:tank(self, MOD.db["tank"]) - self.originalParent = self:GetParent() - return self -end ---[[ -########################################################## -UPDATE -########################################################## -]]-- -function MOD.HeaderUpdate:tank(frame, db) - frame:Hide() - MOD:DetachSubFrames(frame:GetChildren()) - frame:SetAttribute("startingIndex", -1) - RegisterAttributeDriver(frame, "state-visibility", "show") - frame.dirtyWidth, frame.dirtyHeight = frame:GetSize() - RegisterAttributeDriver(frame, "state-visibility", "[@raid1, exists] show;hide") - frame:SetAttribute("startingIndex", 1) - frame:SetAttribute("point", "BOTTOM") - frame:SetAttribute("columnAnchorPoint", "LEFT") - MOD:DetachSubFrames(frame:GetChildren()) - frame:SetAttribute("yOffset", 7) - if not frame.positioned then - frame:ClearAllPoints() - frame:Point("TOPLEFT", SuperVillain.UIParent, "TOPLEFT", 4, -40) - SuperVillain:SetSVMovable(frame, frame:GetName().."_MOVE", L["Tank Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") - frame.Avatar.positionOverride = "TOPLEFT" - frame:SetAttribute("minHeight", frame.dirtyHeight) - frame:SetAttribute("minWidth", frame.dirtyWidth) - frame.positioned = true - end -end - -function MOD.FrameUpdate:tank(frame, db) - frame.colors = oUF_SuperVillain.colors; - frame:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") - if frame.isChild and frame.originalParent then - local targets = db.targetsGroup; - if not frame.originalParent.childList then - frame.originalParent.childList = {} - end - frame.originalParent.childList[frame] = true; - if not InCombatLockdown()then - if targets.enable then - frame:SetParent(frame.originalParent) - frame:Size(targets.width, targets.height) - frame:ClearAllPoints() - SuperVillain:ReversePoint(frame, targets.anchorPoint, frame.originalParent, targets.xOffset, targets.yOffset) - else - frame:SetParent(StealthFrame) - end - end - elseif not InCombatLockdown()then - frame:Size(db.width, db.height) - end - - MOD:RefreshUnitLayout(frame, "tank") - - do - local nametext = frame.InfoPanel.Name; - if oUF_SuperVillain.colors.healthclass then - frame:Tag(nametext, "[name:10]") - else - frame:Tag(nametext, "[name:color][name:10]") - end - end - - frame:UpdateAllElements() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/party.lua b/Interface/AddOns/SVUI/packages/unit/frames/party.lua new file mode 100644 index 0000000..8e0831d --- /dev/null +++ b/Interface/AddOns/SVUI/packages/unit/frames/party.lua @@ -0,0 +1,208 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +--]] +local SuperVillain, L = unpack(select(2, ...)); +local MOD = SuperVillain.Registry:Expose('SVUnit'); +local _, ns = ... +local oUF_SuperVillain = ns.oUF +--[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- +local assert = enforce; +assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +local ceil,tinsert = math.ceil,table.insert + +local VisibilityUpdate = function(self, event) + local db = MOD.db["party"] + if (not db or (db and not db.enable) or not MOD.db.smartRaidFilter or self.isForced) then return end + local instance, instanceType = IsInInstance() + if(event == "PLAYER_REGEN_ENABLED") then + self:UnregisterEvent("PLAYER_REGEN_ENABLED") + end + if(not InCombatLockdown()) then + if(instance and instanceType == "raid") then + UnregisterStateDriver(self,"visibility") + self:Hide() + elseif db.visibility then + RegisterStateDriver(self, "visibility", db.visibility) + end + else + self:RegisterEvent("PLAYER_REGEN_ENABLED") + end +end + +local UpdateTargetGlow = function(self) + if not self.unit then return end + local unit = self.unit; + if(UnitIsUnit(unit, "target")) then + self.TargetGlow:Show() + local reaction = UnitReaction(unit, "player") + if(UnitIsPlayer(unit)) then + local _, class = UnitClass(unit) + if class then + local colors = SVUI_CLASS_COLORS[class] + self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) + else + self.TargetGlow:SetBackdropBorderColor(1, 1, 1) + end + elseif(reaction) then + local colors = FACTION_BAR_COLORS[reaction] + self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) + else + self.TargetGlow:SetBackdropBorderColor(1, 1, 1) + end + else + self.TargetGlow:Hide() + end +end + +local UpdatePartyFrame = function(self) + local frame = self + local db = MOD.db["party"] + frame.colors = oUF_SuperVillain.colors; + frame:RegisterForClicks(MOD.db.fastClickTarget and 'AnyDown' or 'AnyUp') + if frame.isChild then + local altDB = db.petsGroup; + if frame == _G[frame.originalParent:GetName()..'Target'] then + altDB = db.targetsGroup + end + if not frame.originalParent.childList then + frame.originalParent.childList = {} + end + frame.originalParent.childList[frame] = true; + if not InCombatLockdown()then + if altDB.enable then + frame:SetParent(frame.originalParent) + frame:Size(altDB.width,altDB.height) + frame:ClearAllPoints() + SuperVillain:ReversePoint(frame, altDB.anchorPoint, frame.originalParent, altDB.xOffset, altDB.yOffset) + else + frame:SetParent(SuperVillain.Cloaked) + end + end + do + local health = frame.Health; + health.Smooth = nil; + health.frequentUpdates = nil; + health.colorSmooth = nil; + health.colorHealth = nil; + health.colorClass = true; + health.colorReaction = true; + health:ClearAllPoints() + health:Point("TOPRIGHT", frame, "TOPRIGHT", -1, -1) + health:Point("BOTTOMLEFT", frame, "BOTTOMLEFT", 1, 1) + end + do + local nametext = frame.InfoPanel.Name + frame:Tag(nametext, altDB.tags) + end + else + if not InCombatLockdown() then + frame:Size(db.width,db.height) + end + MOD:RefreshUnitLayout(frame, "party") + MOD:UpdateAuraWatch(frame) + end + frame:EnableElement('ReadyCheck') + frame:UpdateAllElements() +end +--[[ +########################################################## +BUILD FUNCTION +########################################################## +]]-- +function MOD.Construct:party() + local frame = self + frame:SetScript("OnEnter", UnitFrame_OnEnter) + frame:SetScript("OnLeave", UnitFrame_OnLeave) + + MOD:SetActionPanel(frame, "party") + + if frame.isChild then + frame.Health = MOD:CreateHealthBar(frame, true) + frame.originalParent = frame:GetParent() + else + frame.Health = MOD:CreateHealthBar(frame, true) + frame.Power = MOD:CreatePowerBar(frame, true) + frame.Power.frequentUpdates = false + MOD:CreatePortrait(frame, true) + frame.Buffs = MOD:CreateBuffs(frame, "party") + frame.Debuffs = MOD:CreateDebuffs(frame, "party") + frame.AuraWatch = MOD:CreateAuraWatch(frame, "party") + frame.Afflicted = MOD:CreateAfflicted(frame) + frame.ResurrectIcon = MOD:CreateResurectionIcon(frame) + frame.LFDRole = MOD:CreateRoleIcon(frame) + frame.RaidRoleFramesAnchor = MOD:CreateRaidRoleFrames(frame) + frame.RaidIcon = MOD:CreateRaidIcon(frame) + frame.ReadyCheck = MOD:CreateReadyCheckIcon(frame) + frame.HealPrediction = MOD:CreateHealPrediction(frame) + + local shadow = CreateFrame("Frame", nil, frame) + shadow:SetFrameLevel(1) + shadow:SetFrameStrata(frame:GetFrameStrata()) + shadow:WrapOuter(frame, 3, 3) + shadow:SetBackdrop({ + edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], + edgeSize = SuperVillain:Scale(3), + insets = { + left = SuperVillain:Scale(5), + right = SuperVillain:Scale(5), + top = SuperVillain:Scale(5), + bottom = SuperVillain:Scale(5) + } + }) + shadow:SetBackdropColor(0, 0, 0, 0) + shadow:SetBackdropBorderColor(0, 0, 0, 0.9) + shadow:Hide() + frame.TargetGlow = shadow + tinsert(frame.__elements, UpdateTargetGlow) + frame:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) + frame:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) + frame:RegisterEvent("GROUP_ROSTER_UPDATE", UpdateTargetGlow) + end + + frame.Range = { insideAlpha = 1, outsideAlpha = 1 } + + return frame +end +--[[ +########################################################## +UPDATE +########################################################## +]]-- +function MOD.HeaderUpdate:party() + local group = self:GetParent() + if not group.positioned then + group:ClearAllPoints() + group:Point("LEFT",SuperVillain.UIParent,"LEFT",40,0) + SuperVillain:SetSVMovable(group, group:GetName()..'_MOVE', L['Party Frames'], nil, nil, nil, 'ALL,PARTY,ARENA'); + group.positioned = true; + group:RegisterEvent("PLAYER_ENTERING_WORLD") + group:RegisterEvent("ZONE_CHANGED_NEW_AREA") + group:SetScript("OnEvent", VisibilityUpdate) + end + VisibilityUpdate(group) + local index = 1; + local childFrame = self:GetAttribute("child"..index) + while childFrame do + UpdatePartyFrame(childFrame) + if(_G[childFrame:GetName().."Pet"]) then + UpdatePartyFrame(_G[childFrame:GetName().."Pet"]) + end + if(_G[childFrame:GetName().."Target"]) then + UpdatePartyFrame(_G[childFrame:GetName().."Target"]) + end + index = index + 1; + childFrame = self:GetAttribute("child"..index) + end +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/pet.lua b/Interface/AddOns/SVUI/packages/unit/frames/pet.lua new file mode 100644 index 0000000..e6601d2 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/unit/frames/pet.lua @@ -0,0 +1,95 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +--]] +local SuperVillain, L = unpack(select(2, ...)); +local MOD = SuperVillain.Registry:Expose('SVUnit'); +local _, ns = ... +local oUF_SuperVillain = ns.oUF +--[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- +local assert = enforce; +assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +local ceil,tinsert = math.ceil,table.insert +--[[ +########################################################## +BUILD FUNCTION +########################################################## +]]-- +function MOD.Construct:pet() + MOD:SetActionPanel(self, "pet") + self.Health = MOD:CreateHealthBar(self, true) + self.Health.frequentUpdates = true; + self.HealPrediction = MOD:CreateHealPrediction(self) + self.Power = MOD:CreatePowerBar(self, true) + self.Power.frequentUpdates = false; + MOD:CreatePortrait(self, true) + self.Castbar = MOD:CreateCastbar(self, false, nil, false) + self.Buffs = MOD:CreateBuffs(self, "pet") + self.Debuffs = MOD:CreateDebuffs(self, "pet") + self.AuraWatch = MOD:CreateAuraWatch(self, "pet") + self.RaidIcon = MOD:CreateRaidIcon(self) + self.Range = { insideAlpha = 1, outsideAlpha = 1 } + self:Point("BOTTOM", SuperVillain.UIParent, "BOTTOM", 0, 182) + SuperVillain:SetSVMovable(self, self:GetName().."_MOVE", L["Pet Frame"], nil, nil, nil, "ALL, SOLO") +end + +function MOD.Construct:pettarget() + MOD:SetActionPanel(self, "pettarget") + self.Health = MOD:CreateHealthBar(self, true) + self.Power = MOD:CreatePowerBar(self, true) + self.Buffs = MOD:CreateBuffs(self, "pettarget") + self.Debuffs = MOD:CreateDebuffs(self, "pettarget") + self.Range = { insideAlpha = 1, outsideAlpha = 1 } + self:Point("BOTTOM", SVUI_Pet, "TOP", 0, 7) + SuperVillain:SetSVMovable(self, self:GetName().."_MOVE", L["PetTarget Frame"], nil, -7, nil, "ALL, SOLO") +end +--[[ +########################################################## +UPDATE +########################################################## +]]-- +function MOD.FrameUpdate:pet() + local db = MOD.db["pet"] + local UNIT_WIDTH = db.width; + local UNIT_HEIGHT = db.height; + self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self.colors = oUF_SuperVillain.colors; + self:Size(UNIT_WIDTH, UNIT_HEIGHT) + _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + MOD:RefreshUnitLayout(self, "pet") + do + if SVUI_Player and not InCombatLockdown()then + self:SetParent(SVUI_Player) + end + end + MOD:UpdateAuraWatch(self) + self:UpdateAllElements() +end + +function MOD.FrameUpdate:pettarget() + local db = MOD.db["pettarget"] + local UNIT_WIDTH = db.width; + local UNIT_HEIGHT = db.height; + self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self.colors = oUF_SuperVillain.colors; + self:Size(UNIT_WIDTH, UNIT_HEIGHT) + _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + MOD:RefreshUnitLayout(self, "pettarget") + do + if SVUI_Pet and not InCombatLockdown()then + self:SetParent(SVUI_Pet) + end + end + self:UpdateAllElements() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/player.lua b/Interface/AddOns/SVUI/packages/unit/frames/player.lua new file mode 100644 index 0000000..0ff320b --- /dev/null +++ b/Interface/AddOns/SVUI/packages/unit/frames/player.lua @@ -0,0 +1,212 @@ + --[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + --]] +local SuperVillain, L = unpack(select(2, ...)); +local MOD = SuperVillain.Registry:Expose('SVUnit'); +local _, ns = ... +local oUF_SuperVillain = ns.oUF +--[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- +local assert = enforce; +assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +local ceil,tinsert = math.ceil,table.insert +--[[ +########################################################## +BUILD FUNCTION +########################################################## +]]-- +function MOD.Construct:player() + MOD:SetActionPanel(self, "player") + self.Health = MOD:CreateHealthBar(self, true) + self.Health.frequentUpdates = true + self.Power = MOD:CreatePowerBar(self, true) + self.Power.frequentUpdates = true + MOD:CreatePortrait(self, false, true) + self.Buffs = MOD:CreateBuffs(self, "player") + self.Debuffs = MOD:CreateDebuffs(self, "player") + self.Castbar = MOD:CreateCastbar(self, false, L["Player Castbar"], true, true) + MOD:CreateExperienceRepBar(self) + MOD:GetClassResources(self) + self.RaidIcon = MOD:CreateRaidIcon(self) + self.Resting = MOD:CreateRestingIndicator(self) + self.Combat = MOD:CreateCombatIndicator(self) + self.PvPText = self.InfoPanel:CreateFontString(nil,'OVERLAY') + self.PvPText:SetFontTemplate(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + self.Afflicted = MOD:CreateAfflicted(self) + self.HealPrediction = MOD:CreateHealPrediction(self, true) + self.AuraBars = MOD:CreateAuraBarHeader(self, "player") + self.CombatFade = true; + self:Point("BOTTOMLEFT", SuperVillain.UIParent, "BOTTOM", -413, 182) + SuperVillain:SetSVMovable(self, self:GetName().."_MOVE", L["Player Frame"], nil, nil, nil, "ALL, SOLO") +end +--[[ +########################################################## +UPDATE +########################################################## +]]-- +function MOD.FrameUpdate:player() + local db = MOD.db["player"] + local UNIT_WIDTH = db.width; + local UNIT_HEIGHT = db.height; + local USE_CLASSBAR = db.classbar.enable; + local classBarHeight = db.classbar.height; + local classBarWidth = db.width * 0.4; + local healthPanel = self.HealthPanel + local iconDB = db.icons + self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self.colors = oUF_SuperVillain.colors; + self:Size(UNIT_WIDTH, UNIT_HEIGHT) + _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + + MOD:RefreshUnitLayout(self, "player") + + do + local resting = self.Resting; + if resting then + if iconDB and iconDB.restIcon and iconDB.restIcon.enable then + local size = iconDB.restIcon.size; + resting:ClearAllPoints() + resting:Size(size) + SuperVillain:ReversePoint(resting, iconDB.restIcon.attachTo, healthPanel, iconDB.restIcon.xOffset, iconDB.restIcon.yOffset) + if not self:IsElementEnabled("Resting")then + self:EnableElement("Resting") + end + elseif self:IsElementEnabled("Resting")then + self:DisableElement("Resting") + resting:Hide() + end + end + end + do + local combat = self.Combat; + if combat then + if iconDB and iconDB.combatIcon and iconDB.combatIcon.enable then + local size = iconDB.combatIcon.size; + combat:ClearAllPoints() + combat:Size(size) + SuperVillain:ReversePoint(combat, iconDB.combatIcon.attachTo, healthPanel, iconDB.combatIcon.xOffset, iconDB.combatIcon.yOffset) + if not self:IsElementEnabled("Combat")then + self:EnableElement("Combat") + end + elseif self:IsElementEnabled("Combat")then + self:DisableElement("Combat") + combat:Hide() + end + end + end + do + local pvp = self.PvPText; + local point = db.pvp.position; + pvp:ClearAllPoints() + pvp:Point(db.pvp.position, healthPanel, db.pvp.position) + self:Tag(pvp, db.pvp.tags) + end + do + local power = self.Power; + if SuperVillain.class == "DRUID" and self.DruidAltMana then + if db.power.druidMana then + self:EnableElement("DruidAltMana") + else + self:DisableElement("DruidAltMana") + self.DruidAltMana:Hide() + end + end + if SuperVillain.class == "MONK" then + local stagger = self.DrunkenMaster; + if db.stagger.enable then + if not self:IsElementEnabled("DrunkenMaster")then + self:EnableElement("DrunkenMaster") + end + else + if self:IsElementEnabled("DrunkenMaster")then + self:DisableElement("DrunkenMaster") + end + end + end + end + do + if(self.DruidAltMana) then + if db.power.druidMana then + self:EnableElement("DruidAltMana") + else + self:DisableElement("DruidAltMana") + self.DruidAltMana:Hide() + end + end + if(self.DrunkenMaster) then + if db.stagger.enable then + if not self:IsElementEnabled("DrunkenMaster")then + self:EnableElement("DrunkenMaster") + end + else + if self:IsElementEnabled("DrunkenMaster")then + self:DisableElement("DrunkenMaster") + end + end + end + + if(self.ClassBar or self.HyperCombo) then + if self.ClassBarRefresh then + self.ClassBarRefresh(self) + end + if(self.ClassBar) then + local classBar = self[self.ClassBar]; + if not db.classbar.detachFromFrame then + if classBar.Avatar then + classBar.Avatar:SetScale(0.000001) + classBar.Avatar:SetAlpha(0) + end + else + classBarWidth = db.classbar.detachedWidth; + if not classBar.Avatar then + classBar:Point("TOPLEFT", self, "BOTTOMLEFT", 0, -2) + SuperVillain:SetSVMovable(classBar, "ClassBar_MOVE", L["Classbar"], nil, nil, nil, "ALL, SOLO") + else + classBar.Avatar:SetScale(1) + classBar.Avatar:SetAlpha(1) + end + end + if USE_CLASSBAR then + if(not self:IsElementEnabled(self.ClassBar)) then + self:EnableElement(self.ClassBar) + end + classBar:Show() + else + if(self:IsElementEnabled(self.ClassBar)) then + self:DisableElement(self.ClassBar) + end + classBar:Hide() + end + end + if(self.HyperCombo) then + if not self:IsElementEnabled("HyperCombo") then + self:EnableElement("HyperCombo") + end + else + if self:IsElementEnabled("HyperCombo") then + self:DisableElement("HyperCombo") + end + end + end + end + do + if db.combatfade and not self:IsElementEnabled("CombatFade")then + self:EnableElement("CombatFade") + elseif + not db.combatfade and self:IsElementEnabled("CombatFade")then + self:DisableElement("CombatFade") + end + end + self:UpdateAllElements() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/raid.lua b/Interface/AddOns/SVUI/packages/unit/frames/raid.lua new file mode 100644 index 0000000..682f5b9 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/unit/frames/raid.lua @@ -0,0 +1,282 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +--]] +local SuperVillain, L = unpack(select(2, ...)); +local MOD = SuperVillain.Registry:Expose('SVUnit'); +local _, ns = ... +local oUF_SuperVillain = ns.oUF +--[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- +local assert = enforce; +assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +local ceil,tinsert = math.ceil,table.insert + +local VisibilityUpdate = function(self, event) + local db = MOD.db[self.___key] + if (not db or (db and not db.enable) or (MOD.db and not MOD.db.smartRaidFilter) or self.isForced) then return end + local instance, group = IsInInstance() + local _, _, _, _, info, _, _ = GetInstanceInfo() + if event == "PLAYER_REGEN_ENABLED"then + self:UnregisterEvent("PLAYER_REGEN_ENABLED") + end + if not InCombatLockdown()then + if(instance and (group == "raid") and (info == i)) then + UnregisterStateDriver(self, "visibility") + self:Show() + elseif(instance and (group == "raid")) then + UnregisterStateDriver(self, "visibility") + self:Hide() + elseif db.visibility then + RegisterStateDriver(self, "visibility", db.visibility) + end + else + self:RegisterEvent("PLAYER_REGEN_ENABLED") + return + end +end + +local RaidPetVisibility = function(self, event) + local db = MOD.db["raidpet"] + if (not db or (db and not db.enable) or (MOD.db and not MOD.db.smartRaidFilter) or self.isForced) then return end + local inInstance, instanceType = IsInInstance() + if event == "PLAYER_REGEN_ENABLED" then self:UnregisterEvent("PLAYER_REGEN_ENABLED") end + + if not InCombatLockdown() then + if inInstance and instanceType == "raid" then + UnregisterStateDriver(self, "visibility") + self:Show() + elseif self.db.visibility then + RegisterStateDriver(self, "visibility", self.db.visibility) + end + else + self:RegisterEvent("PLAYER_REGEN_ENABLED") + return + end +end + +local UpdateTargetGlow = function(self) + if not self.unit then return end + local unit = self.unit; + if(UnitIsUnit(unit, "target")) then + self.TargetGlow:Show() + local reaction = UnitReaction(unit, "player") + if(UnitIsPlayer(unit)) then + local _, class = UnitClass(unit) + if class then + local colors = SVUI_CLASS_COLORS[class] + self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) + else + self.TargetGlow:SetBackdropBorderColor(1, 1, 1) + end + elseif(reaction) then + local colors = FACTION_BAR_COLORS[reaction] + self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) + else + self.TargetGlow:SetBackdropBorderColor(1, 1, 1) + end + else + self.TargetGlow:Hide() + end +end +--[[ +########################################################## +BUILD FUNCTION & UPDATE +########################################################## +]]-- +local ConstructRaidFrame = function(self, unit) + self:SetScript("OnEnter", UnitFrame_OnEnter) + self:SetScript("OnLeave", UnitFrame_OnLeave) + MOD:SetActionPanel(self, unit) + self.Health = MOD:CreateHealthBar(self, true) + self.Power = MOD:CreatePowerBar(self, true) + self.Power.frequentUpdates = false + self.Buffs = MOD:CreateBuffs(self, unit) + self.Debuffs = MOD:CreateDebuffs(self, unit) + self.AuraWatch = MOD:CreateAuraWatch(self, unit) + self.RaidDebuffs = MOD:CreateRaidDebuffs(self) + self.Afflicted = MOD:CreateAfflicted(self) + self.ResurrectIcon = MOD:CreateResurectionIcon(self) + self.LFDRole = MOD:CreateRoleIcon(self) + self.RaidRoleFramesAnchor = MOD:CreateRaidRoleFrames(self) + self.RaidIcon = MOD:CreateRaidIcon(self) + self.ReadyCheck = MOD:CreateReadyCheckIcon(self) + self.HealPrediction = MOD:CreateHealPrediction(self) + self.Range = { insideAlpha = 1, outsideAlpha = 1 } + + local shadow = CreateFrame("Frame", nil, self) + shadow:SetFrameLevel(1) + shadow:SetFrameStrata(self:GetFrameStrata()) + shadow:WrapOuter(self, 3, 3) + shadow:SetBackdrop({ + edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], + edgeSize = SuperVillain:Scale(3), + insets = { + left = SuperVillain:Scale(5), + right = SuperVillain:Scale(5), + top = SuperVillain:Scale(5), + bottom = SuperVillain:Scale(5) + } + }) + shadow:SetBackdropColor(0, 0, 0, 0) + shadow:SetBackdropBorderColor(0, 0, 0, 0.9) + shadow:Hide() + self.TargetGlow = shadow + tinsert(self.__elements, UpdateTargetGlow) + self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) + self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) + + return frame +end + +local UpdateRaidFrame = function(self, header) + local db = MOD.db[header] + 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 + MOD:RefreshUnitLayout(self, header) + do + local rdBuffs = self.RaidDebuffs; + if db.rdebuffs.enable then + self:EnableElement("RaidDebuffs") + rdBuffs:Size(db.rdebuffs.size) + rdBuffs:Point("CENTER", self, "CENTER", db.rdebuffs.xOffset, db.rdebuffs.yOffset) + else + self:DisableElement("RaidDebuffs") + rdBuffs:Hide() + end + end + MOD:UpdateAuraWatch(self) + self:EnableElement("ReadyCheck") + self:UpdateAllElements() +end + +for i = 10, 40, 15 do + local raidGroupName = "raid"..i + MOD.Construct[raidGroupName] = ConstructRaidFrame + MOD.HeaderUpdate[raidGroupName] = function(self) + local frame = self:GetParent() + if not frame.positioned then + frame:ClearAllPoints() + frame:Point("LEFT", SuperVillain.UIParent, "LEFT", 4, 0) + SuperVillain:SetSVMovable(frame, frame:GetName().."_MOVE", L["Raid 1-"]..i..L[" Frames"], nil, nil, nil, "ALL, RAID"..i) + frame:RegisterEvent("PLAYER_ENTERING_WORLD") + frame:RegisterEvent("ZONE_CHANGED_NEW_AREA") + frame:SetScript("OnEvent", VisibilityUpdate) + frame.positioned = true + end + VisibilityUpdate(frame) + local index = 1; + local childFrame = self:GetAttribute("child"..index) + while childFrame do + UpdateRaidFrame(childFrame, raidGroupName) + if(_G[childFrame:GetName().."Pet"]) then + UpdateRaidFrame(_G[childFrame:GetName().."Pet"], raidGroupName) + end + if(_G[childFrame:GetName().."Target"]) then + UpdateRaidFrame(_G[childFrame:GetName().."Target"], raidGroupName) + end + index = index + 1; + childFrame = self:GetAttribute("child"..index) + end + end +end +--[[ +########################################################## +BUILD AND UPDATE RAID PETS +########################################################## +]]-- +local UpdateRaidpetFrame = function(self) + local db = MOD.db["raidpet"] + 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 + MOD:RefreshUnitLayout(self, "raidpet") + do + local rdBuffs = self.RaidDebuffs; + if db.rdebuffs.enable then + self:EnableElement("RaidDebuffs") + rdBuffs:Size(db.rdebuffs.size) + rdBuffs:Point("CENTER", self, "CENTER", db.rdebuffs.xOffset, db.rdebuffs.yOffset) + else + self:DisableElement("RaidDebuffs") + rdBuffs:Hide() + end + end + MOD:UpdateAuraWatch(self, true) + self:UpdateAllElements() +end + +function MOD.Construct:raidpet() + self:SetScript("OnEnter", UnitFrame_OnEnter) + self:SetScript("OnLeave", UnitFrame_OnLeave) + MOD:SetActionPanel(self, "raidpet") + self.Health = MOD:CreateHealthBar(self, true) + self.Debuffs = MOD:CreateDebuffs(self, "raidpet") + self.AuraWatch = MOD:CreateAuraWatch(self, "raidpet") + self.RaidDebuffs = MOD:CreateRaidDebuffs(self) + self.Afflicted = MOD:CreateAfflicted(self) + self.RaidIcon = MOD:CreateRaidIcon(self) + self.Range = { insideAlpha = 1, outsideAlpha = 1 } + + local shadow = CreateFrame("Frame", nil, self) + shadow:SetFrameLevel(1) + shadow:SetFrameStrata(self:GetFrameStrata()) + shadow:WrapOuter(self, 3, 3) + shadow:SetBackdrop({ + edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], + edgeSize = SuperVillain:Scale(3), + insets = { + left = SuperVillain:Scale(5), + right = SuperVillain:Scale(5), + top = SuperVillain:Scale(5), + bottom = SuperVillain:Scale(5) + } + }) + shadow:SetBackdropColor(0, 0, 0, 0) + shadow:SetBackdropBorderColor(0, 0, 0, 0.9) + shadow:Hide() + self.TargetGlow = shadow + tinsert(self.__elements, UpdateTargetGlow) + self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) + self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) + + return self +end + +function MOD.HeaderUpdate:raidpet() + local raidPets = self:GetParent() + if not raidPets.positioned then + raidPets:ClearAllPoints() + raidPets:Point("BOTTOMLEFT", SuperVillain.UIParent, "BOTTOMLEFT", 4, 433) + SuperVillain:SetSVMovable(raidPets, raidPets:GetName().."_MOVE", L["Raid Pet Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") + raidPets.positioned = true; + raidPets:RegisterEvent("PLAYER_ENTERING_WORLD") + raidPets:RegisterEvent("ZONE_CHANGED_NEW_AREA") + raidPets:SetScript("OnEvent", RaidPetVisibility) + end + RaidPetVisibility(raidPets) + local index = 1; + local childFrame = self:GetAttribute("child"..index) + while childFrame do + UpdateRaidpetFrame(childFrame) + if(_G[childFrame:GetName().."Pet"]) then + UpdateRaidpetFrame(_G[childFrame:GetName().."Pet"]) + end + if(_G[childFrame:GetName().."Target"]) then + UpdateRaidpetFrame(_G[childFrame:GetName().."Target"]) + end + index = index + 1; + childFrame = self:GetAttribute("child"..index) + end +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/tankassist.lua b/Interface/AddOns/SVUI/packages/unit/frames/tankassist.lua new file mode 100644 index 0000000..c353176 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/unit/frames/tankassist.lua @@ -0,0 +1,204 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +--]] +local SuperVillain, L = unpack(select(2, ...)); +local MOD = SuperVillain.Registry:Expose('SVUnit'); +local _, ns = ...; +local oUF_SuperVillain = ns.oUF; +--[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- +local assert = enforce; +assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); +local tinsert = table.insert; +--[[ +########################################################## +TANK HANDLERS +########################################################## +]]-- +local function UpdateTankFrame(header) + local db = MOD.db["tank"] + header.colors = oUF_SuperVillain.colors; + header:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + if header.isChild and header.originalParent then + local targets = db.targetsGroup; + if not header.originalParent.childList then + header.originalParent.childList = {} + end + header.originalParent.childList[header] = true; + if not InCombatLockdown()then + if targets.enable then + header:SetParent(header.originalParent) + header:Size(targets.width, targets.height) + header:ClearAllPoints() + SuperVillain:ReversePoint(header, targets.anchorPoint, header.originalParent, targets.xOffset, targets.yOffset) + else + header:SetParent(SuperVillain.Cloaked) + end + end + elseif not InCombatLockdown()then + header:Size(db.width, db.height) + end + MOD:RefreshUnitLayout(header, "tank") + do + local nametext = header.InfoPanel.Name; + if oUF_SuperVillain.colors.healthclass then + header:Tag(nametext, "[name:10]") + else + header:Tag(nametext, "[name:color][name:10]") + end + end + header:UpdateAllElements() +end + +function MOD.Construct:tank() + self:SetScript("OnEnter", UnitFrame_OnEnter) + self:SetScript("OnLeave", UnitFrame_OnLeave) + MOD:SetActionPanel(self, "tank") + self.Health = MOD:CreateHealthBar(self, true) + self.RaidIcon = MOD:CreateRaidIcon(self) + self.RaidIcon:SetPoint("BOTTOMRIGHT") + self.Range = { insideAlpha = 1, outsideAlpha = 1 } + UpdateTankFrame(self) + self.originalParent = self:GetParent() + return self +end + +function MOD.HeaderUpdate:tank() + local db = MOD.db["tank"] + local header = self + if db.enable ~= true then + UnregisterAttributeDriver(header, "state-visibility") + header:Hide() + return + end + header:Hide() + MOD:DetachSubFrames(header:GetChildren()) + header:SetAttribute("startingIndex", -1) + RegisterAttributeDriver(header, "state-visibility", "show") + header.dirtyWidth, header.dirtyHeight = header:GetSize() + RegisterAttributeDriver(header, "state-visibility", "[@raid1, exists] show;hide") + header:SetAttribute("startingIndex", 1) + header:SetAttribute("point", "BOTTOM") + header:SetAttribute("columnAnchorPoint", "LEFT") + MOD:DetachSubFrames(header:GetChildren()) + header:SetAttribute("yOffset", 7) + if not header.positioned then + header:ClearAllPoints() + header:Point("TOPLEFT", SuperVillain.UIParent, "TOPLEFT", 4, -40) + SuperVillain:SetSVMovable(header, header:GetName().."_MOVE", L["Tank Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") + header.Avatar.positionOverride = "TOPLEFT" + header:SetAttribute("minHeight", header.dirtyHeight) + header:SetAttribute("minWidth", header.dirtyWidth) + header.positioned = true + end + for i = 1, header:GetNumChildren() do + local childFrame = select(i, header:GetChildren()) + UpdateTankFrame(childFrame) + if(_G[childFrame:GetName().."Pet"]) then + UpdateTankFrame(_G[childFrame:GetName().."Pet"]) + end + if(_G[childFrame:GetName().."Target"]) then + UpdateTankFrame(_G[childFrame:GetName().."Target"]) + end + end +end +--[[ +########################################################## +ASSIST UPDATE +########################################################## +]]-- +local function UpdateAssistFrame(header) + local db = MOD.db["assist"] + header.colors = oUF_SuperVillain.colors; + header:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + if header.isChild and header.originalParent then + local targets = db.targetsGroup; + if not header.originalParent.childList then + header.originalParent.childList = {} + end + header.originalParent.childList[header] = true; + if not InCombatLockdown()then + if targets.enable then + header:SetParent(header.originalParent) + header:Size(targets.width, targets.height) + header:ClearAllPoints() + SuperVillain:ReversePoint(header, targets.anchorPoint, header.originalParent, targets.xOffset, targets.yOffset) + else + header:SetParent(SuperVillain.Cloaked) + end + end + elseif not InCombatLockdown()then + header:Size(db.width, db.height) + end + + MOD:RefreshUnitLayout(header, "assist") + + do + local nametext = header.InfoPanel.Name; + if oUF_SuperVillain.colors.healthclass then + header:Tag(nametext, "[name:10]") + else + header:Tag(nametext, "[name:color][name:10]") + end + end + header:UpdateAllElements() +end + +function MOD.Construct:assist() + self:SetScript("OnEnter", UnitFrame_OnEnter) + self:SetScript("OnLeave", UnitFrame_OnLeave) + MOD:SetActionPanel(self, "assist") + self.Health = MOD:CreateHealthBar(self, true) + self.RaidIcon = MOD:CreateRaidIcon(self) + self.RaidIcon:SetPoint("BOTTOMRIGHT") + self.Range = { insideAlpha = 1, outsideAlpha = 1 } + UpdateAssistFrame(self) + self.originalParent = self:GetParent() + return self +end + +function MOD.HeaderUpdate:assist() + local db = MOD.db["assist"] + local header = self + header:Hide() + MOD:DetachSubFrames(header:GetChildren()) + header:SetAttribute("startingIndex", -1) + RegisterAttributeDriver(header, "state-visibility", "show") + header.dirtyWidth, header.dirtyHeight = header:GetSize() + RegisterAttributeDriver(header, "state-visibility", "[@raid1, exists] show;hide") + header:SetAttribute("startingIndex", 1) + header:SetAttribute("point", "BOTTOM") + header:SetAttribute("columnAnchorPoint", "LEFT") + MOD:DetachSubFrames(header:GetChildren()) + header:SetAttribute("yOffset", 7) + if not header.positioned then + header:ClearAllPoints() + header:Point("TOPLEFT", SuperVillain.UIParent, "TOPLEFT", 4, -140) + SuperVillain:SetSVMovable(header, header:GetName().."_MOVE", L["Assist Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") + header.Avatar.positionOverride = "TOPLEFT" + header:SetAttribute("minHeight", header.dirtyHeight) + header:SetAttribute("minWidth", header.dirtyWidth) + header.positioned = true + end + for i = 1, header:GetNumChildren() do + local childFrame = select(i, header:GetChildren()) + UpdateAssistFrame(childFrame) + if(_G[childFrame:GetName().."Pet"]) then + UpdateAssistFrame(_G[childFrame:GetName().."Pet"]) + end + if(_G[childFrame:GetName().."Target"]) then + UpdateAssistFrame(_G[childFrame:GetName().."Target"]) + end + end +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames/target.lua b/Interface/AddOns/SVUI/packages/unit/frames/target.lua new file mode 100644 index 0000000..c6cb931 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/unit/frames/target.lua @@ -0,0 +1,155 @@ + --[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + --]] +local SuperVillain, L = unpack(select(2, ...)); +local MOD = SuperVillain.Registry:Expose('SVUnit'); +local _, ns = ... +local oUF_SuperVillain = ns.oUF +--[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- +local assert = enforce; +assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +local ceil,tinsert = math.ceil,table.insert +--[[ +########################################################## +BUILD FUNCTION +########################################################## +]]-- +function MOD.Construct:target() + MOD:SetActionPanel(self, "target") + + self.Health = MOD:CreateHealthBar(self, true, true) + self.Health.frequentUpdates = true + self.HealPrediction = MOD:CreateHealPrediction(self, true) + + self.Power = MOD:CreatePowerBar(self, true, true) + self.Power.frequentUpdates = true + + MOD:CreatePortrait(self) + + self.Castbar = MOD:CreateCastbar(self, true, L["Target Castbar"], true) + + self.Buffs = MOD:CreateBuffs(self, "target") + self.Debuffs = MOD:CreateDebuffs(self, "target") + self.AuraBars = MOD:CreateAuraBarHeader(self, "target") + self.Afflicted = MOD:CreateAfflicted(self) + tinsert(self.__elements, MOD.SmartAuraDisplay) + self:RegisterEvent("PLAYER_TARGET_CHANGED", MOD.SmartAuraDisplay) + + self.RaidIcon = MOD:CreateRaidIcon(self) + local isSmall = MOD.db.target.combobar.smallIcons + if(SuperVillain.class == "ROGUE") then + self.HyperCombo = MOD:CreateRogueCombobar(self, isSmall) + elseif(SuperVillain.class == "DRUID") then + self.HyperCombo = MOD:CreateDruidCombobar(self, isSmall) + end + + self.GPS = MOD:CreateGPS(self) + self.Range = { insideAlpha = 1, outsideAlpha = 1 } + self.XRay = MOD:CreateXRay(self) + self.XRay:SetPoint("TOPRIGHT", 12, 12) + self:Point("BOTTOMRIGHT", SuperVillain.UIParent, "BOTTOM", 413, 182) + SuperVillain:SetSVMovable(self, self:GetName().."_MOVE", L["Target Frame"], nil, nil, nil, "ALL, SOLO") +end + +function MOD.Construct:targettarget() + MOD:SetActionPanel(self, "targettarget") + self.Health = MOD:CreateHealthBar(self, true) + self.Power = MOD:CreatePowerBar(self, true) + MOD:CreatePortrait(self, true) + self.Buffs = MOD:CreateBuffs(self, "targettarget") + self.Debuffs = MOD:CreateDebuffs(self, "targettarget") + self.RaidIcon = MOD:CreateRaidIcon(self) + self.Range = { insideAlpha = 1, outsideAlpha = 1 } + self:Point("BOTTOM", SuperVillain.UIParent, "BOTTOM", 0, 213) + SuperVillain:SetSVMovable(self, self:GetName().."_MOVE", L["TargetTarget Frame"], nil, nil, nil, "ALL, SOLO") +end +--[[ +########################################################## +UPDATE +########################################################## +]]-- +function MOD.FrameUpdate:target() + local db = MOD.db["target"] + local UNIT_WIDTH = db.width; + local UNIT_HEIGHT = db.height; + local USE_COMBOBAR = db.combobar.enable; + local comboBarHeight = db.combobar.height; + self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self.colors = oUF_SuperVillain.colors; + self:Size(UNIT_WIDTH, UNIT_HEIGHT) + _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + if not self:IsElementEnabled("ActionPanel")then + self:EnableElement("ActionPanel") + end + MOD:RefreshUnitLayout(self, "target") + + if(MOD.db.xrayFocus) then + self.XRay:Show() + else + self.XRay:Hide() + end + + if not IsAddOnLoaded("Clique")then + if db.middleClickFocus then + self:SetAttribute("type3", "focus") + elseif self:GetAttribute("type3") == "focus"then + self:SetAttribute("type3", nil) + end + end + + if (SuperVillain.class == "ROGUE" or SuperVillain.class == "DRUID") and self.HyperCombo then + local comboBar = self.HyperCombo; + if self.ComboRefresh then + self.ComboRefresh(self) + end + if db.combobar.autoHide then + comboBar:SetParent(self) + else + comboBar:SetParent(SuperVillain.UIParent) + end + + if comboBar.Avatar then + comboBar.Avatar:SetScale(0.000001) + comboBar.Avatar:SetAlpha(0) + end + + if USE_COMBOBAR and not self:IsElementEnabled("HyperCombo")then + self:EnableElement("HyperCombo") + elseif not USE_COMBOBAR and self:IsElementEnabled("HyperCombo")then + self:DisableElement("HyperCombo") + comboBar:Hide() + end + end + + do + local gps = self.GPS; + if not self:IsElementEnabled("GPS") then + self:EnableElement("GPS") + end + end + self:UpdateAllElements() +end + +function MOD.FrameUpdate:targettarget() + local db = MOD.db["targettarget"] + local UNIT_WIDTH = db.width + local UNIT_HEIGHT = db.height + self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self.colors = oUF_SuperVillain.colors; + self:Size(UNIT_WIDTH, UNIT_HEIGHT) + _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + MOD:RefreshUnitLayout(self, "targettarget") + self:UpdateAllElements() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/mounts.lua b/Interface/AddOns/SVUI/scripts/mounts.lua index aefdb28..834a554 100644 --- a/Interface/AddOns/SVUI/scripts/mounts.lua +++ b/Interface/AddOns/SVUI/scripts/mounts.lua @@ -96,7 +96,7 @@ local function UpdateMountCheckboxes(button, index) end end -function UpdateMountCache() +local function UpdateMountCache() if(not MountJournal or not MountJournal.cachedMounts) then return end local num = GetNumCompanions("MOUNT") for index = 1, num, 1 do @@ -124,7 +124,7 @@ function UpdateMountCache() end end -function Update_MountCheckButtons() +local function Update_MountCheckButtons() if(not MountJournal or not MountJournal.cachedMounts) then return end local count = #MountJournal.cachedMounts if(type(count) ~= "number") then return end; @@ -141,7 +141,7 @@ function Update_MountCheckButtons() end end -function ProxyUpdate_Mounts(self, event, ...) +local ProxyUpdate_Mounts = function(self, event, ...) if(event == "COMPANION_LEARNED" or event == "COMPANION_UNLEARNED") then UpdateMountCache() end @@ -337,7 +337,7 @@ end SLASH FUNCTION ########################################################## ]]-- -function LetsRide() +function SVUILetsRide() local checkList = SVUI_Cache.Mounts.types local letsFly, letsSwim, letsSeahorse, vjZone, IbelieveIcantFly local maxMounts = GetNumCompanions("MOUNT") diff --git a/Interface/AddOns/SVUI/scripts/pvp.lua b/Interface/AddOns/SVUI/scripts/pvp.lua new file mode 100644 index 0000000..0fd5b06 --- /dev/null +++ b/Interface/AddOns/SVUI/scripts/pvp.lua @@ -0,0 +1,59 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local table = _G.table; +local bit = _G.bit; + +local twipe,band = table.wipe, bit.band; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SuperVillain, L = unpack(select(2, ...)); +-- SVUI_Cache.Mounts.types +-- SVUI_Cache.Mounts.names +--[[ +########################################################## +LOCAL VARIABLES +########################################################## +]]-- + +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- + +--[[ +########################################################## +SLASH FUNCTIONS +########################################################## +]]-- +function SVUISayIncoming() + local subzoneText = GetSubZoneText() + SendChatMessage(format("{rt8} Incoming %s {rt8}", subzoneText), "INSTANCE_CHAT") + return +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/cartography.lua b/Interface/AddOns/SVUI/system/cartography.lua index c591b87..54e786b 100644 --- a/Interface/AddOns/SVUI/system/cartography.lua +++ b/Interface/AddOns/SVUI/system/cartography.lua @@ -38,8 +38,7 @@ local band = bit.band; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local LSM = LibStub("LibSharedMedia-3.0") +local SuperVillain, L = unpack(select(2, ...)) --[[ ########################################################## MEASURING UTILITY FUNCTIONS (from Astrolabe by: Esamynn) diff --git a/Interface/AddOns/SVUI/system/classes/Database.lua b/Interface/AddOns/SVUI/system/classes/Database.lua index 558e8d8..32430ff 100644 --- a/Interface/AddOns/SVUI/system/classes/Database.lua +++ b/Interface/AddOns/SVUI/system/classes/Database.lua @@ -52,7 +52,6 @@ GET ADDON DATA ########################################################## ]]-- local SuperVillain, L = unpack(select(2, ...)); -local LSM = LibStub("LibSharedMedia-3.0") local realm = GetRealmName() local name = UnitName("player") local pkey = name .. " - " .. realm @@ -61,45 +60,45 @@ local pkey = name .. " - " .. realm DEFINE SHARED MEDIA ########################################################## ]]-- -LSM:Register("background","SVUI Backdrop 1",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN1]]) -LSM:Register("background","SVUI Backdrop 2",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN2]]) -LSM:Register("background","SVUI Backdrop 3",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN3]]) -LSM:Register("background","SVUI Backdrop 4",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN4]]) -LSM:Register("background","SVUI Backdrop 5",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN5]]) -LSM:Register("background","SVUI Comic 1",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC1]]) -LSM:Register("background","SVUI Comic 2",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC2]]) -LSM:Register("background","SVUI Comic 3",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC3]]) -LSM:Register("background","SVUI Comic 4",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC4]]) -LSM:Register("background","SVUI Comic 5",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC5]]) -LSM:Register("background","SVUI Comic 6",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC6]]) -LSM:Register("background","SVUI Unit BG 1",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG1]]) -LSM:Register("background","SVUI Unit BG 2",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG2]]) -LSM:Register("background","SVUI Unit BG 3",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG3]]) -LSM:Register("background","SVUI Unit BG 4",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG4]]) -LSM:Register("background","SVUI Small BG 1",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG1]]) -LSM:Register("background","SVUI Small BG 2",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG2]]) -LSM:Register("background","SVUI Small BG 3",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG3]]) -LSM:Register("background","SVUI Small BG 4",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG4]]) -LSM:Register("statusbar","SVUI BasicBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) -LSM:Register("statusbar","SVUI MultiColorBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GRADIENT]]) -LSM:Register("statusbar","SVUI SmoothBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\SMOOTH]]) -LSM:Register("statusbar","SVUI PlainBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\FLAT]]) -LSM:Register("statusbar","SVUI FancyBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\TEXTURED]]) -LSM:Register("statusbar","SVUI GlossBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GLOSS]]) -LSM:Register("statusbar","SVUI GlowBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GLOWING]]) -LSM:Register("statusbar","SVUI LazerBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\LAZER]]) -LSM:Register("sound", "Whisper Alert", [[Interface\AddOns\SVUI\assets\sounds\whisper.mp3]]) -LSM:Register("sound", "Toasty", [[Interface\AddOns\SVUI\assets\sounds\toasty.mp3]]) -LSM:Register("font","SVUI Default Font",[[Interface\AddOns\SVUI\assets\fonts\Default.ttf]]) -LSM:Register("font","SVUI System Font",[[Interface\AddOns\SVUI\assets\fonts\System.ttf]]) -LSM:Register("font","SVUI Dialog Font",[[Interface\AddOns\SVUI\assets\fonts\Dialog.ttf]]) -LSM:Register("font","SVUI Narrator Font",[[Interface\AddOns\SVUI\assets\fonts\Narrative.ttf]]) -LSM:Register("font","SVUI Number Font",[[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]]) -LSM:Register("font","SVUI Combat Font",[[Interface\AddOns\SVUI\assets\fonts\Combat.ttf]]) -LSM:Register("font","SVUI Action Font",[[Interface\AddOns\SVUI\assets\fonts\Action.ttf]]) -LSM:Register("font","SVUI Name Font",[[Interface\AddOns\SVUI\assets\fonts\Names.ttf]]) -LSM:Register("font","SVUI Alert Font",[[Interface\AddOns\SVUI\assets\fonts\Alert.ttf]]) -LSM:Register("font","Roboto",[[Interface\AddOns\SVUI\assets\fonts\Roboto.ttf]],LSM.LOCALE_BIT_ruRU+LSM.LOCALE_BIT_western) +SuperVillain.Shared:Register("background","SVUI Backdrop 1",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN1]]) +SuperVillain.Shared:Register("background","SVUI Backdrop 2",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN2]]) +SuperVillain.Shared:Register("background","SVUI Backdrop 3",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN3]]) +SuperVillain.Shared:Register("background","SVUI Backdrop 4",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN4]]) +SuperVillain.Shared:Register("background","SVUI Backdrop 5",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN5]]) +SuperVillain.Shared:Register("background","SVUI Comic 1",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC1]]) +SuperVillain.Shared:Register("background","SVUI Comic 2",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC2]]) +SuperVillain.Shared:Register("background","SVUI Comic 3",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC3]]) +SuperVillain.Shared:Register("background","SVUI Comic 4",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC4]]) +SuperVillain.Shared:Register("background","SVUI Comic 5",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC5]]) +SuperVillain.Shared:Register("background","SVUI Comic 6",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC6]]) +SuperVillain.Shared:Register("background","SVUI Unit BG 1",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG1]]) +SuperVillain.Shared:Register("background","SVUI Unit BG 2",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG2]]) +SuperVillain.Shared:Register("background","SVUI Unit BG 3",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG3]]) +SuperVillain.Shared:Register("background","SVUI Unit BG 4",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG4]]) +SuperVillain.Shared:Register("background","SVUI Small BG 1",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG1]]) +SuperVillain.Shared:Register("background","SVUI Small BG 2",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG2]]) +SuperVillain.Shared:Register("background","SVUI Small BG 3",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG3]]) +SuperVillain.Shared:Register("background","SVUI Small BG 4",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG4]]) +SuperVillain.Shared:Register("statusbar","SVUI BasicBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) +SuperVillain.Shared:Register("statusbar","SVUI MultiColorBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GRADIENT]]) +SuperVillain.Shared:Register("statusbar","SVUI SmoothBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\SMOOTH]]) +SuperVillain.Shared:Register("statusbar","SVUI PlainBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\FLAT]]) +SuperVillain.Shared:Register("statusbar","SVUI FancyBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\TEXTURED]]) +SuperVillain.Shared:Register("statusbar","SVUI GlossBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GLOSS]]) +SuperVillain.Shared:Register("statusbar","SVUI GlowBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GLOWING]]) +SuperVillain.Shared:Register("statusbar","SVUI LazerBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\LAZER]]) +SuperVillain.Shared:Register("sound", "Whisper Alert", [[Interface\AddOns\SVUI\assets\sounds\whisper.mp3]]) +SuperVillain.Shared:Register("sound", "Toasty", [[Interface\AddOns\SVUI\assets\sounds\toasty.mp3]]) +SuperVillain.Shared:Register("font","SVUI Default Font",[[Interface\AddOns\SVUI\assets\fonts\Default.ttf]]) +SuperVillain.Shared:Register("font","SVUI System Font",[[Interface\AddOns\SVUI\assets\fonts\System.ttf]]) +SuperVillain.Shared:Register("font","SVUI Dialog Font",[[Interface\AddOns\SVUI\assets\fonts\Dialog.ttf]]) +SuperVillain.Shared:Register("font","SVUI Narrator Font",[[Interface\AddOns\SVUI\assets\fonts\Narrative.ttf]]) +SuperVillain.Shared:Register("font","SVUI Number Font",[[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]]) +SuperVillain.Shared:Register("font","SVUI Combat Font",[[Interface\AddOns\SVUI\assets\fonts\Combat.ttf]]) +SuperVillain.Shared:Register("font","SVUI Action Font",[[Interface\AddOns\SVUI\assets\fonts\Action.ttf]]) +SuperVillain.Shared:Register("font","SVUI Name Font",[[Interface\AddOns\SVUI\assets\fonts\Names.ttf]]) +SuperVillain.Shared:Register("font","SVUI Alert Font",[[Interface\AddOns\SVUI\assets\fonts\Alert.ttf]]) +SuperVillain.Shared:Register("font","Roboto",[[Interface\AddOns\SVUI\assets\fonts\Roboto.ttf]],SuperVillain.Shared.LOCALE_BIT_ruRU+SuperVillain.Shared.LOCALE_BIT_western) --[[ ########################################################## POPULATE MEDIA TABLE @@ -113,7 +112,8 @@ do local r2,g2,b2 = cColor2.r*.25, cColor2.g*.25, cColor2.b*.25 local ir1,ig1,ib1 = (1 - r1), (1 - g1), (1 - b1) local ir2,ig2,ib2 = (1 - cColor2.r)*.25, (1 - cColor2.g)*.25, (1 - cColor2.b)*.25 - + local Shared = SuperVillain.Shared + SuperVillain.Media["color"] = { ["default"] = {0.2, 0.2, 0.2, 1}, ["special"] = {.37, .32, .29, 1}, @@ -130,34 +130,34 @@ do } SuperVillain.Media["font"] = { - ["default"] = LSM:Fetch("font", "SVUI Default Font"), - ["system"] = LSM:Fetch("font", "SVUI System Font"), - ["combat"] = LSM:Fetch("font", "SVUI Combat Font"), - ["dialog"] = LSM:Fetch("font", "SVUI Dialog Font"), - ["narrator"] = LSM:Fetch("font", "SVUI Narrator Font"), - ["action"] = LSM:Fetch("font", "SVUI Action Font"), - ["names"] = LSM:Fetch("font", "SVUI Name Font"), - ["alert"] = LSM:Fetch("font", "SVUI Alert Font"), - ["numbers"] = LSM:Fetch("font", "SVUI Number Font"), - ["roboto"] = LSM:Fetch("font", "Roboto") + ["default"] = Shared:Fetch("font", "SVUI Default Font"), + ["system"] = Shared:Fetch("font", "SVUI System Font"), + ["combat"] = Shared:Fetch("font", "SVUI Combat Font"), + ["dialog"] = Shared:Fetch("font", "SVUI Dialog Font"), + ["narrator"] = Shared:Fetch("font", "SVUI Narrator Font"), + ["action"] = Shared:Fetch("font", "SVUI Action Font"), + ["names"] = Shared:Fetch("font", "SVUI Name Font"), + ["alert"] = Shared:Fetch("font", "SVUI Alert Font"), + ["numbers"] = Shared:Fetch("font", "SVUI Number Font"), + ["roboto"] = Shared:Fetch("font", "Roboto") } SuperVillain.Media["bar"] = { - ["default"] = LSM:Fetch("statusbar", "SVUI BasicBar"), - ["gradient"] = LSM:Fetch("statusbar", "SVUI MultiColorBar"), - ["smooth"] = LSM:Fetch("statusbar", "SVUI SmoothBar"), - ["flat"] = LSM:Fetch("statusbar", "SVUI PlainBar"), - ["textured"] = LSM:Fetch("statusbar", "SVUI FancyBar"), - ["gloss"] = LSM:Fetch("statusbar", "SVUI GlossBar"), - ["glow"] = LSM:Fetch("statusbar", "SVUI GlowBar"), - ["lazer"] = LSM:Fetch("statusbar", "SVUI LazerBar"), + ["default"] = Shared:Fetch("statusbar", "SVUI BasicBar"), + ["gradient"] = Shared:Fetch("statusbar", "SVUI MultiColorBar"), + ["smooth"] = Shared:Fetch("statusbar", "SVUI SmoothBar"), + ["flat"] = Shared:Fetch("statusbar", "SVUI PlainBar"), + ["textured"] = Shared:Fetch("statusbar", "SVUI FancyBar"), + ["gloss"] = Shared:Fetch("statusbar", "SVUI GlossBar"), + ["glow"] = Shared:Fetch("statusbar", "SVUI GlowBar"), + ["lazer"] = Shared:Fetch("statusbar", "SVUI LazerBar"), } SuperVillain.Media["bg"] = { - ["pattern"] = LSM:Fetch("background", "SVUI Backdrop 1"), - ["comic"] = LSM:Fetch("background", "SVUI Comic 1"), - ["unitlarge"] = LSM:Fetch("background", "SVUI Unit BG 3"), - ["unitsmall"] = LSM:Fetch("background", "SVUI Small BG 3") + ["pattern"] = Shared:Fetch("background", "SVUI Backdrop 1"), + ["comic"] = Shared:Fetch("background", "SVUI Comic 1"), + ["unitlarge"] = Shared:Fetch("background", "SVUI Unit BG 3"), + ["unitsmall"] = Shared:Fetch("background", "SVUI Small BG 3") } SuperVillain.Media["gradient"] = { @@ -796,7 +796,7 @@ local DatabaseDefaults = { ["guildRanks"] = true, ["inspectInfo"] = true, ["itemCount"] = true, - ["spellID"] = true, + ["spellID"] = false, ["progressInfo"] = true, ["visibility"] = { ["unitFrames"] = "NONE", @@ -892,8 +892,7 @@ local DatabaseDefaults = { ["position"] = "INNERLEFT", ["hideonnpc"] = false, ["xOffset"] = 0, - ["yOffset"] = 0, - ["detachFromFrame"] = false, + ["yOffset"] = 0, ["detachedWidth"] = 250, ["attachTextToPower"] = false, ["druidMana"] = true, @@ -987,9 +986,9 @@ local DatabaseDefaults = { ["castbar"] = { ["enable"] = true, - ["width"] = 235, + ["width"] = 215, ["height"] = 20, - ["detachFromFrame"] = false, + ["matchFrameWidth"] = true, ["icon"] = true, ["latency"] = false, ["format"] = "REMAINING", @@ -1234,9 +1233,9 @@ local DatabaseDefaults = { ["castbar"] = { ["enable"] = true, - ["width"] = 235, + ["width"] = 215, ["height"] = 20, - ["detachFromFrame"] = false, + ["matchFrameWidth"] = true, ["icon"] = true, ["format"] = "REMAINING", ["spark"] = true, @@ -1570,6 +1569,7 @@ local DatabaseDefaults = { ["width"] = 170, ["height"] = 18, ["icon"] = true, + ["matchFrameWidth"] = true, ["format"] = "REMAINING", ["spark"] = true, ["useCustomColor"] = false, @@ -1889,6 +1889,7 @@ local DatabaseDefaults = { ["width"] = 130, ["height"] = 8, ["icon"] = false, + ["matchFrameWidth"] = true, ["format"] = "REMAINING", ["spark"] = false, ["useCustomColor"] = false, @@ -2149,6 +2150,7 @@ local DatabaseDefaults = { ["width"] = 200, ["height"] = 18, ["icon"] = true, + ["matchFrameWidth"] = true, ["format"] = "REMAINING", ["spark"] = true, ["useCustomColor"] = false, @@ -2323,6 +2325,7 @@ local DatabaseDefaults = { ["width"] = 215, ["height"] = 18, ["icon"] = true, + ["matchFrameWidth"] = true, ["format"] = "REMAINING", ["spark"] = true, ["useCustomColor"] = false, @@ -2346,11 +2349,11 @@ local DatabaseDefaults = { ["showBy"] = "UP_RIGHT", ["wrapXOffset"] = 9, ["wrapYOffset"] = 13, - ["gCount"] = 1, - ["gRowCol"] = 1, + ["groupCount"] = 1, + ["gRowCol"] = 1, + ["customSorting"] = false, ["sortMethod"] = "GROUP", - ["sortDir"] = "ASC", - ["rSort"] = false, + ["sortDir"] = "ASC", ["invertGroupingOrder"] = false, ["startFromCenter"] = false, ["showPlayer"] = true, @@ -2523,8 +2526,9 @@ local DatabaseDefaults = { ["showBy"] = "RIGHT_DOWN", ["wrapXOffset"] = 8, ["wrapYOffset"] = 8, - ["gCount"] = 2, - ["gRowCol"] = 1, + ["groupCount"] = 2, + ["gRowCol"] = 1, + ["customSorting"] = false, ["sortMethod"] = "GROUP", ["sortDir"] = "ASC", ["showPlayer"] = true, @@ -2672,8 +2676,9 @@ local DatabaseDefaults = { ["showBy"] = "RIGHT_DOWN", ["wrapXOffset"] = 8, ["wrapYOffset"] = 8, - ["gCount"] = 5, - ["gRowCol"] = 1, + ["groupCount"] = 5, + ["gRowCol"] = 1, + ["customSorting"] = false, ["sortMethod"] = "GROUP", ["sortDir"] = "ASC", ["showPlayer"] = true, @@ -2820,8 +2825,9 @@ local DatabaseDefaults = { ["showBy"] = "RIGHT_DOWN", ["wrapXOffset"] = 8, ["wrapYOffset"] = 8, - ["gCount"] = 8, - ["gRowCol"] = 1, + ["groupCount"] = 8, + ["gRowCol"] = 1, + ["customSorting"] = false, ["sortMethod"] = "GROUP", ["sortDir"] = "ASC", ["showPlayer"] = true, @@ -2969,11 +2975,11 @@ local DatabaseDefaults = { ["showBy"] = "DOWN_RIGHT", ["wrapXOffset"] = 3, ["wrapYOffset"] = 3, - ["gCount"] = 2, - ["gRowCol"] = 1, + ["groupCount"] = 2, + ["gRowCol"] = 1, + ["customSorting"] = true, ["sortMethod"] = "PETNAME", - ["sortDir"] = "ASC", - ["rSort"] = true, + ["sortDir"] = "ASC", ["invertGroupingOrder"] = false, ["startFromCenter"] = false, ["predict"] = false, diff --git a/Interface/AddOns/SVUI/system/classes/Registry.lua b/Interface/AddOns/SVUI/system/classes/Registry.lua index 364e073..6fc0b5a 100644 --- a/Interface/AddOns/SVUI/system/classes/Registry.lua +++ b/Interface/AddOns/SVUI/system/classes/Registry.lua @@ -76,22 +76,20 @@ local function SetPrototype(obj) obj.db = {} obj._loaded = false obj.CombatLocked = false - obj.ChangeDBVar = function(obj, value, key, sub1, sub2) - --local debug = self:GetName() - if sub1 and sub2 and obj.db[sub1] and obj.db[sub1][sub2] then - --print(debug..": DB[" .. key .. "] " .. sub1 .. "." .. sub2) + obj.ChangeDBVar = function(obj, value, key, sub1, sub2, sub3) + if((sub1 and sub2 and sub3) and (obj.db[sub1] and obj.db[sub1][sub2] and obj.db[sub1][sub2][sub3])) then + obj.db[sub1][sub2][sub3][key] = value; + SuperVillain.db[obj._name][sub1][sub2][sub3][key] = value; + elseif((sub1 and sub2) and (obj.db[sub1] and obj.db[sub1][sub2])) then obj.db[sub1][sub2][key] = value; SuperVillain.db[obj._name][sub1][sub2][key] = value; - elseif sub1 and obj.db[sub1] then - --print(debug..": DB[" .. key .. "] " .. sub1) + elseif(sub1 and obj.db[sub1]) then obj.db[sub1][key] = value; SuperVillain.db[obj._name][sub1][key] = value; else - --print(debug..": DB[" .. key .. "]") obj.db[key] = value; SuperVillain.db[obj._name][key] = value; end - --print(value) end obj.Protect = function(obj, fnKey, autorun) SuperVillain.Security:Register(obj, fnKey, autorun); diff --git a/Interface/AddOns/SVUI/system/classes/Visibility.lua b/Interface/AddOns/SVUI/system/classes/Visibility.lua index 0e80b7f..bfa8d55 100644 --- a/Interface/AddOns/SVUI/system/classes/Visibility.lua +++ b/Interface/AddOns/SVUI/system/classes/Visibility.lua @@ -35,8 +35,6 @@ LOCALS local DisplayEventHandler = CreateFrame("Frame"); local SecureFadeManager = CreateFrame("Frame"); local SecureFadeFrames = {}; -local StealthFrame = CreateFrame("Frame"); -StealthFrame:Hide(); --[[ ########################################################## FRAME VISIBILITY MANAGEMENT @@ -52,7 +50,7 @@ function SuperVillain:FlushDisplayAudit() if InCombatLockdown() then return end; for frame,_ in pairs(self.DisplayAudit)do if _G[frame] then - _G[frame]:SetParent(StealthFrame) + _G[frame]:SetParent(SuperVillain.Cloaked) end end; DisplayEventHandler:RegisterEvent("PLAYER_REGEN_DISABLED") diff --git a/Interface/AddOns/SVUI/system/mentalo.lua b/Interface/AddOns/SVUI/system/mentalo.lua index 1395de8..586a24f 100644 --- a/Interface/AddOns/SVUI/system/mentalo.lua +++ b/Interface/AddOns/SVUI/system/mentalo.lua @@ -696,15 +696,15 @@ function SuperVillain:LoadMovables() for name, _ in pairs(SuperVillain.MentaloFrames)do local parent, text, overlay, snapoffset, postdrag; for key, value in pairs(SuperVillain.MentaloFrames[name])do - if key == "parent"then + if(key == "parent") then parent = value - elseif key == "text"then + elseif(key == "text") then text = value - elseif key == "overlay"then + elseif(key == "overlay") then overlay = value - elseif key == "snapoffset"then + elseif(key == "snapoffset") then snapoffset = value - elseif key == "postdrag"then + elseif(key == "postdrag") then postdrag = value end end diff --git a/Interface/AddOns/SVUI/system/slash.lua b/Interface/AddOns/SVUI/system/slash.lua index f6b37bd..ff2b18c 100644 --- a/Interface/AddOns/SVUI/system/slash.lua +++ b/Interface/AddOns/SVUI/system/slash.lua @@ -25,19 +25,19 @@ local lower, trim = string.lower, string.trim GLOBAL SLASH FUNCTIONS ########################################################## ]]-- -function FishingMode() +function SVUIFishingMode() if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end if SuperVillain.Modes.CurrentMode and SuperVillain.Modes.CurrentMode == "Fishing" then SuperVillain.Modes:EndJobModes() else SuperVillain.Modes:SetJobMode("Fishing") end end -function FarmingMode() +function SVUIFarmingMode() if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end if SuperVillain.Modes.CurrentMode and SuperVillain.CurrentMode == "Farming" then SuperVillain.Modes:EndJobModes() else SuperVillain.Modes:SetJobMode("Farming") end end -function ArchaeologyMode() +function SVUIArchaeologyMode() if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end if SuperVillain.Modes.CurrentMode and SuperVillain.Modes.CurrentMode == "Archaeology" then SuperVillain.Modes:EndJobModes() else SuperVillain.Modes:SetJobMode("Archaeology") end end -function CookingMode() +function SVUICookingMode() if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end if SuperVillain.Modes.CurrentMode and SuperVillain.Modes.CurrentMode == "Cooking" then SuperVillain.Modes:EndJobModes() else SuperVillain.Modes:SetJobMode("Cooking") end end @@ -58,13 +58,13 @@ local function SVUIMasterCommand(msg) elseif (msg == "reset" or msg == "resetui") then SuperVillain:ResetAllUI() elseif (msg == "fish" or msg == "fishing") then - FishingMode() + SVUIFishingMode() elseif (msg == "farm" or msg == "farming") then - FarmingMode() + SVUIFarmingMode() elseif (msg == "cook" or msg == "cooking") then - ArchaeologyMode() + SVUIArchaeologyMode() elseif (msg == "dig" or msg == "survey" or msg == "archaeology") then - CookingMode() + SVUICookingMode() elseif (msg == "bg" or msg == "pvp") then local MOD = SuperVillain.Registry:Expose('SVStats') MOD.ForceHideBGStats = nil; diff --git a/Interface/AddOns/SVUI/system/system.lua b/Interface/AddOns/SVUI/system/system.lua index c72ebab..50f181e 100644 --- a/Interface/AddOns/SVUI/system/system.lua +++ b/Interface/AddOns/SVUI/system/system.lua @@ -99,9 +99,10 @@ _G[SVUINameSpace] = SVUICore; SET MANY VARIABLES ########################################################## ]]-- +SuperVillain.Shared = LibStub("LibSharedMedia-3.0") local toonClass = select(2,UnitClass("player")); SuperVillain.version = GetAddOnMetadata(..., "Version"); -SuperVillain.HVAL = format("|cff%02x%02x%02x",0.2*255,0.5*255,1*255); +SuperVillain.HVAL = format("|cff%02x%02x%02x", 0.2*255, 0.5*255, 1*255); SuperVillain.class = toonClass; SuperVillain.name = UnitName("player"); SuperVillain.realm = GetRealmName(); @@ -120,11 +121,14 @@ SuperVillain.ConfigurationMode = false; SuperVillain.ClassRole = ""; --[[ INTERNAL HANDLER FRAMES ]]-- local SVUISystemEventHandler = CreateFrame("Frame", "SVUISystemEventHandler") -local SVUIParent = CreateFrame('Frame','SVUIParent',UIParent); +local SVUIParent = CreateFrame("Frame", "SVUIParent", UIParent); +local StealthFrame = CreateFrame("Frame", nil, UIParent); +StealthFrame:Hide(); SVUIParent:SetFrameLevel(UIParent:GetFrameLevel()); -SVUIParent:SetPoint('CENTER',UIParent,'CENTER'); +SVUIParent:SetPoint("CENTER", UIParent, "CENTER"); SVUIParent:SetSize(UIParent:GetSize()); SuperVillain.UIParent = SVUIParent; +SuperVillain.Cloaked = StealthFrame; SuperVillain.snaps[#SuperVillain.snaps + 1] = SuperVillain.UIParent; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/system/templates.lua b/Interface/AddOns/SVUI/system/templates.lua index 56cc0bf..6469c3f 100644 --- a/Interface/AddOns/SVUI/system/templates.lua +++ b/Interface/AddOns/SVUI/system/templates.lua @@ -38,8 +38,7 @@ local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, t GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local LSM = LibStub("LibSharedMedia-3.0") +local SuperVillain, L = unpack(select(2, ...)) --[[ ########################################################## LOCAL VARS diff --git a/Interface/AddOns/SVUI/system/updates.lua b/Interface/AddOns/SVUI/system/updates.lua index 75fa17a..3cb9bca 100644 --- a/Interface/AddOns/SVUI/system/updates.lua +++ b/Interface/AddOns/SVUI/system/updates.lua @@ -37,8 +37,7 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local LSM = LibStub("LibSharedMedia-3.0") +local SuperVillain, L = unpack(select(2, ...)) --[[ ########################################################## LOCALIZED GLOBALS @@ -76,12 +75,12 @@ CORE FUNCTIONS ########################################################## ]]-- function SuperVillain:MediaUpdate() - self.Media.color.default = SuperVillain.db.media.colors.default - self.Media.color.special = SuperVillain.db.media.colors.special - self.Media.bg.pattern = LSM:Fetch("background", SuperVillain.db.media.textures.pattern) - self.Media.bg.comic = LSM:Fetch("background", SuperVillain.db.media.textures.comic) - self.Media.bg.unitlarge = LSM:Fetch("background", SuperVillain.db.media.textures.unitlarge) - self.Media.bg.unitsmall = LSM:Fetch("background", SuperVillain.db.media.textures.unitsmall) + self.Media.color.default = self.db.media.colors.default + self.Media.color.special = self.db.media.colors.special + self.Media.bg.pattern = self.Shared:Fetch("background", self.db.media.textures.pattern) + self.Media.bg.comic = self.Shared:Fetch("background", self.db.media.textures.comic) + self.Media.bg.unitlarge = self.Shared:Fetch("background", self.db.media.textures.unitlarge) + self.Media.bg.unitsmall = self.Shared:Fetch("background", self.db.media.textures.unitsmall) local cColor1 = self.Media.color.special local cColor2 = self.Media.color.default @@ -97,11 +96,11 @@ function SuperVillain:RefreshSystemFonts() local fontsize = self.db.media.fonts.size local unicodesize = self.db.media.fonts.unicodeSize - local NUMBER_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.number); - local GIANT_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.giant); - STANDARD_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.default); - UNIT_NAME_FONT = LSM:Fetch("font", self.db.media.fonts.name); - DAMAGE_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.combat); + local NUMBER_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.number); + local GIANT_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.giant); + STANDARD_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.default); + UNIT_NAME_FONT = self.Shared:Fetch("font", self.db.media.fonts.name); + DAMAGE_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.combat); NAMEPLATE_FONT = STANDARD_TEXT_FONT CHAT_FONT_HEIGHTS = {8,9,10,11,12,13,14,15,16,17,18,19,20} UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = fontsize @@ -166,11 +165,11 @@ function SuperVillain:RefreshAllSystemMedia() local fontsize = self.db.media.fonts.size local unicodesize = self.db.media.fonts.unicodeSize - local NUMBER_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.number); - local GIANT_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.giant); - STANDARD_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.default); - UNIT_NAME_FONT = LSM:Fetch("font", self.db.media.fonts.name); - DAMAGE_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.combat); + local NUMBER_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.number); + local GIANT_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.giant); + STANDARD_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.default); + UNIT_NAME_FONT = self.Shared:Fetch("font", self.db.media.fonts.name); + DAMAGE_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.combat); NAMEPLATE_FONT = STANDARD_TEXT_FONT CHAT_FONT_HEIGHTS = {8,9,10,11,12,13,14,15,16,17,18,19,20} UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = fontsize diff --git a/Interface/AddOns/SVUI/system/utilities.lua b/Interface/AddOns/SVUI/system/utilities.lua index b62fa38..2750b64 100644 --- a/Interface/AddOns/SVUI/system/utilities.lua +++ b/Interface/AddOns/SVUI/system/utilities.lua @@ -36,8 +36,7 @@ local floor, modf = math.floor, math.modf; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local LSM = LibStub("LibSharedMedia-3.0") +local SuperVillain, L = unpack(select(2, ...)) --[[ ########################################################## MISC UTILITY FUNCTIONS diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/filter.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/filter.lua index 997283c..1222c0e 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/filter.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/filter.lua @@ -54,9 +54,9 @@ local function generateFilterOptions() SuperVillain.db.media.unitframes.spellcolor[arg] = false end; generateFilterOptions() - MOD:SetBasicFrame("player") - MOD:SetBasicFrame("target") - MOD:SetBasicFrame("focus") + MOD:SetUnitFrame("player") + MOD:SetUnitFrame("target") + MOD:SetUnitFrame("focus") end }, removeSpell = { @@ -75,9 +75,9 @@ local function generateFilterOptions() end; selectedSpell = nil; generateFilterOptions() - MOD:SetBasicFrame("player") - MOD:SetBasicFrame("target") - MOD:SetBasicFrame("focus") + MOD:SetUnitFrame("player") + MOD:SetUnitFrame("target") + MOD:SetUnitFrame("focus") end }, selectSpell = { @@ -131,9 +131,9 @@ local function generateFilterOptions() end; local abColor = {r, g, b} SuperVillain.db.media.unitframes.spellcolor[selectedSpell] = abColor - MOD:SetBasicFrame("player") - MOD:SetBasicFrame("target") - MOD:SetBasicFrame("focus") + MOD:SetUnitFrame("player") + MOD:SetUnitFrame("target") + MOD:SetUnitFrame("focus") end }, removeColor = { @@ -142,9 +142,9 @@ local function generateFilterOptions() name = L["Restore Defaults"], func = function(e, arg) SuperVillain.db.media.unitframes.spellcolor[selectedSpell] = false; - MOD:SetBasicFrame("player") - MOD:SetBasicFrame("target") - MOD:SetBasicFrame("focus") + MOD:SetUnitFrame("player") + MOD:SetUnitFrame("target") + MOD:SetUnitFrame("focus") end } } @@ -182,7 +182,7 @@ local function generateFilterOptions() else tinsert(SuperVillain.Filters["PetBuffWatch"], {["enable"] = true, ["id"] = tonumber(arg), ["point"] = "TOPRIGHT", ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, ["anyUnit"] = true}) generateFilterOptions() - MOD:SetBasicFrame("pet") + MOD:SetUnitFrame("pet") selectedSpell = nil end end @@ -218,7 +218,7 @@ local function generateFilterOptions() end; selectedSpell = nil; generateFilterOptions() - MOD:SetBasicFrame("pet") + MOD:SetUnitFrame("pet") end }, selectSpell = { @@ -261,7 +261,7 @@ local function generateFilterOptions() get = function(e)return SuperVillain.Filters["PetBuffWatch"][registeredSpell][e[#e]] end, set = function(e, arg) SuperVillain.Filters["PetBuffWatch"][registeredSpell][e[#e]] = arg; - MOD:SetBasicFrame("pet") + MOD:SetUnitFrame("pet") end, order = -10, args = { @@ -304,7 +304,7 @@ local function generateFilterOptions() set = function(e, i, j, k) local abColor = SuperVillain.Filters["PetBuffWatch"][registeredSpell][e[#e]] abColor.r, abColor.g, abColor.b = i, j, k; - MOD:SetBasicFrame("pet") + MOD:SetUnitFrame("pet") end }, displayText = { @@ -327,7 +327,7 @@ local function generateFilterOptions() set = function(e,i,j,k) local abColor = SuperVillain.Filters["PetBuffWatch"][registeredSpell][e[#e]] abColor.r,abColor.g,abColor.b = i,j,k; - MOD:SetBasicFrame("pet") + MOD:SetUnitFrame("pet") end }, textThreshold = { diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/tip.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/tip.lua index 9b611f8..bdb9808 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/tip.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/tip.lua @@ -37,35 +37,77 @@ local LSM = LibStub("LibSharedMedia-3.0"); SET PACKAGE OPTIONS ########################################################## ]]-- -SuperVillain.Options.args.SVTip={ - type="group", - name=L["Tooltip"], - childGroups="tab", - get=function(a)return SuperVillain.db.SVTip[a[#a]]end, - set=function(a,b)SuperVillain.db.SVTip[a[#a]]=b end, - args={ - commonGroup={ - order=1, - type='group', - name=L['Tooltip Options'], - childGroups="tree", - args={ - intro={order=1,type="description",name=L["TOOLTIP_DESC"]}, - enable={order=2,type="toggle",name=L["Enable"],get=function(a)return SuperVillain.db.SVTip[a[#a]]end,set=function(a,b)SuperVillain.db.SVTip[a[#a]]=b;SuperVillain:StaticPopup_Show("RL_CLIENT")end}, - common={ - order=3, - type="group", - name=L["General"], - disabled=function()return not SuperVillain.db.SVTip.enable end, - args={ - cursorAnchor={order=1,type='toggle',name=L['Cursor Anchor'],desc=L['Should tooltip be anchored to mouse cursor']}, - targetInfo={order=2,type='toggle',name=L["Target Info"],desc=L["When in a raid group display if anyone in your raid is targeting the current tooltip unit."]}, - playerTitles={order=3,type='toggle',name=L['Player Titles'],desc=L['Display player titles.']}, - guildRanks={order=4,type='toggle',name=L['Guild Ranks'],desc=L['Display guild ranks if a unit is guilded.']}, - talentInfo={order=5,type='toggle',name=L['Talent Spec'],desc=L['Display the players talent spec in the tooltip, this may not immediately update when mousing over a unit.']}, - itemCount={order=6,type='toggle',name=L['Item Count'],desc=L['Display how many of a certain item you have in your possession.']}, - spellID={order=7,type='toggle',name=L['Spell/Item IDs'],desc=L['Display the spell or item ID when mousing over a spell or item tooltip.']} +SuperVillain.Options.args.SVTip = { + type = "group", + name = L["Tooltip"], + childGroups = "tab", + get = function(a)return SuperVillain.db.SVTip[a[#a]] end, + set = function(a, b)SuperVillain.db.SVTip[a[#a]] = b end, + args = { + commonGroup = { + order = 1, + type = "group", + name = L["Tooltip Options"], + childGroups = "tree", + args = { + intro = { + order = 1, + type = "description", + name = L["TOOLTIP_DESC"] + }, + enable = { + order = 2, + type = "toggle", + name = L["Enable"], + get = function(a)return SuperVillain.db.SVTip[a[#a]]end, + set = function(a, b)SuperVillain.db.SVTip[a[#a]] = b;SuperVillain:StaticPopup_Show("RL_CLIENT") end + }, + common = { + order = 3, + type = "group", + name = L["General"], + disabled = function() return not SuperVillain.db.SVTip.enable end, + args = { + cursorAnchor = { + order = 1, + type = "toggle", + name = L["Cursor Anchor"], + desc = L["Should tooltip be anchored to mouse cursor"] + }, + targetInfo = { + order = 2, + type = "toggle", + name = L["Target Info"], + desc = L["When in a raid group display if anyone in your raid is targeting the current tooltip unit."] + }, + playerTitles = { + order = 3, + type = "toggle", + name = L["Player Titles"], + desc = L["Display player titles."] + }, + guildRanks = { + order = 4, + type = "toggle", + name = L["Guild Ranks"], + desc = L["Display guild ranks if a unit is guilded."] + }, + talentInfo = { + order = 5, + type = "toggle", + name = L["Talent Spec"], + desc = L["Display the players talent spec in the tooltip, this may not immediately update when mousing over a unit."] + }, + spellID = { + order = 6, + type = "toggle", + name = L["Spell/Item IDs"], + desc = L["Display the spell or item ID when mousing over a spell or item tooltip."], + get = function(a)return SuperVillain.db.SVTip.spellID end, + set = function(a, b)SuperVillain.db.SVTip.spellID = b;SuperVillain:StaticPopup_Show("RL_CLIENT") end, + } } + }, visibility={ order=100, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua index 8159ad5..bc18f09 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua @@ -59,11 +59,11 @@ function ns:SetCastbarConfigGroup(updateFunction, unitName, count) order = 800, type = "group", name = L["Castbar"], - get = function(l) - return SuperVillain.db.SVUnit[unitName]["castbar"][l[#l]] + get = function(key) + return SuperVillain.db.SVUnit[unitName]["castbar"][key[#key]] end, - set = function(l, m) - SuperVillain.db.SVUnit[unitName]["castbar"][l[#l]] = m; + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], unitName, "castbar") updateFunction(MOD, unitName, count) end, args = { @@ -78,17 +78,8 @@ function ns:SetCastbarConfigGroup(updateFunction, unitName, count) type = "group", name = L["Base Settings"], args = { - matchsize = { - order = 1, - type = "execute", - name = L["Match Frame Width"], - func = function() - SuperVillain.db.SVUnit[unitName]["castbar"]["width"] = SuperVillain.db.SVUnit[unitName]["width"] - updateFunction(MOD, unitName, count) - end - }, forceshow = { - order = 2, + order = 1, name = SHOW.." / "..HIDE, type = "execute", func = function() @@ -125,17 +116,17 @@ function ns:SetCastbarConfigGroup(updateFunction, unitName, count) end, }, icon = { - order = 3, + order = 2, name = L["Icon"], type = "toggle" }, latency = { - order = 4, + order = 3, name = L["Latency"], type = "toggle" }, spark = { - order = 5, + order = 4, type = "toggle", name = L["Spark"] }, @@ -147,8 +138,24 @@ function ns:SetCastbarConfigGroup(updateFunction, unitName, count) type = "group", name = L["Size Settings"], args = { - width = { + matchFrameWidth = { order = 1, + name = L["Auto Width"], + desc = "Force the castbar to ALWAYS match its unitframes width.", + type = "toggle", + }, + matchsize = { + order = 2, + type = "execute", + name = L["Match Frame Width"], + desc = "Set the castbar width to match its unitframe.", + func = function() + SuperVillain.db.SVUnit[unitName]["castbar"]["width"] = SuperVillain.db.SVUnit[unitName]["width"] + updateFunction(MOD, unitName, count) + end + }, + width = { + order = 3, name = L["Width"], type = "range", width = "full", @@ -157,7 +164,7 @@ function ns:SetCastbarConfigGroup(updateFunction, unitName, count) step = 1 }, height = { - order = 2, + order = 4, name = L["Height"], type = "range", width = "full", @@ -245,12 +252,14 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam local configTable = { order = auraType == "buffs" and 600 or 700, type = "group", - name = auraType == "buffs" and L["Buffs"] or L["Debuffs"], - get = function(l)return SuperVillain.db.SVUnit[unitName][auraType][l[#l]]end, - set = function(l, m) - SuperVillain.db.SVUnit[unitName][auraType][l[#l]] = m; + name = auraType == "buffs" and L["Buffs"] or L["Debuffs"], + get = function(key) + return SuperVillain.db.SVUnit[unitName][auraType][key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], unitName, auraType) updateFunction(MOD, unitName, count) - end, + end, args = { enable = { type = "toggle", @@ -903,8 +912,13 @@ function ns:SetPortraitConfigGroup(updateFunction, unitName, count) order = 400, type = "group", name = L["Portrait"], - get = function(l)return SuperVillain.db.SVUnit[unitName]["portrait"][l[#l]]end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["portrait"][l[#l]] = m;updateFunction(MOD, unitName, count)end, + get = function(key) + return SuperVillain.db.SVUnit[unitName]["portrait"][key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], unitName, "portrait") + updateFunction(MOD, unitName, count) + end, args = { enable = { type = "toggle", @@ -981,6 +995,13 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) order = 5000, type = "group", name = L["Icons"], + get = function(key) + return SuperVillain.db.SVUnit[unitName]["icons"][key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], unitName, "icons") + updateFunction(MOD, unitName, count) + end, args = {} }; @@ -989,9 +1010,14 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) order = grouporder, type = "group", guiInline = true, - name = L["Raid Marker"], - get = function(l)return SuperVillain.db.SVUnit[unitName]["icons"]["raidicon"][l[#l]]end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["icons"]["raidicon"][l[#l]] = m;updateFunction(MOD, unitName, count)end, + name = L["Raid Marker"], + get = function(key) + return SuperVillain.db.SVUnit[unitName]["icons"]["raidicon"][key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], unitName, "icons", "raidicon") + updateFunction(MOD, unitName, count) + end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, @@ -1008,9 +1034,14 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) order = grouporder, type = "group", guiInline = true, - name = L["Combat"], - get = function(l)return SuperVillain.db.SVUnit[unitName]["icons"]["combatIcon"][l[#l]]end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["icons"]["combatIcon"][l[#l]] = m;updateFunction(MOD, unitName, count)end, + name = L["Combat"], + get = function(key) + return SuperVillain.db.SVUnit[unitName]["icons"]["combatIcon"][key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], unitName, "icons", "combatIcon") + updateFunction(MOD, unitName, count) + end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, @@ -1027,9 +1058,14 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) order = grouporder, type = "group", guiInline = true, - name = L["Resting"], - get = function(l)return SuperVillain.db.SVUnit[unitName]["icons"]["restIcon"][l[#l]]end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["icons"]["restIcon"][l[#l]] = m;updateFunction(MOD, unitName, count)end, + name = L["Resting"], + get = function(key) + return SuperVillain.db.SVUnit[unitName]["icons"]["restIcon"][key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], unitName, "icons", "restIcon") + updateFunction(MOD, unitName, count) + end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, @@ -1046,9 +1082,14 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) order = grouporder, type = "group", guiInline = true, - name = L["Class"], - get = function(l)return SuperVillain.db.SVUnit[unitName]["icons"]["classicon"][l[#l]]end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["icons"]["classicon"][l[#l]] = m;updateFunction(MOD, unitName, count)end, + name = L["Class"], + get = function(key) + return SuperVillain.db.SVUnit[unitName]["icons"]["classicon"][key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], unitName, "icons", "classicon") + updateFunction(MOD, unitName, count) + end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, @@ -1065,9 +1106,14 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) order = grouporder, type = "group", guiInline = true, - name = L["Elite / Rare"], - get = function(l)return SuperVillain.db.SVUnit[unitName]["icons"]["eliteicon"][l[#l]]end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["icons"]["eliteicon"][l[#l]] = m;updateFunction(MOD, unitName, count)end, + name = L["Elite / Rare"], + get = function(key) + return SuperVillain.db.SVUnit[unitName]["icons"]["eliteicon"][key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], unitName, "icons", "eliteicon") + updateFunction(MOD, unitName, count) + end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, @@ -1084,9 +1130,14 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) order = grouporder, type = "group", guiInline = true, - name = L["Role"], - get = function(l)return SuperVillain.db.SVUnit[unitName]["icons"]["roleIcon"][l[#l]]end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["icons"]["roleIcon"][l[#l]] = m;updateFunction(MOD, unitName, count)end, + name = L["Role"], + get = function(key) + return SuperVillain.db.SVUnit[unitName]["icons"]["roleIcon"][key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], unitName, "icons", "roleIcon") + updateFunction(MOD, unitName, count) + end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, @@ -1103,9 +1154,14 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) order = grouporder, type = "group", guiInline = true, - name = L["Leader / MasterLooter"], - get = function(l)return SuperVillain.db.SVUnit[unitName]["icons"]["raidRoleIcons"][l[#l]]end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["icons"]["raidRoleIcons"][l[#l]] = m;updateFunction(MOD, unitName, count)end, + name = L["Leader / MasterLooter"], + get = function(key) + return SuperVillain.db.SVUnit[unitName]["icons"]["raidRoleIcons"][key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], unitName, "icons", "raidRoleIcons") + updateFunction(MOD, unitName, count) + end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, @@ -1124,9 +1180,15 @@ function ns:SetAurabarConfigGroup(custom, updateFunction, unitName) local k = { order = 1100, type = "group", - name = L["Aura Bars"], - get = function(l)return SuperVillain.db.SVUnit[unitName]["aurabar"][l[#l]]end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["aurabar"][l[#l]] = m;updateFunction(MOD, unitName);MOD:RefreshUnitFrames()end, + name = L["Aura Bars"], + get = function(key) + return SuperVillain.db.SVUnit[unitName]["aurabar"][key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], unitName, "aurabar") + updateFunction(MOD, unitName, count) + MOD:RefreshUnitFrames() + end, args = { enable = { type = "toggle", @@ -1454,33 +1516,7 @@ SuperVillain.Options.args.SVUnit = { name = L["Debuff Highlight"], desc = L["Color the unit if there is a debuff that can be dispelled by your class."], type = "toggle" - }, - -- combatFadeNames = { - -- order = 4, - -- name = L["Name Fading"], - -- desc = L["Fade Names in Combat"], - -- type = "toggle", - -- get = function(key) - -- return SuperVillain.db.SVUnit.combatFadeNames - -- end, - -- set = function(key, value) - -- MOD:ChangeDBVar(value, key[#key]); - -- MOD:SetFadeManager() - -- end - -- }, - -- combatFadeRoles = { - -- order = 5, - -- name = L["Role Fading"], - -- desc = L["Fade Role Icons in Combat"], - -- type = "toggle", - -- get = function(key) - -- return SuperVillain.db.SVUnit.combatFadeRoles - -- end, - -- set = function(key, value) - -- MOD:ChangeDBVar(value, key[#key]); - -- MOD:SetFadeManager() - -- end - -- }, + }, xrayFocus = { order = 6, name = L["X-Ray Specs"], diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/focus.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/focus.lua index 55fe794..87ed77d 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/focus.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/focus.lua @@ -43,7 +43,7 @@ SuperVillain.Options.args.SVUnit.args.focus = { order = 9, childGroups = "tab", get = function(l)return SuperVillain.db.SVUnit["focus"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "focus");MOD:SetBasicFrame("focus")end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "focus");MOD:SetUnitFrame("focus")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("focus");SuperVillain:ResetMovables("Focus Frame")end}, @@ -68,7 +68,7 @@ SuperVillain.Options.args.SVUnit.args.focus = { order = 1, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_Focus;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetBasicFrame("focus")end + 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", @@ -95,7 +95,7 @@ SuperVillain.Options.args.SVUnit.args.focus = { 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 SuperVillain.db.SVUnit["focus"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["focus"]["power"].hideonnpc = m;MOD:SetBasicFrame("focus")end + set = function(l, m)SuperVillain.db.SVUnit["focus"]["power"].hideonnpc = m;MOD:SetUnitFrame("focus")end }, threatEnabled = { type = "toggle", @@ -132,15 +132,15 @@ SuperVillain.Options.args.SVUnit.args.focus = { }, } }, - misc = ns:SetMiscConfigGroup(false, MOD.SetBasicFrame, "focus"), - health = ns:SetHealthConfigGroup(false, MOD.SetBasicFrame, "focus"), - power = ns:SetPowerConfigGroup(nil, MOD.SetBasicFrame, "focus"), - name = ns:SetNameConfigGroup(MOD.SetBasicFrame, "focus"), - buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetBasicFrame, "focus"), - debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetBasicFrame, "focus"), - castbar = ns:SetCastbarConfigGroup(MOD.SetBasicFrame, "focus"), - aurabar = ns:SetAurabarConfigGroup(false, MOD.SetBasicFrame, "focus"), - icons = ns:SetIconConfigGroup(MOD.SetBasicFrame, "focus") + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "focus"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "focus"), + power = ns:SetPowerConfigGroup(nil, MOD.SetUnitFrame, "focus"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "focus"), + buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "focus"), + debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "focus"), + castbar = ns:SetCastbarConfigGroup(MOD.SetUnitFrame, "focus"), + aurabar = ns:SetAurabarConfigGroup(false, MOD.SetUnitFrame, "focus"), + icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "focus") } } } @@ -156,7 +156,7 @@ SuperVillain.Options.args.SVUnit.args.focustarget = { order = 10, childGroups = "tab", get = function(l)return SuperVillain.db.SVUnit["focustarget"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "focustarget");MOD:SetBasicFrame("focustarget")end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "focustarget");MOD:SetUnitFrame("focustarget")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("focustarget")SuperVillain:ResetMovables("FocusTarget Frame")end}, @@ -177,14 +177,14 @@ SuperVillain.Options.args.SVUnit.args.focustarget = { guiInline = true, name = L["Base Settings"], args = { - showAuras = {order = 1, type = "execute", name = L["Show Auras"], func = function()local U = SVUI_FocusTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetBasicFrame("focustarget")end}, + showAuras = {order = 1, type = "execute", name = L["Show Auras"], func = function()local U = SVUI_FocusTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("focustarget")end}, spacer1 = { order = 2, type = "description", name = "", }, rangeCheck = {order = 3, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, - hideonnpc = {type = "toggle", 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 SuperVillain.db.SVUnit["focustarget"]["power"].hideonnpc end, set = function(l, m)SuperVillain.db.SVUnit["focustarget"]["power"].hideonnpc = m;MOD:SetBasicFrame("focustarget")end}, + hideonnpc = {type = "toggle", 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 SuperVillain.db.SVUnit["focustarget"]["power"].hideonnpc end, set = function(l, m)SuperVillain.db.SVUnit["focustarget"]["power"].hideonnpc = m;MOD:SetUnitFrame("focustarget")end}, threatEnabled = {type = "toggle", order = 5, name = L["Show Threat"]} } }, @@ -200,13 +200,13 @@ SuperVillain.Options.args.SVUnit.args.focustarget = { }, } }, - misc = ns:SetMiscConfigGroup(false, MOD.SetBasicFrame, "focustarget"), - health = ns:SetHealthConfigGroup(false, MOD.SetBasicFrame, "focustarget"), - power = ns:SetPowerConfigGroup(false, MOD.SetBasicFrame, "focustarget"), - name = ns:SetNameConfigGroup(MOD.SetBasicFrame, "focustarget"), - buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetBasicFrame, "focustarget"), - debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetBasicFrame, "focustarget"), - icons = ns:SetIconConfigGroup(MOD.SetBasicFrame, "focustarget") + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "focustarget"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "focustarget"), + power = ns:SetPowerConfigGroup(false, MOD.SetUnitFrame, "focustarget"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "focustarget"), + buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "focustarget"), + debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "focustarget"), + icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "focustarget") } } } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua index 4858db0..ebdcb9c 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua @@ -43,7 +43,7 @@ SuperVillain.Options.args.SVUnit.args.boss = { order = 1000, childGroups = "tab", get = function(l)return SuperVillain.db.SVUnit["boss"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "boss");MOD:SetExtraFrame("boss", MAX_BOSS_FRAMES)end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "boss");MOD:SetEnemyFrames("boss", MAX_BOSS_FRAMES)end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, displayFrames = {type = "execute", order = 2, name = L["Display Frames"], desc = L["Force the frames to show, they will act as if they are the player frame."], func = function()MOD:SwapElement("boss", 4)end}, @@ -72,7 +72,7 @@ SuperVillain.Options.args.SVUnit.args.boss = { name = "", }, rangeCheck = {order = 3, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, - hideonnpc = {type = "toggle", 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 SuperVillain.db.SVUnit["boss"]["power"].hideonnpc end, set = function(l, m)SuperVillain.db.SVUnit["boss"]["power"].hideonnpc = m;MOD:SetBasicFrame("boss")end}, + hideonnpc = {type = "toggle", 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 SuperVillain.db.SVUnit["boss"]["power"].hideonnpc end, set = function(l, m)SuperVillain.db.SVUnit["boss"]["power"].hideonnpc = m;MOD:SetEnemyFrames("boss")end}, threatEnabled = {type = "toggle", order = 5, name = L["Show Threat"]} } }, @@ -88,15 +88,15 @@ SuperVillain.Options.args.SVUnit.args.boss = { }, } }, - misc = ns:SetMiscConfigGroup(false, MOD.SetExtraFrame, "boss", MAX_BOSS_FRAMES), - health = ns:SetHealthConfigGroup(false, MOD.SetExtraFrame, "boss", MAX_BOSS_FRAMES), - power = ns:SetPowerConfigGroup(false, MOD.SetExtraFrame, "boss", MAX_BOSS_FRAMES), - name = ns:SetNameConfigGroup(MOD.SetExtraFrame, "boss", MAX_BOSS_FRAMES), - portrait = ns:SetPortraitConfigGroup(MOD.SetExtraFrame, "boss", MAX_BOSS_FRAMES), - buffs = ns:SetAuraConfigGroup(true, "buffs", false, MOD.SetExtraFrame, "boss", MAX_BOSS_FRAMES), - debuffs = ns:SetAuraConfigGroup(true, "debuffs", false, MOD.SetExtraFrame, "boss", MAX_BOSS_FRAMES), - castbar = ns:SetCastbarConfigGroup(MOD.SetExtraFrame, "boss", MAX_BOSS_FRAMES), - icons = ns:SetIconConfigGroup(MOD.SetExtraFrame, "boss", MAX_BOSS_FRAMES) + misc = ns:SetMiscConfigGroup(false, MOD.SetEnemyFrames, "boss", MAX_BOSS_FRAMES), + health = ns:SetHealthConfigGroup(false, MOD.SetEnemyFrames, "boss", MAX_BOSS_FRAMES), + power = ns:SetPowerConfigGroup(false, MOD.SetEnemyFrames, "boss", MAX_BOSS_FRAMES), + name = ns:SetNameConfigGroup(MOD.SetEnemyFrames, "boss", MAX_BOSS_FRAMES), + portrait = ns:SetPortraitConfigGroup(MOD.SetEnemyFrames, "boss", MAX_BOSS_FRAMES), + buffs = ns:SetAuraConfigGroup(true, "buffs", false, MOD.SetEnemyFrames, "boss", MAX_BOSS_FRAMES), + debuffs = ns:SetAuraConfigGroup(true, "debuffs", false, MOD.SetEnemyFrames, "boss", MAX_BOSS_FRAMES), + castbar = ns:SetCastbarConfigGroup(MOD.SetEnemyFrames, "boss", MAX_BOSS_FRAMES), + icons = ns:SetIconConfigGroup(MOD.SetEnemyFrames, "boss", MAX_BOSS_FRAMES) } } } @@ -112,7 +112,7 @@ SuperVillain.Options.args.SVUnit.args.arena = { order = 1100, childGroups = "tab", get = function(l)return SuperVillain.db.SVUnit["arena"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena");MOD:SetExtraFrame("arena", 5)end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena");MOD:SetEnemyFrames("arena", 5)end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, displayFrames = {type = "execute", order = 2, name = L["Display Frames"], desc = L["Force the frames to show, they will act as if they are the player frame."], func = function()MOD:SwapElement("arena", 5)end}, @@ -143,7 +143,7 @@ SuperVillain.Options.args.SVUnit.args.arena = { predict = {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"}, pvpSpecIcon = {order = 4, name = L["Spec Icon"], desc = L["Display icon on arena frame indicating the units talent specialization or the units faction if inside a battleground."], type = "toggle"}, rangeCheck = {order = 5, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, - hideonnpc = {type = "toggle", order = 6, 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 SuperVillain.db.SVUnit["arena"]["power"].hideonnpc end, set = function(l, m)SuperVillain.db.SVUnit["arena"]["power"].hideonnpc = m;MOD:SetBasicFrame("arena")end}, + hideonnpc = {type = "toggle", order = 6, 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 SuperVillain.db.SVUnit["arena"]["power"].hideonnpc end, set = function(l, m)SuperVillain.db.SVUnit["arena"]["power"].hideonnpc = m;MOD:SetEnemyFrames("arena")end}, threatEnabled = {type = "toggle", order = 7, name = L["Show Threat"]} } }, @@ -163,7 +163,7 @@ SuperVillain.Options.args.SVUnit.args.arena = { type = "group", name = L["PVP Trinket"], get = function(l)return SuperVillain.db.SVUnit["arena"]["pvpTrinket"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena", "pvpTrinket");MOD:SetExtraFrame("arena", 5)end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena", "pvpTrinket");MOD:SetEnemyFrames("arena", 5)end, args = { enable = { type = "toggle", @@ -207,13 +207,13 @@ SuperVillain.Options.args.SVUnit.args.arena = { }, } }, - misc = ns:SetMiscConfigGroup(false, MOD.SetExtraFrame, "arena", 5), - health = ns:SetHealthConfigGroup(false, MOD.SetExtraFrame, "arena", 5), - power = ns:SetPowerConfigGroup(false, MOD.SetExtraFrame, "arena", 5), - name = ns:SetNameConfigGroup(MOD.SetExtraFrame, "arena", 5), - buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetExtraFrame, "arena", 5), - debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetExtraFrame, "arena", 5), - castbar = ns:SetCastbarConfigGroup(MOD.SetExtraFrame, "arena", 5) + misc = ns:SetMiscConfigGroup(false, MOD.SetEnemyFrames, "arena", 5), + health = ns:SetHealthConfigGroup(false, MOD.SetEnemyFrames, "arena", 5), + power = ns:SetPowerConfigGroup(false, MOD.SetEnemyFrames, "arena", 5), + name = ns:SetNameConfigGroup(MOD.SetEnemyFrames, "arena", 5), + buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetEnemyFrames, "arena", 5), + debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetEnemyFrames, "arena", 5), + castbar = ns:SetCastbarConfigGroup(MOD.SetEnemyFrames, "arena", 5) } } } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua index 91a2b7a..7af0a35 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua @@ -161,7 +161,7 @@ SuperVillain.Options.args.SVUnit.args.party ={ LEFT_UP = format(L['%s and then %s'], L['Left'], L['Up']), }, }, - gCount ={ + groupCount ={ order = 7, type = 'range', name = L['Number of Groups'], @@ -270,24 +270,24 @@ SuperVillain.Options.args.SVUnit.args.party ={ width = 'full', name = ' ', }, - rSort ={ + customSorting ={ order = 4, - name = L['Raid-Wide Sorting'], - desc = L['Enabling this allows raid-wide sorting however you will not be able to distinguish between groups.'], + name = L['Custom Sorting'], + desc = L['Enabling this allows unique sorting.'], type = 'toggle', }, invertGroupingOrder ={ order = 5, name = L['Invert Grouping Order'], - desc = L['Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from.'], - disabled = function()return not SuperVillain.db.SVUnit['party'].rSort end, + desc = L['Enabling this inverts the sorting order.'], + disabled = function()return not SuperVillain.db.SVUnit['party'].customSorting end, type = 'toggle', }, startFromCenter ={ order = 6, name = L['Start Near Center'], desc = L['The initial group will start near the center and grow out.'], - disabled = function()return not SuperVillain.db.SVUnit['party'].rSort end, + disabled = function()return not SuperVillain.db.SVUnit['party'].customSorting end, type = 'toggle', }, }, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/pet.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/pet.lua index ec2d49c..8ff28a8 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/pet.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/pet.lua @@ -43,7 +43,7 @@ SuperVillain.Options.args.SVUnit.args.pet = { order = 4, childGroups = "tab", get = function(l)return SuperVillain.db.SVUnit["pet"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "pet");MOD:SetBasicFrame("pet")end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "pet");MOD:SetUnitFrame("pet")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("pet")SuperVillain:ResetMovables("Pet Frame")end}, @@ -62,7 +62,7 @@ SuperVillain.Options.args.SVUnit.args.pet = { order = 1, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_Pet;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetBasicFrame("pet")end + func = function()local U = SVUI_Pet;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("pet")end }, miscGroup = { order = 2, @@ -88,7 +88,7 @@ SuperVillain.Options.args.SVUnit.args.pet = { 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 SuperVillain.db.SVUnit["pet"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["pet"]["power"].hideonnpc = m;MOD:SetBasicFrame("pet")end + set = function(l, m)SuperVillain.db.SVUnit["pet"]["power"].hideonnpc = m;MOD:SetUnitFrame("pet")end }, threatEnabled = { type = "toggle", @@ -113,7 +113,7 @@ SuperVillain.Options.args.SVUnit.args.pet = { guiInline = true, name = L["Buff Indicator"], get = function(l)return SuperVillain.db.SVUnit["pet"]["buffIndicator"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "pet", "buffIndicator");MOD:SetBasicFrame("pet")end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "pet", "buffIndicator");MOD:SetUnitFrame("pet")end, args = { enable = { type = "toggle", @@ -133,13 +133,13 @@ SuperVillain.Options.args.SVUnit.args.pet = { }, }, }, - misc = ns:SetMiscConfigGroup(false, MOD.SetBasicFrame, "pet"), - health = ns:SetHealthConfigGroup(false, MOD.SetBasicFrame, "pet"), - power = ns:SetPowerConfigGroup(false, MOD.SetBasicFrame, "pet"), - portrait = ns:SetPortraitConfigGroup(MOD.SetBasicFrame, "pet"), - name = ns:SetNameConfigGroup(MOD.SetBasicFrame, "pet"), - buffs = ns:SetAuraConfigGroup(true, "buffs", false, MOD.SetBasicFrame, "pet"), - debuffs = ns:SetAuraConfigGroup(true, "debuffs", false, MOD.SetBasicFrame, "pet") + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "pet"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "pet"), + power = ns:SetPowerConfigGroup(false, MOD.SetUnitFrame, "pet"), + portrait = ns:SetPortraitConfigGroup(MOD.SetUnitFrame, "pet"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "pet"), + buffs = ns:SetAuraConfigGroup(true, "buffs", false, MOD.SetUnitFrame, "pet"), + debuffs = ns:SetAuraConfigGroup(true, "debuffs", false, MOD.SetUnitFrame, "pet") } } } @@ -154,7 +154,7 @@ SuperVillain.Options.args.SVUnit.args.pettarget = { type = "group", order = 5, childGroups = "tab", get = function(l)return SuperVillain.db.SVUnit["pettarget"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "pettarget");MOD:SetBasicFrame("pettarget")end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "pettarget");MOD:SetUnitFrame("pettarget")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("pettarget")SuperVillain:ResetMovables("PetTarget Frame")end}, @@ -173,7 +173,7 @@ SuperVillain.Options.args.SVUnit.args.pettarget = { order = 3, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_PetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetBasicFrame("pettarget")end + func = function()local U = SVUI_PetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("pettarget")end }, width = {order = 4, name = L["Width"], type = "range", min = 50, max = 500, step = 1}, height = {order = 5, name = L["Height"], type = "range", min = 10, max = 250, step = 1}, @@ -184,7 +184,7 @@ SuperVillain.Options.args.SVUnit.args.pettarget = { 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 SuperVillain.db.SVUnit["pettarget"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["pettarget"]["power"].hideonnpc = m;MOD:SetBasicFrame("pettarget")end + set = function(l, m)SuperVillain.db.SVUnit["pettarget"]["power"].hideonnpc = m;MOD:SetUnitFrame("pettarget")end }, threatEnabled = {type = "toggle", order = 13, name = L["Show Threat"]} } @@ -198,7 +198,7 @@ SuperVillain.Options.args.SVUnit.args.pettarget = { order = 1, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_PetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetBasicFrame("pettarget")end + func = function()local U = SVUI_PetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("pettarget")end }, miscGroup = { order = 2, @@ -218,7 +218,7 @@ SuperVillain.Options.args.SVUnit.args.pettarget = { 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 SuperVillain.db.SVUnit["pettarget"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["pettarget"]["power"].hideonnpc = m;MOD:SetBasicFrame("pettarget")end + set = function(l, m)SuperVillain.db.SVUnit["pettarget"]["power"].hideonnpc = m;MOD:SetUnitFrame("pettarget")end }, threatEnabled = { type = "toggle", @@ -239,12 +239,12 @@ SuperVillain.Options.args.SVUnit.args.pettarget = { }, }, }, - misc = ns:SetMiscConfigGroup(false, MOD.SetBasicFrame, "pettarget"), - health = ns:SetHealthConfigGroup(false, MOD.SetBasicFrame, "pettarget"), - power = ns:SetPowerConfigGroup(false, MOD.SetBasicFrame, "pettarget"), - name = ns:SetNameConfigGroup(MOD.SetBasicFrame, "pettarget"), - buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetBasicFrame, "pettarget"), - debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetBasicFrame, "pettarget") + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "pettarget"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "pettarget"), + power = ns:SetPowerConfigGroup(false, MOD.SetUnitFrame, "pettarget"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "pettarget"), + buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "pettarget"), + debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "pettarget") } } } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/player.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/player.lua index 1904699..208875f 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/player.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/player.lua @@ -43,7 +43,7 @@ SuperVillain.Options.args.SVUnit.args.player={ order = 3, childGroups = "tab", get = function(l)return SuperVillain.db.SVUnit['player'][l[#l]]end, - set = function(l,m)MOD:ChangeDBVar(m, l[#l], "player");MOD:SetBasicFrame('player')end, + set = function(l,m)MOD:ChangeDBVar(m, l[#l], "player");MOD:SetUnitFrame('player')end, args = { enable = { type = 'toggle', @@ -80,7 +80,7 @@ SuperVillain.Options.args.SVUnit.args.player={ order = 1, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_Player;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetBasicFrame("player")end + func = function()local U = SVUI_Player;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("player")end }, lowmana = { order = 2, @@ -98,7 +98,7 @@ SuperVillain.Options.args.SVUnit.args.player={ type = "toggle", set = function(l, m) MOD:ChangeDBVar(m, l[#l], "player"); - MOD:SetBasicFrame("player") + MOD:SetUnitFrame("player") if m == true then SVUI_Pet:SetParent(SVUI_Player) else @@ -118,7 +118,7 @@ SuperVillain.Options.args.SVUnit.args.player={ 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 SuperVillain.db.SVUnit["player"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["player"]["power"].hideonnpc = m;MOD:SetBasicFrame("player")end + set = function(l, m)SuperVillain.db.SVUnit["player"]["power"].hideonnpc = m;MOD:SetUnitFrame("player")end }, threatEnabled = { type = "toggle", @@ -160,7 +160,7 @@ SuperVillain.Options.args.SVUnit.args.player={ SuperVillain.db.SVUnit["player"].castbar.width = m end; MOD:ChangeDBVar(m, l[#l], "player"); - MOD:SetBasicFrame("player") + MOD:SetUnitFrame("player") end }, height = { @@ -180,7 +180,7 @@ SuperVillain.Options.args.SVUnit.args.player={ guiInline = true, name = PVP, get = function(l)return SuperVillain.db.SVUnit["player"]["pvp"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player", "pvp");MOD:SetBasicFrame("player")end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player", "pvp");MOD:SetUnitFrame("player")end, args = { position = { type = "select", @@ -209,22 +209,22 @@ SuperVillain.Options.args.SVUnit.args.player={ } } }, - misc = ns:SetMiscConfigGroup(false, MOD.SetBasicFrame, "player"), - health = ns:SetHealthConfigGroup(false, MOD.SetBasicFrame, "player"), - power = ns:SetPowerConfigGroup(true, MOD.SetBasicFrame, "player"), - name = ns:SetNameConfigGroup(MOD.SetBasicFrame, "player"), - portrait = ns:SetPortraitConfigGroup(MOD.SetBasicFrame, "player"), - buffs = ns:SetAuraConfigGroup(true, "buffs", false, MOD.SetBasicFrame, "player"), - debuffs = ns:SetAuraConfigGroup(true, "debuffs", false, MOD.SetBasicFrame, "player"), - castbar = ns:SetCastbarConfigGroup(MOD.SetBasicFrame, "player"), - aurabar = ns:SetAurabarConfigGroup(true, MOD.SetBasicFrame, "player"), - icons = ns:SetIconConfigGroup(MOD.SetBasicFrame, "player"), + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "player"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "player"), + power = ns:SetPowerConfigGroup(true, MOD.SetUnitFrame, "player"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "player"), + portrait = ns:SetPortraitConfigGroup(MOD.SetUnitFrame, "player"), + buffs = ns:SetAuraConfigGroup(true, "buffs", false, MOD.SetUnitFrame, "player"), + debuffs = ns:SetAuraConfigGroup(true, "debuffs", false, MOD.SetUnitFrame, "player"), + castbar = ns:SetCastbarConfigGroup(MOD.SetUnitFrame, "player"), + aurabar = ns:SetAurabarConfigGroup(true, MOD.SetUnitFrame, "player"), + icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "player"), classbar = { order = 1000, type = "group", name = L["Classbar"], get = function(l)return SuperVillain.db.SVUnit["player"]["classbar"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player", "classbar");MOD:SetBasicFrame("player")end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player", "classbar");MOD:SetUnitFrame("player")end, args = { enable = { type = "toggle", @@ -252,7 +252,7 @@ SuperVillain.Options.args.SVUnit.args.player={ order = 3, name = L["Stagger Bar"], get = function(l)return SuperVillain.db.SVUnit["player"]["stagger"].enable end, - set = function(l, m)MOD:ChangeDBVar(m, "enable", "player", "stagger");MOD:SetBasicFrame("player")end, + set = function(l, m)MOD:ChangeDBVar(m, "enable", "player", "stagger");MOD:SetUnitFrame("player")end, disabled = SuperVillain.class ~= "MONK", }, druidMana = { @@ -265,7 +265,7 @@ SuperVillain.Options.args.SVUnit.args.player={ end, set = function(key, value) MOD:ChangeDBVar(value, "druidMana", "player", "power"); - MOD:SetBasicFrame("player") + MOD:SetUnitFrame("player") end, disabled = SuperVillain.class ~= "DRUID", } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua index 1ba20b1..e847295 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua @@ -180,7 +180,7 @@ for w=10,40,15 do LEFT_UP = format(L["%s and then %s"], L["Left"], L["Up"]), }, }, - gCount = + groupCount = { order = 7, type = "range", @@ -305,7 +305,7 @@ for w=10,40,15 do width = "full", name = " ", }, - rSort = + customSorting = { order = 4, name = L["Raid-Wide Sorting"], @@ -317,7 +317,7 @@ for w=10,40,15 do order = 5, name = L["Invert Grouping Order"], desc = L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."], - disabled = function()return not SuperVillain.db.SVUnit["raid" .. w].rSort end, + disabled = function()return not SuperVillain.db.SVUnit["raid" .. w].customSorting end, type = "toggle", }, startFromCenter = @@ -325,7 +325,7 @@ for w=10,40,15 do order = 6, name = L["Start Near Center"], desc = L["The initial group will start near the center and grow out."], - disabled = function()return not SuperVillain.db.SVUnit["raid" .. w].rSort end, + disabled = function()return not SuperVillain.db.SVUnit["raid" .. w].customSorting end, type = "toggle", }, }, @@ -543,7 +543,7 @@ SuperVillain.Options.args.SVUnit.args.raidpet ={ LEFT_UP = format(L['%s and then %s'], L['Left'], L['Up']), }, }, - gCount ={ + groupCount ={ order = 7, type = 'range', name = L['Number of Groups'], @@ -632,7 +632,7 @@ SuperVillain.Options.args.SVUnit.args.raidpet ={ width = 'full', name = ' ', }, - rSort ={ + customSorting ={ order = 4, name = L['Raid-Wide Sorting'], desc = L['Enabling this allows raid-wide sorting however you will not be able to distinguish between groups.'], @@ -642,14 +642,14 @@ SuperVillain.Options.args.SVUnit.args.raidpet ={ order = 5, name = L['Invert Grouping Order'], desc = L['Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from.'], - disabled = function()return not SuperVillain.db.SVUnit['raidpet'].rSort end, + disabled = function()return not SuperVillain.db.SVUnit['raidpet'].customSorting end, type = 'toggle', }, startFromCenter ={ order = 6, name = L['Start Near Center'], desc = L['The initial group will start near the center and grow out.'], - disabled = function()return not SuperVillain.db.SVUnit['raidpet'].rSort end, + disabled = function()return not SuperVillain.db.SVUnit['raidpet'].customSorting end, type = 'toggle', }, }, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/target.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/target.lua index 49dbc75..30bc833 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/target.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/target.lua @@ -43,7 +43,7 @@ SuperVillain.Options.args.SVUnit.args.target={ order=6, childGroups="tab", get=function(l)return SuperVillain.db.SVUnit['target'][l[#l]]end, - set=function(l,m)MOD:ChangeDBVar(m, l[#l], "target");MOD:SetBasicFrame('target')end, + set=function(l,m)MOD:ChangeDBVar(m, l[#l], "target");MOD:SetUnitFrame('target')end, args={ enable={type='toggle',order=1,name=L['Enable']}, resetSettings={type='execute',order=2,name=L['Restore Defaults'],func=function(l,m)MOD:ResetUnitOptions('target')SuperVillain:ResetMovables('Target Frame')end}, @@ -68,7 +68,7 @@ SuperVillain.Options.args.SVUnit.args.target={ order = 1, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_Target;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetBasicFrame("target")end + 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", @@ -93,7 +93,7 @@ SuperVillain.Options.args.SVUnit.args.target={ 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 SuperVillain.db.SVUnit["target"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["target"]["power"].hideonnpc = m;MOD:SetBasicFrame("target")end + set = function(l, m)SuperVillain.db.SVUnit["target"]["power"].hideonnpc = m;MOD:SetUnitFrame("target")end }, threatEnabled = { type = "toggle", @@ -129,7 +129,7 @@ SuperVillain.Options.args.SVUnit.args.target={ SuperVillain.db.SVUnit["target"].castbar.width = m end; MOD:ChangeDBVar(m, l[#l], "target"); - MOD:SetBasicFrame("target") + MOD:SetUnitFrame("target") end }, height = { @@ -150,7 +150,7 @@ SuperVillain.Options.args.SVUnit.args.target={ type = "group", name = L["Combobar"], get = function(l)return SuperVillain.db.SVUnit["target"]["combobar"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "target", "combobar");MOD:SetBasicFrame("target")end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "target", "combobar");MOD:SetUnitFrame("target")end, args = { enable = { type = "toggle", @@ -177,16 +177,16 @@ SuperVillain.Options.args.SVUnit.args.target={ } } }, - misc = ns:SetMiscConfigGroup(false, MOD.SetBasicFrame, "target"), - health = ns:SetHealthConfigGroup(false, MOD.SetBasicFrame, "target"), - power = ns:SetPowerConfigGroup(true, MOD.SetBasicFrame, "target"), - name = ns:SetNameConfigGroup(MOD.SetBasicFrame, "target"), - portrait = ns:SetPortraitConfigGroup(MOD.SetBasicFrame, "target"), - buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetBasicFrame, "target"), - debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetBasicFrame, "target"), - castbar = ns:SetCastbarConfigGroup(MOD.SetBasicFrame, "target"), - aurabar = ns:SetAurabarConfigGroup(false, MOD.SetBasicFrame, "target"), - icons = ns:SetIconConfigGroup(MOD.SetBasicFrame, "target") + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "target"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "target"), + power = ns:SetPowerConfigGroup(true, MOD.SetUnitFrame, "target"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "target"), + portrait = ns:SetPortraitConfigGroup(MOD.SetUnitFrame, "target"), + buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "target"), + debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "target"), + castbar = ns:SetCastbarConfigGroup(MOD.SetUnitFrame, "target"), + aurabar = ns:SetAurabarConfigGroup(false, MOD.SetUnitFrame, "target"), + icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "target") } } } @@ -202,7 +202,7 @@ SuperVillain.Options.args.SVUnit.args.targettarget={ order=7, childGroups="tab", get=function(l)return SuperVillain.db.SVUnit['targettarget'][l[#l]]end, - set=function(l,m)MOD:ChangeDBVar(m, l[#l], "targettarget");MOD:SetBasicFrame('targettarget')end, + set=function(l,m)MOD:ChangeDBVar(m, l[#l], "targettarget");MOD:SetUnitFrame('targettarget')end, args={ enable={type='toggle',order=1,name=L['Enable']}, resetSettings={type='execute',order=2,name=L['Restore Defaults'],func=function(l,m)MOD:ResetUnitOptions('targettarget')SuperVillain:ResetMovables('TargetTarget Frame')end}, @@ -227,7 +227,7 @@ SuperVillain.Options.args.SVUnit.args.targettarget={ order = 1, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_TargetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetBasicFrame("targettarget")end + func = function()local U = SVUI_TargetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("targettarget")end }, spacer1 = { order = 2, @@ -246,7 +246,7 @@ SuperVillain.Options.args.SVUnit.args.targettarget={ 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 SuperVillain.db.SVUnit["target"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["target"]["power"].hideonnpc = m;MOD:SetBasicFrame("target")end + set = function(l, m)SuperVillain.db.SVUnit["target"]["power"].hideonnpc = m;MOD:SetUnitFrame("target")end }, threatEnabled = { type = "toggle", @@ -283,14 +283,14 @@ SuperVillain.Options.args.SVUnit.args.targettarget={ } } }, - misc = ns:SetMiscConfigGroup(false, MOD.SetBasicFrame, "targettarget"), - health = ns:SetHealthConfigGroup(false, MOD.SetBasicFrame, "targettarget"), - power = ns:SetPowerConfigGroup(nil, MOD.SetBasicFrame, "targettarget"), - name = ns:SetNameConfigGroup(MOD.SetBasicFrame, "targettarget"), - portrait = ns:SetPortraitConfigGroup(MOD.SetBasicFrame, "targettarget"), - buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetBasicFrame, "targettarget"), - debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetBasicFrame, "targettarget"), - icons = ns:SetIconConfigGroup(MOD.SetBasicFrame, "targettarget") + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "targettarget"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "targettarget"), + power = ns:SetPowerConfigGroup(nil, MOD.SetUnitFrame, "targettarget"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "targettarget"), + portrait = ns:SetPortraitConfigGroup(MOD.SetUnitFrame, "targettarget"), + buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "targettarget"), + debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "targettarget"), + icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "targettarget") } } }