Skip to content

Instantly share code, notes, and snippets.

@kinnou02
Created May 20, 2017 18:51
Show Gist options
  • Save kinnou02/e3e276a0f75763c2081c15591b2375fe to your computer and use it in GitHub Desktop.
Save kinnou02/e3e276a0f75763c2081c15591b2375fe to your computer and use it in GitHub Desktop.
test = {}
local context = UI.CreateContext("main")
local window = UI.CreateFrame("SimpleWindow", "window", context)
local inviteButton = UI.CreateFrame("RiftButton", "LuaPadloadButton", window)
-- Addon initialisation
local function init()
context:SetSecureMode("restricted")
window:SetSecureMode("restricted")
inviteButton:SetSecureMode("restricted")
window:SetVisible(false)
window:SetWidth(840)
window:SetHeight(600)
window:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 100, 100)
window:SetTitle("test")
window:SetLayer(1)
window:SetAlpha(0.8)
inviteButton:SetText("Invite")
inviteButton:SetPoint("BOTTOMRIGHT", window, "BOTTOMRIGHT", -194, -20)
inviteButton:SetWidth(100)
inviteButton:SetLayer(2)
end
-- display LuaPad
local function showTest()
window:SetVisible(true)
dump(context:GetSecureMode())
dump(window:GetSecureMode())
dump(inviteButton:GetSecureMode())
inviteButton:EventMacroSet(Event.UI.Input.Mouse.Left.Click, "/i Ranadyla")
end
-- Register the slash commands
table.insert(Command.Slash.Register("showtest"), {showTest, "test", "Slash command"})
-- initialisation
init()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment