wertzû
Welt-Boss
- Mitglied seit
- 12.01.2008
- Beiträge
- 2.803
- Reaktionspunkte
- 20
- Kommentare
- 76
Bei Ouf wird mir kein ToT mehr angezeigt.
Hier mal den .Lua code
Hier mal den .Lua code
Code:
--[[
oUF Karu
Credits: so many... this is a compilation of codes from LOTS of layouts. i suck at lua coding myself and has taught myself some of the basics.. but i can't code from scratch.. Main layout of code is from LYN! to name a couple others that has been a big inspiration =
Neal, Obble ,tek, Shantalya , caellian, manuet, lolzen .. probably forgetting someone.. sorry :'(
--]]
--YARR
local select = select
local UnitClass = UnitClass
local UnitIsDead = UnitIsDead
local UnitIsPVP = UnitIsPVP
local UnitIsGhost = UnitIsGhost
local UnitIsPlayer = UnitIsPlayer
local UnitReaction = UnitReaction
local UnitIsConnected = UnitIsConnected
local UnitCreatureType = UnitCreatureType
local UnitClassification = UnitClassification
local UnitReactionColor = UnitReactionColor
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
local _, class = UnitClass('player')
local playerClass = select(2, UnitClass("player"))
local statusbarcolor = {75/255, 75/255, 75/255}
local focuscolor = {255/255, 0/255, 255/255}
local ColorGradient = oUF.ColorGradient
-- ZE FONT AND TEXTURES
local font = "Interface\\AddOns\\!media\\fonts\\font.ttf"
local fontsize = 14
local bartex = "Interface\\AddOns\\oUf Karu\\textures\\Minimalist"
local bufftex = "Interface\\AddOns\\!media\\textures\\bufftex"
local border = "Interface\\AddOns\\oUF Karu\\textures\\border"
-- CASTBAR POS
local playerCastBar_x = 0
local playerCastBar_y = -350
local targetCastBar_x = 0
local targetCastBar_y = 55
local focusCastBar_x = 0
local focusCastBar_y = 40
-- RIGHT CLICK
local menu = function(self)
local unit = self.unit:sub(1, -2)
local cunit = self.unit:gsub("(.)", string.upper, 1)
if(unit == "party" or unit == "partypet") then
ToggleDropDownMenu(1, nil, _G["PartyMemberFrame"..self.id.."DropDown"], "cursor", 0, 0)
elseif(_G[cunit.."FrameDropDown"]) then
ToggleDropDownMenu(1, nil, _G[cunit.."FrameDropDown"], "cursor", 0, 0)
end
end
-- SHIBBY
local numberize = function(v)
if v <= 9999 then return v end
if v >= 1000000 then
local value = string.format("%.1fm", v/1000000)
return value
elseif v >= 10000 then
local value = string.format("%.1f", v/1000)
return value
end
end
local numberize_raid = function(v)
if v <= 999 then return v end
if v >= 1000000 then
local value = string.format("%.1fm", v/1000000)
return value
elseif v >= 1000 then
local value = string.format("%.1f", v/1000)
return value
end
end
-- LEVEL UPDATE
local updateLevel = function(self, unit, name)
local lvl = UnitLevel(unit)
local typ = UnitClassification(unit)
local color = GetQuestDifficultyColor(lvl)
if lvl <= 0 then lvl = "??" end
if typ=="worldboss" then
self.Level:SetText("|cffff0000"..lvl.."b|r")
elseif typ=="rareelite" then
self.Level:SetText(lvl.."r")
self.Level:SetTextColor(color.r, color.g, color.b)
elseif typ=="elite" then
self.Level:SetText(lvl.."")
self.Level:SetTextColor(color.r, color.g, color.b)
elseif typ=="rare" then
self.Level:SetText(lvl.."r")
self.Level:SetTextColor(color.r, color.g, color.b)
else
if UnitIsConnected(unit) == 1 then
self.Level:SetText(lvl)
else
self.Level:SetText("??")
end
if(not UnitIsPlayer(unit)) then
self.Level:SetTextColor(color.r, color.g, color.b)
else
local _, class = UnitClass(unit)
color = self.colors.class[class]
self.Level:SetTextColor(color[1], color[2], color[3])
end
end
end
-- NAME UPDATE
local updateName = function(self, event, unit)
if(self.unit ~= unit) then return end
local name = UnitName(unit)
self.Name:SetText(name)
if unit=="target" or unit=="targettarget" or unit=="pet" then
self.Name:SetTextColor(1,1,1)
elseif(unit == "focus") then
self.Name:SetTextColor(1,1,1)
end
if unit=="target" or unit=="targettarget" or unit=="focus" then
updateLevel(self, unit, name)
end
end
-- HEALTH UPDATE
local updateHealth = function(self, event, unit, bar, min, max)
local cur, maxhp = min, max
local missing = maxhp-cur
local d = floor(cur/maxhp*100)
if(max ~= 0) then
r, g, b = ColorGradient(min/max, 1,0,0, 1,1,0, 0,1,0)
if(UnitIsDead(unit)) then
bar:SetValue(0)
bar.value:SetText"DEAD"
elseif(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
bar.value:SetText"|cFFC41F3BTAPPED"
elseif(UnitIsGhost(unit)) then
bar:SetValue(0)
bar.value:SetText"GHOST"
elseif(not UnitIsConnected(unit)) then
bar.value:SetText"D|cFFC41F3B/|rC"
elseif(unit == "player") then
bar.value:SetText("|cff3DF500"..numberize(cur))
elseif(unit == "targettarget" or unit=="target") then
if(min~=max) then
bar.value:SetFormattedText('|cff3DF500%s|r |cffffffff[|r|cff%02x%02x%02x%d%%|cffffffff]|r',numberize(cur), r*255, g*255, b*255, (min/max)*100)
else
bar.value:SetText("|cff3DF500"..numberize(cur))
end
elseif(unit == "focus") then
if(min~=max) then
bar.value:SetFormattedText('|cff3DF500%s|r|cff%02x%02x%02x%d%%|r',"", r*255, g*255, b*255, (min/max)*100)
else
bar.value:SetText("|cff3DF500"..numberize(cur))
end
elseif(unit == "pet") then
if(min~=max) then
bar.value:SetFormattedText('|cff3DF500%s|r|cff%02x%02x%02x%d%%|r',"", r*255, g*255, b*255, (min/max)*100)
else
bar.value:SetText("|cff3DF500"..numberize(cur))
end
else
bar.value:SetText("|cff3DF500"..numberize(cur))
end
end
self:UNIT_NAME_UPDATE(event, unit,bar)
end
-- POWER UPDATE
local updatePower = function(self, event, unit, bar, min, max)
local _, ptype = UnitPowerType(unit)
local color = oUF.colors.power[ptype]
if(UnitIsDead(unit) or UnitIsGhost(unit)) then
bar:SetValue(0)
elseif unit=="player" then
bar.value:SetText(numberize(min))
if color then
bar.value:SetTextColor(color[1], color[2], color[3])
else
bar.value:SetTextColor(1,1,1)
end
end
end
-- AURA SKIN
local auraIcon = function(self, button, icons)
icons.showDebuffType = true -- show debuff border type color
button.icon:SetTexCoord(.07, .93, .07, .93)
button.icon:SetPoint("TOPLEFT", button, "TOPLEFT", 1, -2)
button.icon:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -1, 2)
button.overlay:SetTexture(bufftex)
button.overlay:SetTexCoord(0,1,0,1)
button.overlay.Hide = function(self) self:SetVertexColor(0, 0, 0) end
button.cd:SetReverse()
button.cd:SetPoint("TOPLEFT", button, "TOPLEFT", 1, -1)
button.cd:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -1, 1)
end
-- MEOW
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")
-- MOVABLE FRAMES -_-v
self.MoveableFrames = true
-- HEALTH BAR
self.Health = CreateFrame"StatusBar"
self.Health:SetHeight(10)
self.Health:SetStatusBarTexture(bartex)
self.Health:SetParent(self)
self.Health:SetPoint"TOP"
self.Health:SetPoint"LEFT"
self.Health:SetPoint"RIGHT"
self.Health:SetFrameLevel(1)
self.Health:SetStatusBarColor(statusbarcolor[1],statusbarcolor[2],statusbarcolor
[3])
-- HEALTHBAR BG
self.Health.bg = self.Health:CreateTexture(nil, "BORDER")
self.Health.bg:SetAllPoints(self.Health)
self.Health.bg:SetTexture(bartex)
self.Health.bg:SetAlpha(0.45)
self.Health.bg:SetVertexColor(.2,.2,.2)
-- HEALTHBAR TEXT
self.Health.value = self.Health:CreateFontString(nil, "OVERLAY")
self.Health.value:SetPoint("TOPRIGHT", self.Health, 0, 0)
self.Health.value:SetFont(font, fontsize, "OUTLINE")
self.Health.value:SetTextColor(1,1,1)
-- HEALTHBAR FUNCTION
self.Health.frequentUpdates = true
self.Health.colorClass = false
self.Health.colorDisconnected = false
self.Health.colorTapping = false
self.PostUpdateHealth = updateHealth
self.Health.Smooth = true
-- POWERBAR
self.Power = CreateFrame"StatusBar"
self.Power:SetHeight(2.5)
self.Power:SetStatusBarTexture(bartex)
self.Power:SetParent(self)
self.Power:SetPoint"LEFT"
self.Power:SetPoint"RIGHT"
self.Power:SetPoint("TOP", self.Health, "BOTTOM", 0, -0.75)
self.Power:SetFrameLevel(1)
self.Power.frequentUpdates = true
-- POWERBAR BG
self.Power.bg = self.Power:CreateTexture(nil, "BORDER")
self.Power.bg:SetAllPoints(self.Power)
self.Power.bg:SetTexture(bartex)
self.Power.bg:SetAlpha(0.45)
-- POWERBAR TEXT
self.Power.value = self.Power:CreateFontString(nil, "OVERLAY")
self.Power.value:SetPoint("TOPLEFT", self.Health, 0, 0)
self.Power.value:SetFont(font, fontsize, "OUTLINE")
self.Power.value:SetTextColor(1,1,1)
self.Power.value:Hide()
-- POWERBAR FUNCTION
self.Power.colorTapping = false
self.Power.colorDisconnected = true
self.Power.colorClass = false
self.Power.colorPower = true
self.Power.colorHappiness = false
self.PostUpdatePower = updatePower
self.Power.colorReaction = false
-- NAMES
self.Name = self.Health:CreateFontString(nil, "OVERLAY")
self.Name:SetPoint("TOPLEFT", self.Health, 0, 0)
self.Name:SetJustifyH("LEFT")
self.Name:SetFont(font, fontsize, "OUTLINE")
self.UNIT_NAME_UPDATE = updateName
-- LEVEL
self.Level = self.Health:CreateFontString(nil, "OVERLAY")
self.Level:SetPoint("center", self.Health, 0, 0)
self.Level:SetJustifyH("LEFT")
self.Level:SetFont(font, fontsize, outline)
self.Level:SetTextColor(1,1,1)
self.UNIT_LEVEL = updateLevel
-- PLAYER
if unit=="player" then
self:SetWidth(250)
self:SetHeight(15)
self.Name:Hide()
self.Health.value:SetPoint("LEFT", self.Health, -210, -30)
self.Power.value:Show()
self.Power.value:SetPoint("RIGHT", self.Health, 210, -210)
self.Level:Hide()
self.Health:SetHeight(12)
self.Power:SetHeight(2.5)
self.Health.value:Show()
self.Health.value:SetFont(font, 12, "OUTLINE")
self.Power.value:SetFont(font, 12, "OUTLINE")
self:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = -1},
}
self:SetBackdropColor(0,0,0,1)
-- PLAYER DEBUFF
self.Debuffs = CreateFrame("Frame", nil, self)
self.Debuffs.size = 22
self.Debuffs:SetHeight(self.Debuffs.size)
self.Debuffs:SetWidth(self.Debuffs.size * 6)
self.Debuffs:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 23, -5)
self.Debuffs.initialAnchor = "BOTTOMRIGHT"
self.Debuffs["growth-y"] = "DOWN"
self.Debuffs["growth-x"] = "RIGHT"
self.Debuffs.num = 7
self.Debuffs.spacing = 3
-- LEADER ICON
self.Leader = self.Health:CreateTexture(nil, "OVERLAY")
self.Leader:SetHeight(10)
self.Leader:SetWidth(10)
self.Leader:SetPoint("center", self, 0, 2)
self.Leader:SetTexture"Interface\\GroupFrame\\UI-Group-LeaderIcon"
end
-- PET
if unit=="pet" then
self:SetWidth(120)
self:SetHeight(15)
self.Name:Hide()
self.Power.value:Hide()
self.Health.value:SetPoint("TOPRIGHT", self.Health, -3, 12)
self.Name:SetPoint("TOPLEFT", self.Health, 2,11)
self.Name:SetWidth(70)
self.Health.value:SetHeight(fontsize)
self.Health.value:Hide()
self.Health:SetHeight(12)
self.Level:Hide()
self.Name:SetFont(font, 14, "OUTLINE")
self.Health.value:SetFont(font, 1, "OUTLINE")
self.Name:SetHeight(fontsize)
self:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = -1},
}
self:SetBackdropColor(0,0,0,1)
if playerClass=="HUNTER" then
self.Health.colorReaction = false
self.Health.colorClass = false
self.Health.colorHappiness = false
end
end
-- TARGET
if unit=="target" then
self:SetWidth(250)
self:SetHeight(15)
self.Power.value:Hide()
self.Health.value:SetPoint("TOPRIGHT", self.Health, -3, 1)
self.Name:SetPoint("TOPLEFT", self.Health, 2,1)
self.Name:SetWidth(90)
self.Name:SetHeight(fontsize)
self.Health.value:SetHeight(fontsize)
self.Health:SetHeight(13)
self.Power:SetHeight(2)
self.Level:Hide()
self.Name:SetFont(font, 12, "OUTLINE")
self.Health.value:SetFont(font, 12,"OUTLINE")
self:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = -2},
}
self:SetBackdropColor(0,0,0,1)
-- TARGET DEBUFF
self.Buffs = CreateFrame("Frame", nil, self)
self.Buffs.size = 25
self.Buffs.gap = false
self.Buffs:SetHeight(self.Buffs.size)
self.Buffs:SetWidth(self.Buffs.size * 8)
self.Buffs:SetPoint("BOTTOMLEFT", self, "TOPRiGHT", 2, -23)
self.Buffs.initialAnchor = "TOPLEFT"
self.Buffs["growth-y"] = "DOWN"
self.Buffs["growth-x"] = "RIGHT"
self.Buffs.numBuffs = 5
self.Buffs.spacing = 3
self.Debuffs = CreateFrame("Frame", nil, self)
self.Debuffs.size = 25
self.Debuffs.gap = false
self.Debuffs:SetHeight(self.Debuffs.size)
self.Debuffs:SetWidth(self.Debuffs.size * 8)
self.Debuffs:SetPoint("BOTTOMLEFT", self, "TOPLEFT", -2, -42)
self.Debuffs.initialAnchor = "TOPLEFT"
self.Debuffs["growth-y"] = "DOWN"
self.Debuffs["growth-x"] = "RIGHT"
self.Debuffs.numDebuffs = 5
self.Debuffs.spacing = 3
-- COMBO POINTS
self.CPoints = self:CreateFontString(nil, "OVERLAY")
self.CPoints:SetPoint("RIGHT", self, "RIGHT", 18, 0)
self.CPoints:SetFont(font, 18, "OUTLINE")
self.CPoints:SetTextColor(1,0.9,0.4)
self.CPoints:SetJustifyH"RIGHT"
-- TARGET RAID ICONS
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(25)
self.RaidIcon:SetWidth(25)
self.RaidIcon:SetPoint("RIGHT", self, "RIGHT", 30, 0)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
end
-- TOT
if unit=="targetoftarget" then
self:SetWidth(120)
self:SetHeight(15)
self.Power.value:Hide()
self.Power:SetHeight(1.5)
self.Health.value:SetPoint("TOPRIGHT", self.Health, -3, 12)
self.Name:SetPoint("TOPLEFT", self.Health, 2,11)
self.Name:SetWidth(70)
self.Name:Hide()
self.Health.value:SetHeight(fontsize)
self.Health.value:Hide()
self.Health:SetHeight(12)
self.Level:Hide()
self.Name:SetFont(font, 14, "OUTLINE")
self.Health.value:SetFont(font, 1, "OUTLINE")
self.Name:SetHeight(fontsize)
self:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = 0},
}
self:SetBackdropColor(0,0,0,1)
-- TOT RAID ICONS
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(14)
self.RaidIcon:SetWidth(14)
self.RaidIcon:SetPoint("CENTER", self, 0, 19)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
end
-- FOCUS
if unit=="focus" then
self:SetWidth(120)
self:SetHeight(15)
self.Power.value:Hide()
self.Health.value:SetPoint("TOPRIGHT", self.Health, -3, 12)
self.Name:SetPoint("TOPLEFT", self.Health, 2,11)
self.Name:Hide()
self.Name:SetWidth(70)
self.Health.value:SetHeight(fontsize)
self.Health.value:Hide()
self.Health:SetHeight(12)
self.Level:Hide()
self.Name:SetFont(font, 14, "OUTLINE")
self.Health.value:SetFont(font, 1, "OUTLINE")
self.Name:SetHeight(fontsize)
self:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = -1},
}
self:SetBackdropColor(0,0,0,1)
-- FOCUS BUFF's
self.debuffs = CreateFrame("Frame", nil, self)
self.debuffs.size = 0
self.debuffs.gap = false
self.debuffs:SetHeight(self.debuffs.size)
self.debuffs:SetWidth(self.debuffs.size * 7)
self.debuffs:SetPoint("RIGHT", self, "RIGHT", 38, -9.5)
self.debuffs.initialAnchor = "TOPRIGHT"
self.debuffs["growth-y"] = "DOWN"
self.debuffs["growth-x"] = "left"
self.debuffs.numDebuffs = 0
self.debuffs.spacing = 3
-- FOCUS RAID ICONS
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(20)
self.RaidIcon:SetWidth(20)
self.RaidIcon:SetPoint("CENTER", self, "CENTER", 0, 25)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
end
--CASTBAR's SHIZZLE
if(unit == 'player' or unit == 'target') then
self.Castbar = CreateFrame('StatusBar', nil, self)
self.Castbar:SetStatusBarTexture(bartex)
self.Castbar:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = -1},
}
self.Castbar:SetBackdropColor(0,0,0,1)
self.Castbar.bg = self.Castbar:CreateTexture(nil, "BORDER")
self.Castbar.bg:SetAllPoints(self.Castbar)
self.Castbar.bg:SetTexture(bartex)
self.Castbar.bg:SetAlpha(1)
self.Castbar.bg:SetVertexColor(0,0,0)
if(unit == "player") then
local _, class = UnitClass(unit)
color = self.colors.class[class]
self.Castbar:SetBackdropColor(0,0,0)
self.Castbar:SetStatusBarColor(statusbarcolor[1],statusbarcolor[2],statusbarcolo
r[3])
self.Castbar.bg:SetVertexColor(color[1],color[2],color[3])
self.Castbar:SetHeight(18)
self.Castbar:SetWidth(200)
self.Castbar:SetPoint('CENTER', UIParent, 'CENTER', playerCastBar_x, playerCastBar_y)
else
self.Castbar:SetBackdropColor(0, 0, 0)
self.Castbar:SetStatusBarColor(statusbarcolor[1],statusbarcolor[2],statusbarcolo
r[3])
self.Castbar.bg:SetVertexColor(0.80, 0.01, 0)
self.Castbar:SetHeight(18)
self.Castbar:SetWidth(200)
self.Castbar:SetPoint('CENTER', oUF_Target, 'CENTER', targetCastBar_x, targetCastBar_y)
end
self.Castbar.Text = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Text:SetPoint('TOPLEFT', self.Castbar, 2, -1)
self.Castbar.Text:SetFont(font, 14)
self.Castbar.Text:SetTextColor(1, 1, 1)
self.Castbar.Text:SetJustifyH('LEFT')
self.Castbar.Time = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Time:SetPoint('TOPRIGHT', self.Castbar, 0, -1)
self.Castbar.Time:SetFont(font, 14)
self.Castbar.Time:SetTextColor(1, 1, 1)
self.Castbar.Time:SetJustifyH('RIGHT')
end
-- AURA TEXTURE
self.PostCreateAuraIcon = auraIcon
self.SetAuraPosition = auraOffset
return self
end
--FRAMES.. iv'e been lazy. i use the move function to place my frames. works for me. :)
oUF:RegisterStyle("Mojo", func)
oUF:SetActiveStyle("Mojo")
local player = oUF:Spawn("player", "oUF_Player")
player:SetPoint("CENTER", -0, -405)
local target = oUF:Spawn("target", "oUF_Target")
target:SetPoint("CENTER", -0, -200)
local pet = oUF:Spawn("pet", "oUF_Pet")
pet:SetPoint("BOTTOMLEFT", player, 0, -24)
local tot = oUF:Spawn("targetoftarget", "oUF_TargetofTarget")
tot:SetPoint("Topleft", target, 130, 24)
local focus = oUF:Spawn("focus", "oUF_Focus")
focus:SetPoint("BOTTOMLEFT", player, 130, -24)
Zuletzt bearbeitet von einem Moderator: