Skynniman

Litepanels

Jan 16th, 2012
64
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. lpanels:CreateLayout("Minimap", {
  2.     -- Bordure minimap int
  3.     {   name = "Minimap_border",
  4.         parent = "Minimap", anchor_to = "TOP",
  5.         height = "100%", width = "100%" , bg_alpha = 0,
  6.         border = "SOLID", border_color = "0 0 0",
  7.         border_alpha = 0.5, level = 99, inset = -2.5
  8.     },
  9.     -- barre supérieur carte
  10.     {   name = "Minimap_location",
  11.         anchor_frame = "Minimap", anchor_to = "TOPLEFT",
  12.         height = 11, width = "100%",
  13.         bg_alpha = 0.3, level = 99,
  14.        
  15.         OnLoad=function(self)
  16.         self:RegisterEvent("PLAYER_REGEN_DISABLED")
  17.         self:RegisterEvent("PLAYER_REGEN_ENABLED")
  18.         end,
  19.        
  20.         OnEvent=function(self)
  21.             if event == "PLAYER_REGEN_ENABLED" then
  22.                 self:Show()
  23.             elseif event == "PLAYER_REGEN_DISABLED" then
  24.                 self:Hide()
  25.             end
  26.         end
  27.     }, 
  28.     {   name = "Minimap_location_border",
  29.         parent = "Minimap_location", anchor_to = "BOTTOM",
  30.         width = "100%", height = 1, y_off = -1,
  31.         bg_alpha = 0.5,
  32.     },
  33.    
  34.     -- Barre inférieur carte
  35.     {   name = "Minimap_tracking",
  36.         anchor_frame = "Minimap",
  37.         height = 18, width = "100%",
  38.         bg_alpha = 0.3, level = 99,
  39.        
  40.         OnLoad=function(self)
  41.         self:RegisterEvent("PLAYER_REGEN_DISABLED")
  42.         self:RegisterEvent("PLAYER_REGEN_ENABLED")
  43.         end,
  44.        
  45.         OnEvent=function(self)
  46.             if event == "PLAYER_REGEN_ENABLED" then
  47.                 self:Show()
  48.             elseif event == "PLAYER_REGEN_DISABLED" then
  49.                 self:Hide()
  50.             end
  51.         end
  52.        
  53.     },
  54.     {   name = "Minimap_tracking_border",
  55.         parent = "Minimap_tracking", anchor_to = "TOP",
  56.         width = "100%", height = 1, y_off = 1,
  57.         bg_alpha = 0.5,
  58.     },
  59.  
  60.     -- barre inférieur extérieur carte
  61.     {   name = "Minimap_stat",
  62.         parent = "Minimap_tracking", anchor_to = "BOTTOM",
  63.         border = "SOLID", border_color = "0 0 0",
  64.         border_alpha = 0.5, level = 0, inset = 1,
  65.         height = 15, width = 140, y_off = -17.5,
  66.         bg_alpha = 0.3, level = 99,
  67.        
  68.     }
  69. })
  70.  
  71. lpanels:CreateLayout("Afker", {
  72.     {    name = "AFK", anchor_to = "TOP", y_off = -350,
  73.         bg_alpha = 0.5, width = 200, height = 50,
  74.         border = "SOLID", border_color = "1 0.3 0.3",
  75.         text = {
  76.         -- "YOU ARE AFK!"
  77.             {    string = "Tu es AFK !", anchor_to = "TOP", y_off = -10,
  78.                 shadow=1, font = "Fonts\\FRIZQT__.TTF", size=14,
  79.             },
  80.             -- "0:00" TIMER
  81.             {    string=function()
  82.                     if afk_timer then
  83.                         local secs = mod(time() - afk_timer, 60)
  84.                         local mins = floor((time() - afk_timer) / 60)
  85.                         return format("%s:%02.f", mins, secs)
  86.                     end
  87.                 end, update=0.1,
  88.                 shadow=1, font = "Fonts\\FRIZQT__.TTF", size=16,
  89.                 anchor_to = "CENTER", y_off = -7, color = "1 0.3 0.3"
  90.             }
  91.         },
  92.         OnLoad = function(self)
  93.             self:RegisterEvent("PLAYER_FLAGS_CHANGED")
  94.             self:Hide()
  95.         end,
  96.         OnEvent = function(self)
  97.             if UnitIsAFK("player") and not afk_timer then
  98.                 self.text2:SetText("0:00")
  99.                 afk_timer = time()
  100.                 self:Show()
  101.             elseif not UnitIsAFK("player") then
  102.                 self:Hide()
  103.                 afk_timer = nil
  104.             end
  105.         end,
  106.         OnClick = function(self, b)
  107.             self:Hide()
  108.             if b == "LeftButton" then SendChatMessage("", "AFK") end
  109.         end,
  110.         OnEnter = function(self) self.bg:SetTexture(.1,.1,.1,.5) end,
  111.         OnLeave = function(self) self.bg:SetTexture(0,0,0,.5) end
  112.     }
  113. })
  114.  
  115. lpanels:ApplyLayout(nil, "Minimap", "Afker")
RAW Paste Data