Advertisement
Guest User

Untitled

a guest
Jul 14th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.75 KB | None | 0 0
  1. -- Rolecheck / ReadyCheck / Clear All
  2.  
  3. local function CreateRaidButton(btnName,text,x,y)
  4.     local frame = CreateFrame("Button", btnName, gWorldmarkers, "SecureActionButtonTemplate");
  5.     frame:SetPoint("CENTER", gWorldmarkers,x,y)
  6.     frame:SetWidth(60);
  7.     frame:SetHeight(25);
  8.     frame:SetBackdrop({
  9.         bgFile =  "Interface\\ChatFrame\\ChatFrameBackground",
  10.         edgeFile = "Interface\\Buttons\\WHITE8x8", edgeSize = 1,
  11.         insets = {left = -0, right = -0, top = -0, bottom = -0}
  12.     })
  13.     frame:SetBackdropBorderColor(G.bordercolor.r, G.bordercolor.g, G.bordercolor.b, G.bordercolor.a)
  14.     frame:SetBackdropColor(0,0,0,0)
  15.     frame:SetAttribute("type", "macro");
  16.  
  17.     t = frame:CreateFontString("raidbutton")
  18.     t:SetFont("Interface\\AddOns\\gempUI\\media\\fonts\\square.ttf", 13, "THINOUTLINE");
  19.     t:SetText(text);
  20.     t:SetPoint("CENTER", frame, "CENTER", 2,0);
  21.  
  22.     local buttonOverlay = CreateFrame("Frame", nil, frame)
  23.     buttonOverlay:SetWidth(58)
  24.     buttonOverlay:SetHeight(24)
  25.     buttonOverlay:SetPoint("CENTER", frame, "CENTER", 0,0)
  26.     buttonOverlay:SetBackdrop({
  27.         bgFile = [[Interface\Buttons\WHITE8x8]],
  28.         edgeFile = [[Interface\Buttons\WHITE8x8]],
  29.         edgeSize = 1,
  30.         })
  31.     buttonOverlay:SetBackdropColor(0,0,0,0)
  32.     buttonOverlay:SetBackdropBorderColor(0, 0, 0,0)
  33.  
  34.     frame:SetScript('OnEnter', function() buttonOverlay:SetBackdropColor(1,1,1,0.15) end)
  35.     frame:SetScript('OnLeave', function() buttonOverlay:SetBackdropColor(0,0,0,0) end)
  36.  
  37. end
  38.  
  39. CreateRaidButton("wReadycheck","Ready", -59, 23);
  40. wReadycheck:SetAttribute("macrotext", "/readycheck");
  41.  
  42. CreateRaidButton("wRolecheck","Role", 0, 23);
  43. wRolecheck:SetAttribute("macrotext", "/run InitiateRolePoll()");
  44.  
  45. CreateRaidButton("wClearAll","Clear", 59, 23);
  46. wClearAll:SetAttribute("macrotext", "/cwm all");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement