--[[ ############################################################################## _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# ___\///////////___________\///___________\/////////_____\///////////_# ############################################################################## 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