Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variables
- local addon, ns = ...
- local oUF = ns.oUF or oUF
- local playerClass = select(3, UnitClass('player'))
- -- Closest thing to a config
- local FONT = 'Interface\\AddOns\\media\\HOOG0557.ttf'
- local FONTSIZE = 8
- local FONTSTYLE = 'OUTLINE|MONOCHROME'
- local TEXTURE = 'Interface\\ChatFrame\\ChatFrameBackground'
- local BACKDROP = {
- bgFile = TEXTURE, insets = {top = -1, bottom = -1, left = -1, right = -1}
- }
- local BARTEXTURE = 'Interface\\AddOns\\media\\tap2.tga'
- -- End of closest thing to a config
- --[[
- Makes the background of the healthbar classcolored, or falls back to bright red
- --]]
- local function Health_PostUpdate(bar, unit, health, maxHealth)
- local _, class = UnitClass(unit)
- local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class or ""]
- if color then
- bar.bg:SetVertexColor(color.r, color.g, color.b)
- else
- -- Fall back to red
- bar.bg:SetVertexColor(1, 0, 0)
- end
- end
- -- Have to define UnitSpecific variable here so Shared has access to it or all things break
- local UnitSpecific
- -- Engine!
- local function opRaid10(self, unit)
- self.colors.power.MANA = {1, 1, 1}
- self:RegisterForClicks('AnyUp')
- self:SetScript('OnEnter', UnitFrame_OnEnter)
- self:SetScript('OnLeave', UnitFrame_OnLeave)
- self:SetBackdrop(BACKDROP)
- self:SetBackdropColor(0, 0, 0)
- local Health = CreateFrame('StatusBar', nil, self)
- Health:SetStatusBarTexture(BARTEXTURE)
- Health:SetStatusBarColor(53/255, 53/255, 53/255)
- Health.frequentUpdates = true
- self.Health = Health
- local HealthBG = Health:CreateTexture(nil, 'BORDER')
- HealthBG:SetAllPoints()
- HealthBG:SetTexture(BARTEXTURE)
- Health.bg = HealthBG
- Health.PostUpdate = Health_PostUpdate
- local text = Health:CreateFontString(nil, 'OVERLAY')
- text:SetPoint('CENTER', 0, -1)
- text:SetFont(FONT, FONTSIZE, FONTSTYLE)
- text:SetJustifyH('CENTER')
- text.frequentUpdates = 1/4
- self.HealthValue = text
- self:Tag(text, '[opraid]')
- local Power = CreateFrame('StatusBar', nil, self)
- Power:SetPoint('BOTTOMRIGHT')
- Power:SetPoint('BOTTOMLEFT')
- Power:SetPoint('TOP', Health, 'BOTTOM', 0, -1)
- Health:SetPoint('TOPRIGHT')
- Health:SetPoint('TOPLEFT')
- Power:SetStatusBarTexture(BARTEXTURE)
- Power:SetStatusBarColor(53/255, 53/255, 53/255)
- Power.frequentUpdates = true
- self.Power = Power
- local PowerBG = Power:CreateTexture(nil, 'BORDER')
- PowerBG:SetAllPoints()
- PowerBG:SetTexture(BARTEXTURE)
- PowerBG:SetVertexColor(188/255, 188/255, 188/255)
- Power.bg = PowerBG
- local RaidIcon = Health:CreateTexture(nil, 'OVERLAY')
- RaidIcon:SetPoint('TOP', self, 0, 8)
- RaidIcon:SetSize(16, 16)
- self.RaidIcon = RaidIcon
- Health:SetHeight(20)
- local RoleIcon = self:CreateTexture(nil, 'ARTWORK')
- RoleIcon:SetPoint('RIGHT', self, 'RIGHT', -3, 0)
- RoleIcon:SetSize(14, 14)
- RoleIcon:SetAlpha(1)
- self.LFDRole = RoleIcon
- if(UnitSpecific[unit]) then
- return UnitSpecific[unit](self)
- end
- end
- -- 25 man layout
- local function opRaid25(self, unit)
- self.colors.power.MANA = {1, 1, 1}
- self:RegisterForClicks('AnyUp')
- self:SetScript('OnEnter', UnitFrame_OnEnter)
- self:SetScript('OnLeave', UnitFrame_OnLeave)
- self:SetBackdrop(BACKDROP)
- self:SetBackdropColor(0, 0, 0)
- local Health = CreateFrame('StatusBar', nil, self)
- Health:SetStatusBarTexture(BARTEXTURE)
- Health:SetStatusBarColor(53/255, 53/255, 53/255)
- Health.frequentUpdates = true
- self.Health = Health
- local HealthBG = Health:CreateTexture(nil, 'BORDER')
- HealthBG:SetAllPoints()
- HealthBG:SetTexture(BARTEXTURE)
- Health.bg = HealthBG
- Health.PostUpdate = Health_PostUpdate
- local name = Health:CreateFontString(nil, 'OVERLAY')
- name:SetPoint('LEFT', self, 'RIGHT', 3, 0)
- name:SetFont(FONT, FONTSIZE, FONTSTYLE)
- name:SetJustifyH('LEFT')
- name.frequentUpdates = 1/4
- self.HealthValue = name
- self:Tag(name, '[opnameraid25]')
- Health:SetAllPoints()
- local RaidIcon = Health:CreateTexture(nil, 'OVERLAY')
- RaidIcon:SetPoint('TOP', self, 0, 8)
- RaidIcon:SetSize(16, 16)
- self.RaidIcon = RaidIcon
- -- Health:SetHeight(20)
- local ReadyCheck = self:CreateTexture(nil, 'OVERLAY')
- ReadyCheck:SetPoint('LEFT', self, 'LEFT', 3, 0)
- ReadyCheck:SetSize(14, 14)
- self.ReadyCheck = ReadyCheck
- if(UnitSpecific[unit]) then
- return UnitSpecific[unit](self)
- end
- end
- UnitSpecific = {
- }
- --UnitSpecific.raid = UnitSpecific.party
- oUF:RegisterStyle('opRaidDPS10', opRaid10)
- oUF:RegisterStyle('opRaidDPS25', opRaid25)
- --spawn 10man
- oUF:SetActiveStyle('opRaidDPS10')
- local raid10Header = oUF:SpawnHeader(
- "oUF_OpieRaid10Header",
- nil,
- "custom [@raid11,exists] hide;[@raid1,exists] show; hide",
- 'showPlayer', true,
- 'showSolo', false,
- 'showParty', false,
- 'showRaid', true,
- 'yOffset', -3,
- 'maxColumns', 8,
- 'unitsPerColumn', 5,
- 'groupBy', 'GROUP',
- 'groupingOrder', "1,2,3,4,5,6,7,8",
- 'columnSpacing', 3,
- 'columnAnchorPoint', 'LEFT',
- 'oUF-initialConfigFunction', ([[
- self:SetHeight(24)
- self:SetWidth(78)
- ]])
- )
- raid10Header:SetPoint('TOP', oUF_opUnitFramesPlayer, 'BOTTOM', 0, -10) -- top of header set to bottom of player frame
- --spawn 25man
- oUF:SetActiveStyle('opRaidDPS25')
- local raid25Header = oUF:SpawnHeader(
- "oUF_OpieRaid25Header",
- nil,
- "custom [@raid11,exists] show; hide",
- 'showPlayer', true,
- 'showSolo', false,
- 'showParty', false,
- 'showRaid', true,
- 'yOffset', -3,
- 'xOffset', 0,
- 'point', 'TOP',
- 'maxColumns', 8,
- 'unitsPerColumn', nil,
- 'groupBy', 'GROUP',
- 'groupingOrder', "1,2,3,4,5,6,7,8",
- 'columnSpacing', 3,
- 'columnAnchorPoint', 'TOP',
- 'oUF-initialConfigFunction', ([[
- self:SetHeight(16)
- self:SetWidth(100)
- ]])
- )
- if playerClass == 9 or playerClass == 3 or playerClass == 6 then
- raid25Header:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', 5, -28)
- else
- raid25Header:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', 5, -5)
- end
- --[[
- local raidResize = function(self, event, ...)
- local raidSize = GetNumGroupMembers()
- if raidSize <= 10 then
- oUF:SetActiveStyle('opRaidDPS10')
- elseif raidSize > 10 then
- oUF:SetActiveStyle('opRaidDPS25')
- end
- end
- local updateRaid = CreateFrame("Frame")
- updateRaid:RegisterEvent("GROUP_ROSTER_UPDATE")
- updateRaid:RegisterEvent("PLAYER_ENTERING_WORLD")
- updateRaid:SetScript("OnEvent", function(self)
- if(InCombatLockdown()) then
- self:RegisterEvent('PLAYER_REGEN_ENABLED')
- else
- self:UnregisterEvent('PLAYER_REGEN_ENABLED')
- raidResize()
- end
- end)
- --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement