Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2018
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. function EventHandler(self, Event, ...)
  2. local myself = UnitName("player")
  3. local Range = UnitInRange("target")
  4.  
  5. -- SetMapToCurrentZone()
  6. local mapID = C_Map.GetBestMapForUnit("player")
  7. WorldMapFrame:SetMapID(mapID)
  8. local X, Y = C_Map.GetPlayerMapPosition(mapID, "player"):GetXY()
  9.  
  10. CleanUp()
  11.  
  12.  
  13. for i = 3, 16 do
  14. --print(string.sub(X,i,i))
  15.  
  16. local frame4 = CreateFrame("Frame", "frame4", UIparent)
  17. frame4:SetWidth(10)
  18. frame4:SetHeight(10)
  19. frame4:SetPoint("TOPLEFT", 10*i, 0)
  20. frame4:SetFrameStrata("TOOLTIP")
  21. local textureFrame4 = frame4:CreateTexture("TOOLTIP")
  22. --textureFrame4:SetColorTexture(1, 1, 1, 1)
  23.  
  24.  
  25.  
  26. if string.sub(X,i,i) == "5" then
  27. textureFrame4:SetColorTexture(0, 0.5, 1, 1) -- Darker Blue 5
  28. textureFrame4:SetAllPoints(frame4)
  29.  
  30. elseif string.sub(X,i,i) == "6" then --- Light Blue 6
  31. textureFrame4:SetColorTexture(0, 1, 1, 1)
  32. textureFrame4:SetAllPoints(frame4)
  33.  
  34. elseif string.sub(X,i,i) == "7" then
  35. textureFrame4:SetColorTexture(0.5, 1, 1, 1)
  36. textureFrame4:SetAllPoints(frame4)
  37.  
  38. elseif string.sub(X,i,i) == "8" then
  39. textureFrame4:SetColorTexture(1, 1, 0.5, 1) -- Yellow 8
  40. textureFrame4:SetAllPoints(frame4)
  41.  
  42. elseif string.sub(X,i,i) == "9" then
  43. textureFrame4:SetColorTexture(0, 0.5, 0.5, 1) --- Darker green 9
  44. textureFrame4:SetAllPoints(frame4)
  45.  
  46.  
  47. elseif string.sub(X,i,i) == "4" then
  48. textureFrame4:SetColorTexture(0, 0, 1, 1) -- Blue 4
  49. textureFrame4:SetAllPoints(frame4)
  50.  
  51.  
  52. elseif string.sub(X,i,i) == "3" then --- Green 3
  53. textureFrame4:SetColorTexture(0, 1, 0, 1)
  54. textureFrame4:SetAllPoints(frame4)
  55.  
  56.  
  57. elseif string.sub(X,i,i) == "2" then ---- Red 2
  58. textureFrame4:SetColorTexture(1, 0, 0, 1)
  59. textureFrame4:SetAllPoints(frame4)
  60.  
  61.  
  62. elseif string.sub(X,i,i) == "1" then ---- White 1
  63. textureFrame4:SetColorTexture(1, 1, 1, 1)
  64. textureFrame4:SetAllPoints(frame4)
  65. else
  66. textureFrame4:SetColorTexture(0, 0, 0, 1) --- Black 0
  67. textureFrame4:SetAllPoints(frame4)
  68. end
  69. textureFrame4:SetAllPoints(frame4)
  70. end
  71.  
  72. print(X)
  73. print(Y)
  74.  
  75.  
  76. end
  77.  
  78. local CounterPoofDaddy = 1
  79.  
  80.  
  81.  
  82. function CleanUp()
  83.  
  84. for i = 3,16 do
  85. if textureFrame4 == nil then
  86.  
  87. else
  88. print("asd")
  89. textureFrame4:SetColorTexture(1, 1, 1, 1)
  90. --textureFrame4:SetAllPoints(frame4)
  91. --frame4:Hide()
  92. end
  93. end
  94.  
  95. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement