Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.67 KB | None | 0 0
  1. ---------------------
  2. -- Allaidia Zone Text
  3. ---------------------
  4. -- Background
  5. ZoneBackground = CreateFrame("Frame", "ZoneBackground", UIParent)
  6. TukuiDB.CreatePanel(ZoneBackground, TukuiDB.Scale(120), TukuiDB.Scale(18), "TOP", UIParent, "TOP", 0, TukuiDB.Scale(-10))
  7. ZoneBackground:SetFrameLevel(2)
  8. ZoneBackground:SetBackdropColor(.075,.075,.075,.7)
  9. ZoneBackground:SetBackdropBorderColor(unpack(TukuiCF["media"].bordercolor))
  10. HydraDB.SetBorder(ZoneBackground)
  11. TukuiDB.CreateShadow(ZoneBackground)
  12.  
  13. -- Invisible Frame to toggle
  14. ZoneToggle = CreateFrame("Frame", "ZoneToggle", UIParent)
  15. TukuiDB.CreatePanel(ZoneToggle, TukuiDB.Scale(120), TukuiDB.Scale(18), "CENTER", ZoneBackground, "CENTER", 0, 0)
  16. ZoneToggle:SetAlpha(0)
  17. ZoneToggle:SetFrameStrata("HIGH")
  18. ZoneToggle:EnableMouse(true)
  19. AnimGroup(ZoneBackground, 0, TukuiDB.Scale(30), 0.4)
  20. ZoneToggle:SetScript("OnMouseDown", function(self)
  21.     if not ZoneBackground:IsVisible() then
  22.         SlideIn(ZoneBackground)
  23.     else
  24.         SlideOut(ZoneBackground)
  25.     end
  26. end)
  27.  
  28. -- Text
  29. local TukuiZone = CreateFrame("Frame")
  30. ZoneText = ZoneBackground:CreateFontString(nil, "LOW")
  31. ZoneText:SetFont(TukuiCF.media.font, 12)
  32. ZoneText:SetPoint("CENTER", ZoneBackground, 0, 0)
  33. ZoneText:SetShadowColor(0, 0, 0)
  34. ZoneText:SetShadowOffset(1.25, -1.25)
  35.  
  36. -- Update / Set Text
  37. local function ZoneUpdate(self)
  38.     if GetMinimapZoneText() == "Putricide's Laboratory of Alchemical Horrors and Fun" then
  39.         ZoneText:SetText(hexa.."Putricide's Laboratory"..hexb)
  40.     else
  41.         ZoneText:SetText(hexa..GetMinimapZoneText()..hexb)
  42.     end
  43.     ZoneBackground:SetWidth(ZoneText:GetWidth() + TukuiDB.Scale(16))    
  44. end
  45. TukuiZone:SetScript("OnUpdate", ZoneUpdate)
  46. ZoneUpdate(TukuiZone, 10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement