Code:
-- Create context for UIFrames
local context = UI.CreateContext("Onebag")
local Onebagwindow = UI.CreateFrame("RiftWindow", "Onebag", context)
-- Context and Resolution Control --
local Onebag.Context = UI.CreateContext("OnebagContext")
local Onebag.Context:SetPoint("TOPLEFT", UIParent, "TOPLEFT")
local Onebag.Context:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT")
-- Sets frame position and size
local function init()
Onebagwindow:SetVisible(True)
Onebagwindow:SetWidth(800)
Onebagwindow:SetHeight(600)
Onebagwindow:SetPoint("CENTER", UIParent, "CENTER")
Onebagwindow:SetTitle("Onebag")
Onebagwindow:SetLayer(1)
end
-- Shows the window
local function showOnebag()
Onebagwindow:SetVisible(true)
end
table.insert (Command.Slash.Register("Onebag"), {showOnebag, "OneBag", "Slash command"})
init()
Add init() to start the function, I have a similar code that I can give to you to use for a template. The code I have has a button added to the bag window. You can't put items in the bag yet, but I think I read something about it being added on pts 1.6