code cleanup (settings menu completely redone)

Kith [02-16-16 - 10:18]
code cleanup (settings menu completely redone)

removed LAM-fontblock control

fixed error in cyrodiil (attribute fade config)
Filename
ActionBar.lua
Azurah.txt
Bossbar.lua
Core.lua
Defaults.lua
ExperienceBar.lua
Locales/Local_en.lua
Mover.lua
Player.lua
Settings.lua
Target.lua
Unlock.lua
diff --git a/ActionBar.lua b/ActionBar.lua
index b8c98e3..2d9cf68 100644
--- a/ActionBar.lua
+++ b/ActionBar.lua
@@ -1,5 +1,5 @@
-local Azurah = _G['Azurah'] -- grab addon table from global
-local LMP = LibStub('LibMediaProvider-1.0')
+local Azurah		= _G['Azurah'] -- grab addon table from global
+local LMP			= LibStub('LibMediaProvider-1.0')

 -- UPVALUES --
 local POWERTYPE_ULTIMATE	= POWERTYPE_ULTIMATE
@@ -94,6 +94,10 @@ function Azurah:ConfigureActionBarElements()
 	end
 end

+
+-- ------------------------
+-- INITIALIZATION
+-- ------------------------
 function Azurah:InitializeActionBar()
 	db = self.db.actionBar

@@ -104,7 +108,7 @@ function Azurah:InitializeActionBar()
 	-- set 'dummy' display function
 	FormatUlt			= ultFuncs[1]
 	FormatUltPercent	= ultPercentFuncs[2]
-
+
 	-- Fix for scaling issue
 	ActionButton8Decoration:SetAnchor(CENTER, ActionButton8, CENTER, 0, 0)

diff --git a/Azurah.txt b/Azurah.txt
index 6c88d0c..ed38f8b 100644
--- a/Azurah.txt
+++ b/Azurah.txt
@@ -1,12 +1,11 @@
-## Title: |c67b1e9A|c4779cezurah|r 2.11d
+## Title: |c67b1e9A|c4779cezurah|r
 ## Description: Enhances the default interface with additional overlay details and customization options while retaining the stock theme.
-## Version: 2.11d
+## Version: 2.2.0
 ## Author: Kith, |cEFEBBEGarkin|r, |c66ccffPhinix|r, |c68D2E8Sounomi|r
 ## APIVersion: 100013
 ## SavedVariables: AzurahDB
 ## OptionalDependsOn: LibAddonMenu-2.0 LibMediaProvider-1.0

-
 Lib/LibStub/LibStub.lua
 Lib/LibMediaProvider-1.0/LibMediaProvider-1.0.lua
 Lib/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
@@ -23,14 +22,15 @@ Lib/LibAddonMenu-2.0/controls/header.lua
 Lib/LibAddonMenu-2.0/controls/slider.lua
 Lib/LibAddonMenu-2.0/controls/texture.lua
 Lib/LibAddonMenu-2.0/controls/iconpicker.lua
-Lib/LAM-fontblock.lua

 Azurah.xml

 Locales\Local_en.lua
 Locales\Local_fr.lua

-Azurah.lua
+Defaults.lua
+
+Core.lua

 Mover.lua
 Unlock.lua
diff --git a/Bossbar.lua b/Bossbar.lua
index 6d1cef6..9f38d0d 100644
--- a/Bossbar.lua
+++ b/Bossbar.lua
@@ -1,10 +1,10 @@
-local Azurah = _G['Azurah'] -- grab addon table from global
-local LMP = LibStub('LibMediaProvider-1.0')
+local Azurah		= _G['Azurah'] -- grab addon table from global
+local LMP			= LibStub('LibMediaProvider-1.0')

 -- UPVALUES --
-local DoesUnitExist         = DoesUnitExist
-local GetUnitPower          = GetUnitPower
-local strformat             = string.format
+local DoesUnitExist	= DoesUnitExist
+local GetUnitPower	= GetUnitPower
+local strformat		= string.format

 local overlayBossbar
 local FormatBossbar
@@ -13,95 +13,99 @@ local bossUnitTags = {}
 local bossHealthValues = {}

 local function RefreshBossOverlay()
-    local totalHealth = 0
-    local totalMaxHealth = 0
+	local totalHealth		= 0
+	local totalMaxHealth	= 0

-    for unitTag, bossEntry in pairs(bossHealthValues) do
-        totalHealth = totalHealth + bossEntry.health
-        totalMaxHealth = totalMaxHealth + bossEntry.maxHealth
-    end
+	for unitTag, bossEntry in pairs(bossHealthValues) do
+		totalHealth = totalHealth + bossEntry.health
+		totalMaxHealth = totalMaxHealth + bossEntry.maxHealth
+	end

-    overlayBossbar:SetText(FormatBossbar(totalHealth, totalMaxHealth, totalMaxHealth))
+	overlayBossbar:SetText(FormatBossbar(totalHealth, totalMaxHealth, totalMaxHealth))
 end

 local function RefreshBossHealth(unitTag)
-    local health, maxHealth = GetUnitPower(unitTag, POWERTYPE_HEALTH)
-    local bossEntry = bossHealthValues[unitTag]
-    bossEntry.health = health
-    bossEntry.maxHealth = maxHealth
+	local health, maxHealth = GetUnitPower(unitTag, POWERTYPE_HEALTH)
+	local bossEntry = bossHealthValues[unitTag]
+	bossEntry.health = health
+	bossEntry.maxHealth = maxHealth
 end

 local function AddBoss(unitTag)
-    bossHealthValues[unitTag] = {}
-    RefreshBossHealth(unitTag)
+	bossHealthValues[unitTag] = {}
+	RefreshBossHealth(unitTag)
 end

 local function RefreshAllBosses()
-    --if there are multiple bosses and one of them dies and despawns in the middle of the fight we
-    --still want to show them as part of the boss bar (otherwise it will reset to 100%).
-    local currentBossCount = 0
-    for unitTag in pairs(bossUnitTags) do
-        if(DoesUnitExist(unitTag)) then
-            AddBoss(unitTag)
-            currentBossCount = currentBossCount + 1
-        end
-    end
-
-    --if there are no bosses left it's safe to reset everything
-    if(currentBossCount == 0 and next(bossHealthValues) ~= nil) then
-        bossHealthValues = {}
-    end
-
-    RefreshBossOverlay()
+	--if there are multiple bosses and one of them dies and despawns in the middle of the fight we
+	--still want to show them as part of the boss bar (otherwise it will reset to 100%).
+	local currentBossCount = 0
+	for unitTag in pairs(bossUnitTags) do
+		if (DoesUnitExist(unitTag)) then
+			AddBoss(unitTag)
+			currentBossCount = currentBossCount + 1
+		end
+	end
+
+	--if there are no bosses left it's safe to reset everything
+	if (currentBossCount == 0 and next(bossHealthValues) ~= nil) then
+		bossHealthValues = {}
+	end
+
+	RefreshBossOverlay()
 end

 local function OnPowerUpdate(_, unitTag, _, powerType)
-    if (bossUnitTags[unitTag] and powerType == POWERTYPE_HEALTH) then
-        RefreshBossHealth(unitTag)
-        RefreshBossOverlay()
-    end
+	if (bossUnitTags[unitTag] and powerType == POWERTYPE_HEALTH) then
+		RefreshBossHealth(unitTag)
+		RefreshBossOverlay()
+	end
 end

 function Azurah:ConfigureBossbarOverlay()
-    if (not IsInGamepadPreferredMode() and db.overlay > 1) then -- showing overlay, enabled tracking
-        EVENT_MANAGER:RegisterForEvent(self.name .. 'Bossbar', EVENT_POWER_UPDATE, OnPowerUpdate)
-        EVENT_MANAGER:RegisterForEvent(self.name .. 'Bossbar', EVENT_BOSSES_CHANGED, RefreshAllBosses)
-        EVENT_MANAGER:RegisterForEvent(self.name .. 'Bossbar', EVENT_PLAYER_ACTIVATED, RefreshAllBosses)
-    else -- no overlay being shown, disable tracking
-        EVENT_MANAGER:UnregisterForEvent(self.name .. 'Bossbar', EVENT_POWER_UPDATE)
-        EVENT_MANAGER:UnregisterForEvent(self.name .. 'Bossbar', EVENT_BOSSES_CHANGED)
-        EVENT_MANAGER:UnregisterForEvent(self.name .. 'Bossbar', EVENT_PLAYER_ACTIVATED)
-    end
-
-    local fontStr, value, max, maxEff
-
-    if (db.overlay > 1 and not IsInGamepadPreferredMode()) then
-        fontStr = strformat('%s|%d|%s', LMP:Fetch('font', db.fontFace), db.fontSize, db.fontOutline)
-
-        overlayBossbar:SetFont(fontStr)
-        overlayBossbar:SetColor(db.fontColour.r, db.fontColour.g, db.fontColour.b, db.fontColour.a)
-        overlayBossbar:SetHidden(false)
-
-        FormatBossbar = self.overlayFuncs[db.overlay + ((db.overlayFancy) and 10 or 0)]
-
-        RefreshAllBosses()
-    else -- not showing
-        overlayBossbar:SetHidden(true)
-    end
+	if (not IsInGamepadPreferredMode() and db.overlay > 1) then -- showing overlay, enabled tracking
+		EVENT_MANAGER:RegisterForEvent(self.name .. 'Bossbar', EVENT_POWER_UPDATE,		OnPowerUpdate)
+		EVENT_MANAGER:RegisterForEvent(self.name .. 'Bossbar', EVENT_BOSSES_CHANGED,	RefreshAllBosses)
+		EVENT_MANAGER:RegisterForEvent(self.name .. 'Bossbar', EVENT_PLAYER_ACTIVATED,	RefreshAllBosses)
+	else -- no overlay being shown, disable tracking
+		EVENT_MANAGER:UnregisterForEvent(self.name .. 'Bossbar', EVENT_POWER_UPDATE)
+		EVENT_MANAGER:UnregisterForEvent(self.name .. 'Bossbar', EVENT_BOSSES_CHANGED)
+		EVENT_MANAGER:UnregisterForEvent(self.name .. 'Bossbar', EVENT_PLAYER_ACTIVATED)
+	end
+
+	local fontStr, value, max, maxEff
+
+	if (db.overlay > 1 and not IsInGamepadPreferredMode()) then
+		fontStr = strformat('%s|%d|%s', LMP:Fetch('font', db.fontFace), db.fontSize, db.fontOutline)
+
+		overlayBossbar:SetFont(fontStr)
+		overlayBossbar:SetColor(db.fontColour.r, db.fontColour.g, db.fontColour.b, db.fontColour.a)
+		overlayBossbar:SetHidden(false)
+
+		FormatBossbar = self.overlayFuncs[db.overlay + ((db.overlayFancy) and 10 or 0)]
+
+		RefreshAllBosses()
+	else -- not showing
+		overlayBossbar:SetHidden(true)
+	end
 end

+
+-- ------------------------
+-- INITIALIZATION
+-- ------------------------
 function Azurah:InitializeBossbar()
-    db = self.db.bossbar
+	db = self.db.bossbar

-    -- create overlay
-    overlayBossbar = self:CreateOverlay(ZO_BossBarHealth, CENTER, CENTER, 0, -0.5)
+	-- create overlay
+	overlayBossbar = self:CreateOverlay(ZO_BossBarHealth, CENTER, CENTER, 0, -0.5)

-    -- set 'dummy' display function
-    FormatTarget = self.overlayFuncs[1]
+	-- set 'dummy' display function
+	FormatTarget = self.overlayFuncs[1]

-    for i = 1, MAX_BOSSES do
-        bossUnitTags["boss"..i] = true
-    end
+	for i = 1, MAX_BOSSES do
+		bossUnitTags["boss"..i] = true
+	end

-    self:ConfigureBossbarOverlay()
-end
\ No newline at end of file
+	self:ConfigureBossbarOverlay()
+end
diff --git a/Core.lua b/Core.lua
new file mode 100644
index 0000000..093c175
--- /dev/null
+++ b/Core.lua
@@ -0,0 +1,164 @@
+--[[----------------------------------------------------------
+	Azurah - Interface Enhanced
+	----------------------------------------------------------
+	* An addon designed to allow for user customization of the
+	* stock interface with optional components to provide
+	* additional information while maintaining the stock feel.
+	*
+	* Version 2.2.0
+	* Kith, Garkin, Phinix, Sounomi
+	*
+	*
+]]--
+local Azurah				= _G['Azurah'] -- grab addon table from global
+local L						= Azurah:GetLocale()
+
+Azurah.name					= 'Azurah'
+Azurah.slash				= '/azurah'
+Azurah.version				= '2.2.0'
+Azurah.versionDB			= 2
+
+Azurah.movers				= {}
+Azurah.snapToGrid			= true
+Azurah.uiUnlocked			= false
+
+
+-- ------------------------
+-- ADDON INITIALIZATION
+-- ------------------------
+function Azurah.OnInitialize(code, addon)
+	if (addon ~= Azurah.name) then return end
+
+	local self = Azurah
+
+	EVENT_MANAGER:UnregisterForEvent(self.name, EVENT_ADD_ON_LOADED)
+	SLASH_COMMANDS[self.slash] = self.SlashCommand
+
+	self.db = ZO_SavedVars:New('AzurahDB', self.versionDB, nil, self:GetDefaults())
+
+	self:InitializePlayer()
+	self:InitializeTarget()
+	self:InitializeBossbar()
+	self:InitializeActionBar()
+	self:InitializeExperienceBar()
+
+	self:InitializeSettings()
+
+	-- register events for state changes
+	EVENT_MANAGER:RegisterForEvent(Azurah.name, EVENT_GAMEPAD_PREFERRED_MODE_CHANGED,	self.OnPreferredModeChanged)
+	EVENT_MANAGER:RegisterForEvent(Azurah.name, EVENT_PLAYER_COMBAT_STATE,				self.OnStateChanged)
+	EVENT_MANAGER:RegisterForEvent(Azurah.name, EVENT_MOUNTED_STATE_CHANGED,			self.OnStateChanged)
+	EVENT_MANAGER:RegisterForEvent(Azurah.name, EVENT_WEREWOLF_STATE_CHANGED,			self.OnStateChanged)
+end
+
+function Azurah.OnPlayerActivated()
+	EVENT_MANAGER:UnregisterForEvent(Azurah.name, EVENT_PLAYER_ACTIVATED)
+
+	Azurah:InitializeUnlock()
+end
+
+function Azurah.OnStateChanged()
+	Azurah:ConfigureAttributeFade()
+end
+
+function Azurah.OnPreferredModeChanged() -- eventCode, gamepadPreferred)
+	if (Azurah.uiUnlocked) then
+		Azurah:LockUI()
+	end
+
+	Azurah:InitializeUnlock()
+	Azurah:ConfigureTargetIcons()
+	Azurah:ConfigureExperienceBarOverlay()
+end
+
+function Azurah.SlashCommand(text)
+	if (text == 'lock') then
+		Azurah:LockUI()
+	elseif (text == 'unlock') then
+		Azurah:UnlockUI()
+	else
+		CHAT_SYSTEM:AddMessage(L.Usage)
+	end
+end
+
+
+-- ------------------------
+-- OVERLAY BASE
+-- ------------------------
+local strformat			= string.format
+local strgsub			= string.gsub
+local captureStr		= '%1' .. L.ThousandsSeperator .. '%2'
+local k
+
+local function comma_value(amount)
+	while (true) do
+		amount, k = strgsub(amount, '^(-?%d+)(%d%d%d)', captureStr)
+
+		if (k == 0) then
+			break
+		end
+	end
+
+	return amount
+end
+
+Azurah.overlayFuncs = {
+	[1] = function(current, max, effMax)
+		return '' -- dummy, returns an empty string
+	end,
+	-- standard overlays
+	[2] = function(current, max, effMax)
+		effMax = effMax > 0 and effMax or 1 -- ensure we don't do a divide by 0
+		return strformat('%d / %d (%d%%)', current, effMax, (current / effMax) * 100)
+	end,
+	[3] = function(current, max, effMax)
+		return strformat('%d / %d', current, effMax)
+	end,
+	[4] = function(current, max, effMax)
+		effMax = effMax > 0 and effMax or 1 -- ensure we don't do a divide by 0
+		return strformat('%d (%d%%)', current, (current / effMax) * 100)
+	end,
+	[5] = function(current, max, effMax)
+		return strformat('%d', current)
+	end,
+	[6] = function(current, max, effMax)
+		effMax = effMax > 0 and effMax or 1 -- ensure we don't do a divide by 0
+		return strformat('%d%%', (current / effMax) * 100)
+	end,
+	-- comma-seperated overlays
+	[12] = function(current, max, effMax)
+		effMax = effMax > 0 and effMax or 1 -- ensure we don't do a divide by 0
+		return strformat('%s / %s (%d%%)', comma_value(current), comma_value(effMax), (current / effMax) * 100)
+	end,
+	[13] = function(current, max, effMax)
+		return strformat('%s / %s', comma_value(current), comma_value(effMax))
+	end,
+	[14] = function(current, max, effMax)
+		effMax = effMax > 0 and effMax or 1 -- ensure we don't do a divide by 0
+		return strformat('%s (%d%%)', comma_value(current), (current / effMax) * 100)
+	end,
+	[15] = function(current, max, effMax)
+		return strformat('%s', comma_value(current))
+	end,
+	[16] = function(current, max, effMax)
+		effMax = effMax > 0 and effMax or 1 -- ensure we don't do a divide by 0
+		return strformat('%d%%', (current / effMax) * 100)
+	end
+}
+
+function Azurah:CreateOverlay(parent, rel, relPoint, x, y, width, height, vAlign, hAlign)
+	local o = WINDOW_MANAGER:CreateControl(nil, parent, CT_LABEL)
+	o:SetResizeToFitDescendents(true)
+	o:SetInheritScale(false)
+	o:SetDrawTier(DT_HIGH)
+	o:SetDrawLayer(DL_OVERLAY)
+	o:SetAnchor(rel, parent, relPoint, x, y)
+	o:SetHorizontalAlignment(hAlign or TEXT_ALIGN_CENTER)
+	o:SetVerticalAlignment(vAlign or TEXT_ALIGN_CENTER)
+
+	return o
+end
+
+
+EVENT_MANAGER:RegisterForEvent(Azurah.name, EVENT_ADD_ON_LOADED,	Azurah.OnInitialize)
+EVENT_MANAGER:RegisterForEvent(Azurah.name, EVENT_PLAYER_ACTIVATED,	Azurah.OnPlayerActivated)
diff --git a/Defaults.lua b/Defaults.lua
new file mode 100644
index 0000000..65fd7e5
--- /dev/null
+++ b/Defaults.lua
@@ -0,0 +1,89 @@
+local Azurah		= _G['Azurah'] -- grab addon table from global
+
+local defaults = {
+	uiData						= {},
+	compassPinScale				= 1.0,
+	compassHidePinLabel			= false,
+
+	attributes = {
+		fadeMinAlpha			= 0,	-- when full
+		fadeMaxAlpha			= 1,	-- when not full
+		combatBars				= true,
+		lockSize				= false,
+		-- overlays
+		healthOverlay			= 2,
+		healthOverlayFancy		= false,
+		healthFontFace			= 'Univers 67',
+		healthFontColour		= {r = 0.9, g = 0.9, b = 0.9, a = 1.0},
+		healthFontOutline		= 'soft-shadow-thick',
+		healthFontSize			= 16,
+		magickaOverlay			= 2,
+		magickaOverlayFancy		= false,
+		magickaFontFace			= 'Univers 67',
+		magickaFontColour		= {r = 0.9, g = 0.9, b = 0.9, a = 1.0},
+		magickaFontOutline		= 'soft-shadow-thick',
+		magickaFontSize			= 16,
+		staminaOverlay			= 2,
+		staminaOverlayFancy		= false,
+		staminaFontFace			= 'Univers 67',
+		staminaFontColour		= {r = 0.9, g = 0.9, b = 0.9, a = 1.0},
+		staminaFontOutline		= 'soft-shadow-thick',
+		staminaFontSize			= 16,
+	},
+	target = {
+		lockSize				= false,
+		colourByBar				= 2,
+		colourByName			= 1,
+		colourByLevel			= true,
+		classShow				= false,
+		classByName				= true,
+		allianceShow			= false,
+		allianceByName			= false,
+		-- overlay
+		overlay					= 2,
+		overlayFancy			= false,
+		fontFace				= 'Univers 67',
+		fontColour				= {r = 0.9, g = 0.9, b = 0.9, a = 1.0},
+		fontOutline				= 'soft-shadow-thick',
+		fontSize				= 16,
+	},
+	bossbar = {
+		overlay					= 2,
+		overlayFancy			= false,
+		fontFace				= 'Univers 67',
+		fontColour				= {r = 0.9, g = 0.9, b = 0.9, a = 1.0},
+		fontOutline				= 'soft-shadow-thick',
+		fontSize				= 16,
+	},
+	actionBar = {
+		hideBindBG				= false,
+		hideBindText			= false,
+		hideWeaponSwap			= false,
+		-- overlays
+		ultValueShow			= true,
+		ultValueFontFace		= 'Univers 67',
+		ultValueFontColour		= {r = 0.9, g = 0.9, b = 0.9, a = 1.0},
+		ultValueFontOutline		= 'soft-shadow-thick',
+		ultValueFontSize		= 16,
+		ultPercentShow			= true,
+		ultPercentFontFace		= 'Univers 67',
+		ultPercentFontColour	= {r = 0.9, g = 0.9, b = 0.9, a = 1.0},
+		ultPercentFontOutline	= 'soft-shadow-thick',
+		ultPercentFontSize		= 16,
+		ultPercentRelative		= false,
+	},
+	experienceBar = {
+		displayStyle			= 1,
+		-- overlay
+		overlay					= 2,
+		overlayFancy			= true,
+		fontFace				= 'Univers 67',
+		fontColour				= {r = 0.9, g = 0.9, b = 0.9, a = 1.0},
+		fontOutline				= 'soft-shadow-thick',
+		fontSize				= 18,
+	},
+}
+
+function Azurah:GetDefaults()
+	return defaults
+end
diff --git a/ExperienceBar.lua b/ExperienceBar.lua
index 9d451b4..b542b14 100644
--- a/ExperienceBar.lua
+++ b/ExperienceBar.lua
@@ -1,176 +1,180 @@
-local Azurah = _G['Azurah'] -- grab addon table from global
-local LMP = LibStub('LibMediaProvider-1.0')
+local Azurah		= _G['Azurah'] -- grab addon table from global
+local LMP			= LibStub('LibMediaProvider-1.0')

 -- UPVALUES --
-local IsUnitVeteran                 = IsUnitVeteran
-local GetUnitVeteranPoints          = GetUnitVeteranPoints
-local GetUnitVeteranPointsMax       = GetUnitVeteranPointsMax
-local GetUnitXP                     = GetUnitXP
-local GetUnitXPMax                  = GetUnitXPMax
-local GetMaxVeteranRank             = GetMaxVeteranRank
-local IsChampionSystemUnlocked      = IsChampionSystemUnlocked
-local GetPlayerChampionXP           = GetPlayerChampionXP
-local GetChampionXPInRank           = GetChampionXPInRank
-local GetPlayerChampionPointsEarned = GetPlayerChampionPointsEarned
-local strformat                     = string.format
-local zo_callLater                  = zo_callLater
-local overlayExp
-local overlayChamp
+local IsUnitVeteran					= IsUnitVeteran
+local GetUnitVeteranPoints			= GetUnitVeteranPoints
+local GetUnitVeteranPointsMax		= GetUnitVeteranPointsMax
+local GetUnitXP						= GetUnitXP
+local GetUnitXPMax					= GetUnitXPMax
+local GetMaxVeteranRank				= GetMaxVeteranRank
+local IsChampionSystemUnlocked		= IsChampionSystemUnlocked
+local GetPlayerChampionXP			= GetPlayerChampionXP
+local GetChampionXPInRank			= GetChampionXPInRank
+local GetPlayerChampionPointsEarned	= GetPlayerChampionPointsEarned
+local strformat						= string.format
+local zo_callLater					= zo_callLater
+
+local hasMaxXP						= false
+local hasMaxCP						= false
+local overlayExp, overlayChamp
 local FormatExp
-local db
 local isUpdating
-local hasMaxXP = false
-local hasMaxCP = false
+local db

 local function OnCraftStart()
-    if (db.displayStyle == 2) then
-        ZO_PlayerProgressBar:SetAlpha(0)
-    end
+	if (db.displayStyle == 2) then
+		ZO_PlayerProgressBar:SetAlpha(0)
+	end
 end

 local function OnCraftEnd()
-    if (db.displayStyle == 2) then
-        ZO_PlayerProgressBar:SetAlpha(1)
-    end
+	if (db.displayStyle == 2) then
+		ZO_PlayerProgressBar:SetAlpha(1)
+	end
 end

 local function UpdateExperienceBarOverlayValues()
-    local isVeteran = IsUnitVeteran('player')
-
-    if (not hasMaxXP) then
-        local current, max
-
-        if (isVeteran) then
-            current, max = GetUnitVeteranPoints('player'), GetUnitVeteranPointsMax('player')
-            hasMaxXP = (GetUnitVeteranRank('player') == GetMaxVeteranRank()) and (current >= max)
-        else
-            current, max = GetUnitXP('player'), GetUnitXPMax('player')
-        end
-
-        overlayExp:SetText(FormatExp(current, nil, max))
-    end
-
-    if (not hasMaxCP and isVeteran) then
-        if (IsChampionSystemUnlocked()) then
-            local earnedCP = GetPlayerChampionPointsEarned()
-            local inRankCP = GetChampionXPInRank(earnedCP)
-            if (inRankCP ~= nil) then
-                local championXP = GetPlayerChampionXP()
-                overlayChamp:SetText(strformat("%d - %s", earnedCP, FormatExp(championXP, nil, inRankCP)))
-            end
-            hasMaxCP = earnedCP == 3600
-        end
-    end
-
-    isUpdating = false
+	local isVeteran = IsUnitVeteran('player')
+
+	if (not hasMaxXP) then
+		local current, max
+
+		if (isVeteran) then
+			current, max = GetUnitVeteranPoints('player'), GetUnitVeteranPointsMax('player')
+			hasMaxXP = (GetUnitVeteranRank('player') == GetMaxVeteranRank()) and (current >= max)
+		else
+			current, max = GetUnitXP('player'), GetUnitXPMax('player')
+		end
+
+		overlayExp:SetText(FormatExp(current, nil, max))
+	end
+
+	if (not hasMaxCP and isVeteran) then
+		if (IsChampionSystemUnlocked()) then
+			local earnedCP = GetPlayerChampionPointsEarned()
+			local inRankCP = GetChampionXPInRank(earnedCP)
+			if (inRankCP ~= nil) then
+				local championXP = GetPlayerChampionXP()
+				overlayChamp:SetText(strformat("%d - %s", earnedCP, FormatExp(championXP, nil, inRankCP)))
+			end
+			hasMaxCP = earnedCP == 3600
+		end
+	end
+
+	isUpdating = false
 end

 local function OnExpGain(_, unit)
-    if (unit ~= 'player') then return end -- only care about the player
+	if (unit ~= 'player') then return end -- only care about the player

-    if (not isUpdating) then
-        isUpdating = true
-        zo_callLater(UpdateExperienceBarOverlayValues, 1000)
-    end
+	if (not isUpdating) then
+		isUpdating = true
+		zo_callLater(UpdateExperienceBarOverlayValues, 1000) -- called later as exp bar doesn't show new values immediately
+	end
 end

 function Azurah:ConfigureExperienceBarOverlay()
-    if (not IsInGamepadPreferredMode() and db.overlay > 1) then -- showing overlay, enable tracking
-        local current, max, earnedCP, inRankCP
-        local isVeteran = IsUnitVeteran('player')
-
-        local fontStr = strformat('%s|%d|%s', LMP:Fetch('font', db.fontFace), db.fontSize, db.fontOutline)
-        FormatExp = self.overlayFuncs[db.overlay + ((db.overlayFancy) and 10 or 0)]
-
-        overlayExp:SetFont(fontStr)
-        overlayExp:SetColor(db.fontColour.r, db.fontColour.g, db.fontColour.b, db.fontColour.a)
-        overlayChamp:SetFont(fontStr)
-        overlayChamp:SetColor(db.fontColour.r, db.fontColour.g, db.fontColour.b, db.fontColour.a)
-
-        if (isVeteran) then
-            current  = GetUnitVeteranPoints('player')
-            max      = GetUnitVeteranPointsMax('player')
-            earnedCP = GetPlayerChampionPointsEarned()
-            inRankCP = GetChampionXPInRank(earnedCP)
-            hasMaxXP = (GetUnitVeteranRank('player') == GetMaxVeteranRank()) and (current >= max)
-            hasMaxCP = earnedCP == 3600
-        else
-            current, max = GetUnitXP('player'), GetUnitXPMax('player')
-        end
-
-        if (not hasMaxXP) then
-            --hide "LEVEL"/"VETERAN RANK" text
-            ZO_PlayerProgressLevelType:SetAlpha(0)
-            overlayExp:SetHidden(false)
-            overlayExp:SetText(FormatExp(current, nil, max))
-        else
-            ZO_PlayerProgressLevelType:SetAlpha(1)
-            overlayExp:SetHidden(true)
-        end
-
-        if (IsChampionSystemUnlocked() and isVeteran and not hasMaxCP) then
-            --hide "CHAMPION POINT" text
-            ZO_PlayerProgressSecondaryLevelType:SetAlpha(0)
-            overlayChamp:SetHidden(false)
-            overlayChamp:SetText(strformat("%d - %s", earnedCP, FormatExp(GetPlayerChampionXP(), nil, inRankCP)))
-        else
-            ZO_PlayerProgressSecondaryLevelType:SetAlpha(1)
-            overlayChamp:SetHidden(true)
-        end
-
-        EVENT_MANAGER:RegisterForEvent(self.name .. 'Experience', EVENT_EXPERIENCE_UPDATE, OnExpGain)
-        EVENT_MANAGER:RegisterForEvent(self.name .. 'Experience', EVENT_VETERAN_POINTS_UPDATE, OnExpGain)
-
-    else -- no overlay being shown, disable tracking
-        EVENT_MANAGER:UnregisterForEvent(self.name .. 'Experience', EVENT_EXPERIENCE_UPDATE)
-        EVENT_MANAGER:UnregisterForEvent(self.name .. 'Experience', EVENT_VETERAN_POINTS_UPDATE)
-
-        overlayExp:SetHidden(true)
-        overlayChamp:SetHidden(true)
-
-        --restore visibility of "LEVEL"/"VETERAN RANK" and "CHAMPION POINT" texts
-        ZO_PlayerProgressLevelType:SetAlpha(1)
-        ZO_PlayerProgressSecondaryLevelType:SetAlpha(1)
-    end
+	if (not IsInGamepadPreferredMode() and db.overlay > 1) then -- showing overlay, enable tracking
+		local current, max, earnedCP, inRankCP
+		local isVeteran = IsUnitVeteran('player')
+
+		local fontStr = strformat('%s|%d|%s', LMP:Fetch('font', db.fontFace), db.fontSize, db.fontOutline)
+		FormatExp = self.overlayFuncs[db.overlay + ((db.overlayFancy) and 10 or 0)]
+
+		overlayExp:SetFont(fontStr)
+		overlayExp:SetColor(db.fontColour.r, db.fontColour.g, db.fontColour.b, db.fontColour.a)
+		overlayChamp:SetFont(fontStr)
+		overlayChamp:SetColor(db.fontColour.r, db.fontColour.g, db.fontColour.b, db.fontColour.a)
+
+		if (isVeteran) then
+			current= GetUnitVeteranPoints('player')
+			max	= GetUnitVeteranPointsMax('player')
+			earnedCP = GetPlayerChampionPointsEarned()
+			inRankCP = GetChampionXPInRank(earnedCP)
+			hasMaxXP = (GetUnitVeteranRank('player') == GetMaxVeteranRank()) and (current >= max)
+			hasMaxCP = earnedCP == 3600
+		else
+			current, max = GetUnitXP('player'), GetUnitXPMax('player')
+		end
+
+		if (not hasMaxXP) then
+			--hide "LEVEL"/"VETERAN RANK" text
+			ZO_PlayerProgressLevelType:SetAlpha(0)
+			overlayExp:SetHidden(false)
+			overlayExp:SetText(FormatExp(current, nil, max))
+		else
+			ZO_PlayerProgressLevelType:SetAlpha(1)
+			overlayExp:SetHidden(true)
+		end
+
+		if (IsChampionSystemUnlocked() and isVeteran and not hasMaxCP) then
+			--hide "CHAMPION POINT" text
+			ZO_PlayerProgressSecondaryLevelType:SetAlpha(0)
+			overlayChamp:SetHidden(false)
+			overlayChamp:SetText(strformat("%d - %s", earnedCP, FormatExp(GetPlayerChampionXP(), nil, inRankCP)))
+		else
+			ZO_PlayerProgressSecondaryLevelType:SetAlpha(1)
+			overlayChamp:SetHidden(true)
+		end
+
+		EVENT_MANAGER:RegisterForEvent(self.name .. 'Experience', EVENT_EXPERIENCE_UPDATE, OnExpGain)
+		EVENT_MANAGER:RegisterForEvent(self.name .. 'Experience', EVENT_VETERAN_POINTS_UPDATE, OnExpGain)
+
+	else -- no overlay being shown, disable tracking
+		EVENT_MANAGER:UnregisterForEvent(self.name .. 'Experience', EVENT_EXPERIENCE_UPDATE)
+		EVENT_MANAGER:UnregisterForEvent(self.name .. 'Experience', EVENT_VETERAN_POINTS_UPDATE)
+
+		overlayExp:SetHidden(true)
+		overlayChamp:SetHidden(true)
+
+		--restore visibility of "LEVEL"/"VETERAN RANK" and "CHAMPION POINT" texts
+		ZO_PlayerProgressLevelType:SetAlpha(1)
+		ZO_PlayerProgressSecondaryLevelType:SetAlpha(1)
+	end
 end

 function Azurah:ConfigureExperienceBarDisplay()
