Quantcast WoWInterface - View Single Post - Skinning default raid frames
View Single Post
03-28-15, 11:52 PM   #1
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 579
Skinning default raid frames

So my skin works but it produces this error regardlkess of whether Im in a raid or party. I remember this running with no issue in the past though that was back in cataclysm. Have things changed since? (likely yes)

Code:
1x BobRaid\core.lua:123: attempt to index field '?' (a nil value)
BobRaid\core.lua:123: in function <BobRaid\core.lua:117>
Code:
Lua Code:
  1. local _, cfg = ... --import config
  2.  
  3. --[[
  4. Cause I wanted to do it!
  5.  --10leej
  6. ]]
  7.  
  8. local function CreateBackdrop(frame)
  9.     frame:SetBackdrop({bgFile = cfg.backdrop, edgeFile = "Interface\\Buttons\\WHITE8x8", edgeSize = cfg.pixelbordersize,
  10.         insets = {top = 2, left = 2, bottom = 2, right = 2}})
  11.     frame:SetBackdropColor(unpack(cfg.bColor))
  12.     frame:SetBackdropBorderColor(unpack(cfg.bColor))
  13.     if isBeautiful then
  14.         frame:CreateBeautyBorder(cfg.border.size.large)
  15.         frame:SetBeautyBorderTexture(cfg.border.texture)
  16.         frame:SetBeautyBorderColor(unpack(cfg.border.color))
  17.     end
  18. end
  19.  
  20. --Hide Group # tag on raid frames
  21. local inInstanceGroup = IsInGroup(LE_PARTY_CATEGORY_INSTANCE)
  22. if inInstanceGroup then
  23.     print("DEBUG: Player is in an instance group!")
  24. elseif IsInGroup() then
  25.     print("DEBUG: Player is in a normal group!")
  26. elseif IsInRaid() then
  27.     print("DEBUG: Player is in a raid group!")
  28.     b = CreateFrame("Frame")
  29.     b:SetScript("OnEvent", function(self, event, ...)
  30.         if event == "GROUP_ROSTER_UPDATE" then
  31.             CompactRaidGroup1Title:Hide()
  32.             CompactRaidGroup2Title:Hide()
  33.             CompactRaidGroup3Title:Hide()
  34.             CompactRaidGroup4Title:Hide()
  35.             CompactRaidGroup5Title:Hide()
  36.             CompactRaidGroup6Title:Hide()
  37.             CompactRaidGroup7Title:Hide()
  38.             CompactRaidGroup8Title:Hide()
  39.         end
  40.     end)
  41.     b:RegisterEvent("PLAYER_LOGIN")
  42.     b:RegisterEvent("GROUP_ROSTER_UPDATE")
  43.     b:RegisterEvent("ADDON_LOADED")
  44. end
  45.  
  46. --Make frames more resizable (RaidFrameResizer)
  47. local n,w,h="CompactUnitFrameProfilesGeneralOptionsFrame" h,w=
  48. _G[n.."HeightSlider"],
  49. _G[n.."WidthSlider"]
  50. h:SetMinMaxValues(1,150) --height
  51. w:SetMinMaxValues(1,150) --width
  52.  
  53. --Skin the RaidManager
  54. if not CompactRaidFrameManager then LoadAddOn("Blizzard_CompactRaidFrames") end
  55.  
  56. --hide stuff
  57. local buttons = {
  58.     CompactRaidFrameManagerDisplayFrameFilterOptionsFilterRoleTank,
  59.     CompactRaidFrameManagerDisplayFrameFilterOptionsFilterRoleHealer,
  60.     CompactRaidFrameManagerDisplayFrameFilterOptionsFilterRoleDamager,
  61.     CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup1,
  62.     CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup2,
  63.     CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup3,
  64.     CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup4,
  65.     CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup5,
  66.     CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup6,
  67.     CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup7,
  68.     CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup8,
  69.     CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateRolePoll,
  70.     CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateReadyCheck,
  71.     CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton,
  72.     CompactRaidFrameManagerDisplayFrameLockedModeToggle,
  73.     CompactRaidFrameManagerDisplayFrameHiddenModeToggle,
  74.     CompactRaidFrameManagerDisplayFrameConvertToRaid
  75. }
  76. CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton.SetNormalTexture = function() end
  77. for _, button in pairs(buttons) do
  78.     for i = 1, 3 do
  79.         select(i, button:GetRegions()):SetAlpha(0)
  80.     end
  81. end
  82.  
  83. for i = 1, 8 do
  84.     select(i, CompactRaidFrameManager:GetRegions()):Hide()
  85. end
  86. select(1, CompactRaidFrameManagerDisplayFrameFilterOptions:GetRegions()):Hide()
  87. select(1, CompactRaidFrameManagerDisplayFrame:GetRegions()):Hide()
  88. select(4, CompactRaidFrameManagerDisplayFrame:GetRegions()):Hide()
  89.  
  90. local bd = CreateFrame("Frame", nil, CompactRaidFrameManager)
  91. bd:SetPoint("TOPLEFT", CompactRaidFrameManager, "TOPLEFT")
  92. bd:SetPoint("BOTTOMRIGHT", CompactRaidFrameManager, "BOTTOMRIGHT", -9, 9)
  93.  
  94. --now we skin it and yes it's really this simple :)
  95. CreateBackdrop(CompactRaidFrameManagerDisplayFrameFilterOptionsFilterRoleTank)
  96. CreateBackdrop(CompactRaidFrameManagerDisplayFrameFilterOptionsFilterRoleHealer)
  97. CreateBackdrop(CompactRaidFrameManagerDisplayFrameFilterOptionsFilterRoleDamager)
  98. CreateBackdrop(CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup1)
  99. CreateBackdrop(CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup2)
  100. CreateBackdrop(CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup3)
  101. CreateBackdrop(CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup4)
  102. CreateBackdrop(CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup5)
  103. CreateBackdrop(CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup6)
  104. CreateBackdrop(CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup7)
  105. CreateBackdrop(CompactRaidFrameManagerDisplayFrameFilterOptionsFilterGroup8)
  106. CreateBackdrop(CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateRolePoll)
  107. CreateBackdrop(CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateReadyCheck)
  108. CreateBackdrop(CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton)
  109. CreateBackdrop(CompactRaidFrameManagerDisplayFrameLockedModeToggle)
  110. CreateBackdrop(CompactRaidFrameManagerDisplayFrameHiddenModeToggle)
  111. CreateBackdrop(CompactRaidFrameManagerDisplayFrameConvertToRaid)
  112. CreateBackdrop(CompactRaidFrameManager)
  113. CompactRaidFrameManagerToggleButton:SetNormalTexture("Interface\\AddOns\\BobUI\\media\\buttons\\RaidPanel-Toggle")
  114.  
  115. --This is how you skin the default raid frames
  116. f = CreateFrame("Frame")
  117. f:SetScript("OnEvent", function(self, event, ...)
  118.     if event == "GROUP_ROSTER_UPDATE" then
  119.         for i = 1, 5 do -- Party Frames
  120.             _G["CompactPartyFrameMember" .. i]:CreateBeautyBorder(12)
  121.         end
  122.         for i = 1, 80 do -- Raid Frames, do we really have 80 of them? Don't remember
  123.             _G["CompactRaidFrame" .. i]:CreateBeautyBorder(12)
  124.         end
  125.         for i = 1, 5 do -- Raid Frames Group 1
  126.             _G["CompactRaidGroup1Member" .. i]:CreateBeautyBorder(12)
  127.         end
  128.         for i = 1, 5 do -- Raid Frames Group 2
  129.             _G["CompactRaidGroup2Member" .. i]:CreateBeautyBorder(12)
  130.         end
  131.         for i = 1, 5 do -- Raid Frames Group 3
  132.             _G["CompactRaidGroup3Member" .. i]:CreateBeautyBorder(12)
  133.         end
  134.         for i = 1, 5 do -- Raid Frames Group 5
  135.             _G["CompactRaidGroup4Member" .. i]:CreateBeautyBorder(12)
  136.         end
  137.         for i = 1, 5 do -- Raid Frames Group 6
  138.             _G["CompactRaidGroup5Member" .. i]:CreateBeautyBorder(12)
  139.         end
  140.         --Set the default raid frame options to how we want them
  141.         --apparently doesn't work?
  142.         SetCVar("useCompactPartyFrames", 1)
  143.         SetCVar("raidOptionShowBorders", 0)
  144.         SetCVar("raidFramesDisplayPowerBars", 1)
  145.         SetCVar("raidFramesDisplayClassColor", 1)
  146.  
  147.     end
  148. end)
  149. f:RegisterEvent("PLAYER_LOGIN")
  150. f:RegisterEvent("GROUP_ROSTER_UPDATE")
  151. f:RegisterEvent("ADDON_LOADED")
__________________
Tweets Facebook YouTube Website
  Reply With Quote