Thread: darn taint
View Single Post
01-25-10, 11:35 AM   #14
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
no luck yet.... i think it has to do with to many frames hooked to each other it does not show hide the right ones or something.... i dont know. the base looks like this

lua Code:
  1. -- party frame 1 unit watch
  2. local GrimMPartyFrame1 = CreateFrame("frame", "GrimMPartyFrame1", GrimPartyMain, "SecureUnitButtonTemplate")
  3. GrimMPartyFrame1:SetAttribute('unit', 'party1')
  4. RegisterUnitWatch(GrimMPartyFrame1)
  5.  
  6. GrimUI.GrimMPartyFrame1 = GrimMPartyFrame1
  7.  
  8. -- party frame 2 unit watch
  9. local GrimMPartyFrame2 = CreateFrame("frame", "GrimMPartyFrame2", GrimPartyMain, "SecureUnitButtonTemplate")
  10. GrimMPartyFrame2:SetAttribute('unit', 'party2')
  11. RegisterUnitWatch(GrimMPartyFrame2)
  12.  
  13. GrimUI.GrimMPartyFrame2 = GrimMPartyFrame2
  14.  
  15. -- party frame 3 unit watch
  16. local GrimMPartyFrame3 = CreateFrame("frame", "GrimMPartyFrame3", GrimPartyMain, "SecureUnitButtonTemplate")
  17. GrimMPartyFrame3:SetAttribute('unit', 'party3')
  18. RegisterUnitWatch(GrimMPartyFrame3)
  19.  
  20. GrimUI.GrimMPartyFrame3 = GrimMPartyFrame3
  21.  
  22. -- party frame 4 unit watch
  23. local GrimMPartyFrame4 = CreateFrame("frame", "GrimMPartyFrame4", GrimPartyMain, "SecureUnitButtonTemplate")
  24. GrimMPartyFrame4:SetAttribute('unit', 'party4')
  25. RegisterUnitWatch(GrimMPartyFrame4)
  26.  
  27. GrimUI.GrimMPartyFrame4 = GrimMPartyFrame4
  28.  
  29. ---- hide party frames in raid ----
  30.  
  31.  
  32.  
  33. local RaidPartyHandler = CreateFrame("Frame", "RaidPartyHandler", UIParent, "SecureHandlerStateTemplate");
  34. SecureHandler_OnLoad(RaidPartyHandler);
  35. RaidPartyHandler.GrimPartyMain = CreateFrame("Frame", nil, RaidPartyHandler);
  36.  
  37.  
  38.  
  39. RaidPartyHandler:SetFrameRef("GrimPartyMain", RaidPartyHandler.GrimPartyMain);
  40. RaidPartyHandler:Execute([[
  41. GrimPartyMain = self:GetFrameRef("GrimPartyMain");
  42. ]]);
  43. RaidPartyHandler:SetAttribute("_onstate-unitexists", [[
  44.     if newstate then
  45.     GrimPartyMain:Hide()
  46.     else
  47.     GrimPartyMain:Show()
  48.     end
  49. ]]);
  50.  
  51. RaidPartyHandler:SetAttribute("unit", "raid1");
  52. RegisterUnitWatch(RaidPartyHandler, true);
  53.  
  54. RaidPartyHandler:SetAttribute("state-unitexists", UnitExists("raid1"));
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote