Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------
- --[[ Namespace ]]
- --------------------------
- local Name=...;
- local Title=select(2,GetAddOnInfo(Name)):gsub("%s*v?[%d%.]+$","");
- local Version=GetAddOnMetadata(Name,"Version");
- local Author=GetAddOnMetadata(Name,"Author");
- --------------------------
- --[[ Options Panel ]]
- --------------------------
- local Panel=CreateFrame("Frame"); do
- Panel.name=Title;
- InterfaceOptions_AddCategory(Panel);-- Panel Registration
- do local title=Panel:CreateFontString(nil,"OVERLAY","GameFontNormalLarge");
- title:SetPoint("TOP",0,-12);
- title:SetText(Title);
- local author=Panel:CreateFontString(nil,"OVERLAY","GameFontNormalSmall");
- author:SetPoint("TOP",title,"BOTTOM",0,0);
- author:SetTextColor(1,0.5,0.25);
- author:SetText("by "..Author);
- local ver=Panel:CreateFontString(nil,"OVERLAY","GameFontNormalSmall");
- ver:SetPoint("TOPLEFT",title,"TOPRIGHT",4,0);
- ver:SetTextColor(0.5,0.5,0.5);
- ver:SetText("v"..Version);
- local eb = CreateFrame("EditBox", nil, Panel, "InputBoxTemplate");
- eb:SetSize(300,300);
- eb:SetAutoFocus(false);
- eb:SetFontObject("ChatFontNormal");
- eb:SetPoint("TOPLEFT", 30, -30);
- eb:SetText("Test");
- end
- end
- --------------------------
- --[[ Load Saved Data ]]
- --------------------------
- Panel:RegisterEvent("ADDON_LOADED"); -- Fired when saved variables are loaded
- function Panel:OnEvent(event, arg1)
- if event == "ADDON_LOADED" and arg1 == "TFTB_EMOTE" then
- -- Our saved variable is ready at this point. If there is none, variable will set to nil.
- if TFTB_EMOTE == nil then
- TFTB_EMOTE = "cry"; -- This is the first time this addon is loaded; initialize with default.
- end
- end
- end
- Panel:SetScript("OnEvent", Panel.OnEvent);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement