10-18-11, 07:26 PM | #1 |
Riftwindow problem
Code:
print ("LilBag is loaded") -- Create context for UIFrames local context = UI.CreateContext("Lilbag") local lilbagwindow = UI.CreateFrame("RiftWindow", "LilBag", context) -- Sets frame position and size local function init() lilbagwindow:SetVisible(false) lilbagwindow:SetWidth(800) lilbagwindow:SetHeight(600) lilbagwindow:SetPoint("CENTER", UIParent, "CENTER") lilbagwindow:SetTitle("Lilbag") lilbagwindow:SetLayer(1) end -- Shows the window local function showlilbag() lilbagwindow:SetVisible(true) end table.insert (Command.Slash.Register("lilbag"), {showlilbag, "LilBag", "Slash command"}) local function init() lilbagwindow:SetVisible(false) would make the window closed when rift starts up and then I would open it with the slash command. Anyone see what my problem is? Note: I am using the code for LuaPad as a learning tool. |
|
10-18-11, 08:06 PM | #2 |
When is init() being called?
|
|
10-18-11, 10:13 PM | #3 |
10-19-11, 07:23 AM | #4 |
I would replace local function init() with a do/end. But that's only if you need something like that; I ask because everything you have in init() can be put in the main chunk, right after creating the context and frame.
Further, and you probably have already thought of this, but you want an if/then statement checking the window's visibility. If false, show it, if true, hide it. Put that check in your slash command function. |
|
10-22-11, 11:21 AM | #5 | |
Quote:
thanks for the feedback Lildry |
||
10-23-11, 02:58 AM | #6 |
Since no addon is a national secret, you could put your entire code on pastebin.com and provide the link. That way, we can look over it and provide further, more accurate, help.
Good job being willing to learn, and good luck with your addon! |
|
10-26-11, 09:58 PM | #7 |
I think the work that everyone does here at riftui is by far greater than anything I hope to develop. Lets just say My Work <<<<< your work and this makes me shy about shareing. But I am getting there. What about dropbox? I have droped a few version of my work there and shared with ingame friends that think they can help but none of them have experience with Lua, only C++.
|
|
10-26-11, 11:36 PM | #8 |
Don't worry about feeling inferior. I felt like that a month ago but after way too many hours of tinkering I'm starting to get a hang of things.
|
|
10-27-11, 01:14 AM | #9 | |
Quote:
First time using pastebin so here it is hope this works the way I believe it will work. I added a bunch of notes, more for myself then for anyone who views it. Note: this is for RiftLoot the completed project would look similar to runecraft helper. Last edited by Lildry : 10-27-11 at 01:20 AM. |
||
Riftui » Developer Discussions » General Authoring Discussion » Riftwindow problem |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|