Cytek
Quest-Mob
- Mitglied seit
- 22.08.2007
- Beiträge
- 91
- Reaktionspunkte
- 0
- Kommentare
- 3
Hi,
benutze das oUF_Lyn und bin nich so der coder^^
kann mir vlt. wer sagen was ich in der lua ändern muss damit mir im player,target und tot frame die maxhp anzahl angezeigt wird (7,4k z.b.)
bzw. welcher teil der lua dafür überhaupt verantwortlich ist.
[codebox]local func = function(self, unit)
self.menu = menu -- Enable the menus
self:SetScript("OnEnter", UnitFrame_OnEnter)
self:SetScript("OnLeave", UnitFrame_OnLeave)
self:RegisterForClicks"anyup"
self:SetAttribute("*type2", "menu")
--
-- background
--
self:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -2, right = -2, top = -2, bottom = -2},
}
self:SetBackdropColor(0,0,0,1) -- and color the backgrounds
--
-- healthbar
--
self.Health = CreateFrame"StatusBar"
self.Health:SetHeight(19) -- Custom height
self.Health:SetStatusBarTexture(bartex)
self.Health:SetParent(self)
self.Health:SetPoint"TOP"
self.Health:SetPoint"LEFT"
self.Health:SetPoint"RIGHT"
--
-- healthbar background
--
self.Health.bg = self.Health:CreateTexture(nil, "BORDER")
self.Health.bg:SetAllPoints(self.Health)
self.Health.bg:SetTexture(bartex)
self.Health.bg:SetAlpha(0.30)
--
-- healthbar text
--
self.Health.value = self.Health:CreateFontString(nil, "OVERLAY")
self.Health.value:SetPoint("RIGHT", -2, 2)
self.Health.value:SetFont(font, fontsize, "OUTLINE")
self.Health.value:SetTextColor(1,1,1)
self.Health.value:SetShadowOffset(1, -1)
--
-- healthbar functions
--
self.Health.frequentUpdates = true
self.Health.colorClass = true
self.Health.colorReaction = true
self.Health.colorDisconnected = true
self.Health.colorTapping = true
self.PostUpdateHealth = updateHealth -- let the colors be
--
-- powerbar
--
self.Power = CreateFrame"StatusBar"
self.Power:SetHeight(3)
self.Power:SetStatusBarTexture(bartex)
self.Power:SetParent(self)
self.Power:SetPoint"LEFT"
self.Power:SetPoint"RIGHT"
self.Power:SetPoint("TOP", self.Health, "BOTTOM", 0, -1.45) -- Little offset to make it pretty
--
-- powerbar background
--
self.Power.bg = self.Power:CreateTexture(nil, "BORDER")
self.Power.bg:SetAllPoints(self.Power)
self.Power.bg:SetTexture(bartex)
self.Power.bg:SetAlpha(0.30)
--
-- powerbar text
--
self.Power.value = self.Power:CreateFontString(nil, "OVERLAY")
self.Power.value:SetPoint("RIGHT", self.Health.value, "BOTTOMRIGHT", 0, -5) -- powerbar text in health box
self.Power.value:SetFont(font, fontsize, "OUTLINE")
self.Power.value:SetTextColor(1,1,1)
self.Power.value:SetShadowOffset(1, -1)
self.Power.value:Hide()
--
-- powerbar functions
--
self.Power.frequentUpdates = true
self.Power.colorTapping = true
self.Power.colorDisconnected = true
self.Power.colorClass = true
self.Power.colorPower = true
self.Power.colorHappiness = false
self.PostUpdatePower = updatePower -- let the colors be
--
-- names
--
self.Name = self.Health:CreateFontString(nil, "OVERLAY")
self.Name:SetPoint("LEFT", self, 0, 9)
self.Name:SetJustifyH"LEFT"
self.Name:SetFont(font, fontsize, "OUTLINE")
self.Name:SetShadowOffset(1, -1)
self.UNIT_NAME_UPDATE = updateName
--
-- level
--
self.Level = self.Health:CreateFontString(nil, "OVERLAY")
self.Level:SetPoint("LEFT", self.Health, 0, 9)
self.Level:SetJustifyH("LEFT")
self.Level:SetFont(font, fontsize, "OUTLINE")
self.Level:SetTextColor(1,1,1)
self.Level:SetShadowOffset(1, -1)
self.UNIT_LEVEL = updateLevel
-- ------------------------------------
-- player
-- ------------------------------------
if unit=="player" then
self:SetWidth(250)
self:SetHeight(20)
self.Health:SetHeight(15.5)
self.Name:Hide()
self.Health.value:SetPoint("RIGHT", 0, 9)
self.Power:SetHeight(3)
self.Power.value:Show()
self.Power.value:SetPoint("LEFT", self.Health, 0, 9)
self.Power.value:SetJustifyH"LEFT"
self.Level:Hide()
--[[
if(playerClass=="DRUID") then
-- bar
self.DruidMana = CreateFrame('StatusBar', nil, self)
self.DruidMana:SetPoint('TOP', self, 'BOTTOM', 0, -6)
self.DruidMana:SetStatusBarTexture(bartex)
self.DruidMana:SetStatusBarColor(45/255, 113/255, 191/255)
self.DruidMana:SetHeight(10)
self.DruidMana:SetWidth(250)
-- bar bg
self.DruidMana.bg = self.DruidMana:CreateTexture(nil, "BORDER")
self.DruidMana.bg:SetAllPoints(self.DruidMana)
self.DruidMana.bg:SetTexture(bartex)
self.DruidMana.bg:SetAlpha(0.30)
-- black bg
self.DruidMana:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -2, right = -2.5, top = -2.5, bottom = -2},
}
self.DruidMana:SetBackdropColor(0,0,0,1)
-- text
self.DruidManaText = self.DruidMana:CreateFontString(nil, 'OVERLAY')
self.DruidManaText:SetPoint("CENTER", self.DruidMana, "CENTER", 0, 1)
self.DruidManaText:SetFont(font, 12, "OUTLINE")
self.DruidManaText:SetTextColor(1,1,1)
self.DruidManaText:SetShadowOffset(1, -1)
end
--]]
--
-- leader icon
--
self.Leader = self.Health:CreateTexture(nil, "OVERLAY")
self.Leader:SetHeight(12)
self.Leader:SetWidth(12)
self.Leader:SetPoint("BOTTOMRIGHT", self, -2, 4)
self.Leader:SetTexture"Interface\\GroupFrame\\UI-Group-LeaderIcon"
--
-- raid target icons
--
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(16)
self.RaidIcon:SetWidth(16)
self.RaidIcon:SetPoint("TOP", self, 0, 9)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
--
-- oUF_PowerSpark support
--
self.Spark = self.Power:CreateTexture(nil, "OVERLAY")
self.Spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark")
self.Spark:SetVertexColor(1, 1, 1, 1)
self.Spark:SetBlendMode("ADD")
self.Spark:SetHeight(self.Power:GetHeight()*2.5)
self.Spark:SetWidth(self.Power:GetHeight()*2)
-- self.Spark.rtl = true -- Make the spark go from Right To Left instead
-- self.Spark.manatick = true -- Show mana regen ticks outside FSR (like the energy ticker)
-- self.Spark.highAlpha = 1 -- What alpha setting to use for the FSR and energy spark
-- self.Spark.lowAlpha = 0.25 -- What alpha setting to use for the mana regen ticker
--
-- oUF_BarFader
--
self.BarFade = true
self.BarFadeAlpha = 0.2
end
-- ------------------------------------
-- pet
-- ------------------------------------
if unit=="pet" then
self:SetWidth(120)
self:SetHeight(18)
self.Health:SetHeight(18)
self.Power:Hide()
self.Health.value:Hide()
self.Level:Hide()
self.Name:Hide()
if playerClass=="HUNTER" then
self.Health.colorReaction = false
self.Health.colorClass = false
self.Health.colorHappiness = true
end
--
-- oUF_BarFader
--
self.BarFade = true
self.BarFadeAlpha = 0.2
end
-- ------------------------------------
-- target
-- ------------------------------------
if unit=="target" then
self:SetWidth(250)
self:SetHeight(20)
self.Health:SetHeight(15.5)
self.Power:SetHeight(3)
self.Power.value:Hide()
self.Health.value:SetPoint("RIGHT", 0, 9)
self.Name:SetPoint("LEFT", self.Level, "RIGHT", 0, 0)
self.Name:SetHeight(20)
self.Name:SetWidth(150)
self.Health.colorClass = false
--
-- combo points
--
if(playerClass=="ROGUE" or playerClass=="DRUID") then
self.CPoints = self:CreateFontString(nil, "OVERLAY")
self.CPoints:SetPoint("RIGHT", self, "LEFT", -10, 0)
self.CPoints:SetFont(font, 38, "OUTLINE")
self.CPoints:SetTextColor(0, 0.81, 1)
self.CPoints:SetShadowOffset(1, -1)
self.CPoints:SetJustifyH"RIGHT"
end
--
-- raid target icons
--
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(24)
self.RaidIcon:SetWidth(24)
self.RaidIcon:SetPoint("RIGHT", self, 30, 0)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
--
-- buffs
--
self.Buffs = CreateFrame("Frame", nil, self) -- buffs
self.Buffs.size = 22
self.Buffs:SetHeight(self.Buffs.size)
self.Buffs:SetWidth(self.Buffs.size * 5)
self.Buffs:SetPoint("BOTTOMLEFT", self, "TOPLEFT", -2, 15)
self.Buffs.initialAnchor = "BOTTOMLEFT"
self.Buffs["growth-y"] = "TOP"
self.Buffs.num = 20
self.Buffs.spacing = 2
--
-- debuffs
--
self.Debuffs = CreateFrame("Frame", nil, self)
self.Debuffs.size = 30
self.Debuffs:SetHeight(self.Debuffs.size)
self.Debuffs:SetWidth(self.Debuffs.size * 9)
self.Debuffs:SetPoint("TOPLEFT", self, "BOTTOMLEFT", -2, -6)
self.Debuffs.initialAnchor = "TOPLEFT"
self.Debuffs["growth-y"] = "DOWN"
self.Debuffs.filter = false
self.Debuffs.num = 40
self.Debuffs.spacing = 2
end
-- ------------------------------------
-- target of target and focus
-- ------------------------------------
if unit=="targettarget" or unit=="focus" then
self:SetWidth(120)
self:SetHeight(18)
self.Health:SetHeight(18)
self.Power:Hide()
self.Power.value:Hide()
self.Health.value:Hide()
self.Name:SetWidth(95)
self.Name:SetHeight(18)
--
-- raid target icons
--
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(16)
self.RaidIcon:SetWidth(16)
self.RaidIcon:SetPoint("RIGHT", self, 0, 9)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
--
-- oUF_BarFader
--
if unit=="focus" then
self.BarFade = true
self.BarFadeAlpha = 0.2
end
end
-- ------------------------------------
-- player and target castbar
-- ------------------------------------
--[[
if(unit == 'player' or unit == 'target') then
self.Castbar = CreateFrame('StatusBar', nil, self)
self.Castbar:SetStatusBarTexture(bartex)
if(unit == "player") then
self.Castbar:SetStatusBarColor(1, 0.50, 0)
self.Castbar:SetHeight(24)
self.Castbar:SetWidth(260)
self.Castbar:SetBackdrop({
bgFile = "Interface\ChatFrame\ChatFrameBackground",
insets = {top = -3, left = -3, bottom = -3, right = -3}})
self.Castbar.SafeZone = self.Castbar:CreateTexture(nil,"ARTWORK")
self.Castbar.SafeZone:SetTexture(bartex)
self.Castbar.SafeZone:SetVertexColor(.75,.10,.10,.6)
self.Castbar.SafeZone:SetPoint("TOPRIGHT")
self.Castbar.SafeZone:SetPoint("BOTTOMRIGHT")
self.Castbar:SetPoint('CENTER', UIParent, 'CENTER', playerCastBar_x, playerCastBar_y)
else
self.Castbar:SetStatusBarColor(0.80, 0.01, 0)
self.Castbar:SetHeight(24)
self.Castbar:SetWidth(286)
self.Castbar:SetBackdrop({
bgFile = "Interface\ChatFrame\ChatFrameBackground",
insets = {top = -3, left = -30, bottom = -3, right = -3}})
self.Castbar.Icon = self.Castbar:CreateTexture(nil, 'OVERLAY')
self.Castbar.Icon:SetPoint("RIGHT", self.Castbar, "LEFT", -3, 0)
self.Castbar.Icon:SetHeight(24)
self.Castbar.Icon:SetWidth(24)
self.Castbar.Icon:SetTexCoord(0.1,0.9,0.1,0.9)
self.Castbar:SetPoint('CENTER', UIParent, 'CENTER', targetCastBar_x, targetCastBar_y)
end
self.Castbar:SetBackdropColor(0, 0, 0, 0.5)
self.Castbar.bg = self.Castbar:CreateTexture(nil, 'BORDER')
self.Castbar.bg:SetAllPoints(self.Castbar)
self.Castbar.bg:SetTexture(0, 0, 0, 0.6)
self.Castbar.Text = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Text:SetPoint('LEFT', self.Castbar, 2, 0)
self.Castbar.Text:SetFont(upperfont, 11, "OUTLINE")
self.Castbar.Text:SetShadowOffset(1, -1)
self.Castbar.Text:SetTextColor(1, 1, 1)
self.Castbar.Text:SetJustifyH('LEFT')
self.Castbar.Time = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Time:SetPoint('RIGHT', self.Castbar, -2, 0)
self.Castbar.Time:SetFont(upperfont, 12, "OUTLINE")
self.Castbar.Time:SetTextColor(1, 1, 1)
self.Castbar.Time:SetJustifyH('RIGHT')
end
--]]
-- ------------------------------------
-- party
-- ------------------------------------
if(self:GetParent():GetName():match"oUF_Party") then
self:SetWidth(160)
self:SetHeight(20)
self.Health:SetHeight(15)
self.Power:SetHeight(3)
self.Power.value:Hide()
self.Health.value:SetPoint("RIGHT", 0 , 9)
self.Name:SetPoint("LEFT", 0, 9)
--
-- debuffs
--
self.Debuffs = CreateFrame("Frame", nil, self)
self.Debuffs.size = 20 * 1.3
self.Debuffs:SetHeight(self.Debuffs.size)
self.Debuffs:SetWidth(self.Debuffs.size * 5)
self.Debuffs:SetPoint("LEFT", self, "RIGHT", 5, 0)
self.Debuffs.initialAnchor = "TOPLEFT"
self.Debuffs.filter = false
self.Debuffs.showDebuffType = true
self.Debuffs.spacing = 2
self.Debuffs.num = 2 -- max debuffs
--
-- leader icon
--
self.Leader = self.Health:CreateTexture(nil, "OVERLAY")
self.Leader:SetHeight(12)
self.Leader:SetWidth(12)
self.Leader:SetPoint("BOTTOMRIGHT", self, -2, 4)
self.Leader:SetTexture"Interface\\GroupFrame\\UI-Group-LeaderIcon"
--
-- raid target icons
--
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(24)
self.RaidIcon:SetWidth(24)
self.RaidIcon:SetPoint("LEFT", self, -30, 0)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
end
-- ------------------------------------
-- raid
-- ------------------------------------
if(self:GetParent():GetName():match"oUF_Raid") then
self:SetWidth(85)
self:SetHeight(15)
self.Health:SetHeight(15)
self.Power:Hide()
self.Health:SetFrameLevel(2)
self.Power:SetFrameLevel(2)
self.Health.value:Hide()
self.Power.value:Hide()
self.Name:SetFont(font, 12, "OUTLINE")
self.Name:SetWidth(85)
self.Name:SetHeight(15)
--
-- oUF_DebuffHighlight support
--
self.DebuffHighlight = self.Health:CreateTexture(nil, "OVERLAY")
self.DebuffHighlight:SetAllPoints(self.Health)
self.DebuffHighlight:SetTexture("Interface\\AddOns\\oUF_Lyn\\textures\\highlight.tga")
self.DebuffHighlight:SetBlendMode("ADD")
self.DebuffHighlight:SetVertexColor(0, 0, 0, 0)
self.DebuffHighlightAlpha = 0.8
self.DebuffHighlightFilter = true
end
--
-- fading for party and raid
--
if(not unit) then -- fadeout if units are out of range
self.Range = false -- put true to make party/raid frames fade out if not in your range
self.inRangeAlpha = 1.0 -- what alpha if IN range
self.outsideRangeAlpha = 0.5 -- the alpha it will fade out to if not in range
end
--
-- custom aura textures
--
self.PostCreateAuraIcon = auraIcon
self.SetAuraPosition = auraOffset
if(self:GetParent():GetName():match"oUF_Party") then
self:SetAttribute('initial-height', 20)
self:SetAttribute('initial-width', 160)
else
self:SetAttribute('initial-height', height)
self:SetAttribute('initial-width', width)
end
return self
end
-- ------------------------------------------------------------------------
-- spawning the frames
-- ------------------------------------------------------------------------
--
-- normal frames
--
oUF:RegisterStyle("Lyn", func)
oUF:SetActiveStyle("Lyn")
local player = oUF:Spawn("player", "oUF_Player")
player:SetPoint("CENTER", -335, -106)
local target = oUF:Spawn("target", "oUF_Target")
target:SetPoint("CENTER", 335, -106)
local pet = oUF:Spawn("pet", "oUF_Pet")
pet:SetPoint("BOTTOMLEFT", player, 0, -30)
local tot = oUF:Spawn("targettarget", "oUF_TargetTarget")
tot:SetPoint("TOPRIGHT", target, 0, 35)
local focus = oUF:Spawn("focus", "oUF_Focus")
focus:SetPoint("BOTTOMRIGHT", player, 0, -30)
--
-- party
--
local party = oUF:Spawn("header", "oUF_Party")
party:SetManyAttributes("showParty", true, "yOffset", -10)
party:SetPoint("Center", -380, -225)
party:Show()
party:SetAttribute("showRaid", false)
--
-- raid
--
local Raid = {}
for i = 1, NUM_RAID_GROUPS do
local RaidGroup = oUF:Spawn("header", "oUF_Raid" .. i)
RaidGroup:SetAttribute("groupFilter", tostring(i))
RaidGroup:SetAttribute("showRaid", true)
RaidGroup:SetAttribute("yOffset", -10)
RaidGroup:SetAttribute("point", "TOP")
RaidGroup:SetAttribute("showRaid", true)
table.insert(Raid, RaidGroup)
if i == 1 then
RaidGroup:SetPoint("CENTER", UIParent, -418, -230)
else
RaidGroup:SetPoint("TOPLEFT", Raid[i-1], "TOPRIGHT", 10, 0)
end
RaidGroup:Show()
end
--
-- party toggle in raid
--
local partyToggle = CreateFrame('Frame')
partyToggle:RegisterEvent('PLAYER_LOGIN')
partyToggle:RegisterEvent('RAID_ROSTER_UPDATE')
partyToggle:RegisterEvent('PARTY_LEADER_CHANGED')
partyToggle:RegisterEvent('PARTY_MEMBER_CHANGED')
partyToggle:SetScript('OnEvent', function(self)
if(InCombatLockdown()) then
self:RegisterEvent('PLAYER_REGEN_ENABLED')
else
self:UnregisterEvent('PLAYER_REGEN_DISABLED')
if(HIDE_PARTY_INTERFACE == "1" and GetNumRaidMembers() > 0) then
party:Hide()
else
party:Show()
end
end
end)
[/codebox]
benutze das oUF_Lyn und bin nich so der coder^^
kann mir vlt. wer sagen was ich in der lua ändern muss damit mir im player,target und tot frame die maxhp anzahl angezeigt wird (7,4k z.b.)
bzw. welcher teil der lua dafür überhaupt verantwortlich ist.
[codebox]local func = function(self, unit)
self.menu = menu -- Enable the menus
self:SetScript("OnEnter", UnitFrame_OnEnter)
self:SetScript("OnLeave", UnitFrame_OnLeave)
self:RegisterForClicks"anyup"
self:SetAttribute("*type2", "menu")
--
-- background
--
self:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -2, right = -2, top = -2, bottom = -2},
}
self:SetBackdropColor(0,0,0,1) -- and color the backgrounds
--
-- healthbar
--
self.Health = CreateFrame"StatusBar"
self.Health:SetHeight(19) -- Custom height
self.Health:SetStatusBarTexture(bartex)
self.Health:SetParent(self)
self.Health:SetPoint"TOP"
self.Health:SetPoint"LEFT"
self.Health:SetPoint"RIGHT"
--
-- healthbar background
--
self.Health.bg = self.Health:CreateTexture(nil, "BORDER")
self.Health.bg:SetAllPoints(self.Health)
self.Health.bg:SetTexture(bartex)
self.Health.bg:SetAlpha(0.30)
--
-- healthbar text
--
self.Health.value = self.Health:CreateFontString(nil, "OVERLAY")
self.Health.value:SetPoint("RIGHT", -2, 2)
self.Health.value:SetFont(font, fontsize, "OUTLINE")
self.Health.value:SetTextColor(1,1,1)
self.Health.value:SetShadowOffset(1, -1)
--
-- healthbar functions
--
self.Health.frequentUpdates = true
self.Health.colorClass = true
self.Health.colorReaction = true
self.Health.colorDisconnected = true
self.Health.colorTapping = true
self.PostUpdateHealth = updateHealth -- let the colors be
--
-- powerbar
--
self.Power = CreateFrame"StatusBar"
self.Power:SetHeight(3)
self.Power:SetStatusBarTexture(bartex)
self.Power:SetParent(self)
self.Power:SetPoint"LEFT"
self.Power:SetPoint"RIGHT"
self.Power:SetPoint("TOP", self.Health, "BOTTOM", 0, -1.45) -- Little offset to make it pretty
--
-- powerbar background
--
self.Power.bg = self.Power:CreateTexture(nil, "BORDER")
self.Power.bg:SetAllPoints(self.Power)
self.Power.bg:SetTexture(bartex)
self.Power.bg:SetAlpha(0.30)
--
-- powerbar text
--
self.Power.value = self.Power:CreateFontString(nil, "OVERLAY")
self.Power.value:SetPoint("RIGHT", self.Health.value, "BOTTOMRIGHT", 0, -5) -- powerbar text in health box
self.Power.value:SetFont(font, fontsize, "OUTLINE")
self.Power.value:SetTextColor(1,1,1)
self.Power.value:SetShadowOffset(1, -1)
self.Power.value:Hide()
--
-- powerbar functions
--
self.Power.frequentUpdates = true
self.Power.colorTapping = true
self.Power.colorDisconnected = true
self.Power.colorClass = true
self.Power.colorPower = true
self.Power.colorHappiness = false
self.PostUpdatePower = updatePower -- let the colors be
--
-- names
--
self.Name = self.Health:CreateFontString(nil, "OVERLAY")
self.Name:SetPoint("LEFT", self, 0, 9)
self.Name:SetJustifyH"LEFT"
self.Name:SetFont(font, fontsize, "OUTLINE")
self.Name:SetShadowOffset(1, -1)
self.UNIT_NAME_UPDATE = updateName
--
-- level
--
self.Level = self.Health:CreateFontString(nil, "OVERLAY")
self.Level:SetPoint("LEFT", self.Health, 0, 9)
self.Level:SetJustifyH("LEFT")
self.Level:SetFont(font, fontsize, "OUTLINE")
self.Level:SetTextColor(1,1,1)
self.Level:SetShadowOffset(1, -1)
self.UNIT_LEVEL = updateLevel
-- ------------------------------------
-- player
-- ------------------------------------
if unit=="player" then
self:SetWidth(250)
self:SetHeight(20)
self.Health:SetHeight(15.5)
self.Name:Hide()
self.Health.value:SetPoint("RIGHT", 0, 9)
self.Power:SetHeight(3)
self.Power.value:Show()
self.Power.value:SetPoint("LEFT", self.Health, 0, 9)
self.Power.value:SetJustifyH"LEFT"
self.Level:Hide()
--[[
if(playerClass=="DRUID") then
-- bar
self.DruidMana = CreateFrame('StatusBar', nil, self)
self.DruidMana:SetPoint('TOP', self, 'BOTTOM', 0, -6)
self.DruidMana:SetStatusBarTexture(bartex)
self.DruidMana:SetStatusBarColor(45/255, 113/255, 191/255)
self.DruidMana:SetHeight(10)
self.DruidMana:SetWidth(250)
-- bar bg
self.DruidMana.bg = self.DruidMana:CreateTexture(nil, "BORDER")
self.DruidMana.bg:SetAllPoints(self.DruidMana)
self.DruidMana.bg:SetTexture(bartex)
self.DruidMana.bg:SetAlpha(0.30)
-- black bg
self.DruidMana:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -2, right = -2.5, top = -2.5, bottom = -2},
}
self.DruidMana:SetBackdropColor(0,0,0,1)
-- text
self.DruidManaText = self.DruidMana:CreateFontString(nil, 'OVERLAY')
self.DruidManaText:SetPoint("CENTER", self.DruidMana, "CENTER", 0, 1)
self.DruidManaText:SetFont(font, 12, "OUTLINE")
self.DruidManaText:SetTextColor(1,1,1)
self.DruidManaText:SetShadowOffset(1, -1)
end
--]]
--
-- leader icon
--
self.Leader = self.Health:CreateTexture(nil, "OVERLAY")
self.Leader:SetHeight(12)
self.Leader:SetWidth(12)
self.Leader:SetPoint("BOTTOMRIGHT", self, -2, 4)
self.Leader:SetTexture"Interface\\GroupFrame\\UI-Group-LeaderIcon"
--
-- raid target icons
--
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(16)
self.RaidIcon:SetWidth(16)
self.RaidIcon:SetPoint("TOP", self, 0, 9)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
--
-- oUF_PowerSpark support
--
self.Spark = self.Power:CreateTexture(nil, "OVERLAY")
self.Spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark")
self.Spark:SetVertexColor(1, 1, 1, 1)
self.Spark:SetBlendMode("ADD")
self.Spark:SetHeight(self.Power:GetHeight()*2.5)
self.Spark:SetWidth(self.Power:GetHeight()*2)
-- self.Spark.rtl = true -- Make the spark go from Right To Left instead
-- self.Spark.manatick = true -- Show mana regen ticks outside FSR (like the energy ticker)
-- self.Spark.highAlpha = 1 -- What alpha setting to use for the FSR and energy spark
-- self.Spark.lowAlpha = 0.25 -- What alpha setting to use for the mana regen ticker
--
-- oUF_BarFader
--
self.BarFade = true
self.BarFadeAlpha = 0.2
end
-- ------------------------------------
-- pet
-- ------------------------------------
if unit=="pet" then
self:SetWidth(120)
self:SetHeight(18)
self.Health:SetHeight(18)
self.Power:Hide()
self.Health.value:Hide()
self.Level:Hide()
self.Name:Hide()
if playerClass=="HUNTER" then
self.Health.colorReaction = false
self.Health.colorClass = false
self.Health.colorHappiness = true
end
--
-- oUF_BarFader
--
self.BarFade = true
self.BarFadeAlpha = 0.2
end
-- ------------------------------------
-- target
-- ------------------------------------
if unit=="target" then
self:SetWidth(250)
self:SetHeight(20)
self.Health:SetHeight(15.5)
self.Power:SetHeight(3)
self.Power.value:Hide()
self.Health.value:SetPoint("RIGHT", 0, 9)
self.Name:SetPoint("LEFT", self.Level, "RIGHT", 0, 0)
self.Name:SetHeight(20)
self.Name:SetWidth(150)
self.Health.colorClass = false
--
-- combo points
--
if(playerClass=="ROGUE" or playerClass=="DRUID") then
self.CPoints = self:CreateFontString(nil, "OVERLAY")
self.CPoints:SetPoint("RIGHT", self, "LEFT", -10, 0)
self.CPoints:SetFont(font, 38, "OUTLINE")
self.CPoints:SetTextColor(0, 0.81, 1)
self.CPoints:SetShadowOffset(1, -1)
self.CPoints:SetJustifyH"RIGHT"
end
--
-- raid target icons
--
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(24)
self.RaidIcon:SetWidth(24)
self.RaidIcon:SetPoint("RIGHT", self, 30, 0)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
--
-- buffs
--
self.Buffs = CreateFrame("Frame", nil, self) -- buffs
self.Buffs.size = 22
self.Buffs:SetHeight(self.Buffs.size)
self.Buffs:SetWidth(self.Buffs.size * 5)
self.Buffs:SetPoint("BOTTOMLEFT", self, "TOPLEFT", -2, 15)
self.Buffs.initialAnchor = "BOTTOMLEFT"
self.Buffs["growth-y"] = "TOP"
self.Buffs.num = 20
self.Buffs.spacing = 2
--
-- debuffs
--
self.Debuffs = CreateFrame("Frame", nil, self)
self.Debuffs.size = 30
self.Debuffs:SetHeight(self.Debuffs.size)
self.Debuffs:SetWidth(self.Debuffs.size * 9)
self.Debuffs:SetPoint("TOPLEFT", self, "BOTTOMLEFT", -2, -6)
self.Debuffs.initialAnchor = "TOPLEFT"
self.Debuffs["growth-y"] = "DOWN"
self.Debuffs.filter = false
self.Debuffs.num = 40
self.Debuffs.spacing = 2
end
-- ------------------------------------
-- target of target and focus
-- ------------------------------------
if unit=="targettarget" or unit=="focus" then
self:SetWidth(120)
self:SetHeight(18)
self.Health:SetHeight(18)
self.Power:Hide()
self.Power.value:Hide()
self.Health.value:Hide()
self.Name:SetWidth(95)
self.Name:SetHeight(18)
--
-- raid target icons
--
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(16)
self.RaidIcon:SetWidth(16)
self.RaidIcon:SetPoint("RIGHT", self, 0, 9)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
--
-- oUF_BarFader
--
if unit=="focus" then
self.BarFade = true
self.BarFadeAlpha = 0.2
end
end
-- ------------------------------------
-- player and target castbar
-- ------------------------------------
--[[
if(unit == 'player' or unit == 'target') then
self.Castbar = CreateFrame('StatusBar', nil, self)
self.Castbar:SetStatusBarTexture(bartex)
if(unit == "player") then
self.Castbar:SetStatusBarColor(1, 0.50, 0)
self.Castbar:SetHeight(24)
self.Castbar:SetWidth(260)
self.Castbar:SetBackdrop({
bgFile = "Interface\ChatFrame\ChatFrameBackground",
insets = {top = -3, left = -3, bottom = -3, right = -3}})
self.Castbar.SafeZone = self.Castbar:CreateTexture(nil,"ARTWORK")
self.Castbar.SafeZone:SetTexture(bartex)
self.Castbar.SafeZone:SetVertexColor(.75,.10,.10,.6)
self.Castbar.SafeZone:SetPoint("TOPRIGHT")
self.Castbar.SafeZone:SetPoint("BOTTOMRIGHT")
self.Castbar:SetPoint('CENTER', UIParent, 'CENTER', playerCastBar_x, playerCastBar_y)
else
self.Castbar:SetStatusBarColor(0.80, 0.01, 0)
self.Castbar:SetHeight(24)
self.Castbar:SetWidth(286)
self.Castbar:SetBackdrop({
bgFile = "Interface\ChatFrame\ChatFrameBackground",
insets = {top = -3, left = -30, bottom = -3, right = -3}})
self.Castbar.Icon = self.Castbar:CreateTexture(nil, 'OVERLAY')
self.Castbar.Icon:SetPoint("RIGHT", self.Castbar, "LEFT", -3, 0)
self.Castbar.Icon:SetHeight(24)
self.Castbar.Icon:SetWidth(24)
self.Castbar.Icon:SetTexCoord(0.1,0.9,0.1,0.9)
self.Castbar:SetPoint('CENTER', UIParent, 'CENTER', targetCastBar_x, targetCastBar_y)
end
self.Castbar:SetBackdropColor(0, 0, 0, 0.5)
self.Castbar.bg = self.Castbar:CreateTexture(nil, 'BORDER')
self.Castbar.bg:SetAllPoints(self.Castbar)
self.Castbar.bg:SetTexture(0, 0, 0, 0.6)
self.Castbar.Text = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Text:SetPoint('LEFT', self.Castbar, 2, 0)
self.Castbar.Text:SetFont(upperfont, 11, "OUTLINE")
self.Castbar.Text:SetShadowOffset(1, -1)
self.Castbar.Text:SetTextColor(1, 1, 1)
self.Castbar.Text:SetJustifyH('LEFT')
self.Castbar.Time = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Time:SetPoint('RIGHT', self.Castbar, -2, 0)
self.Castbar.Time:SetFont(upperfont, 12, "OUTLINE")
self.Castbar.Time:SetTextColor(1, 1, 1)
self.Castbar.Time:SetJustifyH('RIGHT')
end
--]]
-- ------------------------------------
-- party
-- ------------------------------------
if(self:GetParent():GetName():match"oUF_Party") then
self:SetWidth(160)
self:SetHeight(20)
self.Health:SetHeight(15)
self.Power:SetHeight(3)
self.Power.value:Hide()
self.Health.value:SetPoint("RIGHT", 0 , 9)
self.Name:SetPoint("LEFT", 0, 9)
--
-- debuffs
--
self.Debuffs = CreateFrame("Frame", nil, self)
self.Debuffs.size = 20 * 1.3
self.Debuffs:SetHeight(self.Debuffs.size)
self.Debuffs:SetWidth(self.Debuffs.size * 5)
self.Debuffs:SetPoint("LEFT", self, "RIGHT", 5, 0)
self.Debuffs.initialAnchor = "TOPLEFT"
self.Debuffs.filter = false
self.Debuffs.showDebuffType = true
self.Debuffs.spacing = 2
self.Debuffs.num = 2 -- max debuffs
--
-- leader icon
--
self.Leader = self.Health:CreateTexture(nil, "OVERLAY")
self.Leader:SetHeight(12)
self.Leader:SetWidth(12)
self.Leader:SetPoint("BOTTOMRIGHT", self, -2, 4)
self.Leader:SetTexture"Interface\\GroupFrame\\UI-Group-LeaderIcon"
--
-- raid target icons
--
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(24)
self.RaidIcon:SetWidth(24)
self.RaidIcon:SetPoint("LEFT", self, -30, 0)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
end
-- ------------------------------------
-- raid
-- ------------------------------------
if(self:GetParent():GetName():match"oUF_Raid") then
self:SetWidth(85)
self:SetHeight(15)
self.Health:SetHeight(15)
self.Power:Hide()
self.Health:SetFrameLevel(2)
self.Power:SetFrameLevel(2)
self.Health.value:Hide()
self.Power.value:Hide()
self.Name:SetFont(font, 12, "OUTLINE")
self.Name:SetWidth(85)
self.Name:SetHeight(15)
--
-- oUF_DebuffHighlight support
--
self.DebuffHighlight = self.Health:CreateTexture(nil, "OVERLAY")
self.DebuffHighlight:SetAllPoints(self.Health)
self.DebuffHighlight:SetTexture("Interface\\AddOns\\oUF_Lyn\\textures\\highlight.tga")
self.DebuffHighlight:SetBlendMode("ADD")
self.DebuffHighlight:SetVertexColor(0, 0, 0, 0)
self.DebuffHighlightAlpha = 0.8
self.DebuffHighlightFilter = true
end
--
-- fading for party and raid
--
if(not unit) then -- fadeout if units are out of range
self.Range = false -- put true to make party/raid frames fade out if not in your range
self.inRangeAlpha = 1.0 -- what alpha if IN range
self.outsideRangeAlpha = 0.5 -- the alpha it will fade out to if not in range
end
--
-- custom aura textures
--
self.PostCreateAuraIcon = auraIcon
self.SetAuraPosition = auraOffset
if(self:GetParent():GetName():match"oUF_Party") then
self:SetAttribute('initial-height', 20)
self:SetAttribute('initial-width', 160)
else
self:SetAttribute('initial-height', height)
self:SetAttribute('initial-width', width)
end
return self
end
-- ------------------------------------------------------------------------
-- spawning the frames
-- ------------------------------------------------------------------------
--
-- normal frames
--
oUF:RegisterStyle("Lyn", func)
oUF:SetActiveStyle("Lyn")
local player = oUF:Spawn("player", "oUF_Player")
player:SetPoint("CENTER", -335, -106)
local target = oUF:Spawn("target", "oUF_Target")
target:SetPoint("CENTER", 335, -106)
local pet = oUF:Spawn("pet", "oUF_Pet")
pet:SetPoint("BOTTOMLEFT", player, 0, -30)
local tot = oUF:Spawn("targettarget", "oUF_TargetTarget")
tot:SetPoint("TOPRIGHT", target, 0, 35)
local focus = oUF:Spawn("focus", "oUF_Focus")
focus:SetPoint("BOTTOMRIGHT", player, 0, -30)
--
-- party
--
local party = oUF:Spawn("header", "oUF_Party")
party:SetManyAttributes("showParty", true, "yOffset", -10)
party:SetPoint("Center", -380, -225)
party:Show()
party:SetAttribute("showRaid", false)
--
-- raid
--
local Raid = {}
for i = 1, NUM_RAID_GROUPS do
local RaidGroup = oUF:Spawn("header", "oUF_Raid" .. i)
RaidGroup:SetAttribute("groupFilter", tostring(i))
RaidGroup:SetAttribute("showRaid", true)
RaidGroup:SetAttribute("yOffset", -10)
RaidGroup:SetAttribute("point", "TOP")
RaidGroup:SetAttribute("showRaid", true)
table.insert(Raid, RaidGroup)
if i == 1 then
RaidGroup:SetPoint("CENTER", UIParent, -418, -230)
else
RaidGroup:SetPoint("TOPLEFT", Raid[i-1], "TOPRIGHT", 10, 0)
end
RaidGroup:Show()
end
--
-- party toggle in raid
--
local partyToggle = CreateFrame('Frame')
partyToggle:RegisterEvent('PLAYER_LOGIN')
partyToggle:RegisterEvent('RAID_ROSTER_UPDATE')
partyToggle:RegisterEvent('PARTY_LEADER_CHANGED')
partyToggle:RegisterEvent('PARTY_MEMBER_CHANGED')
partyToggle:SetScript('OnEvent', function(self)
if(InCombatLockdown()) then
self:RegisterEvent('PLAYER_REGEN_ENABLED')
else
self:UnregisterEvent('PLAYER_REGEN_DISABLED')
if(HIDE_PARTY_INTERFACE == "1" and GetNumRaidMembers() > 0) then
party:Hide()
else
party:Show()
end
end
end)
[/codebox]