Advertisement
NotHawthorne

gate_trainer

Nov 5th, 2014
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.43 KB | None | 0 0
  1. --      The purpose of this script is to attempt to increase ease of UI
  2. --  navigation,  and create  some  sort  of  explanation behind certain
  3. --  undocumented GATE functions. Consider this a  framework  for future
  4. --  GATE based user interface elements.
  5. -- 
  6. --  ~NotHawthorne
  7.  
  8.  
  9. local Liturgy = {Prefix = "Liturgy"};        --Prefix. Important... I think?
  10.  
  11. function liturgy_menu (event, player, spell)     --Temporary trigger for testing
  12.     if (spell:GetEntry()==818012) then
  13.          Liturgy.RenderMainMenu(player)
  14.     end
  15. end
  16.  
  17. function Liturgy.RenderMainMenu(player)
  18. --   _______________________________________
  19. --  |  ~Variable~   |    ~Explanation~  |
  20. --  |_______________|_______________________|
  21. --  | frame_name    | "Title of the window" |____
  22. --  | frame_height  | Height of frame in pixels. |
  23. --  | frame_width   | Width of frame in pixels.  |_____________________
  24. --  | frame_texture | "Path to the background texture for your frame." |
  25. --  | locked_frame  | Set to 'false' if you want your window draggable.|
  26. --  | "      "  | Set to 'true' to make the window unmoveable._____|
  27. --  | menu_height   | Height of dropdown box. |
  28. --  | menu_width    | Width of dropdown box   |____________________________________________________________
  29. --  | DropDownItems | {"Name Displayed", "Selection(ordered number)"}, 'Selection' being used for reference.|
  30. --  |_______________|_______________________________________________________________________________________|
  31.      
  32.     local frame_name = "Skill Advancement"
  33.     local frame_height = 300
  34.     local frame_width = 300
  35.     local frame_texture = "Interface/AchievementFrame/UI-Achievement-Parchment-Horizontal-Desaturated"
  36.     local locked_frame = false
  37.        
  38.     local menu_height = 40
  39.     local menu_width = 100
  40.  
  41.     Liturgy.DropDownItems =
  42.     {
  43.         {"Holy Bonds", "Selection1"},
  44.         {"Smite", "Selection2"}
  45.     }
  46.     --[[Frame Rendering]]--
  47.     local YOffset = 320
  48.     local Frame = CreateFrame(Liturgy.Prefix.."MainFrame")
  49.     Frame:SetText(frame_name)
  50.     Frame:SetCantMove(locked_frame)
  51.     Frame:SetHeight(frame_height)
  52.     Frame:SetWidth(frame_width)
  53.     Frame:SetTexture(frame_texture)
  54.  
  55.     --[[DropDownMenu and DropDownItem Rendering]]--
  56.     local menu = Frame:CreateDropDownMenu("Choose Skill")
  57.     menu:SetHeight(menu_height)
  58.     menu:SetWidth(menu_width)
  59.     for k, v in pairs(Liturgy.DropDownItems) do
  60.     menu:SetDropDownItem(v[1])
  61.     player:SendBroadcastMessage("Loaded "..v[1].."")
  62.     end
  63. Frame:Send(player)
  64. end
  65.  
  66. RegisterPlayerEvent(5, liturgy_menu)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement