Advertisement
Skynniman

lua2

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