SHARE
TWEET

Untitled

a guest Nov 21st, 2015 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local font, fontsize, flags = [=[Interface\AddOns\oUF_Terenna\Font.ttf]=], 10, "OUTLINE"
  2. local texture = [=[Interface\ChatFrame\ChatFrameBackground]=]
  3. local backdrop  = {
  4.         bgFile = texture,
  5.         insets = {top = -1, bottom = -1, left = -1, right = -1}
  6. }
  7.  
  8. local tArchFrame = CreateFrame("Frame", "tArchFrame", UIParent)
  9. tArchFrame:SetSize(150, 331)
  10. tArchFrame:SetPoint("RIGHT", UIParent, "RIGHT")
  11. tArchFrame:SetBackdrop(backdrop)
  12. tArchFrame:SetBackdropColor(0, 0, 0, 1)
  13.  
  14. local tArchTexture = tArchFrame:CreateTexture(nil, "BACKGROUND")
  15. tArchTexture:SetAllPoints()
  16. tArchTexture:SetTexture(texture)
  17. tArchTexture:SetVertexColor(0.2, 0.2, 0.2, 1)
  18. tArchFrame.t = tArchTexture
  19.  
  20. local tArchTitle = tArchFrame:CreateFontString(nil, "OVERLAY")
  21. tArchTitle:SetSize(70, 10)
  22. tArchTitle:SetPoint("TOP", tArchFrame, "TOP", 0, -1)
  23. tArchTitle:SetFont(font, fontsize, flags)
  24. tArchTitle:SetTextColor(1, 1, 1)
  25. tArchTitle:SetJustifyH("CENTER")
  26. tArchTitle:SetJustifyV("CENTER")
  27. tArchTitle:SetText("tArchaeology")
  28. tArchFrame.title = tArchTitleFrame
  29.  
  30. local tArchClose = CreateFrame("Frame", "tArchCloseFrame", tArchFrame)
  31. tArchClose:SetSize(10, 10)
  32. tArchClose:SetPoint("TOPRIGHT", tArchFrame, "TOPRIGHT", -2, 0)
  33. tArchClose.text = tArchClose:CreateFontString(nil, "OVERLAY")
  34. tArchClose.text:SetAllPoints()
  35. tArchClose.text:SetFont(font, fontsize, flags)
  36. tArchClose.text:SetTextColor(1, 1, 1)
  37. tArchClose.text:SetJustifyH("RIGHT")
  38. tArchClose.text:SetJustifyV("CENTER")
  39. tArchClose.text:SetText("x")
  40.  
  41. tArchClose:HookScript("OnEnter", function()
  42.         tArchClose.text:SetTextColor(0.8, 0.1, 0.1)
  43. end)
  44.  
  45. tArchClose:HookScript("OnLeave", function()
  46.         tArchClose.text:SetTextColor(1, 1, 1)
  47. end)
  48.  
  49. tArchClose:SetScript("OnMouseUp", function()
  50.         tArchFrame:Hide()
  51. end)
  52.  
  53. local tArchProgressBarFrames = {}
  54. for i = 1, 15 do
  55.         tArchProgressBarFrames[i] = CreateFrame("Frame", "ProgressBarFrame"..i, tArchFrame)
  56.         tArchProgressBarFrames[i]:SetSize(tArchFrame:GetWidth()-4, 20)
  57.         if i == 1 then
  58.                 tArchProgressBarFrames[i]:SetPoint("TOP", tArchTitle, "BOTTOM", 0, -4)
  59.         else
  60.                 tArchProgressBarFrames[i]:SetPoint("TOP", tArchProgressBarFrames[i-1], "BOTTOM", 0, -1)
  61.         end
  62.  
  63.         tArchProgressBarFrames[i].bar = CreateFrame("StatusBar", "ProgressBar"..i, tArchProgressBarFrames[i])
  64.         tArchProgressBarFrames[i].bar:SetAllPoints()
  65.         tArchProgressBarFrames[i].bar:SetMinMaxValues(0, 1)
  66.         tArchProgressBarFrames[i].bar:SetValue(0)
  67.         tArchProgressBarFrames[i].bar:SetStatusBarTexture(texture)
  68.         tArchProgressBarFrames[i].bar:SetBackdrop(backdrop)
  69.         tArchProgressBarFrames[i].bar:SetBackdropColor(0, 0, 0, 1)
  70.  
  71.         tArchProgressBarFrames[i].solveButton = CreateFrame("Button", "SolveButton"..i, tArchFrame, "SecureHandlerClickTemplate")
  72.         tArchProgressBarFrames[i].solveButton:SetSize(tArchFrame:GetWidth()-4, 20)
  73.         if i == 1 then
  74.                 tArchProgressBarFrames[i].solveButton:SetPoint("TOP", tArchFrame, "TOP", 0, -14)
  75.         else
  76.                 tArchProgressBarFrames[i].solveButton:SetPoint("TOP", tArchFrame, "TOP", 0, -14 - ((i-1)*21))
  77.         end
  78.  
  79.         tArchProgressBarFrames[i].bar.bg = tArchProgressBarFrames[i].bar:CreateTexture("ProgressBar"..i.."bg", "BORDER")
  80.         tArchProgressBarFrames[i].bar.bg:SetAllPoints()
  81.         tArchProgressBarFrames[i].bar.bg:SetTexture(texture)
  82.         tArchProgressBarFrames[i].bar.bg:SetVertexColor(0.2, 0.2, 0.2)
  83.  
  84.         tArchProgressBarFrames[i].bar.raceText = tArchProgressBarFrames[i].bar:CreateFontString("ProgressBar"..i.."raceText", "OVERLAY")
  85.         tArchProgressBarFrames[i].bar.raceText:SetSize(100, 20)
  86.         tArchProgressBarFrames[i].bar.raceText:SetPoint("LEFT", tArchProgressBarFrames[i].bar, "LEFT", 1, 1)
  87.         tArchProgressBarFrames[i].bar.raceText:SetFont(font, fontsize, flags)
  88.         tArchProgressBarFrames[i].bar.raceText:SetJustifyH("LEFT")
  89.         tArchProgressBarFrames[i].bar.raceText:SetJustifyV("CENTER")
  90.         tArchProgressBarFrames[i].bar.raceText:SetTextColor(1, 1, 1)
  91.  
  92.         tArchProgressBarFrames[i].bar.solveStatus = tArchProgressBarFrames[i].bar:CreateFontString("ProgressBar"..i.."solveStatus", "OVERLAY")
  93.         tArchProgressBarFrames[i].bar.solveStatus:SetSize(75, 20)
  94.         tArchProgressBarFrames[i].bar.solveStatus:SetPoint("RIGHT", tArchProgressBarFrames[i].bar, "RIGHT", -1, 1)
  95.         tArchProgressBarFrames[i].bar.solveStatus:SetFont(font, fontsize, flags)
  96.         tArchProgressBarFrames[i].bar.solveStatus:SetJustifyH("RIGHT")
  97.         tArchProgressBarFrames[i].bar.solveStatus:SetJustifyV("CENTER")
  98.         tArchProgressBarFrames[i].bar.solveStatus:SetTextColor(1, 1, 1)
  99. end
  100.  
  101. tArchFrame:SetScript("OnEvent", function(self, event)
  102.         for i = 1, 15 do
  103.                 SetSelectedArtifact(i)
  104.                 local raceName, _, raceItemID, numFragmentsCollected, numFragmentsRequired = GetArchaeologyRaceInfo(i)
  105.                 local name, description, rarity, _, _, numSockets = GetSelectedArtifactInfo(i)
  106.                 local keyStoneCount = GetItemCount(raceItemID)
  107.                 local bonus
  108.  
  109.                 if keyStoneCount > 0 then
  110.                         bonus = "|cff00cc00".."("..keyStoneCount..")"
  111.                 else
  112.                         bonus = ""
  113.                 end
  114.                 tArchProgressBarFrames[i].bar.solveStatus:SetText(numFragmentsCollected.."/"..numFragmentsRequired.. " "..bonus)
  115.  
  116.                 tArchProgressBarFrames[i].bar:SetValue(numFragmentsCollected/numFragmentsRequired)
  117.                 if numFragmentsCollected > numFragmentsRequired then
  118.                         tArchProgressBarFrames[i].bar:SetStatusBarColor(0.1, 0.65, 0.1)
  119.                 elseif (i < 10 and (numFragmentsCollected + min(keyStoneCount*12, numSockets*12)) >= numFragmentsRequired) or (i > 9 and (numFragmentsCollected + min(keyStoneCount*20, numSockets*20)) >= numFragmentsRequired) then
  120.                         tArchProgressBarFrames[i].bar:SetStatusBarColor(0.65, 0.65, 0.1)
  121.                 else
  122.                         tArchProgressBarFrames[i].bar:SetStatusBarColor(0.65, 0.1, 0.1)
  123.                 end
  124.  
  125.                 tArchProgressBarFrames[i].bar.raceText:SetText(raceName)
  126.  
  127.                 tArchProgressBarFrames[i].solveButton:SetScript("OnClick", function(self, button)
  128.                         SetSelectedArtifact(i)
  129.                         if button == "LeftButton" then
  130.                                 if (IsShiftKeyDown() and IsControlKeyDown()) then
  131.                                         if CanSolveArtifact() then
  132.                                                 SolveArtifact()
  133.                                         end
  134.                                 elseif IsShiftKeyDown() then
  135.                                          if (i < 10 and (numFragmentsCollected + min(keyStoneCount*12, numSockets*12)) >= numFragmentsRequired) or (i > 9 and (numFragmentsCollected + min(keyStoneCount*20, numSockets*20)) >= numFragmentsRequired) then
  136.                                                 for i = 1, min(numSockets, keyStoneCount) do
  137.                                                         if not ItemAddedToArtifact(i) then
  138.                                                                 SocketItemToArtifact()
  139.                                                         end
  140.                                                 end
  141.                                                 SolveArtifact()
  142.                                         end
  143.                                 elseif GetNumArtifactsByRace(i) > 0 then
  144.                                         DEFAULT_CHAT_FRAME:AddMessage("Your next "..raceName.." puzzle will create "..rewards[i][name]..".")
  145.                                 end
  146.                         end
  147.                 end)
  148.         end
  149. end)
  150.  
  151. tArchFrame:RegisterEvent("CHAT_MSG_CURRENCY")
  152. tArchFrame:RegisterEvent("CHAT_MSG_LOOT")
  153. tArchFrame:RegisterEvent("ARTIFACT_DIG_SITE_UPDATED")
  154. tArchFrame:RegisterEvent("ARTIFACT_DIGSITE_COMPLETE")
  155. tArchFrame:RegisterEvent("ARTIFACT_COMPLETE")
  156. tArchFrame:RegisterEvent("ARTIFACT_UPDATE")
  157. tArchFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top