I wonder if anyone can help me here. i'm trying to setup a custom UI that involves Bartender4 and i came across an addon called SpartenUI and in that it setups a custom Profile and wonder if anyone can tell me how this does that as i want to setup an LUA addon that automaticly does that as a few friends like my UI and want a copy of the pack but dont want to manualy set it up for each char. can anyone help me here.
In order to "automatically" set up profiles for someone else, you can either:
1) Make sure your Bartender4 profile is named "Default", and then just provide your saved variables. When the user logs in for the first time, they will get the "Default" profile by default. (This assumes that Bartender4 doesn't default to character-specific profiles; I don't use it, so I don't know.) The advantage of this method is that it doesn't require any programming on your part. The disadvantage is that the user must manually copy files into the correct directories.
2) Write a custom addon that contains a table with your Bartender4 profile, and upon loading, have it copy that data into the Bartender4 saved variables table and call whatever functions are necessary for Bartender4 to update itself. It should also have its own saved variables to remember that it's made the copy, so it doesn't re-copy on every load and override any changes the user might make on their own. The advantage of this method is that you don't have to include any saved variables or other files that don't go in the AddOns directory. The disadvantage is, obviously, complexity and having to program it.
To expand on Phanx's #1, you don't *have* to have your settings saved to the default profile - just that doing so makes it easier on the person getting your settings. If not the default, then just instruct them to select the correct profile in the Bartender options.
I don't, since I dislike the concept of premade UIs and will never distribute them, but something along these lines:
if not SETUP_BARTENDER then
Bartender4.db.profile = {
-- your settings here
}
Bartender4:UpdateAll()
SETUP_BARTENDER = true
end
Pretty simple. As I don't use BT4, I don't know what the correct path to its profile is, and I don't know the correct function(s) to call to apply the new settings, so you'll have to figure those out yourself. You should save SETUP_BARTENDER in your custom addon's saved variables. If you need more help, there are dozens of WoW addon and general Lua tutorials out there.
I wonder if anyone can help me here. i'm trying to setup a custom UI that involves Bartender4 and i came across an addon called SpartenUI and in that it setups a custom Profile and wonder if anyone can tell me how this does that as i want to setup an LUA addon that automaticly does that as a few friends like my UI and want a copy of the pack but dont want to manualy set it up for each char. can anyone help me here.
Cheers
Nog
1) Make sure your Bartender4 profile is named "Default", and then just provide your saved variables. When the user logs in for the first time, they will get the "Default" profile by default. (This assumes that Bartender4 doesn't default to character-specific profiles; I don't use it, so I don't know.) The advantage of this method is that it doesn't require any programming on your part. The disadvantage is that the user must manually copy files into the correct directories.
2) Write a custom addon that contains a table with your Bartender4 profile, and upon loading, have it copy that data into the Bartender4 saved variables table and call whatever functions are necessary for Bartender4 to update itself. It should also have its own saved variables to remember that it's made the copy, so it doesn't re-copy on every load and override any changes the user might make on their own. The advantage of this method is that you don't have to include any saved variables or other files that don't go in the AddOns directory. The disadvantage is, obviously, complexity and having to program it.
thanks for the replys tho. :)
Pretty simple. As I don't use BT4, I don't know what the correct path to its profile is, and I don't know the correct function(s) to call to apply the new settings, so you'll have to figure those out yourself. You should save SETUP_BARTENDER in your custom addon's saved variables. If you need more help, there are dozens of WoW addon and general Lua tutorials out there.