Loading...

Addon Profiles

#1
So ran into an issue with loading my predefined addon profiles. Some work fine because they just use a global profile and those I can load easily.

The ones in having issue with are addons that save profiles under your character/server name. Once your in game you can change it, but I do not know that part. Even after trying to load it via function and copy paste saved variables method. You still have to manually go through addons and choose the correct profile.

So how can I force load OrkoUI profile in that case?
“Do not go where the path may lead, go instead where there is no path -- and leave a trail.”

OrkoUI - Currently Under Construction

Addon Profiles

#2
I'm thinking the only way you can do that is by looking at how the specific addon handles profile changes, and then use that method. For example, if an addon has a specific function to create a new profile and apply certain settings, then you would call that method and modify the returned object if needed.

For DBM for example, I'm doing this:

Code: Select all

if IsAddOnLoaded('DBM-Core') then
	--Use the profile creation method built into DBM. Saves me from copying redundant data.
	DBM:CreateProfile('CodeNameBlaze')

	--DBM Settings
	DBM_AllSavedOptions['CodeNameBlaze']['InfoFramePoint'] = 'RIGHT'
	DBM_AllSavedOptions['CodeNameBlaze']['InfoFrameX'] = -123
	DBM_AllSavedOptions['CodeNameBlaze']['InfoFrameY'] = -120
	
	-- the rest of the settings here ...
end
Any addon that uses profiles will have to have a way to change it. As long as that function is accessible outside the addon itself, then you will be able to use it to your needs.
ElvUI: Request Feature | Report Bug

My replies might be short sometimes due to time constraints. Nothing personal.

Addon Profiles

#3
Thanks again Blazeflack for the great info! Will work on it today and see if I can get it to work.
“Do not go where the path may lead, go instead where there is no path -- and leave a trail.”

OrkoUI - Currently Under Construction

Addon Profiles

#4
You can do that by 3 ways:
1. If you know how an addon handle profiles, just like Blaze said
example of DBM:

Code: Select all

DBM:CreateProfile('profilenamehere') -- to creat a profile
DBM:ApplyProfile('profilenamehere') -- to apply the profile created
example of Details:

Code: Select all

_detalhes:ApplyProfile('profilenamehere') -- to apply the profile you specified
So this change from addon to addon.

2. For addons that loads a 'Default' profile by default, you can just name your profile setting [Default] and it will work

3. For addons that use Ace3.0 to handle profiles, like Gladius, add this to the buttom of the function that set addons profiles in your code, just before the 'end' command:

Code: Select all

local db = LibStub("AceDB-3.0"):New(NameOfTheAddonDBHere, nil, true)
db:SetProfile("profilenamehere")
replace NameOfTheAddonDBHere with the DB of your addon, and profilenamehere with your profile.
Hope it helps

PS: I have absolutely zero knowledge in Lua, i just firgured it out for my ElvUI Edit by reading and understanding others code.
GENN UI An ElvUI Edit.

Who is online

Users browsing this forum: No registered users and 1 guest