-    -- Visibility code for Experience Bar is by Garkin (http://www.esoui.com/forums/member.php?u=524)\and used with permission.
-    PLAYER_PROGRESS_BAR_FRAGMENT:SetConditional(function() return not (db.displayStyle == 3) end)
-    PLAYER_PROGRESS_BAR_CURRENT_FRAGMENT:SetConditional(function() return not (db.displayStyle == 3) end)
-
-    if (db.displayStyle == 2) then
-        EVENT_MANAGER:RegisterForEvent(self.name .. 'Experience', EVENT_CRAFTING_STATION_INTERACT,      OnCraftStart)
-        EVENT_MANAGER:RegisterForEvent(self.name .. 'Experience', EVENT_END_CRAFTING_STATION_INTERACT,  OnCraftEnd)
-        HUD_SCENE:AddFragment(PLAYER_PROGRESS_BAR_FRAGMENT)
-        HUD_SCENE:AddFragment(PLAYER_PROGRESS_BAR_CURRENT_FRAGMENT)
-        HUD_UI_SCENE:AddFragment(PLAYER_PROGRESS_BAR_FRAGMENT)
-        HUD_UI_SCENE:AddFragment(PLAYER_PROGRESS_BAR_CURRENT_FRAGMENT)
-    else
-        EVENT_MANAGER:UnregisterForEvent(self.name .. 'Experience', EVENT_CRAFTING_STATION_INTERACT)
-        EVENT_MANAGER:UnregisterForEvent(self.name .. 'Experience', EVENT_END_CRAFTING_STATION_INTERACT)
-        HUD_SCENE:RemoveFragment(PLAYER_PROGRESS_BAR_FRAGMENT)
-        HUD_SCENE:RemoveFragment(PLAYER_PROGRESS_BAR_CURRENT_FRAGMENT)
-        HUD_UI_SCENE:RemoveFragment(PLAYER_PROGRESS_BAR_FRAGMENT)
-        HUD_UI_SCENE:RemoveFragment(PLAYER_PROGRESS_BAR_CURRENT_FRAGMENT)
-    end
+	-- Visibility code for Experience Bar is by Garkin (http://www.esoui.com/forums/member.php?u=524)\and used with permission.
+	PLAYER_PROGRESS_BAR_FRAGMENT:SetConditional(function() return not (db.displayStyle == 3) end)
+	PLAYER_PROGRESS_BAR_CURRENT_FRAGMENT:SetConditional(function() return not (db.displayStyle == 3) end)
+
+	if (db.displayStyle == 2) then
+		EVENT_MANAGER:RegisterForEvent(self.name .. 'Experience', EVENT_CRAFTING_STATION_INTERACT,	OnCraftStart)
+		EVENT_MANAGER:RegisterForEvent(self.name .. 'Experience', EVENT_END_CRAFTING_STATION_INTERACT,OnCraftEnd)
+		HUD_SCENE:AddFragment(PLAYER_PROGRESS_BAR_FRAGMENT)
+		HUD_SCENE:AddFragment(PLAYER_PROGRESS_BAR_CURRENT_FRAGMENT)
+		HUD_UI_SCENE:AddFragment(PLAYER_PROGRESS_BAR_FRAGMENT)
+		HUD_UI_SCENE:AddFragment(PLAYER_PROGRESS_BAR_CURRENT_FRAGMENT)
+	else
+		EVENT_MANAGER:UnregisterForEvent(self.name .. 'Experience', EVENT_CRAFTING_STATION_INTERACT)
+		EVENT_MANAGER:UnregisterForEvent(self.name .. 'Experience', EVENT_END_CRAFTING_STATION_INTERACT)
+		HUD_SCENE:RemoveFragment(PLAYER_PROGRESS_BAR_FRAGMENT)
+		HUD_SCENE:RemoveFragment(PLAYER_PROGRESS_BAR_CURRENT_FRAGMENT)
+		HUD_UI_SCENE:RemoveFragment(PLAYER_PROGRESS_BAR_FRAGMENT)
+		HUD_UI_SCENE:RemoveFragment(PLAYER_PROGRESS_BAR_CURRENT_FRAGMENT)
+	end
 end

+
+-- ------------------------
+-- INITIALIZATION
+-- ------------------------
 function Azurah:InitializeExperienceBar()
-    db = self.db.experienceBar
+	db = self.db.experienceBar

-    --I'm not sure where I have to show overlay, so I'll replace "VETERAN RANK" and "CHAMPION POINT" texts
-    overlayExp = self:CreateOverlay(ZO_PlayerProgressBar, BOTTOMLEFT, TOPLEFT, 4, -2, nil, nil, nil, TEXT_ALIGN_LEFT)
-    overlayChamp = self:CreateOverlay(ZO_PlayerProgressSecondaryLevelTypeIcon, LEFT, RIGHT, 8, 0, nil, nil, nil, TEXT_ALIGN_LEFT)
+	--I'm not sure where I have to show overlay, so I'll replace "VETERAN RANK" and "CHAMPION POINT" texts
+	overlayExp = self:CreateOverlay(ZO_PlayerProgressBar, BOTTOMLEFT, TOPLEFT, 4, -2, nil, nil, nil, TEXT_ALIGN_LEFT)
+	overlayChamp = self:CreateOverlay(ZO_PlayerProgressSecondaryLevelTypeIcon, LEFT, RIGHT, 8, 0, nil, nil, nil, TEXT_ALIGN_LEFT)

-    if IsUnitVeteran('player') then
-        overlayExp:ClearAnchors()
-        overlayExp:SetAnchor(LEFT, ZO_PlayerProgressLevelTypeIcon, RIGHT, 8, 0)
-    end
+	if IsUnitVeteran('player') then
+		overlayExp:ClearAnchors()
+		overlayExp:SetAnchor(LEFT, ZO_PlayerProgressLevelTypeIcon, RIGHT, 8, 0)
+	end

-    -- set 'dummy' display function
-    FormatExp = self.overlayFuncs[1]
+	-- set 'dummy' display function
+	FormatExp = self.overlayFuncs[1]

-    self:ConfigureExperienceBarOverlay()
-    self:ConfigureExperienceBarDisplay()
+	self:ConfigureExperienceBarOverlay()
+	self:ConfigureExperienceBarDisplay()
 end
\ No newline at end of file
diff --git a/Locales/Local_en.lua b/Locales/Local_en.lua
index 9c80c1f..2fe41c6 100644
--- a/Locales/Local_en.lua
+++ b/Locales/Local_en.lua
@@ -77,11 +77,14 @@ L.UnlockResetConfirm	= 'Confirm Reset'
 L.SettingOverlayFormat = 'Overlay Format'
 L.SettingOverlayFancy = 'Show Thousands Seperator'
 L.SettingOverlayFancyTip = 'Set whether to break up large numbers in this overlay.\n\nFor example, 10000 will become 10' .. L.ThousandsSeperator .. '000.'
-L.SettingOverlayStyle = 'Overlay Styling'
+L.SettingOverlayFont = 'Overlay Text Font'
+L.SettingOverlayStyle = 'Overlay Text Colour & Style'
+L.SettingOverlaySize = 'Overlay Text Size'

 -- settings: general tab (1)
 L.GeneralAnchorDesc = 'Unlock to allow the UI windows to be dragged using the mouse, and size scaled using the scrollwheel. An overlay will be shown for each unlocked UI window and will reposition windows even if they are not currently shown (eg, the target health if you have no target).'
 L.GeneralAnchorUnlock = 'Unlock UI Windows'
+L.GeneralCompassPins = 'Compass Pins'
 L.GeneralPinScale = 'Compass Pin Size'
 L.GeneralPinScaleTip = 'Set how large the compass pins should be. This size is independant of the size of the compass itself which can be changed when the UI is unlocked.\n\nA setting of 100 is 100% of the default size (no change).'
 L.GeneralPinLabel = 'Hide Compass Pin Text'
@@ -153,6 +156,8 @@ L.ProfileCharacterListTip = 'List of characters that currently have Azurah setti
 L.ProfileCopyFrom = 'Copy Settings'
 L.ProfileCopyFromTip = 'Copy the settings of the selected character to the currently logged in character.'
 L.ProfileCopyFromWarn = 'Clicking this button will reload the UI and permanently overwrite this character\'s settings with those of the selected character.\n\nThis cannot be undone.'
+L.Profile_CopyCannotCopy = 'Unable to copy selected profile. Please try again or select another profile.'
+

 function Azurah:GetLocale() -- default locale, will be the return unless overwritten
 	return L
diff --git a/Mover.lua b/Mover.lua
index d3f5780..0ffba0e 100644
--- a/Mover.lua
+++ b/Mover.lua
@@ -1,5 +1,4 @@
-local Azurah = _G['Azurah'] -- grab addon table from global
-
+local Azurah		= _G['Azurah'] -- grab addon table from global
 local Mover			= {}

 local rootWidth, rootHeight
@@ -30,13 +29,13 @@ local function GetAnchorRelativeToScreen(frame)

 	-- special case for Magicka/Stamina frames to keep 'expansion' alignment (provided by Garkin)
 	if (frame == ZO_PlayerAttributeMagicka) then
-		x = right - rootW
-		y = (bottom + top) / 2 - rootH / 2
-		point = RIGHT
+		x		= right - rootW
+		y		= (bottom + top) / 2 - rootH / 2
+		point	= RIGHT
 	elseif (frame == ZO_PlayerAttributeStamina) then
-		x = left
-		y = (bottom + top) / 2 - rootH / 2
-		point = LEFT
+		x		= left
+		y		= (bottom + top) / 2 - rootH / 2
+		point	= LEFT
 	else
 		if (left < (rootW - right) and left < math.abs((left + right) / 2 - rootW / 2)) then
 			x, point = left, 2 -- 'LEFT'
diff --git a/Player.lua b/Player.lua
index 56b0513..27de1e8 100644
--- a/Player.lua
+++ b/Player.lua
@@ -1,5 +1,5 @@
-local Azurah = _G['Azurah'] -- grab addon table from global
-local LMP = LibStub('LibMediaProvider-1.0')
+local Azurah		= _G['Azurah'] -- grab addon table from global
+local LMP			= LibStub('LibMediaProvider-1.0')

 -- UPVALUES --
 local POWERTYPE_HEALTH	= POWERTYPE_HEALTH
@@ -22,9 +22,6 @@ local function OnPowerUpdate(_, unit, _, powerType, powerValue, powerMax, powerE
 	elseif (powerType == POWERTYPE_STAMINA) then
 		overlayStamina:SetText(FormatStamina(powerValue, powerMax, powerEffMax))
 	end
-
-	-- To help with issues that cause the bars to get stuck visible
-	--Azurah:ConfigureAttributeFade()
 end

 function Azurah:ConfigureAttributeOverlays()
@@ -91,17 +88,15 @@ end
 function Azurah:ConfigureAttributeFade()
 	local minH, minM, minS, maxH, maxM, maxS
 	local curH, curM, curS, curMS, emaxH, emaxM, emaxS, emaxS, emaxMS
-	local inCombat
-
-	inCombat = IsUnitInCombat('player')
-	if inCombat == nil then inCombat = false end
-
-	curH, _, emaxH = GetUnitPower("player", POWERTYPE_HEALTH)
-	curM, _, emaxM = GetUnitPower("player", POWERTYPE_MAGICKA)
-	curS, _, emaxS = GetUnitPower("player", POWERTYPE_STAMINA)
-	curMS, _, emaxMS = GetUnitPower("player", POWERTYPE_MOUNT_STAMINA)
-
-	if db.combatBars and inCombat then
+
+	local inCombat		= IsUnitInCombat('player') and true or false
+
+	curH, _, emaxH		= GetUnitPower("player", POWERTYPE_HEALTH)
+	curM, _, emaxM		= GetUnitPower("player", POWERTYPE_MAGICKA)
+	curS, _, emaxS		= GetUnitPower("player", POWERTYPE_STAMINA)
+	curMS, _, emaxMS	= GetUnitPower("player", POWERTYPE_MOUNT_STAMINA)
+
+	if (db.combatBars and inCombat) then
 		minH = db.fadeMaxAlpha
 		maxH = db.fadeMaxAlpha
 		minM = db.fadeMaxAlpha
@@ -116,84 +111,26 @@ function Azurah:ConfigureAttributeFade()
 		minS = db.fadeMinAlpha
 		maxS = db.fadeMaxAlpha
 	end
-
+
 	ZO_PlayerAttributeHealth.playerAttributeBarObject.timeline:GetAnimation():SetAlphaValues(minH, maxH)
 	ZO_PlayerAttributeStamina.playerAttributeBarObject.timeline:GetAnimation():SetAlphaValues(minM, maxM)
 	ZO_PlayerAttributeMagicka.playerAttributeBarObject.timeline:GetAnimation():SetAlphaValues(minS, maxS)
-
+
 	ZO_PlayerAttributeMountStamina.playerAttributeBarObject.timeline:GetAnimation():SetAlphaValues(0, maxS)
 	ZO_PlayerAttributeWerewolf.playerAttributeBarObject.timeline:GetAnimation():SetAlphaValues(0, maxM)
 	ZO_PlayerAttributeSiegeHealth.playerAttributeBarObject.timeline:GetAnimation():SetAlphaValues(0, maxH)
-
-	if curH >= emaxH then
+
+	if (curH >= emaxH) then
 		ZO_PlayerAttributeHealth:SetAlpha(minH)
 	end
-	if curM >= emaxM then
+	if (curM >= emaxM) then
 		ZO_PlayerAttributeMagicka:SetAlpha(minM)
 	end
-	if curS >= emaxS and curMS >= emaxMS then
+	if (curS >= emaxS and curMS >= emaxMS) then
 		ZO_PlayerAttributeStamina:SetAlpha(minS)
 	end
 end

-function Azurah:ConfigureAttributeFade1()
-	local inCombat = IsUnitInCombat('player')
-	local combatBars = db.combatBars
-	local minH
-	local minM
-	local minS
-	local maxH
-	local maxM
-	local maxS
-
-	if combatBars and inCombat then
-		minH = db.fadeMaxAlpha
-		minM = db.fadeMaxAlpha
-		minS = db.fadeMaxAlpha
-		maxH = db.fadeMaxAlpha
-		maxM = db.fadeMaxAlpha
-		maxS = db.fadeMaxAlpha
-	else
-		minH = db.fadeMinAlpha
-		maxH = db.fadeMaxAlpha
-		minM = db.fadeMinAlpha
-		maxM = db.fadeMaxAlpha
-		minS = db.fadeMinAlpha
-		maxS = db.fadeMaxAlpha
-	end
-
-	ZO_PlayerAttributeHealth.playerAttributeBarObject.timeline:GetAnimation():SetAlphaValues(minH, maxH)
-	ZO_PlayerAttributeStamina.playerAttributeBarObject.timeline:GetAnimation():SetAlphaValues(minM, maxM)
-	ZO_PlayerAttributeMagicka.playerAttributeBarObject.timeline:GetAnimation():SetAlphaValues(minS, maxS)
-
-
-	local currentH,_,emaxH = GetUnitPower("player",-2)
-	local currentM,_,emaxM = GetUnitPower("player",0)
-	local currentS,_,emaxS = GetUnitPower("player",6)
-
-	if currentH >= emaxH then
-		ZO_PlayerAttributeHealth:SetAlpha(inCombat and maxH or minH)
-	end
-
-	if not IsWerewolf() then
-		if currentM >= emaxM then
-			ZO_PlayerAttributeMagicka:SetAlpha(inCombat and maxM or minM)
-		end
-	end
-
-	if IsMounted() then
-		local currentMS,_,emaxMS = GetUnitPower("player",11)
-		if currentS >= emaxS and currentMS >= emaxMS then
-			ZO_PlayerAttributeStamina:SetAlpha(inCombat and maxS or minS)
-		end
-	else
-		if currentS >= emaxS then
-			ZO_PlayerAttributeStamina:SetAlpha(inCombat and maxS or minS)
-		end
-	end
-
-end
-
 function Azurah:ConfigureAttributeSizeLock()
 	for k, v in pairs(PLAYER_ATTRIBUTE_BARS.attributeVisualizer.visualModules) do
 		if (v.expandedWidth) then -- this is the size changer
@@ -214,6 +151,10 @@ function Azurah:ConfigureAttributeSizeLock()
 	end
 end

+
+-- ------------------------
+-- INITIALIZATION
+-- ------------------------
 function Azurah:InitializePlayer()
 	db = self.db.attributes

diff --git a/Settings.lua b/Settings.lua
index 912cd6d..3bbefaf 100644
--- a/Settings.lua
+++ b/Settings.lua
@@ -1,853 +1,1109 @@
-local Azurah = _G['Azurah'] -- grab addon table from global
-local LAM = LibStub('LibAddonMenu-2.0')
-local LMP = LibStub('LibMediaProvider-1.0')
-local L = Azurah:GetLocale()
+local Azurah		= _G['Azurah'] -- grab addon table from global
+local LAM			= LibStub('LibAddonMenu-2.0')
+local LMP			= LibStub('LibMediaProvider-1.0')
+local L				= Azurah:GetLocale()

 -- UPVALUES --
-local WM            = GetWindowManager()
-local CM            = CALLBACK_MANAGER
-local tinsert       = table.insert
-local tsort         = table.sort
-
--- DROPDOWN SETTINGS --
-local dropOverlay           = {L.DropOverlay1, L.DropOverlay2, L.DropOverlay3, L.DropOverlay4, L.DropOverlay5, L.DropOverlay6}
-local dropOverlayRef        = {[L.DropOverlay1] = 1, [L.DropOverlay2] = 2, [L.DropOverlay3] = 3, [L.DropOverlay4] = 4, [L.DropOverlay5] = 5, [L.DropOverlay6] = 6}
-local dropColourBy          = {L.DropColourBy1, L.DropColourBy2, L.DropColourBy3}
-local dropColourByRef       = {[L.DropColourBy1] = 1, [L.DropColourBy2] = 2, [L.DropColourBy3] = 3}
-local dropExpBarStyle       = {L.DropExpBarStyle1, L.DropExpBarStyle2, L.DropExpBarStyle3}
-local dropExpBarStyleRef    = {[L.DropExpBarStyle1] = 1, [L.DropExpBarStyle2] = 2, [L.DropExpBarStyle3] = 3}
-
-local playerSettingsList    = {}
-local playerSettingCopyFrom
-
-local tabButtons        = false
-local tabPanels         = {}
-local lastAddedControl  = {}
-local controlPanel
-
--- PROFILE FUNCTIONS --
-local function CopyTable(src, dest)
-    if type(dest) ~= 'table' then dest = {} end
-    if type(src) == 'table' then
-        for k, v in pairs(src) do
-            if type(v) == 'table' then
-                CopyTable(v, dest[k])
-            end
+local WM					= GetWindowManager()
+local CM					= CALLBACK_MANAGER
+local tinsert 				= table.insert
+local tsort					= table.sort
+local strformat				= string.format

-            dest[k] = v
-        end
-    end
-end
+-- DROPDOWN CHOICES --
+local dropOverlay			= {L.DropOverlay1, L.DropOverlay2, L.DropOverlay3, L.DropOverlay4, L.DropOverlay5, L.DropOverlay6}
+local dropOverlayRef		= {[L.DropOverlay1] = 1, [L.DropOverlay2] = 2, [L.DropOverlay3] = 3, [L.DropOverlay4] = 4, [L.DropOverlay5] = 5, [L.DropOverlay6] = 6}
+local dropColourBy			= {L.DropColourBy1, L.DropColourBy2, L.DropColourBy3}
+local dropColourByRef		= {[L.DropColourBy1] = 1, [L.DropColourBy2] = 2, [L.DropColourBy3] = 3}
+local dropExpBarStyle		= {L.DropExpBarStyle1, L.DropExpBarStyle2, L.DropExpBarStyle3}
+local dropExpBarStyleRef	= {[L.DropExpBarStyle1] = 1, [L.DropExpBarStyle2] = 2, [L.DropExpBarStyle3] = 3}

-local function CopySettingsFrom(src)
-    local srcData, destData
-    local dest = GetUnitName('player')
+local dropFontStyle			= {'none', 'outline', 'thin-outline', 'thick-outline', 'shadow', 'soft-shadow-thin', 'soft-shadow-thick'}

-    for account, accountData in pairs(AzurahDB.Default) do
-        for character, data in pairs(accountData) do
-            if (character == src and data.version == 2) then -- source character data
-                srcData = data
-            end
+local tabButtons			= {}
+local tabPanels				= {}
+local lastAddedControl		= {}
+local settingsGlobalStr		= strformat('%s_%s', Azurah.name, 'Settings')
+local settingsGlobalStrBtns	= strformat('%s_%s', settingsGlobalStr, 'TabButtons')
+local availableProfiles		= {}	-- profiles avilable to player to copy (either from other characters or built-in choices)
+local profileToCopy			= false -- profile to copy (if chosen)
+local controlPanel, controlPanelWidth, tabButtonsPanel, tabPanelData

-            if (character == dest) then -- dest character data (current character)
-                destData = data
-            end
-        end
-    end

-    if (not srcData or not destData) then
-        d(Azurah.name .. ': Unable to find character settings to copy!')
-        return
-    end
+-- ------------------------
+-- PROFILE FUNCTIONS
+-- ------------------------
+local function CopyTable(src, dest)
+	if (type(dest) ~= 'table') then
+		dest = {}
+	end

-    CopyTable(srcData, destData) -- copy settings
+	if (type(src) == 'table') then
+		for k, v in pairs(src) do
+			if (type(v) == 'table') then
+				CopyTable(v, dest[k])
+			end

-    ReloadUI() -- reloadui to re-initialize
+			dest[k] = v
+		end
+	end
 end

-local function GeneratePlayerList()
-    local current = GetUnitName('player')
+local function CopyProfileSettings(source)
+	local sourceData, destData
+	local dest = GetUnitName('player')
+
+	for account, accountData in pairs(AzurahDB.Default) do
+		for character, data in pairs(accountData) do
+			if (character == source and data.version == 2) then -- source character data (and is of the right version)
+				sourceData = data
+			end
+
+			if (character == dest) then -- dest character data (current character)
+				destData = data
+			end
+		end
+	end
+
+	if (not sourceData or not destData) then -- something went wrong, abort
+		CHAT_SYSTEM:AddMessage(string.format('%s: %s', L.Azurah, L.Profile_CopyCannotCopy))
+	else
+		CopyTable(sourceData, destData) -- do the copy
+		ReloadUI()
+	end
+end
+
+local function GetAvailableProfiles()
+	local currentPlayer = GetUnitName('player')

     for account, accountData in pairs(AzurahDB.Default) do
         for player, data in pairs (accountData) do
-            if (data.version == 2 and player ~= current) then -- only copy 2.X settings, ignore 1.X (and current character)
-                tinsert(playerSettingsList, player)
+            if (data.version == 2 and player ~= currentPlayer) then -- only copy 2.X settings, ignore 1.X and current character
+                tinsert(availableProfiles, player)
             end
         end
     end

-    tsort(playerSettingsList)
+	-- eventually add suggested default profiles to this list as well kt
+
+    tsort(availableProfiles)
 end

-local optionsData = {
-    -- ----------------------------
-    -- GENERAL --------------------
-    -- ----------------------------
-    [1] = {
-        {
-            type = "description",
-            text = L.GeneralAnchorDesc,
-        },
-        {
-            type = "button",
-            name = L.GeneralAnchorUnlock,
-            func = function() Azurah.SlashCommand('unlock') end,
-        },
-        {
-            type = "header",
-            name = "", -- blank header just to add a nice dividing line
-        },
-        {
-            type = "slider",
-            name = L.GeneralPinScale,
-            tooltip = L.GeneralPinScaleTip,
-            min = 60,
-            max = 110,
-            getFunc = function() return Azurah.db.compassPinScale * 100 end,
-            setFunc = function(arg)
-                    Azurah.db.compassPinScale = arg / 100
-                    Azurah:ConfigureCompass()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.GeneralPinLabel,
-            tooltip = L.GeneralPinLabelTip,
-            getFunc = function() return Azurah.db.compassHidePinLabel end,
-            setFunc = function(arg)
-                    Azurah.db.compassHidePinLabel = arg
-                    Azurah:ConfigureCompass()
-                end,
-        },
-    },
-    -- ----------------------------
-    -- ATTRIBUTES -----------------
-    -- ----------------------------
-    [2] = {
-        {
-            type = "slider",
-            name = L.AttributesFadeMin,
-            tooltip = L.AttributesFadeMinTip,
-            min = 0,
-            max = 100,
-            step = 5,
-            getFunc = function() return Azurah.db.attributes.fadeMinAlpha * 100 end,
-            setFunc = function(arg)
-                    Azurah.db.attributes.fadeMinAlpha = arg / 100
-                    Azurah:ConfigureAttributeFade()
-                end,
-        },
-        {
-            type = "slider",
-            name = L.AttributesFadeMax,
-            tooltip = L.AttributesFadeMaxTip,
-            min = 0,
-            max = 100,
-            step = 5,
-            getFunc = function() return Azurah.db.attributes.fadeMaxAlpha * 100 end,
-            setFunc = function(arg)
-                    Azurah.db.attributes.fadeMaxAlpha = arg / 100
-                    Azurah:ConfigureAttributeFade()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.AttributesCombatBars,
-            tooltip = L.AttributesCombatBarsTip,
-            getFunc = function() return Azurah.db.attributes.combatBars end,
-            setFunc = function(arg)
-                Azurah.db.attributes.combatBars = arg
-                Azurah:ConfigureAttributeFade()
-            end,
-        },
-        {
-            type = "checkbox",
-            name = L.AttributesLockSize,
-            tooltip = L.AttributesLockSizeTip,
-            getFunc = function() return Azurah.db.attributes.lockSize end,
-            setFunc = function(arg)
-                    Azurah.db.attributes.lockSize = arg
-                    Azurah:ConfigureAttributeSizeLock()
-                end,
-            warning = L.AttributesLockSizeWarn,
-        },
-        {
-            type = "header",
-            name = L.AttributesOverlayHealth,
-        },
-        {
-            type = "dropdown",
-            name = L.SettingOverlayFormat,
-            tooltip = L.AttributesOverlayFormatTip,
-            choices = dropOverlay,
-            getFunc = function() return dropOverlay[Azurah.db.attributes.healthOverlay] end,
-            setFunc = function(arg)
-                    Azurah.db.attributes.healthOverlay = dropOverlayRef[arg]
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.SettingOverlayFancy,
-            tooltip = L.SettingOverlayFancyTip,
-            getFunc = function() return Azurah.db.attributes.healthOverlayFancy end,
-            setFunc = function(arg)
-                    Azurah.db.attributes.healthOverlayFancy = arg
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-        },
-        {
-            type = "fontblock",
-            name = L.SettingOverlayStyle,
-            getFace = function() return Azurah.db.attributes.healthFontFace end,
-            getSize = function() return Azurah.db.attributes.healthFontSize end,
-            getOutline = function() return Azurah.db.attributes.healthFontOutline end,
-            getColor = function() return Azurah.db.attributes.healthFontColour.r, Azurah.db.attributes.healthFontColour.g, Azurah.db.attributes.healthFontColour.b, Azurah.db.attributes.healthFontColour.a end,
-            setFace = function(font)
-                    Azurah.db.attributes.healthFontFace = font
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-            setSize = function(size)
-                    Azurah.db.attributes.healthFontSize = size
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-            setOutline = function(outline)
-                    Azurah.db.attributes.healthFontOutline = outline
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-            setColor = function(r, g, b, a)
-                    Azurah.db.attributes.healthFontColour.r = r
-                    Azurah.db.attributes.healthFontColour.g = g
-                    Azurah.db.attributes.healthFontColour.b = b
-                    Azurah.db.attributes.healthFontColour.a = a
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-        },
-        {
-            type = "header",
-            name = L.AttributesOverlayMagicka,
-        },
-        {
-            type = "dropdown",
-            name = L.SettingOverlayFormat,
-            tooltip = L.AttributesOverlayFormatTip,
-            choices = dropOverlay,
-            getFunc = function() return dropOverlay[Azurah.db.attributes.magickaOverlay] end,
-            setFunc = function(arg)
-                    Azurah.db.attributes.magickaOverlay = dropOverlayRef[arg]
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.SettingOverlayFancy,
-            tooltip = L.SettingOverlayFancyTip,
-            getFunc = function() return Azurah.db.attributes.magickaOverlayFancy end,
-            setFunc = function(arg)
-                    Azurah.db.attributes.magickaOverlayFancy = arg
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-        },
-        {
-            type = "fontblock",
-            name = L.SettingOverlayStyle,
-            getFace = function() return Azurah.db.attributes.magickaFontFace end,
-            getSize = function() return Azurah.db.attributes.magickaFontSize end,
-            getOutline = function() return Azurah.db.attributes.magickaFontOutline end,
-            getColor = function() return Azurah.db.attributes.magickaFontColour.r, Azurah.db.attributes.magickaFontColour.g, Azurah.db.attributes.magickaFontColour.b, Azurah.db.attributes.magickaFontColour.a end,
-            setFace = function(font)
-                    Azurah.db.attributes.magickaFontFace = font
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-            setSize = function(size)
-                    Azurah.db.attributes.magickaFontSize = size
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-            setOutline = function(outline)
-                    Azurah.db.attributes.magickaFontOutline = outline
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-            setColor = function(r, g, b, a)
-                    Azurah.db.attributes.magickaFontColour.r = r
-                    Azurah.db.attributes.magickaFontColour.g = g
-                    Azurah.db.attributes.magickaFontColour.b = b
-                    Azurah.db.attributes.magickaFontColour.a = a
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-        },
-        {
-            type = "header",
-            name = L.AttributesOverlayStamina,
-        },
-        {
-            type = "dropdown",
-            name = L.SettingOverlayFormat,
-            tooltip = L.AttributesOverlayFormatTip,
-            choices = dropOverlay,
-            getFunc = function() return dropOverlay[Azurah.db.attributes.staminaOverlay] end,
-            setFunc = function(arg)
-                    Azurah.db.attributes.staminaOverlay = dropOverlayRef[arg]
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.SettingOverlayFancy,
-            tooltip = L.SettingOverlayFancyTip,
-            getFunc = function() return Azurah.db.attributes.staminaOverlayFancy end,
-            setFunc = function(arg)
-                    Azurah.db.attributes.staminaOverlayFancy = arg
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-        },
-        {
-            type = "fontblock",
-            name = L.SettingOverlayStyle,
-            getFace = function() return Azurah.db.attributes.staminaFontFace end,
-            getSize = function() return Azurah.db.attributes.staminaFontSize end,
-            getOutline = function() return Azurah.db.attributes.staminaFontOutline end,
-            getColor = function() return Azurah.db.attributes.staminaFontColour.r, Azurah.db.attributes.staminaFontColour.g, Azurah.db.attributes.staminaFontColour.b, Azurah.db.attributes.staminaFontColour.a end,
-            setFace = function(font)
-                    Azurah.db.attributes.staminaFontFace = font
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-            setSize = function(size)
-                    Azurah.db.attributes.staminaFontSize = size
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-            setOutline = function(outline)
-                    Azurah.db.attributes.staminaFontOutline = outline
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-            setColor = function(r, g, b, a)
-                    Azurah.db.attributes.staminaFontColour.r = r
-                    Azurah.db.attributes.staminaFontColour.g = g
-                    Azurah.db.attributes.staminaFontColour.b = b
-                    Azurah.db.attributes.staminaFontColour.a = a
-                    Azurah:ConfigureAttributeOverlays()
-                end,
-        },
-    },
-    -- ----------------------------
-    -- TARGET ---------------------
-    -- ----------------------------
-    [3] = {
-        {
-            type = "checkbox",
-            name = L.TargetLockSize,
-            tooltip = L.TargetLockSizeTip,
-            getFunc = function() return Azurah.db.target.lockSize end,
-            setFunc = function(arg)
-                    Azurah.db.target.lockSize = arg
-                    Azurah:ConfigureTargetSizeLock()
-                end
-        },
-        {
-            type = "dropdown",
-            name = L.TargetColourByBar,
-            tooltip = L.TargetColourByBarTip,
-            choices = dropColourBy,
-            getFunc = function() return dropColourBy[Azurah.db.target.colourByBar] end,
-            setFunc = function(arg)
-                    Azurah.db.target.colourByBar = dropColourByRef[arg]
-                    Azurah:ConfigureTargetColouring()
-                end,
-        },
-        {
-            type = "dropdown",
-            name = L.TargetColourByName,
-            tooltip = L.TargetColourByNameTip,
-            choices = dropColourBy,
-            getFunc = function() return dropColourBy[Azurah.db.target.colourByName] end,
-            setFunc = function(arg)
-                    Azurah.db.target.colourByName = dropColourByRef[arg]
-                    Azurah:ConfigureTargetColouring()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.TargetColourByLevel,
-            tooltip = L.TargetColourByLevelTip,
-            getFunc = function() return Azurah.db.target.colourByLevel end,
-            setFunc = function(arg)
-                    Azurah.db.target.colourByLevel = arg
-                    Azurah:ConfigureTargetColouring()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.TargetIconClassShow,
-            tooltip = L.TargetIconClassShowTip,
-            getFunc = function() return Azurah.db.target.classShow end,
-            setFunc = function(arg)
-                    Azurah.db.target.classShow = arg
-                    Azurah:ConfigureTargetIcons()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.TargetIconClassByName,
-            tooltip = L.TargetIconClassByNameTip,
-            getFunc = function() return Azurah.db.target.classByName end,
-            setFunc = function(arg)
-                    Azurah.db.target.classByName = arg
-                    Azurah:ConfigureTargetIcons()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.TargetIconAllianceShow,
-            tooltip = L.TargetIconAllianceShowTip,
-            getFunc = function() return Azurah.db.target.allianceShow end,
-            setFunc = function(arg)
-                    Azurah.db.target.allianceShow = arg
-                    Azurah:ConfigureTargetIcons()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.TargetIconAllianceByName,
-            tooltip = L.TargetIconAllianceByNameTip,
-            getFunc = function() return Azurah.db.target.allianceByName end,
-            setFunc = function(arg)
-                    Azurah.db.target.allianceByName = arg
-                    Azurah:ConfigureTargetIcons()
-                end,
-        },
-        {
-            type = "dropdown",
-            name = L.SettingOverlayFormat,
-            tooltip = L.TargetOverlayFormatTip,
-            choices = dropOverlay,
-            getFunc = function() return dropOverlay[Azurah.db.target.overlay] end,
-            setFunc = function(arg)
-                    Azurah.db.target.overlay = dropOverlayRef[arg]
-                    Azurah:ConfigureTargetOverlay()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.SettingOverlayFancy,
-            tooltip = L.SettingOverlayFancyTip,
-            getFunc = function() return Azurah.db.target.overlayFancy end,
-            setFunc = function(arg)
-                    Azurah.db.target.overlayFancy = arg
-                    Azurah:ConfigureTargetOverlay()
-                end,
-        },
-        {
-            type = "fontblock",
-            name = L.SettingOverlayStyle,
-            getFace = function() return Azurah.db.target.fontFace end,
-            getSize = function() return Azurah.db.target.fontSize end,
-            getOutline = function() return Azurah.db.target.fontOutline end,
-            getColor = function() return Azurah.db.target.fontColour.r, Azurah.db.target.fontColour.g, Azurah.db.target.fontColour.b, Azurah.db.target.fontColour.a end,
-            setFace = function(font)
-                    Azurah.db.target.fontFace = font
-                    Azurah:ConfigureTargetOverlay()
-                end,
-            setSize = function(size)
-                    Azurah.db.target.fontSize = size
-                    Azurah:ConfigureTargetOverlay()
-                end,
-            setOutline = function(outline)
-                    Azurah.db.target.fontOutline = outline
-                    Azurah:ConfigureTargetOverlay()
-                end,
-            setColor = function(r, g, b, a)
-                    Azurah.db.target.fontColour.r = r
-                    Azurah.db.target.fontColour.g = g
-                    Azurah.db.target.fontColour.b = b
-                    Azurah.db.target.fontColour.a = a
-                    Azurah:ConfigureTargetOverlay()
-                end,
-        },
-        {
-            type = "header",
-            name = L.BossbarHeader,
-        },
-        {
-            type = "dropdown",
-            name = L.SettingOverlayFormat,
-            tooltip = L.BossbarOverlayFormatTip,
-            choices = dropOverlay,
-            getFunc = function() return dropOverlay[Azurah.db.bossbar.overlay] end,
-            setFunc = function(arg)
-                    Azurah.db.bossbar.overlay = dropOverlayRef[arg]
-                    Azurah:ConfigureBossbarOverlay()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.SettingOverlayFancy,
-            tooltip = L.SettingOverlayFancyTip,
-            getFunc = function() return Azurah.db.bossbar.overlayFancy end,
-            setFunc = function(arg)
-                    Azurah.db.bossbar.overlayFancy = arg
-                    Azurah:ConfigureBossbarOverlay()
-                end,
-        },
-        {
-            type = "fontblock",
-            name = L.SettingOverlayStyle,
-            getFace = function() return Azurah.db.bossbar.fontFace end,
-            getSize = function() return Azurah.db.bossbar.fontSize end,
-            getOutline = function() return Azurah.db.bossbar.fontOutline end,
-            getColor = function() return Azurah.db.bossbar.fontColour.r, Azurah.db.bossbar.fontColour.g, Azurah.db.bossbar.fontColour.b, Azurah.db.bossbar.fontColour.a end,
-            setFace = function(font)
-                    Azurah.db.bossbar.fontFace = font
-                    Azurah:ConfigureBossbarOverlay()
-                end,
-            setSize = function(size)
-                    Azurah.db.bossbar.fontSize = size
-                    Azurah:ConfigureBossbarOverlay()
-                end,
-            setOutline = function(outline)
-                    Azurah.db.bossbar.fontOutline = outline
-                    Azurah:ConfigureBossbarOverlay()
-                end,
-            setColor = function(r, g, b, a)
-                    Azurah.db.bossbar.fontColour.r = r
-                    Azurah.db.bossbar.fontColour.g = g
-                    Azurah.db.bossbar.fontColour.b = b
-                    Azurah.db.bossbar.fontColour.a = a
-                    Azurah:ConfigureBossbarOverlay()
-                end,
-        },
-    },
-    -- ----------------------------
-    -- ACTION BAR -----------------
-    -- ----------------------------
-    [4] = {
-        {
-            type = "checkbox",
-            name = L.ActionBarHideBindBG,
-            tooltip = L.ActionBarHideBindBGTip,
-            getFunc = function() return Azurah.db.actionBar.hideBindBG end,
-            setFunc = function(arg)
-                    Azurah.db.actionBar.hideBindBG = arg
-                    Azurah:ConfigureActionBarElements()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.ActionBarHideBindText,
-            tooltip = L.ActionBarHideBindTextTip,
-            getFunc = function() return Azurah.db.actionBar.hideBindText end,
-            setFunc = function(arg)
-                    Azurah.db.actionBar.hideBindText = arg
-                    Azurah:ConfigureActionBarElements()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.ActionBarHideWeaponSwap,
-            tooltip = L.ActionBarHideWeaponSwapTip,
-            getFunc = function() return Azurah.db.actionBar.hideWeaponSwap end,
-            setFunc = function(arg)
-                    Azurah.db.actionBar.hideWeaponSwap = arg
-                    Azurah:ConfigureActionBarElements()
-                end,
-        },
-        {
-            type = "header",
-            name = L.ActionBarOverlayUltValue,
-        },
-        {
-            type = "checkbox",
-            name = L.ActionBarOverlayShow,
-            tooltip = L.ActionBarOverlayUltValueShowTip,
-            getFunc = function() return Azurah.db.actionBar.ultValueShow end,
-            setFunc = function(arg)
-                    Azurah.db.actionBar.ultValueShow = arg
-                    Azurah:ConfigureUltimateOverlays()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.ActionBarOverlayUltValueShowCost,
-            tooltip = L.ActionBarOverlayUltValueShowCostTip,
-            getFunc = function() return Azurah.db.actionBar.ultValueShowCost end,
-            setFunc = function(arg)
-                    Azurah.db.actionBar.ultValueShowCost = arg
-                    Azurah:ConfigureUltimateOverlays()
-                end,
-        },
-        {
-            type = "fontblock",
-            name = L.SettingOverlayStyle,
-            getFace = function() return Azurah.db.actionBar.ultValueFontFace end,
-            getSize = function() return Azurah.db.actionBar.ultValueFontSize end,
-            getOutline = function() return Azurah.db.actionBar.ultValueFontOutline end,
-            getColor = function() return Azurah.db.actionBar.ultValueFontColour.r, Azurah.db.actionBar.ultValueFontColour.g, Azurah.db.actionBar.ultValueFontColour.b, Azurah.db.actionBar.ultValueFontColour.a end,
-            setFace = function(font)
-                    Azurah.db.actionBar.ultValueFontFace = font
-                    Azurah:ConfigureUltimateOverlays()
-                end,
-            setSize = function(size)
-                    Azurah.db.actionBar.ultValueFontSize = size
-                    Azurah:ConfigureUltimateOverlays()
-                end,
-            setOutline = function(outline)
-                    Azurah.db.actionBar.ultValueFontOutline = outline
-                    Azurah:ConfigureUltimateOverlays()
-                end,
-            setColor = function(r, g, b, a)
-                    Azurah.db.actionBar.ultValueFontColour.r = r
-                    Azurah.db.actionBar.ultValueFontColour.g = g
-                    Azurah.db.actionBar.ultValueFontColour.b = b
-                    Azurah.db.actionBar.ultValueFontColour.a = a
-                    Azurah:ConfigureUltimateOverlays()
-                end,
-        },
-        {
-            type = "header",
-            name = L.ActionBarOverlayUltPercent,
-        },
-        {
-            type = "checkbox",
-            name = L.ActionBarOverlayShow,
-            tooltip = L.ActionBarOverlayUltPercentShowTip,
-            getFunc = function() return Azurah.db.actionBar.ultPercentShow end,
-            setFunc = function(arg)
-                    Azurah.db.actionBar.ultPercentShow = arg
-                    Azurah:ConfigureUltimateOverlays()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.ActionBarOverlayUltPercentRelative,
-            tooltip = L.ActionBarOverlayUltPercentRelativeTip,
-            getFunc = function() return Azurah.db.actionBar.ultPercentRelative end,
-            setFunc = function(arg)
-                    Azurah.db.actionBar.ultPercentRelative = arg
-                    Azurah:ConfigureUltimateOverlays()
-                end,
-        },
-        {
-            type = "fontblock",
-            name = L.SettingOverlayStyle,
-            getFace = function() return Azurah.db.actionBar.ultPercentFontFace end,
-            getSize = function() return Azurah.db.actionBar.ultPercentFontSize end,
-            getOutline = function() return Azurah.db.actionBar.ultPercentFontOutline end,
-            getColor = function() return Azurah.db.actionBar.ultPercentFontColour.r, Azurah.db.actionBar.ultPercentFontColour.g, Azurah.db.actionBar.ultPercentFontColour.b, Azurah.db.actionBar.ultPercentFontColour.a end,
-            setFace = function(font)
-                    Azurah.db.actionBar.ultPercentFontFace = font
-                    Azurah:ConfigureUltimateOverlays()
-                end,
-            setSize = function(size)
-                    Azurah.db.actionBar.ultPercentFontSize = size
-                    Azurah:ConfigureUltimateOverlays()
-                end,
-            setOutline = function(outline)
-                    Azurah.db.actionBar.ultPercentFontOutline = outline
-                    Azurah:ConfigureUltimateOverlays()
-                end,
-            setColor = function(r, g, b, a)
-                    Azurah.db.actionBar.ultPercentFontColour.r = r
-                    Azurah.db.actionBar.ultPercentFontColour.g = g
-                    Azurah.db.actionBar.ultPercentFontColour.b = b
-                    Azurah.db.actionBar.ultPercentFontColour.a = a
-                    Azurah:ConfigureUltimateOverlays()
-                end,
-        },
-    },
-    -- ----------------------------
-    -- EXPERIENCE BAR -------------
-    -- ----------------------------
-    [5] = {
-        {
-            type = "dropdown",
-            name = L.ExperienceDisplayStyle,
-            tooltip = L.ExperienceDisplayStyleTip,
-            choices = dropExpBarStyle,
-            getFunc = function() return dropExpBarStyle[Azurah.db.experienceBar.displayStyle] end,
-            setFunc = function(arg)
-                    Azurah.db.experienceBar.displayStyle = dropExpBarStyleRef[arg]
-                    Azurah:ConfigureExperienceBarDisplay()
-                end,
-        },
-        {
-            type = "dropdown",
-            name = L.SettingOverlayFormat,
-            tooltip = L.ExperienceOverlayFormatTip,
-            choices = dropOverlay,
-            getFunc = function() return dropOverlay[Azurah.db.experienceBar.overlay] end,
-            setFunc = function(arg)
-                    Azurah.db.experienceBar.overlay = dropOverlayRef[arg]
-                    Azurah:ConfigureExperienceBarOverlay()
-                end,
-        },
-        {
-            type = "checkbox",
-            name = L.SettingOverlayFancy,
-            tooltip = L.SettingOverlayFancyTip,
-            getFunc = function() return Azurah.db.experienceBar.overlayFancy end,
-            setFunc = function(arg)
-                    Azurah.db.experienceBar.overlayFancy = arg
-                    Azurah:ConfigureExperienceBarOverlay()
-                end,
-        },
-        {
-            type = "fontblock",
-            name = L.SettingOverlayStyle,
-            getFace = function() return Azurah.db.experienceBar.fontFace end,
-            getSize = function() return Azurah.db.experienceBar.fontSize end,
-            getOutline = function() return Azurah.db.experienceBar.fontOutline end,
-            getColor = function() return Azurah.db.experienceBar.fontColour.r, Azurah.db.experienceBar.fontColour.g, Azurah.db.experienceBar.fontColour.b, Azurah.db.experienceBar.fontColour.a end,
-            setFace = function(font)
-                    Azurah.db.experienceBar.fontFace = font
-                    Azurah:ConfigureExperienceBarOverlay()
-                end,
-            setSize = function(size)
-                    Azurah.db.experienceBar.fontSize = size
-                    Azurah:ConfigureExperienceBarOverlay()
-                end,
-            setOutline = function(outline)
-                    Azurah.db.experienceBar.fontOutline = outline
-                    Azurah:ConfigureExperienceBarOverlay()
-                end,
-            setColor = function(r, g, b, a)
-                    Azurah.db.experienceBar.fontColour.r = r
-                    Azurah.db.experienceBar.fontColour.g = g
-                    Azurah.db.experienceBar.fontColour.b = b
-                    Azurah.db.experienceBar.fontColour.a = a
-                    Azurah:ConfigureExperienceBarOverlay()
-                end,
-        },
-    },
-    -- ----------------------------
-    -- PROFILES -------------------
-    -- ----------------------------
-    [6] = {
-        {
-            type = "dropdown",
-            name = L.ProfileCharacterList,
-            tooltip = L.ProfileCharacterListTip,
-            choices = playerSettingsList,
-            getFunc = function()
-                    if (#playerSettingsList >= 1) then
-                        playerSettingCopyFrom = playerSettingsList[1]
-                        return playerSettingsList[1]
-                    end
-                end,
-            setFunc = function(arg) playerSettingCopyFrom = arg end,
-        },
-        {
-            type = "button",
-            name = L.ProfileCopyFrom,
-            tooltip = L.ProfileCopyFromTip,
-            func = function() CopySettingsFrom(playerSettingCopyFrom) end,
-            warning = L.ProfileCopyFromWarn,
-        },
-    },
-}

-local function CreateWidgets(id, panelData)
-    local panel = tabPanels[id]
-    local isLastHalf = false
-    local anchorOffset = 0
-
-    for _, widgetData in pairs(panelData) do
-        local widgetType = widgetData.type
-        local widget = LAMCreateControl[widgetType](panel, widgetData)
-        local isHalf = widgetData.width == "half"
-
-        if isLastHalf and isHalf then
-            widget:SetAnchor(TOPLEFT, lastAddedControl[id], TOPRIGHT, 10, 0)
-            anchorOffset = zo_max(0, widget:GetHeight() - lastAddedControl[id]:GetHeight())
-            isLastHalf = false
-        else
-            widget:SetAnchor(TOPLEFT, lastAddedControl[id], BOTTOMLEFT, 0, 15 + anchorOffset)
-            anchorOffset = 0
-            isLastHalf = isHalf
-            lastAddedControl[id] = widget
-        end
-    end
+-- ------------------------
+-- PANEL CONSTRUCTION
+-- ------------------------
+local function CreateWidgets(panelID, panelData)
+	local panel = tabPanels[panelID]
+
+	for entry, widgetData in ipairs(panelData) do
+		local widgetType = widgetData.type
+		local widget = LAMCreateControl[widgetType](panel, widgetData)
+
+		if (widget.data.isFontColour) then -- special case for font colour widgets
+			widget.thumb:ClearAnchors()
+			widget.thumb:SetAnchor(RIGHT, widget.color, RIGHT, 0, 0)
+
+			widget:SetAnchor(TOPLEFT, lastAddedControl[panelID], TOPLEFT, 0, 0) -- overlay widget with previous
+			widget:SetWidth(controlPanelWidth - (controlPanelWidth / 3) - 15) -- shrink widget to give appearance of sharing a row
+		else
+			widget:SetAnchor(TOPLEFT, lastAddedControl[panelID], BOTTOMLEFT, 0, 15)
+			lastAddedControl[panelID] = widget
+		end
+	end
 end

-local function BuildTabWindow(id)
-    local panelData = optionsData[id]
+local function CreateTabPanel(panelID)
+	local panel = WM:CreateControl(nil, controlPanel.scroll, CT_CONTROL)
+	panel.panel = controlPanel
+	panel:SetWidth(controlPanelWidth)
+	panel:SetAnchor(TOPLEFT, tabButtonsPanel, BOTTOMLEFT, 0, 6)
+	panel:SetResizeToFitDescendents(true)

-    if (id == 6) then
-        GeneratePlayerList()
-    end
+	tabPanels[panelID] = panel
+
+	local ctrl = LAMCreateControl.header(panel, {
+		type = 'header',
+		name = L['TabHeader' .. panelID],
+	})
+	ctrl:SetAnchor(TOPLEFT)
+
+	lastAddedControl[panelID] = ctrl

-    CreateWidgets(id, panelData)
+	CreateWidgets(panelID, tabPanelData[panelID]) -- create the actual setting elements
 end

-local function BuildTabPanel(id)
-    local panel = WM:CreateControl(nil, controlPanel.scroll, CT_CONTROL)
-    panel.panel = controlPanel
-    panel:SetWidth(controlPanel:GetWidth() - 60)
-    panel:SetAnchor(TOPLEFT)
-    panel:SetResizeToFitDescendents(true)

-    tabPanels[id] = panel
+-- ------------------------
+-- TAB BUTTON HANDLER
+-- ------------------------
+local function TabButtonOnClick(self)
+	if (not tabPanels[self.panelID]) then
+		CreateTabPanel(self.panelID) -- call to create appropriate panel if not created yet
+	end

-    local ctrl = LAMCreateControl.header(panel, { type = 'header', name = L['TabHeader' .. id] })
-    ctrl:SetAnchor(TOPLEFT)
+	for x = 1, 6 do
+		tabButtons[x].button:SetState(0) -- unset selected state for all buttons
+	end

-    lastAddedControl[id] = ctrl
+	tabButtons[self.buttonID].button:SetState(1, true) -- set selected state for current button

-    BuildTabWindow(id)
+	for id, panel in pairs(tabPanels) do
+		panel:SetHidden(not (id == self.panelID)) -- hide all other tab panels but intended
+	end
 end

-local function BuildTabButton(controlPanel, id)
-    local tab = WM:CreateControlFromVirtual(nil, controlPanel, 'ZO_DefaultButton')
-    tab:SetWidth(((controlPanel:GetWidth() - 60) / 3) - 2)
-    tab:SetText(L['TabButton' .. id])
-    tab.tabID = id
-    tab:SetHandler('OnClicked', function(btn)
-            if (not tabPanels[btn.tabID]) then
-                BuildTabPanel(btn.tabID)
-            end
-            for id, panel in pairs(tabPanels) do
-                panel:SetHidden(not (id == btn.tabID))
-            end
-        end)

-    return tab
+-- -----------------------
+-- INITIALIZATION
+-- -----------------------
+local function CompleteInitialization(panel)
+	if (panel ~= controlPanel) then return end -- only proceed if this is our settings panel
+
+	tabButtonsPanel		= _G[settingsGlobalStrBtns] -- setup reference to tab buttons (custom) panel
+	controlPanelWidth	= controlPanel:GetWidth() - 60 -- used several times
+
+	local btn
+
+	for x = 1, 6 do
+		btn = LAMCreateControl.button(tabButtonsPanel, { -- create our tab buttons
+			type = 'button',
+			name = L['TabButton' .. x],
+			func = TabButtonOnClick,
+		})
+		btn.button.buttonID	= x -- reference lookup to refer to buttons
+		btn.button.panelID	= x -- reference lookup to refer to panels
+
+		btn:SetWidth((controlPanelWidth / 3) - 2)
+		btn.button:SetWidth((controlPanelWidth / 3) - 2)
+		btn:SetAnchor(TOPLEFT, tabButtonsPanel, TOPLEFT, (controlPanelWidth / 3) * ((x - 1) % 3), (x <= 3) and 0 or 34)
+
+		tabButtons[x] = btn
+	end
+
+	tabButtons[1].button:SetState(1, true) -- set selected state for first (General) panel
+
+	CreateTabPanel(1) -- create first (General) panel on settings first load
+
+	GetAvailableProfiles() -- populate available profiles
 end

 function Azurah:InitializeSettings()
-    local panelData = {
-        type = 'panel',
-        name = self.name,
-        displayName = L.Azurah,
-        author = 'Kith, Garkin, Phinix, Sounomi',
-        version = self.version,
-        registerForRefresh = true,
-        registerForDefaults = false,
-    }
-    controlPanel = LAM:RegisterAddonPanel(self.name .. '_SettingsMenu', panelData)
-    local buttonsWidth = controlPanel:GetWidth() - 60
-
-    local buttons = WM:CreateControl(nil, controlPanel, CT_CONTROL)
-    buttons:SetAnchor(TOPLEFT, controlPanel.label, BOTTOMLEFT, 0, 20)
-    buttons:SetDimensions(buttonsWidth, 54)
-    controlPanel.container:ClearAnchors()
-    controlPanel.container:SetAnchor(TOPLEFT, buttons, BOTTOMLEFT, 0, 20)
-    controlPanel.container:SetAnchor(BOTTOMRIGHT, controlPanel, BOTTOMRIGHT, -3, -3)
-
-    local tabBtn = BuildTabButton(controlPanel, 1)
-    tabBtn:SetAnchor(TOPLEFT, buttons, TOPLEFT, 0, 0)
-    tabBtn = BuildTabButton(controlPanel, 2)
-    tabBtn:SetAnchor(TOPLEFT, buttons, TOPLEFT, buttonsWidth / 3, 0)
-    tabBtn = BuildTabButton(controlPanel, 3)
-    tabBtn:SetAnchor(TOPLEFT, buttons, TOPLEFT, buttonsWidth / 3 * 2, 0)
-    tabBtn = BuildTabButton(controlPanel, 4)
-    tabBtn:SetAnchor(BOTTOMLEFT, buttons, BOTTOMLEFT, 0, 8)
-    tabBtn = BuildTabButton(controlPanel, 5)
-    tabBtn:SetAnchor(BOTTOMLEFT, buttons, BOTTOMLEFT, buttonsWidth / 3, 8)
-    tabBtn = BuildTabButton(controlPanel, 6)
-    tabBtn:SetAnchor(BOTTOMLEFT, buttons, BOTTOMLEFT, buttonsWidth / 3 * 2, 8)
-
-    tabButtons = buttons
-
-    ZO_PreHookHandler(controlPanel, "OnEffectivelyShown", function(control)
-        if (not tabPanels[1]) then
-            BuildTabPanel(1)
-        end
-    end)
-end
\ No newline at end of file
+	local panelData = {
+		type = 'panel',
+		name = self.name,
+		displayName = L.Azurah,
+		author = 'Kith, Garkin, Phinix, Sounomi',
+		version = self.version,
+		registerForRefresh = true,
+		registerForDefaults = false,
+	}
+
+	controlPanel = LAM:RegisterAddonPanel(settingsGlobalStr, panelData)
+
+	local optionsData = {
+		[1] = {
+			type = 'custom',
+			reference = settingsGlobalStrBtns,
+		}
+	}
+
+	LAM:RegisterOptionControls(settingsGlobalStr, optionsData)
+
+	CM:RegisterCallback('LAM-PanelControlsCreated', CompleteInitialization)
+end
+
+
+-- -----------------------
+-- OPTIONS DATA TABLES
+-- -----------------------
+tabPanelData = {
+	-- -----------------------
+	-- GENERAL PANEL
+	-- -----------------------
+	[1] = {
+		{
+			type = "description",
+			text = L.GeneralAnchorDesc,
+		},
+		{
+			type = "button",
+			name = L.GeneralAnchorUnlock,
+			func = function()
+				Azurah.SlashCommand('unlock')
+
+			end,
+		},
+		-- -----------------------
+		-- COMPASS PINS
+		-- -----------------------
+		{
+			type = "header",
+			name = L.GeneralCompassPins,
+		},
+		{
+			type = "slider",
+			name = L.GeneralPinScale,
+			tooltip = L.GeneralPinScaleTip,
+			min = 60,
+			max = 110,
+			getFunc = function()
+				return Azurah.db.compassPinScale * 100
+			end,
+			setFunc = function(arg)
+				Azurah.db.compassPinScale = arg / 100
+				Azurah:ConfigureCompass()
+			end,
+		},
+		{
+			type = "checkbox",
+			name = L.GeneralPinLabel,
+			tooltip = L.GeneralPinLabelTip,
+			getFunc = function()
+				return Azurah.db.compassHidePinLabel
+			end,
+			setFunc = function(arg)
+				Azurah.db.compassHidePinLabel = arg
+				Azurah:ConfigureCompass()
+			end,
+		},
+	},
+	-- -----------------------
+	-- ATTRIBUTES PANEL
+	-- -----------------------
+	[2] = {
+		{
+			type = "slider",
+			name = L.AttributesFadeMin,
+			tooltip = L.AttributesFadeMinTip,
+			min = 0,
+			max = 100,
+			step = 5,
+			getFunc = function() return Azurah.db.attributes.fadeMinAlpha * 100 end,
+			setFunc = function(arg)
+					Azurah.db.attributes.fadeMinAlpha = arg / 100
+					Azurah:ConfigureAttributeFade()
+				end,
+		},
+		{
+			type = "slider",
+			name = L.AttributesFadeMax,
+			tooltip = L.AttributesFadeMaxTip,
+			min = 0,
+			max = 100,
+			step = 5,
+			getFunc = function() return Azurah.db.attributes.fadeMaxAlpha * 100 end,
+			setFunc = function(arg)
+					Azurah.db.attributes.fadeMaxAlpha = arg / 100
+					Azurah:ConfigureAttributeFade()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.AttributesCombatBars,
+			tooltip = L.AttributesCombatBarsTip,
+			getFunc = function() return Azurah.db.attributes.combatBars end,
+			setFunc = function(arg)
+				Azurah.db.attributes.combatBars = arg
+				Azurah:ConfigureAttributeFade()
+			end,
+		},
+		{
+			type = "checkbox",
+			name = L.AttributesLockSize,
+			tooltip = L.AttributesLockSizeTip,
+			getFunc = function() return Azurah.db.attributes.lockSize end,
+			setFunc = function(arg)
+					Azurah.db.attributes.lockSize = arg
+					Azurah:ConfigureAttributeSizeLock()
+				end,
+			warning = L.AttributesLockSizeWarn,
+		},
+		-- -----------------------
+		-- OVERLAY: HEALTH
+		-- -----------------------
+		{
+			type = "header",
+			name = L.AttributesOverlayHealth,
+		},
+		{
+			type = "dropdown",
+			name = L.SettingOverlayFormat,
+			tooltip = L.AttributesOverlayFormatTip,
+			choices = dropOverlay,
+			getFunc = function() return dropOverlay[Azurah.db.attributes.healthOverlay] end,
+			setFunc = function(arg)
+					Azurah.db.attributes.healthOverlay = dropOverlayRef[arg]
+					Azurah:ConfigureAttributeOverlays()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.SettingOverlayFancy,
+			tooltip = L.SettingOverlayFancyTip,
+			getFunc = function() return Azurah.db.attributes.healthOverlayFancy end,
+			setFunc = function(arg)
+					Azurah.db.attributes.healthOverlayFancy = arg
+					Azurah:ConfigureAttributeOverlays()
+				end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayFont,
+			choices = LMP:List('font'),
+			getFunc = function()
+				return Azurah.db.attributes.healthFontFace
+			end,
+			setFunc = function(v)
+				Azurah.db.attributes.healthFontFace = v
+				Azurah:ConfigureAttributeOverlays()
+			end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayStyle,
+			choices = dropFontStyle,
+			getFunc = function()
+				return Azurah.db.attributes.healthFontOutline
+			end,
+			setFunc = function(v)
+				Azurah.db.attributes.healthFontOutline = v
+				Azurah:ConfigureAttributeOverlays()
+			end,
+		},
+		{
+			type = 'colorpicker',
+			getFunc = function()
+				return Azurah.db.attributes.healthFontColour.r, Azurah.db.attributes.healthFontColour.g, Azurah.db.attributes.healthFontColour.b, Azurah.db.attributes.healthFontColour.a
+			end,
+			setFunc = function(r, g, b, a)
+				Azurah.db.attributes.healthFontColour.r = r
+				Azurah.db.attributes.healthFontColour.g = g
+				Azurah.db.attributes.healthFontColour.b = b
+				Azurah.db.attributes.healthFontColour.a = a
+				Azurah:ConfigureAttributeOverlays()
+			end,
+			isFontColour = true,
+		},
+		{
+			type = 'slider',
+			name = L.SettingOverlaySize,
+			min = 8,
+			max = 32,
+			getFunc = function()
+				return Azurah.db.attributes.healthFontSize
+			end,
+			setFunc = function(v)
+				Azurah.db.attributes.healthFontSize = v
+				Azurah:ConfigureAttributeOverlays()
+			end,
+		},
+		-- -----------------------
+		-- OVERLAY: MAGICKA
+		-- -----------------------
+		{
+			type = "header",
+			name = L.AttributesOverlayMagicka,
+		},
+		{
+			type = "dropdown",
+			name = L.SettingOverlayFormat,
+			tooltip = L.AttributesOverlayFormatTip,
+			choices = dropOverlay,
+			getFunc = function() return dropOverlay[Azurah.db.attributes.magickaOverlay] end,
+			setFunc = function(arg)
+					Azurah.db.attributes.magickaOverlay = dropOverlayRef[arg]
+					Azurah:ConfigureAttributeOverlays()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.SettingOverlayFancy,
+			tooltip = L.SettingOverlayFancyTip,
+			getFunc = function() return Azurah.db.attributes.magickaOverlayFancy end,
+			setFunc = function(arg)
+					Azurah.db.attributes.magickaOverlayFancy = arg
+					Azurah:ConfigureAttributeOverlays()
+				end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayFont,
+			choices = LMP:List('font'),
+			getFunc = function()
+				return Azurah.db.attributes.magickaFontFace
+			end,
+			setFunc = function(v)
+				Azurah.db.attributes.magickaFontFace = v
+				Azurah:ConfigureAttributeOverlays()
+			end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayStyle,
+			choices = dropFontStyle,
+			getFunc = function()
+				return Azurah.db.attributes.magickaFontOutline
+			end,
+			setFunc = function(v)
+				Azurah.db.attributes.magickaFontOutline = v
+				Azurah:ConfigureAttributeOverlays()
+			end,
+		},
+		{
+			type = 'colorpicker',
+			getFunc = function()
+				return Azurah.db.attributes.magickaFontColour.r, Azurah.db.attributes.magickaFontColour.g, Azurah.db.attributes.magickaFontColour.b, Azurah.db.attributes.magickaFontColour.a
+			end,
+			setFunc = function(r, g, b, a)
+				Azurah.db.attributes.magickaFontColour.r = r
+				Azurah.db.attributes.magickaFontColour.g = g
+				Azurah.db.attributes.magickaFontColour.b = b
+				Azurah.db.attributes.magickaFontColour.a = a
+				Azurah:ConfigureAttributeOverlays()
+			end,
+			isFontColour = true,
+		},
+		{
+			type = 'slider',
+			name = L.SettingOverlaySize,
+			min = 8,
+			max = 32,
+			getFunc = function()
+				return Azurah.db.attributes.magickaFontSize
+			end,
+			setFunc = function(v)
+				Azurah.db.attributes.magickaFontSize = v
+				Azurah:ConfigureAttributeOverlays()
+			end,
+		},
+		-- -----------------------
+		-- OVERLAY: STAMINA
+		-- -----------------------
+		{
+			type = "header",
+			name = L.AttributesOverlayStamina,
+		},
+		{
+			type = "dropdown",
+			name = L.SettingOverlayFormat,
+			tooltip = L.AttributesOverlayFormatTip,
+			choices = dropOverlay,
+			getFunc = function() return dropOverlay[Azurah.db.attributes.staminaOverlay] end,
+			setFunc = function(arg)
+					Azurah.db.attributes.staminaOverlay = dropOverlayRef[arg]
+					Azurah:ConfigureAttributeOverlays()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.SettingOverlayFancy,
+			tooltip = L.SettingOverlayFancyTip,
+			getFunc = function() return Azurah.db.attributes.staminaOverlayFancy end,
+			setFunc = function(arg)
+					Azurah.db.attributes.staminaOverlayFancy = arg
+					Azurah:ConfigureAttributeOverlays()
+				end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayFont,
+			choices = LMP:List('font'),
+			getFunc = function()
+				return Azurah.db.attributes.staminaFontFace
+			end,
+			setFunc = function(v)
+				Azurah.db.attributes.staminaFontFace = v
+				Azurah:ConfigureAttributeOverlays()
+			end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayStyle,
+			choices = dropFontStyle,
+			getFunc = function()
+				return Azurah.db.attributes.staminaFontOutline
+			end,
+			setFunc = function(v)
+				Azurah.db.attributes.staminaFontOutline = v
+				Azurah:ConfigureAttributeOverlays()
+			end,
+		},
+		{
+			type = 'colorpicker',
+			getFunc = function()
+				return Azurah.db.attributes.staminaFontColour.r, Azurah.db.attributes.staminaFontColour.g, Azurah.db.attributes.staminaFontColour.b, Azurah.db.attributes.staminaFontColour.a
+			end,
+			setFunc = function(r, g, b, a)
+				Azurah.db.attributes.staminaFontColour.r = r
+				Azurah.db.attributes.staminaFontColour.g = g
+				Azurah.db.attributes.staminaFontColour.b = b
+				Azurah.db.attributes.staminaFontColour.a = a
+				Azurah:ConfigureAttributeOverlays()
+			end,
+			isFontColour = true,
+		},
+		{
+			type = 'slider',
+			name = L.SettingOverlaySize,
+			min = 8,
+			max = 32,
+			getFunc = function()
+				return Azurah.db.attributes.staminaFontSize
+			end,
+			setFunc = function(v)
+				Azurah.db.attributes.staminaFontSize = v
+				Azurah:ConfigureAttributeOverlays()
+			end,
+		},
+	},
+	-- -----------------------
+	-- TARGET PANEL
+	-- -----------------------
+	[3] = {
+		{
+			type = "checkbox",
+			name = L.TargetLockSize,
+			tooltip = L.TargetLockSizeTip,
+			getFunc = function() return Azurah.db.target.lockSize end,
+			setFunc = function(arg)
+					Azurah.db.target.lockSize = arg
+					Azurah:ConfigureTargetSizeLock()
+				end
+		},
+		{
+			type = "dropdown",
+			name = L.TargetColourByBar,
+			tooltip = L.TargetColourByBarTip,
+			choices = dropColourBy,
+			getFunc = function() return dropColourBy[Azurah.db.target.colourByBar] end,
+			setFunc = function(arg)
+					Azurah.db.target.colourByBar = dropColourByRef[arg]
+					Azurah:ConfigureTargetColouring()
+				end,
+		},
+		{
+			type = "dropdown",
+			name = L.TargetColourByName,
+			tooltip = L.TargetColourByNameTip,
+			choices = dropColourBy,
+			getFunc = function() return dropColourBy[Azurah.db.target.colourByName] end,
+			setFunc = function(arg)
+					Azurah.db.target.colourByName = dropColourByRef[arg]
+					Azurah:ConfigureTargetColouring()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.TargetColourByLevel,
+			tooltip = L.TargetColourByLevelTip,
+			getFunc = function() return Azurah.db.target.colourByLevel end,
+			setFunc = function(arg)
+					Azurah.db.target.colourByLevel = arg
+					Azurah:ConfigureTargetColouring()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.TargetIconClassShow,
+			tooltip = L.TargetIconClassShowTip,
+			getFunc = function() return Azurah.db.target.classShow end,
+			setFunc = function(arg)
+					Azurah.db.target.classShow = arg
+					Azurah:ConfigureTargetIcons()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.TargetIconClassByName,
+			tooltip = L.TargetIconClassByNameTip,
+			getFunc = function() return Azurah.db.target.classByName end,
+			setFunc = function(arg)
+					Azurah.db.target.classByName = arg
+					Azurah:ConfigureTargetIcons()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.TargetIconAllianceShow,
+			tooltip = L.TargetIconAllianceShowTip,
+			getFunc = function() return Azurah.db.target.allianceShow end,
+			setFunc = function(arg)
+					Azurah.db.target.allianceShow = arg
+					Azurah:ConfigureTargetIcons()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.TargetIconAllianceByName,
+			tooltip = L.TargetIconAllianceByNameTip,
+			getFunc = function() return Azurah.db.target.allianceByName end,
+			setFunc = function(arg)
+					Azurah.db.target.allianceByName = arg
+					Azurah:ConfigureTargetIcons()
+				end,
+		},
+		{
+			type = "dropdown",
+			name = L.SettingOverlayFormat,
+			tooltip = L.TargetOverlayFormatTip,
+			choices = dropOverlay,
+			getFunc = function() return dropOverlay[Azurah.db.target.overlay] end,
+			setFunc = function(arg)
+					Azurah.db.target.overlay = dropOverlayRef[arg]
+					Azurah:ConfigureTargetOverlay()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.SettingOverlayFancy,
+			tooltip = L.SettingOverlayFancyTip,
+			getFunc = function() return Azurah.db.target.overlayFancy end,
+			setFunc = function(arg)
+					Azurah.db.target.overlayFancy = arg
+					Azurah:ConfigureTargetOverlay()
+				end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayFont,
+			choices = LMP:List('font'),
+			getFunc = function()
+				return Azurah.db.target.fontFace
+			end,
+			setFunc = function(v)
+				Azurah.db.target.fontFace = v
+				Azurah:ConfigureTargetOverlay()
+			end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayStyle,
+			choices = dropFontStyle,
+			getFunc = function()
+				return Azurah.db.target.fontOutline
+			end,
+			setFunc = function(v)
+				Azurah.db.target.fontOutline = v
+				Azurah:ConfigureTargetOverlay()
+			end,
+		},
+		{
+			type = 'colorpicker',
+			getFunc = function()
+				return Azurah.db.target.fontColour.r, Azurah.db.target.fontColour.g, Azurah.db.target.fontColour.b, Azurah.db.target.fontColour.a
+			end,
+			setFunc = function(r, g, b, a)
+				Azurah.db.target.fontColour.r = r
+				Azurah.db.target.fontColour.g = g
+				Azurah.db.target.fontColour.b = b
+				Azurah.db.target.fontColour.a = a
+				Azurah:ConfigureTargetOverlay()
+			end,
+			isFontColour = true,
+		},
+		{
+			type = 'slider',
+			name = L.SettingOverlaySize,
+			min = 8,
+			max = 32,
+			getFunc = function()
+				return Azurah.db.target.fontSize
+			end,
+			setFunc = function(v)
+				Azurah.db.target.fontSize = v
+				Azurah:ConfigureTargetOverlay()
+			end,
+		},
+		-- -----------------------
+		-- BOSSBAR SETTINGS
+		-- -----------------------
+		{
+			type = "header",
+			name = L.BossbarHeader,
+		},
+		{
+			type = "dropdown",
+			name = L.SettingOverlayFormat,
+			tooltip = L.BossbarOverlayFormatTip,
+			choices = dropOverlay,
+			getFunc = function() return dropOverlay[Azurah.db.bossbar.overlay] end,
+			setFunc = function(arg)
+					Azurah.db.bossbar.overlay = dropOverlayRef[arg]
+					Azurah:ConfigureBossbarOverlay()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.SettingOverlayFancy,
+			tooltip = L.SettingOverlayFancyTip,
+			getFunc = function() return Azurah.db.bossbar.overlayFancy end,
+			setFunc = function(arg)
+					Azurah.db.bossbar.overlayFancy = arg
+					Azurah:ConfigureBossbarOverlay()
+				end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayFont,
+			choices = LMP:List('font'),
+			getFunc = function()
+				return Azurah.db.bossbar.fontFace
+			end,
+			setFunc = function(v)
+				Azurah.db.bossbar.fontFace = v
+				Azurah:ConfigureBossbarOverlay()
+			end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayStyle,
+			choices = dropFontStyle,
+			getFunc = function()
+				return Azurah.db.bossbar.fontOutline
+			end,
+			setFunc = function(v)
+				Azurah.db.bossbar.fontOutline = v
+				Azurah:ConfigureBossbarOverlay()
+			end,
+		},
+		{
+			type = 'colorpicker',
+			getFunc = function()
+				return Azurah.db.bossbar.fontColour.r, Azurah.db.bossbar.fontColour.g, Azurah.db.bossbar.fontColour.b, Azurah.db.bossbar.fontColour.a
+			end,
+			setFunc = function(r, g, b, a)
+				Azurah.db.bossbar.fontColour.r = r
+				Azurah.db.bossbar.fontColour.g = g
+				Azurah.db.bossbar.fontColour.b = b
+				Azurah.db.bossbar.fontColour.a = a
+				Azurah:ConfigureBossbarOverlay()
+			end,
+			isFontColour = true,
+		},
+		{
+			type = 'slider',
+			name = L.SettingOverlaySize,
+			min = 8,
+			max = 32,
+			getFunc = function()
+				return Azurah.db.bossbar.fontSize
+			end,
+			setFunc = function(v)
+				Azurah.db.bossbar.fontSize = v
+				Azurah:ConfigureBossbarOverlay()
+			end,
+		},
+	},
+	-- -----------------------
+	-- ACTION BAR PANEL
+	-- -----------------------
+	[4] = {
+		{
+			type = "checkbox",
+			name = L.ActionBarHideBindBG,
+			tooltip = L.ActionBarHideBindBGTip,
+			getFunc = function() return Azurah.db.actionBar.hideBindBG end,
+			setFunc = function(arg)
+					Azurah.db.actionBar.hideBindBG = arg
+					Azurah:ConfigureActionBarElements()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.ActionBarHideBindText,
+			tooltip = L.ActionBarHideBindTextTip,
+			getFunc = function() return Azurah.db.actionBar.hideBindText end,
+			setFunc = function(arg)
+					Azurah.db.actionBar.hideBindText = arg
+					Azurah:ConfigureActionBarElements()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.ActionBarHideWeaponSwap,
+			tooltip = L.ActionBarHideWeaponSwapTip,
+			getFunc = function() return Azurah.db.actionBar.hideWeaponSwap end,
+			setFunc = function(arg)
+					Azurah.db.actionBar.hideWeaponSwap = arg
+					Azurah:ConfigureActionBarElements()
+				end,
+		},
+		-- ----------------------------
+		-- OVERLAY: ULTIMATE (VALUE)
+		-- ----------------------------
+		{
+			type = "header",
+			name = L.ActionBarOverlayUltValue,
+		},
+		{
+			type = "checkbox",
+			name = L.ActionBarOverlayShow,
+			tooltip = L.ActionBarOverlayUltValueShowTip,
+			getFunc = function() return Azurah.db.actionBar.ultValueShow end,
+			setFunc = function(arg)
+					Azurah.db.actionBar.ultValueShow = arg
+					Azurah:ConfigureUltimateOverlays()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.ActionBarOverlayUltValueShowCost,
+			tooltip = L.ActionBarOverlayUltValueShowCostTip,
+			getFunc = function() return Azurah.db.actionBar.ultValueShowCost end,
+			setFunc = function(arg)
+					Azurah.db.actionBar.ultValueShowCost = arg
+					Azurah:ConfigureUltimateOverlays()
+				end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayFont,
+			choices = LMP:List('font'),
+			getFunc = function()
+				return Azurah.db.actionBar.ultValueFontFace
+			end,
+			setFunc = function(v)
+				Azurah.db.actionBar.ultValueFontFace = v
+				Azurah:ConfigureUltimateOverlays()
+			end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayStyle,
+			choices = dropFontStyle,
+			getFunc = function()
+				return Azurah.db.actionBar.ultValueFontOutline
+			end,
+			setFunc = function(v)
+				Azurah.db.actionBar.ultValueFontOutline = v
+				Azurah:ConfigureUltimateOverlays()
+			end,
+		},
+		{
+			type = 'colorpicker',
+			getFunc = function()
+				return Azurah.db.actionBar.ultValueFontColour.r, Azurah.db.actionBar.ultValueFontColour.g, Azurah.db.actionBar.ultValueFontColour.b, Azurah.db.actionBar.ultValueFontColour.a
+			end,
+			setFunc = function(r, g, b, a)
+				Azurah.db.actionBar.ultValueFontColour.r = r
+				Azurah.db.actionBar.ultValueFontColour.g = g
+				Azurah.db.actionBar.ultValueFontColour.b = b
+				Azurah.db.actionBar.ultValueFontColour.a = a
+				Azurah:ConfigureUltimateOverlays()
+			end,
+			isFontColour = true,
+		},
+		{
+			type = 'slider',
+			name = L.SettingOverlaySize,
+			min = 8,
+			max = 32,
+			getFunc = function()
+				return Azurah.db.actionBar.ultValueFontSize
+			end,
+			setFunc = function(v)
+				Azurah.db.actionBar.ultValueFontSize = v
+				Azurah:ConfigureUltimateOverlays()
+			end,
+		},
+		-- ----------------------------
+		-- OVERLAY: ULTIMATE (PERCENT)
+		-- ----------------------------
+		{
+			type = "header",
+			name = L.ActionBarOverlayUltPercent,
+		},
+		{
+			type = "checkbox",
+			name = L.ActionBarOverlayShow,
+			tooltip = L.ActionBarOverlayUltPercentShowTip,
+			getFunc = function() return Azurah.db.actionBar.ultPercentShow end,
+			setFunc = function(arg)
+					Azurah.db.actionBar.ultPercentShow = arg
+					Azurah:ConfigureUltimateOverlays()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.ActionBarOverlayUltPercentRelative,
+			tooltip = L.ActionBarOverlayUltPercentRelativeTip,
+			getFunc = function() return Azurah.db.actionBar.ultPercentRelative end,
+			setFunc = function(arg)
+					Azurah.db.actionBar.ultPercentRelative = arg
+					Azurah:ConfigureUltimateOverlays()
+				end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayFont,
+			choices = LMP:List('font'),
+			getFunc = function()
+				return Azurah.db.actionBar.ultPercentFontFace
+			end,
+			setFunc = function(v)
+				Azurah.db.actionBar.ultPercentFontFace = v
+				Azurah:ConfigureUltimateOverlays()
+			end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayStyle,
+			choices = dropFontStyle,
+			getFunc = function()
+				return Azurah.db.actionBar.ultPercentFontOutline
+			end,
+			setFunc = function(v)
+				Azurah.db.actionBar.ultPercentFontOutline = v
+				Azurah:ConfigureUltimateOverlays()
+			end,
+		},
+		{
+			type = 'colorpicker',
+			getFunc = function()
+				return Azurah.db.actionBar.ultPercentFontColour.r, Azurah.db.actionBar.ultPercentFontColour.g, Azurah.db.actionBar.ultPercentFontColour.b, Azurah.db.actionBar.ultPercentFontColour.a
+			end,
+			setFunc = function(r, g, b, a)
+				Azurah.db.actionBar.ultPercentFontColour.r = r
+				Azurah.db.actionBar.ultPercentFontColour.g = g
+				Azurah.db.actionBar.ultPercentFontColour.b = b
+				Azurah.db.actionBar.ultPercentFontColour.a = a
+				Azurah:ConfigureUltimateOverlays()
+			end,
+			isFontColour = true,
+		},
+		{
+			type = 'slider',
+			name = L.SettingOverlaySize,
+			min = 8,
+			max = 32,
+			getFunc = function()
+				return Azurah.db.actionBar.ultPercentFontSize
+			end,
+			setFunc = function(v)
+				Azurah.db.actionBar.ultPercentFontSize = v
+				Azurah:ConfigureUltimateOverlays()
+			end,
+		},
+	},
+	-- ----------------------------
+	-- EXPERIENCE BAR PANEL
+	-- ----------------------------
+	[5] = {
+		{
+			type = "dropdown",
+			name = L.ExperienceDisplayStyle,
+			tooltip = L.ExperienceDisplayStyleTip,
+			choices = dropExpBarStyle,
+			getFunc = function() return dropExpBarStyle[Azurah.db.experienceBar.displayStyle] end,
+			setFunc = function(arg)
+					Azurah.db.experienceBar.displayStyle = dropExpBarStyleRef[arg]
+					Azurah:ConfigureExperienceBarDisplay()
+				end,
+		},
+		{
+			type = "dropdown",
+			name = L.SettingOverlayFormat,
+			tooltip = L.ExperienceOverlayFormatTip,
+			choices = dropOverlay,
+			getFunc = function() return dropOverlay[Azurah.db.experienceBar.overlay] end,
+			setFunc = function(arg)
+					Azurah.db.experienceBar.overlay = dropOverlayRef[arg]
+					Azurah:ConfigureExperienceBarOverlay()
+				end,
+		},
+		{
+			type = "checkbox",
+			name = L.SettingOverlayFancy,
+			tooltip = L.SettingOverlayFancyTip,
+			getFunc = function() return Azurah.db.experienceBar.overlayFancy end,
+			setFunc = function(arg)
+					Azurah.db.experienceBar.overlayFancy = arg
+					Azurah:ConfigureExperienceBarOverlay()
+				end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayFont,
+			choices = LMP:List('font'),
+			getFunc = function()
+				return Azurah.db.experienceBar.fontFace
+			end,
+			setFunc = function(v)
+				Azurah.db.experienceBar.fontFace = v
+				Azurah:ConfigureExperienceBarOverlay()
+			end,
+		},
+		{
+			type = 'dropdown',
+			name = L.SettingOverlayStyle,
+			choices = dropFontStyle,
+			getFunc = function()
+				return Azurah.db.experienceBar.fontOutline
+			end,
+			setFunc = function(v)
+				Azurah.db.experienceBar.fontOutline = v
+				Azurah:ConfigureExperienceBarOverlay()
+			end,
+		},
+		{
+			type = 'colorpicker',
+			getFunc = function()
+				return Azurah.db.experienceBar.fontColour.r, Azurah.db.experienceBar.fontColour.g, Azurah.db.experienceBar.fontColour.b, Azurah.db.experienceBar.fontColour.a
+			end,
+			setFunc = function(r, g, b, a)
+				Azurah.db.experienceBar.fontColour.r = r
+				Azurah.db.experienceBar.fontColour.g = g
+				Azurah.db.experienceBar.fontColour.b = b
+				Azurah.db.experienceBar.fontColour.a = a
+				Azurah:ConfigureExperienceBarOverlay()
+			end,
+			isFontColour = true,
+		},
+		{
+			type = 'slider',
+			name = L.SettingOverlaySize,
+			min = 8,
+			max = 32,
+			getFunc = function()
+				return Azurah.db.experienceBar.fontSize
+			end,
+			setFunc = function(v)
+				Azurah.db.experienceBar.fontSize = v
+				Azurah:ConfigureExperienceBarOverlay()
+			end,
+		},
+	},
+	-- ----------------------------
+	-- PROFILES PANEL
+	-- ----------------------------
+	[6] = {
+		{
+			type = "dropdown",
+			name = L.ProfileCharacterList,
+			tooltip = L.ProfileCharacterListTip,
+			choices = availableProfiles,
+			getFunc = function()
+					if (#availableProfiles >= 1) then -- if there are entries, set the first as default
+						if (not profileToCopy) then -- profile hasn't been set yet
+							profileToCopy = availableProfiles[1]
+						end
+
+						return availableProfiles[1]
+					end
+				end,
+			setFunc = function(arg)
+				profileToCopy = arg
+			end,
+		},
+		{
+			type = "button",
+			name = L.ProfileCopyFrom,
+			tooltip = L.ProfileCopyFromTip,
+			warning = L.ProfileCopyFromWarn,
+			func = function(btn)
+				CopyProfileSettings(profileToCopy)
+			end,
+		},
+	},
+}
diff --git a/Target.lua b/Target.lua
index 0e3b9e8..495b965 100644
--- a/Target.lua
+++ b/Target.lua
@@ -1,5 +1,5 @@
-local Azurah = _G['Azurah'] -- grab addon table from global
-local LMP = LibStub('LibMediaProvider-1.0')
+local Azurah		= _G['Azurah'] -- grab addon table from global
+local LMP			= LibStub('LibMediaProvider-1.0')

 -- UPVALUES --
 local POWERTYPE_HEALTH		= POWERTYPE_HEALTH
@@ -14,24 +14,26 @@ local strformat				= string.format

 local classIcons = {
 	keyboard = {
-		[1]		= "/esoui/art/icons/class/class_dragonknight.dds",
-		[2]		= "/esoui/art/icons/class/class_sorcerer.dds",
-		[3]		= "/esoui/art/icons/class/class_nightblade.dds",
-		[6]		= "/esoui/art/icons/class/class_templar.dds"
+		[1]		= [[/esoui/art/icons/class/class_dragonknight.dds]],
+		[2]		= [[/esoui/art/icons/class/class_sorcerer.dds]],
+		[3]		= [[/esoui/art/icons/class/class_nightblade.dds]],
+		[6]		= [[/esoui/art/icons/class/class_templar.dds]]
 	},
 	gamepad = {
-		[1]		= "/esoui/art/icons/class/gamepad/gp_class_dragonknight.dds",
-		[2]		= "/esoui/art/icons/class/gamepad/gp_class_sorcerer.dds",
-		[3]		= "/esoui/art/icons/class/gamepad/gp_class_nightblade.dds",
-		[6]		= "/esoui/art/icons/class/gamepad/gp_class_templar.dds"
+		[1]		= [[/esoui/art/icons/class/gamepad/gp_class_dragonknight.dds]],
+		[2]		= [[/esoui/art/icons/class/gamepad/gp_class_sorcerer.dds]],
+		[3]		= [[/esoui/art/icons/class/gamepad/gp_class_nightblade.dds]],
+		[6]		= [[/esoui/art/icons/class/gamepad/gp_class_templar.dds]]
 	}
 }
+
 local allianceIcons = {
-	[1]		= [[/esoui/art/guild/guildbanner_icon_aldmeri.dds]],
-	[2]		= [[/esoui/art/guild/guildbanner_icon_ebonheart.dds]],
-	[3]		= [[/esoui/art/guild/guildbanner_icon_daggerfall.dds]],
-	[100]	= [[/esoui/art/ava/ava_allianceflag_neutral.dds]]
+	[1]			= [[/esoui/art/guild/guildbanner_icon_aldmeri.dds]],
+	[2]			= [[/esoui/art/guild/guildbanner_icon_ebonheart.dds]],
+	[3]			= [[/esoui/art/guild/guildbanner_icon_daggerfall.dds]],
+	[100]		= [[/esoui/art/ava/ava_allianceflag_neutral.dds]]
 }
+
 local playerLevel = GetUnitLevel('player')

 local reactR, reactG, reactB, conR, conG, conB, isTargetPlayer, isTargetVeteran
@@ -95,19 +97,19 @@ local function OnTargetChanged()
 			targetClass:SetTexture(classIcons.gamepad[GetUnitClassId('reticleover')])
 			targetClass:SetHidden(false)
 		end
-
+
 		if (db.classByName) then
 			if (isTargetVeteran) then
 				targetClass:ClearAnchors()
 				targetClass:SetAnchor(TOPRIGHT, targetVet, TOPLEFT, 2, 0)
 			else
 				targetClass:ClearAnchors()
-
+
 				if not IsInGamepadPreferredMode() then
-		    		targetClass:SetAnchor(TOPRIGHT, targetLevel, TOPLEFT, -2, -4)
+					targetClass:SetAnchor(TOPRIGHT, targetLevel, TOPLEFT, -2, -4)
 				else
-		    		targetClass:SetAnchor(TOPRIGHT, targetLevel, TOPLEFT, -6, 6)
-		    	end
+					targetClass:SetAnchor(TOPRIGHT, targetLevel, TOPLEFT, -6, 6)
+				end
 			end
 		else
 			targetClass:SetAnchor(RIGHT, ZO_TargetUnitFramereticleoverFrameLeft, LEFT, 0, 0)
@@ -179,14 +181,14 @@ function Azurah:ConfigureTargetIcons()
 			targetAlliance:SetAnchor(LEFT, ZO_TargetUnitFramereticleoverFrameRight, RIGHT, 0, 1)
 		end
 	end
-
-	if not IsInGamepadPreferredMode() or not db.classByName then
+
+	if (not IsInGamepadPreferredMode() or not db.classByName) then
 		targetClass:SetDimensions(32, 32)
 	else
 		targetClass:SetDimensions(40, 40)
 	end
-
-	if not IsInGamepadPreferredMode() or not db.allianceByName then
+
+	if (not IsInGamepadPreferredMode() or not db.allianceByName) then
 		targetAlliance:SetDimensions(32, 32)
 	else
 		targetAlliance:SetDimensions(40, 40)
@@ -209,6 +211,10 @@ function Azurah:ConfigureTargetSizeLock()
 	end
 end

+
+-- ------------------------
+-- INITIALIZATION
+-- ------------------------
 function Azurah:InitializeTarget()
 	db = self.db.target

diff --git a/Unlock.lua b/Unlock.lua
index dbd1c91..aebc9dc 100644
--- a/Unlock.lua
+++ b/Unlock.lua
@@ -1,5 +1,5 @@
-local Azurah = _G['Azurah'] -- grab addon table from global
-local L = Azurah:GetLocale()
+local Azurah		= _G['Azurah'] -- grab addon table from global
+local L				= Azurah:GetLocale()

 -- UPVALUES --
 local strformat				= string.format
@@ -61,48 +61,36 @@ local uiFrames = {
 local uiPanel


-
-
-
-
-
+-- ------------------------
+-- BUTTON FLIP ANIMATION OVERRIDE
+-- ------------------------
 local origApplyFlipAnimationStyle = ActionButton.ApplyFlipAnimationStyle

 local function ApplyFlipAnimationStyle(self)
-    local timeline = self.hotbarSwapAnimation
+	local timeline = self.hotbarSwapAnimation

-    if (timeline) then
-        local width, height = self.flipCard:GetDimensions()
-        local scale = self.flipCard:GetScale()
+	if (timeline) then
+		local width, height = self.flipCard:GetDimensions()
+		local scale = self.flipCard:GetScale()

-        width, height = (width / scale) , (height / scale)
+		width, height = (width / scale) , (height / scale)

-        local firstAnimation = timeline:GetFirstAnimation()
-        local lastAnimation = timeline:GetLastAnimation()
+		local firstAnimation = timeline:GetFirstAnimation()
+		local lastAnimation = timeline:GetLastAnimation()

-        firstAnimation:SetStartAndEndWidth(width, width)
-        firstAnimation:SetStartAndEndHeight(height, 0)
-        lastAnimation:SetStartAndEndWidth(width, width)
-        lastAnimation:SetStartAndEndHeight(0, height)
-    end
+		firstAnimation:SetStartAndEndWidth(width, width)
+		firstAnimation:SetStartAndEndHeight(height, 0)
+		lastAnimation:SetStartAndEndWidth(width, width)
+		lastAnimation:SetStartAndEndHeight(0, height)
+	end
 end


-
-
-
-
-
-
-
-
-
+-- ------------------------
+-- ALERT TEXT ALIGNMENT OVERRIDE
+-- ------------------------
 local alertTextAlign = TEXT_ALIGN_RIGHT

--- --------------------------------------------
--- ALERT TEXT ALIGNMENT -----------------------
--- --------------------------------------------
-
 local function AlertTextNotificationAlignmentFunc(control, data)
 	control:SetWidth(ZO_Compass:GetLeft() - GuiRoot:GetLeft() - 40)
 	control:SetText(data.text)
@@ -121,7 +109,7 @@ local function ConfigureAlertTextNotificationTextAlign(point)
 		alertTextAlign = TEXT_ALIGN_RIGHT
 	end

-	if not IsInGamepadPreferredMode() then
+	if (not IsInGamepadPreferredMode()) then
 		line = ZO_AlertTextNotification:GetChild(1)
 	else
 		line = ZO_AlertTextNotificationGamepad:GetChild(1)
@@ -130,12 +118,12 @@ local function ConfigureAlertTextNotificationTextAlign(point)
 	line.fadingControlBuffer.anchor = ZO_Anchor:New(point)
 end

--- --------------------------------------------
--- DEFAULT ------------------------------------
--- --------------------------------------------

+-- ------------------------
+-- DEFAULTS
+-- ------------------------
 function Azurah:RestoreDefaultData()
-	if not IsInGamepadPreferredMode() then
+	if (not IsInGamepadPreferredMode()) then
 		self.db.uiData.keyboard = {}
 	else
 		self.db.uiData.gamepad = {}
@@ -144,54 +132,11 @@ function Azurah:RestoreDefaultData()
 	ReloadUI('ingame')
 end

---[[
-function Azurah:RecordDefaultData()
-	local point, rel, relPoint, x, y, data
-
-	for frame in pairs(uiFrames) do -- record default position data
-		_, point, rel, relPoint, x, y = _G[frame]:GetAnchor()
-
-		defaultUIData[frame] = {
-			['point']		= point,
-			['rel']			= rel,
-			['relPoint']	= relPoint,
-			['x']			= x,
-			['y']			= y,
-			['scale']		= _G[frame]:GetScale()
-		}
-	end
-end
-
-function Azurah:RestoreDefaultData() -- reset all frames to default positions
-	local data, obj
-
-	for frame in pairs(uiFrames) do
-		obj, data = _G[frame], defaultUIData[frame]
-
-		if (self.db.uiData[frame]) then
-			self.db.uiData[frame] = nil -- cleanse user data
-		end
-
-		obj:ClearAnchors()
-		obj:SetAnchor(data.point, data.rel, data.relPoint, data.x, data.y)
-		obj:SetScale(data.scale)
-
-		self.movers[obj]:Sync() -- reset attachments to new frame positions
-	end
-
-	AZ_MOVED_COMPASS	= false	-- GLOBALS FOR WYKKYD
-	AZ_MOVED_TARGET		= false	-- GLOBALS FOR WYKKYD
-
-	ConfigureAlertTextNotificationTextAlign(9) -- configure the alignment of alert text notifications
-end
---]]
-
--- --------------------------------------------
--- USER ---------------------------------------
--- --------------------------------------------
-
+-- ------------------------
+-- USER SETTINGS
+-- ------------------------
 function Azurah:RecordUserData(frame, point, x, y, scale)
-	if not IsInGamepadPreferredMode() then
+	if (not IsInGamepadPreferredMode()) then
 		if (not self.db.uiData.keyboard[frame]) then
 			self.db.uiData.keyboard[frame] = {}
 		end
@@ -237,7 +182,7 @@ function Azurah:RecordUserData(frame, point, x, y, scale)
 	end

 	if (frame == 'ZO_ActionBar1') then
-		if (scale ~= 1) then -- scale of action bar is not the default, replace ActionButton.ApplyFlipAnimationStyle
+		if (scale ~= 1) then -- scale of action bar is not the default, replace ActionButton.ApplyFlipAnimationStyle with our own
 			ActionButton.ApplyFlipAnimationStyle = ApplyFlipAnimationStyle
 		else -- scale is default, ensure original function is in place
 			ActionButton.ApplyFlipAnimationStyle = origApplyFlipAnimationStyle
@@ -248,28 +193,28 @@ end
 function Azurah:RestoreUserData()
 	local obj, userData, framesList

-	if self.db.uiData and not self.db.uiData.keyboard then
+	if (self.db.uiData and not self.db.uiData.keyboard) then
 		-- Old data conversion
-		self.db.oldData = self.db.uiData
-		self.db.uiData = nil
-
-		self.db.uiData = {}
-		self.db.uiData.keyboard = self.db.oldData
-		self.db.uiData.gamepad = {}
-		self.db.oldData = nil
-	elseif not self.db.uiData then
+		self.db.oldData			= self.db.uiData
+		self.db.uiData			= nil
+
+		self.db.uiData			= {}
+		self.db.uiData.keyboard	= self.db.oldData
+		self.db.uiData.gamepad	= {}
+		self.db.oldData			= nil
+	elseif (not self.db.uiData) then
 		-- Create new data
-		self.db.uiData = {}
-		self.db.uiData.keyboard = {}
-		self.db.uiData.gamepad = {}
+		self.db.uiData			= {}
+		self.db.uiData.keyboard	= {}
+		self.db.uiData.gamepad	= {}
 	end

-	if not IsInGamepadPreferredMode() then
-		userData = self.db.uiData.keyboard
-		framesList = uiFrames.keyboard
+	if (not IsInGamepadPreferredMode()) then
+		userData	= self.db.uiData.keyboard
+		framesList	= uiFrames.keyboard
 	else
-		userData = self.db.uiData.gamepad
-		framesList = uiFrames.gamepad
+		userData	= self.db.uiData.gamepad
+		framesList	= uiFrames.gamepad
 	end

 	for frame, data in pairs(framesList) do
@@ -282,7 +227,7 @@ function Azurah:RestoreUserData()

 		-- special cases
 		if (frame == 'ZO_PlayerAttributeHealth') then -- scale attached bar
-			if userData[frame] then
+			if (userData[frame]) then
 				ZO_PlayerAttributeSiegeHealth:SetScale(userData[frame].scale)
 			else
 				ZO_PlayerAttributeMountStamina:SetScale(1)
@@ -290,7 +235,7 @@ function Azurah:RestoreUserData()
 		end

 		if (frame == 'ZO_PlayerAttributeMagicka') then -- scale attached bar
-			if userData[frame] then
+			if (userData[frame]) then
 				ZO_PlayerAttributeWerewolf:SetScale(userData[frame].scale)
 			else
 				ZO_PlayerAttributeMountStamina:SetScale(1)
@@ -298,7 +243,7 @@ function Azurah:RestoreUserData()
 		end

 		if (frame == 'ZO_PlayerAttributeStamina') then -- scale attached bar
-			if userData[frame] then
+			if (userData[frame]) then
 				ZO_PlayerAttributeMountStamina:SetScale(userData[frame].scale)
 			else
 				ZO_PlayerAttributeMountStamina:SetScale(1)
@@ -309,7 +254,7 @@ function Azurah:RestoreUserData()
 			ConfigureAlertTextNotificationTextAlign(userData[frame].point) -- configure the alignment of alert text notifications
 		end

-		if userData[frame] then
+		if (userData[frame]) then
 			obj:ClearAnchors()
 			obj:SetAnchor(userData[frame].point, GuiRoot, userData[frame].point, userData[frame].x, userData[frame].y)
 			obj:SetScale(userData[frame].scale)
@@ -335,130 +280,10 @@ function Azurah:RestoreUserData()
 	end
 end

---[[
-function Azurah:RecordUserData(frame, point, x, y, scale)
-	if (not self.db.uiData[frame]) then
-		self.db.uiData[frame] = {}
-	end
-
-	self.db.uiData[frame].point		= point
-	self.db.uiData[frame].x			= x
-	self.db.uiData[frame].y			= y
-	self.db.uiData[frame].scale		= scale
-
-	-- special cases
-	if (frame == 'ZO_CompassframeName') then
-		AZ_MOVED_COMPASS = true	-- GLOBALS FOR WYKKYD
-	end
-
-	if (frame == 'ZO_TargetUnitFramereticleover') then
-		AZ_MOVED_TARGET = true	-- GLOBALS FOR WYKKYD
-	end
-
-	if (frame == 'ZO_PlayerAttributeHealth') then -- scale attached bar
-		ZO_PlayerAttributeSiegeHealth:SetScale(scale)
-	end
-
-	if (frame == 'ZO_PlayerAttributeMagicka') then -- scale attached bar
-		ZO_PlayerAttributeWerewolf:SetScale(scale)
-	end
-
-	if (frame == 'ZO_PlayerAttributeStamina') then -- scale attached bar
-		ZO_PlayerAttributeMountStamina:SetScale(scale)
-	end
-
-	if (frame == 'ZO_AlertTextNotification') then -- configure the alignment of alert text notifications
-		ConfigureAlertTextNotificationTextAlign(point)
-	end
-
--- 	if (frame == 'ZO_PlayerProgress') then
--- 		PLAYER_PROGRESS_BAR_KEYBOARD_ANCHOR_TOP_LEFT_FRAGMENT.anchor.data = { point, GuiRoot, point, x, y }
--- 	end
-end
-
-function Azurah:RestoreUserData()
-	local obj
-
-	for frame, data in pairs(self.db.uiData) do
-		-- fix for renamed frames
-		if (frame == 'ZO_ExperienceBar') then
-			self.db.uiData['ZO_PlayerProgress'] = data
-			self.db.uiData['ZO_ExperienceBar'] = nil
-			frame = 'ZO_PlayerProgress'
-		elseif (frame == 'ZO_PlayerProgressBar') then
-			self.db.uiData['ZO_PlayerProgress'] = data
-			self.db.uiData['ZO_PlayerProgressBar'] = nil
-			frame = 'ZO_PlayerProgress'
-		elseif (frame == 'ZO_TutorialHudInfoTip') then
-			self.db.uiData['ZO_TutorialHudInfoTipKeyboard'] = data
-			self.db.uiData['ZO_TutorialHudInfoTip'] = nil
-			frame = 'ZO_TutorialHudInfoTipKeyboard'
-		end
-
-		obj = _G[frame]
-
-	-- special cases
-		if (frame == 'ZO_CompassFrame') then
-			AZ_MOVED_COMPASS = true	-- GLOBALS FOR WYKKYD
-		end
-
-		if (frame == 'ZO_TargetUnitFramereticleover') then
-			AZ_MOVED_TARGET = true	-- GLOBALS FOR WYKKYD
-		end
-
-		if (frame == 'ZO_CenterScreenAnnounce') then -- special case, has no height
-			ZO_CenterScreenAnnounce:SetHeight(100)
-		end
-
-		if (frame == 'ZO_PlayerToPlayerAreaPromptContainer') then -- special case, has no height
-			ZO_PlayerToPlayerAreaPromptContainer:SetHeight(100)
-		end
-
-		if (frame == 'ZO_FocusedQuestTrackerPanel') then
-			ZO_FocusedQuestTrackerPanel:SetHeight(200)
-		end
-
-		if (frame == 'ZO_ActiveCombatTips') then
-			ZO_ActiveCombatTips:SetDimensions(250, 20)
-		end
-
-		if (frame == 'ZO_PlayerAttributeHealth') then -- scale attached bar
-			ZO_PlayerAttributeSiegeHealth:SetScale(data.scale)
-		end
-
-		if (frame == 'ZO_PlayerAttributeMagicka') then -- scale attached bar
-			ZO_PlayerAttributeWerewolf:SetScale(data.scale)
-		end
-
-		if (frame == 'ZO_PlayerAttributeStamina') then -- scale attached bar
-			ZO_PlayerAttributeMountStamina:SetScale(data.scale)
-		end
-
-		if (frame == 'ZO_AlertTextNotification') then  -- set an actual size for positioning
-			ZO_AlertTextNotification:SetDimensions(600, 56)
-			ConfigureAlertTextNotificationTextAlign(data.point) -- configure the alignment of alert text notifications
-		end
-
-		if (frame == 'ZO_ActionBar1') then -- fix decoration for ultimate button
-			ActionButton8Decoration:ClearAnchors()
-			ActionButton8Decoration:SetAnchor(CENTER)
-		end
-
--- 		if (frame == 'ZO_PlayerProgress') then
--- 			PLAYER_PROGRESS_BAR_KEYBOARD_ANCHOR_TOP_LEFT_FRAGMENT.anchor.data = { data.point, GuiRoot, data.point, data.x, data.y }
--- 		end
-
-		obj:ClearAnchors()
-		obj:SetAnchor(data.point, GuiRoot, data.point, data.x, data.y)
-		obj:SetScale(data.scale)
-	end
-end
---]]
-
--- --------------------------------------------
--- UNLOCK PANEL -------------------------------
--- --------------------------------------------

+-- ------------------------
+-- UNLOCK PANEL
+-- ------------------------
 local function CreateButton(text, anchor, yOffset)
 	local btn = WINDOW_MANAGER:CreateControlFromVirtual(nil, uiPanel, 'ZO_DefaultButton')
 	btn:SetAnchor(TOP, anchor, BOTTOM, 0, yOffset)
@@ -558,7 +383,7 @@ end

 function Azurah:UnlockUI()
 	if (not uiPanel) then -- first time using the overlays, register!
-		BuildUnlockPanel() -- build ui panel to
+		BuildUnlockPanel() -- build ui panel

 		local mover, userData, framesList

@@ -592,63 +417,10 @@ function Azurah:UnlockUI()
 	self.uiUnlocked = true
 end

---[[
-function Azurah:LockUI()
-	self.uiUnlocked = false
-
-	if (uiPanel) then
-		uiPanel:SetHidden(true)
-	end
-end
-
-function Azurah:UnlockUI()
-	if (not uiPanel) then -- first time using the overlays, register!
-		BuildUnlockPanel() -- build ui panel to
-
-		local mover
-
-		for frame, data in pairs(uiFrames) do
-			if (frame == 'ZO_AlertTextNotification') then -- special case, has no dimensions
-				ZO_AlertTextNotification:SetDimensions(600, 56)
-			end
-
-			if (frame == 'ZO_CenterScreenAnnounce') then -- special case, has no height
-				ZO_CenterScreenAnnounce:SetHeight(100)
-			end
-
-			if (frame == 'ZO_PlayerToPlayerAreaPromptContainer') then -- special case, has no height
-				ZO_PlayerToPlayerAreaPromptContainer:SetHeight(100)
-			end
-
-			if (frame == 'ZO_FocusedQuestTrackerPanel') then
-				ZO_FocusedQuestTrackerPanel:SetHeight(200)
-			end
-
-			if (frame == 'ZO_ObjectiveCaptureMeter') then -- special case, has no dimensions
-				ZO_ObjectiveCaptureMeter:SetDimensions(128, 128)
-			end
-
-			mover = self.Mover:New(_G[frame], data[2])
-
-			if (data[1] == 2) then -- anchored frame, show but disallow drag
-				mover:SetMouseEnabled(false)
-				mover.overlay:SetCenterColor(0.6, 0.6, 0.6, 0.32)
-				mover.overlay:SetEdgeColor(0.6, 0.6, 0.6, 1)
-				mover.label:SetColor(0.6, 0.6, 0.6, 1)
-			end
-		end
-	end
-
-	uiPanel:SetHidden(false)
-
-	self.uiUnlocked = true
-end
---]]
-
--- --------------------------------------------
--- COMPASS PINS -------------------------------
--- --------------------------------------------

+-- ------------------------
+-- COMPASS PINS
+-- ------------------------
 local compassPinScaleRef

 local function OnPinAreaChanged()
@@ -680,10 +452,10 @@ function Azurah:ConfigureCompass()
 	end
 end

--- --------------------------------------------
--- INIT ---------------------------------------
--- --------------------------------------------

+-- ------------------------
+-- INITIALIZATION
+-- ------------------------
 local function ApplyTemplateHook(obj, funcName, controlName)
 	local origFunc = obj[funcName]

@@ -734,7 +506,6 @@ function Azurah:InitializeUnlock()
 		line.fadingControlBuffer.templates.ZO_AlertLineGamepad.setup = AlertTextNotificationAlignmentFunc
 	end

-	--self:RecordDefaultData()
 	self:RestoreUserData()

 	if not IsInGamepadPreferredMode() then
@@ -772,4 +543,3 @@ function Azurah:InitializeUnlock()

 	self:ConfigureCompass()
 end
-