Advertisement
Senit

Core.lua

Aug 20th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.38 KB | None | 0 0
  1.  
  2. --oUF_Senit 2012--
  3.  
  4. --Gets Namespace
  5. local addon, ns = ...
  6.  
  7. --Gets Config
  8. local config = ns.config
  9.  
  10. --Gets Library
  11. local lib = ns.lib
  12.  
  13. --STYLE FUNCTIONS--
  14.  
  15. --Sub Function
  16. local SubFunc = function(self)
  17.     self:SetSize(self.width, self.height)
  18.     self.menu = lib.menu
  19.     self:RegisterForClicks("AnyUp")
  20.     self:SetAttribute("*type2", "menu")
  21.     self:SetScript("OnEnter", UnitFrame_OnEnter)
  22.     self:SetScript("OnLeave", UnitFrame_OnLeave)
  23.     --local unitBackground = self:CreateTexture(nil, "ARTWORK")
  24.     --unitBackground:SetAllPoints(self)
  25.     --unitBackground:SetTexture(0, 0, 0, 1)
  26.     lib.gen_hpbar(self)
  27. end
  28. local function CreatePlayer(self)
  29.     --Unit Specific Style
  30.     self.mystyle = "player"
  31.    
  32.     --Size
  33.     self.width = 225
  34.     self.height = 15
  35.    
  36.     --Generate Bars and Text
  37.     SubFunc(self)
  38.     lib.gen_ppbar(self)
  39.     lib.gen_castbar(self)
  40.     lib.pla_fontstrings(self)
  41.     lib.cps_fontstrings(self)
  42.    
  43.     --Style Specific
  44.     self.Health.Smooth = true
  45.     self.Health.frequentUpdates = true
  46.     self.Health.colorHealth = true
  47.     self.colors.health = {20/255, 20/255, 20/255}
  48.     self.Health.bg.multiplier = 8
  49.    
  50.     --self.Power.colorPower = true
  51.     --self.colors.power["ENERGY"] = {255/255, 50/255, 37/255}
  52.     self.Power.colorClass = true
  53.     self.Power.Smooth = true
  54.     self.Power.frequentUpdates = true
  55.     self.Power.bg.multiplier = 0.3 
  56.    
  57.     --lib.createDebuffs(self)
  58.     lib.bufftracker(self)
  59.     --lib.debufftracker(self)
  60.     --lib.playBuffs(self)
  61. end
  62. local function CreateTarget(self)
  63.     --Unit Specific Style
  64.     self.mystyle = "target"
  65.    
  66.     --Size
  67.     self.width = 225
  68.     self.height = 15
  69.    
  70.     --Generate Bars and Text
  71.     SubFunc(self)
  72.     lib.gen_ppbar(self)
  73.     lib.gen_castbar(self)
  74.     lib.tar_fontstrings(self)
  75.    
  76.     --Style Specific
  77.     self.Health.frequentUpdates = true
  78.     self.Health.Smooth = true
  79.     self.Health.colorTapping = true
  80.     self.Health.colorDisconnected = true
  81.     self.Health.colorHealth = true
  82.     self.Health.bg.multiplier = 8
  83.    
  84.     --self.Power.PostUpdate = PostUpdate
  85.     self.Power.Smooth = true
  86.     self.Power.colorReaction = true
  87.     self.Power.colorClass = true
  88.     self.Power.frequentUpdates = true
  89.     self.Power.bg.multiplier = 0.3
  90.    
  91.     lib.createBuffs(self)
  92.     --lib.createDebuffs(self)
  93.     lib.debufftracker(self)
  94. end
  95. local function CreateTargetTarget(self)
  96.     --Unit Specific Style
  97.     self.mystle = "targettarget"
  98.    
  99.     --Size
  100.     self.width = 150
  101.     self.height = 15
  102.    
  103.     --Generate Bars and Text
  104.     SubFunc(self)
  105.     lib.gen_ppbar(self)
  106.     lib.tot_fontstrings(self)
  107.    
  108.     --Style Specific
  109.     self.Health.frequentUpdates = true
  110.     self.Health.Smooth = true
  111.     self.Health.colorTapping = true
  112.     self.Health.colorDisconnected = true
  113.     self.Health.colorHealth = true
  114.     self.Health.bg.multiplier = 8
  115.    
  116.     self.Power.Smooth = true
  117.     self.Power.colorReaction = true
  118.     self.Power.colorClass = true
  119.     self.Power.frequentUpdates = true
  120.     self.Power.bg.multiplier = 0.3
  121. end
  122. local function CreateFocus(self)
  123.     --Unit Specific Style
  124.     self.mystle = "focus"
  125.    
  126.     --Size
  127.     self.width = 150
  128.     self.height = 15
  129.    
  130.     --Generate Bars and Text
  131.     SubFunc(self)
  132.     lib.gen_ppbar(self)
  133.     lib.tot_fontstrings(self)
  134.    
  135.     --Style Specific
  136.     self.Health.frequentUpdates = true
  137.     self.Health.Smooth = true
  138.     self.Health.colorTapping = true
  139.     self.Health.colorDisconnected = true
  140.     self.Health.colorHealth = true
  141.     self.Health.bg.multiplier = 8
  142.    
  143.     self.Power.Smooth = true
  144.     self.Power.colorReaction = true
  145.     self.Power.colorClass = true
  146.     self.Power.frequentUpdates = true
  147.     self.Power.bg.multiplier = 0.3
  148. end
  149. local function CreateRaid(self)
  150.     --Unit Specific Style
  151.     self.mystle = "raid"
  152.    
  153.     --Size
  154.     self.width = 41
  155.     self.height = 15
  156.    
  157.     self.Range = {
  158.         insideAlpha = 1,
  159.         outsideAlpha = .3,
  160.     }
  161.    
  162.     --Generate Bars and Text
  163.     SubFunc(self)
  164.     lib.gen_ppbar2(self)
  165.     lib.raid_fontstrings(self)
  166.    
  167.     self.Health.PostUpdate = lib.PostUpdateRaidFrame
  168.    
  169.     --Style Specific
  170.     self.Health.Smooth = true
  171.     self.Health.colorTapping = true
  172.     self.Health.colorDisconnected = true
  173.     self.Health.colorHealth = true
  174.     self.Health.bg.multiplier = 8
  175.    
  176.     self.Power.colorClass = true
  177.     self.Power.bg.multiplier = 0.3
  178. end
  179.  
  180. --UNIT SPAWN--
  181.  
  182. --Registers Styles
  183. oUF:RegisterStyle("oUF_Senit_Player", CreatePlayer)
  184. oUF:RegisterStyle("oUF_Senit_Target", CreateTarget)
  185. oUF:RegisterStyle("oUF_Senit_TargetTarget", CreateTargetTarget)
  186. oUF:RegisterStyle("oUF_Senit_Focus", CreateFocus)
  187. oUF:RegisterStyle("oUF_Senit_Raid", CreateRaid)
  188.  
  189. oUF:SetActiveStyle("oUF_Senit_Player")
  190.  
  191. --Spawns Player
  192. local player = oUF:Spawn("player", "oUF_player")
  193. player:SetPoint("CENTER", UIParent, "CENTER", 0, -190)
  194.  
  195. oUF:SetActiveStyle("oUF_Senit_Target")
  196.  
  197. --Spawns Target
  198. local target = oUF:Spawn("target", "oUF_target")
  199. target:SetPoint("CENTER", UIParent, "CENTER", 235, -190)
  200.  
  201. oUF:SetActiveStyle("oUF_Senit_TargetTarget")
  202.  
  203. --Spawns Target's Target
  204. local target = oUF:Spawn("targettarget", "oUF_targettarget")
  205. target:SetPoint("CENTER", UIParent, "CENTER", -198, -190)
  206.  
  207. oUF:SetActiveStyle("oUF_Senit_Focus")
  208.  
  209. --Spawns Focus
  210. local focus = oUF:Spawn("focus", "oUF_focus")
  211. focus:SetPoint("CENTER", UIParent, "CENTER", 470, 0)
  212.  
  213. oUF:SetActiveStyle("oUF_Senit_Raid")
  214.  
  215. --Spawns Raid
  216. local maxGroups = 5
  217. local raid = oUF:SpawnHeader("oUF_Raid", nil, "custom [@raid1,exists] show; [group:party,nogroup:raid] show; hide",
  218.         "showPlayer",         true,
  219.         "showSolo",           false,
  220.         "showParty",          true,
  221.         "showRaid",           true,
  222.         "yOffset",            0,
  223.         "xoffset",            15,
  224.         "groupFilter",        "1,2,3,4,5,6,7,8",
  225.         "groupBy",            "GROUP",
  226.         "groupingOrder",      "1,2,3,4,5,6,7,8",
  227.         "sortMethod",         "INDEX",
  228.         "maxColumns",         maxGroups,
  229.         "unitsPerColumn",     5,
  230.         "columnSpacing",      15,
  231.         "point",              "LEFT",
  232.         "columnAnchorPoint",  "TOP",
  233.         "oUF-initialConfigFunction", [[
  234.         self:SetHeight(25)
  235.         self:SetWidth(100)
  236.         ]])
  237.         raid:SetPoint("TOPLEFT", UIParent, 850, -300)
  238.  
  239. --DIE RAID PANEL
  240.     CompactRaidFrameManager:UnregisterAllEvents()
  241.     CompactRaidFrameManager.Show = CompactRaidFrameManager.Hide
  242.     CompactRaidFrameManager:Hide()
  243.  
  244.     CompactRaidFrameContainer:UnregisterAllEvents()
  245.     CompactRaidFrameContainer.Show = CompactRaidFrameContainer.Hide
  246.     CompactRaidFrameContainer:Hide()
  247.    
  248. --DIE BOSS FRAMES
  249. function hideBossFrames()
  250.     for i = 1, 4 do
  251.         local frame = _G["Boss"..i.."TargetFrame"]
  252.         frame:UnregisterAllEvents()
  253.         frame:Hide()
  254.         frame.Show = function () end
  255.     end
  256. end
  257. -- Call the hide function
  258. hideBossFrames()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement