Reply
Thread Tools Display Modes
Unread 10-19-11, 03:18 PM   #1
Rithious
Zombie
 
Rithious's Avatar
Join Date: Oct 2011
Posts: 4
Having problems

I have been trying a 1 bag thing and this is what i have but im having problems getting it to work right. I am new to all this so i have just been looking at other stuff trying to figure it all out. And yes once its all done i will have the appropriate rights to whoms addons i have been looking at and working off of. Any comments or tips please PM me. Thanks

-- 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"})
__________________
Rithious is offline   Reply With Quote
Unread 10-19-11, 07:19 PM   #2
Aieny
Veiled Ripper
 
Aieny's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 40
Wink

You only need to create one context. Also, you can't define points in a context, it is simply a wrapper for your frames.
__________________
Lua Code:
  1. local function signature()
  2.     print("Aieny Celenovia")
  3.     print("www.riftcrafter.com")
  4. end
Aieny is offline   Reply With Quote
Unread 10-26-11, 06:00 PM   #3
Lildry
Claw of Regulos
Join Date: Oct 2011
Posts: 13
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
Lildry is offline   Reply With Quote
Reply

Go BackRiftui » Developer Discussions » General Authoring Discussion » Having problems

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off