Config.lua to ingame GUI?
Ok so I have been trying for weeks to make a in game GUI with no luck. I was hopping to do this just with lua code and no libs.
I tried looking into doing it with Ace3 but I can't understand all that has to be done and were to place the code. I added my SavedVariables field to my TOC, put all my settings into a single table. That's as far as I can get with out then getting completely lost. Her is all of my code. http://www.wowace.com/paste/3767/ O also when using Ace3 were do I put the files and which ones do I use, or do I just place the whole Ace3 file in the addons? |
So i finely got the GUI to show up but im getting lots of errors.
Code:
Message: Interface\AddOns\Tweaks\Core.lua:536: attempt to index upvalue 'db' (a nil value) http://www.wowace.com/paste/3784/ |
First, I don't see you declaring your addon at the very top in Ace fashion. Ie:
Core.lua Code:
local MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") Code:
local MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") For getting DB, you'll want to put this line in: Code:
self.db = LibStub("AceDB-3.0"):New("MyAddonDB", defaults, "Default") To get the DB into a variable, something like this in a MyAddon:Anything() function. Code:
db = self.db.profile Quote:
|
Here's some quick examples of a basic Ace addon. You can install Ace3 components under MyAddon\libs\
MyAddon.toc Embeds.xml Core.lua Config.lua |
First thank you for your help, I got the options to show up now and there are no errors. :D
Now I'm trying to set up all the functions and I'm having some problems. :confused:
Core.lua Code:
local defaults = { Code:
MAB = {
Core.lua Code:
function Style(self) Code:
HideMacronames = { |
Quote:
Post from wowace.com Quote:
Hope this helps ya. Coke |
I to have not played wow in two weeks been like you say obsessed with my coding
I have been looking at your stuff on the WowAce Forums. But yours is so so so much bigger then mine that i get lost in your code. Also you don't have any gui command for positions. |
Woot figured out how to change position of bar.
Config.lua Code:
offsetX = { Code:
local defaults = { |
Another problem I just noticed is when I do a reload it is resenting all options to default.
Config.lua Code:
function MyAddon:ConfigRefresh() Code:
function MyAddon:UpdateStuff() |
I would have given you permission to use my code had you asked...
|
Quote:
|
Quote:
|
Quote:
|
If your game installation is in the program files folder then try running with administrator rights.
I apologise if this has already been suggested and tried without success. |
Quote:
So any way, question. I still cant get the option for hide/show micro names to work. Config.lua Code:
HideMacronames = { Code:
function Style(self) |
Ah yes, each addon needs a unique name. If you want to use a TestAddon temporary folder for one you are working on then you would have to make sure that the old wtf file for that last addon you used it with has been deleted so as to not confuse things. I usually just create a new folder with a new name and rename it later if I needed to.
As to it not seeming to work do a test printout of the values. If the values are stored as "1" and "0" for one reason or another the test of if x then .. will not work if I remember rightly. try doing the following before the if statements. Quote:
|
Quote:
|
Quote:
The thing is it works fine if i do it manually in the default config but it dos nothing in the gui. Config.lua Code:
HideMacronames = { Code:
local defaults = { |
Ok well I'm confused. :confused: The option to show or hide micro names from the gui is working but only if i do a reload after selecting it in the gui.
|
Quote:
Code:
function UpdateActionButtonStyle() |
All times are GMT -6. The time now is 01:15 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI