Advertisement
Guest User

GridClickSets: keydown patch

a guest
Aug 30th, 2017
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. hooksecurefunc("CompactUnitFrame_SetUpClicks", function(frame)
  2. if InCombatLockdown() then
  3. GridClickSetsFrame_UpdateAll(true)
  4. else
  5. -- frame:RegisterForClicks("AnyUp");
  6. frame:RegisterForClicks("AnyDown");
  7. GridClickSets_SetAttributes(frame, GridClickSetsFrame_GetCurrentSet());
  8. end
  9. end);
  10.  
  11. --[[
  12. hooksecurefunc("CompactPartyFrame_UpdateShown", function(self)
  13. if ( GetCVarBool("useCompactPartyFrames") and GetNumRaidMembers() == 0 and not InCombatLockdown() ) then
  14. self:Show();
  15. end
  16. end)
  17. ]]
  18.  
  19. local button = CreateFrame("Button", "CompactClickSetsButton", CompactRaidFrameManagerDisplayFrame, "UIMenuButtonStretchTemplate");
  20. button:SetHeight(21);
  21. button:SetText(GRIDCLICKSETS_TITLE);
  22. button:SetPoint("LEFT", button:GetParent(), "LEFT", 8, 0);
  23. button:SetPoint("RIGHT", button:GetParent(), "RIGHT", -5, 0);
  24. button:SetPoint("TOP", button:GetParent(), "BOTTOM", 0, 6);
  25. button:SetScript("OnClick", function() if GridClickSetsFrame:IsVisible() then GridClickSetsFrame:Hide() else GridClickSetsFrame:Show() end end)
  26.  
  27. function CompactUnitFrameClickSets_UpdateAll(set)
  28. for i=1, MEMBERS_PER_RAID_GROUP do
  29. local frame = _G["CompactPartyFrameMember"..i]
  30. if not frame then break; end
  31. -- frame:RegisterForClicks("AnyUp");
  32. frame:RegisterForClicks("AnyDown");
  33. GridClickSets_SetAttributes(frame, set);
  34. end
  35.  
  36. --宠物,坦克都是同样的名字排列。但不一定是顺序的,所以都检查一遍
  37. --if checkCombat() ~= 1 then
  38.  
  39. for i=1, 100 do
  40. local frame = _G["CompactRaidFrame"..i]
  41. if frame then
  42. -- frame:RegisterForClicks("AnyUp");
  43. frame:RegisterForClicks("AnyDown");
  44. GridClickSets_SetAttributes(frame, set);
  45. end
  46. end
  47. --end
  48. end
  49.  
  50. if GridClickSetsFrame_Updates then
  51. table.insert(GridClickSetsFrame_Updates, CompactUnitFrameClickSets_UpdateAll);
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement