Advertisement
BoboEGR

WrytchIt

Aug 25th, 2012
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.87 KB | None | 0 0
  1. --[[
  2.     Project: Wrytch it!
  3.     Version: 1.0.0
  4.     Author: BoboEGR (http://www.sven-bobrowski.de - info@sven-bobrowski.de)
  5.    
  6. This program is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.    
  19. ]]
  20. WrytchIt = {}
  21.  
  22. local context = UI.CreateContext("WrytchItContext")
  23. local WrytchItWindow = UI.CreateFrame("SimpleWindow", "WrytchItWindow", context)
  24. local closeButton = UI.CreateFrame("Texture", "WrytchItCloseButton", WrytchItWindow)
  25.  
  26. -- Addon initialisation
  27. local function init()
  28.  
  29.     WrytchItWindow:SetVisible(false)
  30.    
  31.     WrytchItWindow:SetWidth(300)
  32.     WrytchItWindow:SetHeight(200)
  33.     WrytchItWindow:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 100, 100)
  34.     WrytchItWindow:SetTitle("Wrytch It!")
  35.     WrytchItWindow:SetLayer(1)
  36.     WrytchItWindow:SetAlpha(0.8)
  37.    
  38.     closeButton:SetTexture("WrytchIt", "Textures/close.png")
  39.     closeButton:SetPoint("TOPRIGHT", WrytchItWindow, "TOPRIGHT", -8, 16)   
  40.     closeButton:SetLayer(2)
  41.     function closeButton.Event:LeftClick()
  42.         WrytchItWindow:SetVisible(false)
  43.     end    
  44.    
  45. end
  46.  
  47. -- display WrytchIt
  48. local function showWrytchIt()
  49.     WrytchItWindow:SetVisible(true)
  50. end
  51.  
  52. -- Register the slash commands
  53. table.insert(Command.Slash.Register("wrytchit"), {showWrytchIt, "Wrytch_It", "Slash command"})
  54. table.insert(Command.Slash.Register("wi"), {showWrytchIt, "Wrytch_It", "Slash command"})
  55.  
  56. -- initialisation
  57. init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement