Thread Tools Display Modes
05-28-06, 11:11 PM   #1
HiroCT
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 8
FuBar - Getting options to save on a plugin

Alright, I am hoping you guys can help with this as I have hit a brick wall.

I'm building an add-on for the FuBar Panel that is a plugin for WhisperCast. It works, but I have options to Hide Label and Hide Icon, however doing a /console reloadui or re-logging and those options reset.

I'm basically having issues getting those two options to save, that's it.

Any insight you can help me with? I've taken a look at FuBar_RegenFu and FuBar_LootTyFu for ideas but I just can't seem to find out where the commands are to cause it to save to the SavedVariables file.

Thanks for any help in advance,
Hiro
  Reply With Quote
05-28-06, 11:53 PM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You aren't creating an AceDB on the same variable as the toc has specified.
The toc: FuBar_WhisperCastDB
The lua: FuBar_WhisperCastFuDB
  Reply With Quote
05-28-06, 11:55 PM   #3
chuckg
A Fallenroot Satyr
 
chuckg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 26
I think I can I think I can

In your declaration of the plugin,

Code:
PluginNameFu = FuBarPlugin:GetInstance("1.2"):new({
      (declaration stuff)

      defaults = {
            variableName = someSetting,
            someArray = {}
      }
}

self.data.variableName = newSetting
table.insert(self.data.someArray, someValue)
That should also save your settings based on the active profile, at least that's how I handle it. If you're really interested in how it's done, you can probably just checkout the WoWAce usage manual to get further details, since FuBar is just built on top of Ace: http://wowace.com/?page=usage

I hope that helps.

edit: Fixed.

Last edited by chuckg : 05-29-06 at 07:22 PM. Reason: Typo
  Reply With Quote
05-29-06, 08:47 AM   #4
HiroCT
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 8
Thanks for the help guys, I got it fixed.

The issue was in the .toc the SV name was "Fubar_WhisperCastDB" but in the LUA it was "FuBar_WhisperCastFuDB"

Just a typo with the naming convention fixed it.
  Reply With Quote
05-29-06, 06:55 PM   #5
ckknight
A Warpwood Thunder Caller
 
ckknight's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 90
Please do not follow chuckg's code example, it's flawed in FuBar's case.

FuBar doesn't take much credence towards Ace's DB system, it handles its data through self.data, self.charData, self.realmData, etc. See the API documentation for more specifics.
  Reply With Quote
05-29-06, 07:21 PM   #6
chuckg
A Fallenroot Satyr
 
chuckg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 26
Originally Posted by ckknight
Please do not follow chuckg's code example, it's flawed in FuBar's case.

FuBar doesn't take much credence towards Ace's DB system, it handles its data through self.data, self.charData, self.realmData, etc. See the API documentation for more specifics.
Whoops, you're right. I use self.data in my own mods for FuBar; not sure why I did an example with self.db!
  Reply With Quote
05-29-06, 08:05 PM   #7
brotherhobbes
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 313
If your addon has an icon, there will be an option to hide label or hide the icon.
If your addon does not have an icon, these options will not exist.

These are default options available to all FuBar addons, you do not need to add them.
  Reply With Quote
05-30-06, 12:49 AM   #8
ckknight
A Warpwood Thunder Caller
 
ckknight's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 90
I also recommend you steal your ideas from the addons that I have written instead of from a third party.

Not to say that they are necessarily bad, but mine are pretty much correct in almost all cases, cause I'm intimately comfortable with the API.
  Reply With Quote
05-30-06, 07:19 PM   #9
HiroCT
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 8
Well, next issue I guess.

I'm trying to update the API to 1.2 and I'm having issues getting the OnUpdate to work. Any recommendations?

Here's what I have so far.

http://www.corsec.org/files/FuBar_Wh...stFu-mark4.zip

Edit: Also, I took a look at the 1.2 example and went to the OnUpdate function and added the following line:

Code:
DEFAULT_CHAT_FRAME:AddMessage("test");
So even using the example as a base, I was unable to get this working. Also worth noting is that the tablet portion does not need to work in the 1.2 example besides the hint code.

Last edited by HiroCT : 05-30-06 at 07:26 PM.
  Reply With Quote
05-30-06, 07:37 PM   #10
brotherhobbes
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 313
this part in the 1.2 example is extremely out-dated and needs to be removed. i keep forgetting to post it in the bug list. i'll go do it now.
Code:
OnUpdate = function(self, t)
	-- this is run once every `self.updateTime` seconds.
	self:Update()
end
somewhere in the 1.0 to 1.2 notes, it says that the OnUpdate function has been removed from our use in 1.2. instead you use metrognome.

example:

Code:
local metro = Metrognome:GetInstance('1')

function AddonName:Enable()
	metro:Register(self.name, self.Update, 1, self)
	metro:Start(self.name)
end

function AddonName:Disable()
	metro:Unregister(self.name)
end
  Reply With Quote
05-30-06, 09:54 PM   #11
HiroCT
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 8
I appreciate all the help guys, thank you.
  Reply With Quote
06-04-06, 09:12 PM   #12
Global
A Flamescale Wyrmkin
 
Global's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2005
Posts: 95
I've been helping Hiro with this mod a little bit and while he was away this weekend I started adding the WhisperCast menu into the mod. I finished everything except the disabled spells menu which I've had practically zero luck with. I commented the sections I was having issues with (just go to the bottom of the menu code). If someone who knows Dewdrop a bit better wouldn't mind helping, that would be great. The file can be found here:

http://www.g-ball.com/wow/ui/other/F....03_Beta_1.zip

I feel like I'm just one variable off or something so hopefully it should be pretty easy. If this thread draws the attention of ckknight again I could hound you for some advice for ScaleFu regarding the slider as well
  Reply With Quote
06-10-06, 11:04 AM   #13
HiroCT
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 8
Still have been unable to get the Disabled Spells portion of the Menu plugged in to this mod and I'm hoping someone has some time to assist Global and I with the Dewdrop library.

Any takers?
  Reply With Quote
07-09-06, 08:00 AM   #14
HiroCT
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 8
Anyone out there good enough with Dewdrop that they could spare a few mins to answer some questions for me?
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » FuBar - Getting options to save on a plugin


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