Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.79 KB | None | 0 0
  1. --------------------------
  2. --[[    Namespace   ]]
  3. --------------------------
  4. local Name=...;
  5. local Title=select(2,GetAddOnInfo(Name)):gsub("%s*v?[%d%.]+$","");
  6. local Version=GetAddOnMetadata(Name,"Version");
  7. local Author=GetAddOnMetadata(Name,"Author");
  8.  
  9.  
  10. --------------------------
  11. --[[    Options Panel   ]]
  12. --------------------------
  13. local Panel=CreateFrame("Frame"); do
  14.     Panel.name=Title;
  15.     InterfaceOptions_AddCategory(Panel);--  Panel Registration
  16.  
  17.     do  local title=Panel:CreateFontString(nil,"OVERLAY","GameFontNormalLarge");
  18.         title:SetPoint("TOP",0,-12);
  19.         title:SetText(Title);
  20.  
  21.         local author=Panel:CreateFontString(nil,"OVERLAY","GameFontNormalSmall");
  22.         author:SetPoint("TOP",title,"BOTTOM",0,0);
  23.         author:SetTextColor(1,0.5,0.25);
  24.         author:SetText("by "..Author);
  25.  
  26.         local ver=Panel:CreateFontString(nil,"OVERLAY","GameFontNormalSmall");
  27.         ver:SetPoint("TOPLEFT",title,"TOPRIGHT",4,0);
  28.         ver:SetTextColor(0.5,0.5,0.5);
  29.         ver:SetText("v"..Version);
  30.  
  31.         local eb = CreateFrame("EditBox", nil, Panel, "InputBoxTemplate");
  32.         eb:SetSize(300,300);
  33.         eb:SetAutoFocus(false);
  34.         eb:SetFontObject("ChatFontNormal");
  35.         eb:SetPoint("TOPLEFT", 30, -30);
  36.         eb:SetText("Test");
  37.  
  38.     end
  39. end
  40.  
  41. --------------------------
  42. --[[    Load Saved Data    ]]
  43. --------------------------
  44. Panel:RegisterEvent("ADDON_LOADED"); -- Fired when saved variables are loaded
  45.  
  46. function Panel:OnEvent(event, arg1)
  47.     if event == "ADDON_LOADED" and arg1 == "TFTB_EMOTE" then
  48.      -- Our saved variable is ready at this point. If there is none, variable will set to nil.
  49.         if TFTB_EMOTE == nil then
  50.             TFTB_EMOTE = "cry"; -- This is the first time this addon is loaded; initialize with default.
  51.         end
  52.     end
  53. end
  54.  
  55. Panel:SetScript("OnEvent", Panel.OnEvent);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement