Thread Tools Display Modes
05-14-14, 03:46 PM   #1
WhiteWolf87
A Deviate Faerie Dragon
 
WhiteWolf87's Avatar
AddOn Compiler - Click to view compilations
Join Date: Dec 2013
Posts: 16
Issues creating an install window

I am trying to create an install window for my addon compilation. The install window works fine, but after the reload, there should be an art frame at the bottom of the screen.

Note: This installer is not quite finish by any means, I am working on one bit of it at a time.
Attached Files
File Type: zip LCI_1.03a.zip (1.41 MB, 170 views)

Last edited by WhiteWolf87 : 05-14-14 at 07:03 PM. Reason: updated to current issue
  Reply With Quote
05-14-14, 04:06 PM   #2
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
You don't have access to any file system functions in WoW's Lua. The only way to load code on demand is to use load on demand addons.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
05-14-14, 04:33 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You should probably take a look at the Things Addons/Macros Can't Do sticky thread. Addons cannot access anything -- files, system functions, network connections, etc. -- outside of the in-game UI sandbox.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
05-14-14, 06:28 PM   #4
WhiteWolf87
A Deviate Faerie Dragon
 
WhiteWolf87's Avatar
AddOn Compiler - Click to view compilations
Join Date: Dec 2013
Posts: 16
Originally Posted by Phanx View Post
You should probably take a look at the Things Addons/Macros Can't Do sticky thread. Addons cannot access anything -- files, system functions, network connections, etc. -- outside of the in-game UI sandbox.
Yea, I've read this. I was merely trying to run code that is within the same folder. When I tried to do it as a function it merely it didn't stick when i reloaded the UI.
  Reply With Quote
05-14-14, 06:43 PM   #5
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Ah, you are misinterpreting the WoW interpreter; most of the Lua syntax simply does not exist, and thus cannot execute.

In Warcraft, there are no APIs to access the hard drive, for example, and so calling said APIs results in nil value errors.

When Phanx linked the cannot do list, it is exactly as she says: you cannot do these things. At all. Ever. Zero possible ways to accomplish them.

Blizzard removed all such APIs from their Lua environment.

Hopefully that is more clear.
  Reply With Quote
05-14-14, 06:44 PM   #6
WhiteWolf87
A Deviate Faerie Dragon
 
WhiteWolf87's Avatar
AddOn Compiler - Click to view compilations
Join Date: Dec 2013
Posts: 16
Originally Posted by myrroddin View Post
Ah, you are misinterpreting the WoW interpreter; most of the Lua syntax simply does not exist, and thus cannot execute.

In Warcraft, there are no APIs to access the hard drive, for example, and so calling said APIs results in nil value errors.

When Phanx linked the cannot do list, it is exactly as she says: you cannot do these things. At all. Ever. Zero possible ways to accomplish them.

Blizzard removed all such APIs from their Lua environment.

Hopefully that is more clear.
Yes, I understand now. Thanks.
  Reply With Quote
05-14-14, 06:46 PM   #7
WhiteWolf87
A Deviate Faerie Dragon
 
WhiteWolf87's Avatar
AddOn Compiler - Click to view compilations
Join Date: Dec 2013
Posts: 16
Re-uploaded the addon and changed first post to reflect my issue.
  Reply With Quote
05-14-14, 06:47 PM   #8
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
As a follow up, since I didn't look at your code, it is possible to have an install screen for AddOns. Several full UI suites use them, and there may be other types.

It is all about how you code. You could take a look at ElvUI/TukUI.
  Reply With Quote
05-14-14, 07:04 PM   #9
WhiteWolf87
A Deviate Faerie Dragon
 
WhiteWolf87's Avatar
AddOn Compiler - Click to view compilations
Join Date: Dec 2013
Posts: 16
I got the installer to work, but after it reloads the UI it doesn't show the art frame at the bottom.
  Reply With Quote
05-14-14, 07:04 PM   #10
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
For a more straightforward example that also doesn't require wading through a poorly designed third-party site to find a download, look at the first-time setup dialogs in Mayron UI.

You need to use saved variables to keep track of whether the user has already installed your UI, and if there are options (eg. which art frame to show) to keep track of those as well. When your addon loads, check your saved variables to see whether you should show the install dialog or create the art frame, and then do that.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
05-14-14, 08:01 PM   #11
kurapica.igas
A Chromatic Dragonspawn
Join Date: Aug 2011
Posts: 152
Lua Code:
  1. -- LCIres["Res1"] always be false when you reload ui for those code:
  2. if type(LCIres) ~= "table" then
  3.     LCIres = {}
  4.     LCIres["Res1"] = false
  5. else
  6.     if LCIres["Res1"] == true then
  7.            -- skip
  8.         end
  9. end

When you reload the ui, the LCIres won't be existed in the _G, so you need put the LCIres in saved variables and check it when your add-on is loaded.
  Reply With Quote
05-14-14, 10:13 PM   #12
WhiteWolf87
A Deviate Faerie Dragon
 
WhiteWolf87's Avatar
AddOn Compiler - Click to view compilations
Join Date: Dec 2013
Posts: 16
Originally Posted by kurapica.igas View Post
Lua Code:
  1. -- LCIres["Res1"] always be false when you reload ui for those code:
  2. if type(LCIres) ~= "table" then
  3.     LCIres = {}
  4.     LCIres["Res1"] = false
  5. else
  6.     if LCIres["Res1"] == true then
  7.            -- skip
  8.         end
  9. end

When you reload the ui, the LCIres won't be existed in the _G, so you need put the LCIres in saved variables and check it when your add-on is loaded.
Ah, can't believe I missed that! Thank you so much got it to work now :P
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Issues creating an install window

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