local E, L, V, P, G = unpack(ElvUI);
local mPlugin = "mMediaTag"
local mMT = E:GetModule(mPlugin);
local DT = E:GetModule("DataTexts");
local addon, ns = ...

--Lua functions
local pairs = pairs
local format = format
local tonumber = tonumber
local strjoin = strjoin
local select = select
local mInsert = table.insert

--Variables
local LSM = LibStub("LibSharedMedia-3.0")
local TextureList, mIconsList = nil, nil
local mFontFlags = {
	NONE = L["NONE"],
	OUTLINE = 'Outline',
	THICKOUTLINE = 'Thick',
	MONOCHROME = '|cffaaaaaaMono|r',
	MONOCHROMEOUTLINE = '|cffaaaaaaMono|r Outline',
	MONOCHROMETHICKOUTLINE = '|cffaaaaaaMono|r Thick',
}

local function mTextureList()
	if not TextureList then
        local tmpTexture = {}
        local i = 0
        for i in pairs(mIconsList) do
            tmpTexture[i] = mIconsList[i].icon
        end
        TextureList = tmpTexture
    end
	return TextureList
end

local function mTGAtoIcon(file, name, i)
	return format("|T%s:16:16:0:0:128:128|t %s - %s", file, name, i)
end

local function SetupDockIconList()
	if not mIconsList then
        local tmpIcon = {}
		local tIndex = 1

		-- Collection
        for i=1, 18, 1 do
            local path = format("Interface\\AddOns\\ElvUI_mMediaTag\\media\\dock\\collection\\collection%s.tga", i)
            tmpIcon[tIndex] = {["file"] = path, ["icon"] = mTGAtoIcon(path, "Collection", i)}
			tIndex = tIndex +1
        end

		-- Other
        for i=1, 30, 1 do
            local path = format("Interface\\AddOns\\ElvUI_mMediaTag\\media\\dock\\other\\other%s.tga", i)
            tmpIcon[tIndex] = {["file"] = path, ["icon"] = mTGAtoIcon(path, "Other", i)}
			tIndex = tIndex +1
        end

		-- Quest
        for i=1, 19, 1 do
            local path = format("Interface\\AddOns\\ElvUI_mMediaTag\\media\\dock\\quest\\quest%s.tga", i)
            tmpIcon[tIndex] = {["file"] = path, ["icon"] = mTGAtoIcon(path, "Quest", i)}
			tIndex = tIndex +1
        end

		-- Shop
        for i=1, 7, 1 do
            local path = format("Interface\\AddOns\\ElvUI_mMediaTag\\media\\dock\\shop\\shop%s.tga", i)
            tmpIcon[tIndex] = {["file"] = path, ["icon"] = mTGAtoIcon(path, "Shop", i)}
			tIndex = tIndex +1
        end

		-- Social
        for i=1, 19, 1 do
            local path = format("Interface\\AddOns\\ElvUI_mMediaTag\\media\\dock\\social\\social%s.tga", i)
            tmpIcon[tIndex] = {["file"] = path, ["icon"] = mTGAtoIcon(path, "Social", i)}
			tIndex = tIndex +1
        end

		-- FPS
        for i=1, 3, 1 do
            local path = format("Interface\\AddOns\\ElvUI_mMediaTag\\media\\dock\\system\\fps%s.tga", i)
            tmpIcon[tIndex] = {["file"] = path, ["icon"] = mTGAtoIcon(path, "FPS", i)}
			tIndex = tIndex +1
        end

		-- MS
        for i=1, 3, 1 do
            local path = format("Interface\\AddOns\\ElvUI_mMediaTag\\media\\dock\\system\\ms%s.tga", i)
            tmpIcon[tIndex] = {["file"] = path, ["icon"] = mTGAtoIcon(path, "MS", i)}
			tIndex = tIndex +1
        end

		-- System
        for i=1, 35, 1 do
            local path = format("Interface\\AddOns\\ElvUI_mMediaTag\\media\\dock\\system\\system%s.tga", i)
            tmpIcon[tIndex] = {["file"] = path, ["icon"] = mTGAtoIcon(path, "System", i)}
			tIndex = tIndex +1
        end

		-- Toy
        for i=1, 25, 1 do
            local path = format("Interface\\AddOns\\ElvUI_mMediaTag\\media\\dock\\toy\\toy%s.tga", i)
            tmpIcon[tIndex] = {["file"] = path, ["icon"] = mTGAtoIcon(path, "Toy", i)}
			tIndex = tIndex +1
        end
		
        mIconsList = tmpIcon
    end
end

local function OptionsDock()
	SetupDockIconList()
	
	E.Options.args.mMediaTag.args.datatext.args.docks.args = {
		dockgeneral = {
			order = 10,
			type = "group",
			name = L['General'],
			args = {
				headerdockgeneralcolor= {
					order = 0,
					type = "header",
					name = L["Color"],
				},
				docknormalstyle = {
					order = 10,
					type = 'select',
					name = L["Normal Color Style"],
					get = function(info) return E.db[mPlugin].mDock.normal.style end,
					set = function(info, value)
						E.db[mPlugin].mDock.normal.style = value
						DT:LoadDataTexts()
					end,
					values = {
						class = L["Class"],
						custom = L["Custom"],
					},
				},
				docknormalcolor = {
					type = 'color',
					order = 11,
					name = L["Custom Icon Color"],
					hasAlpha = true,
					get = function(info)
						local t = E.db[mPlugin].mDock.normal
						return t.r, t.g, t.b, t.a
					end,
					set = function(info, r, g, b, a)
						local t = E.db[mPlugin].mDock.normal
						t.r, t.g, t.b, t.a = r, g, b, a
						DT:LoadDataTexts()
					end,
				},
				dockgeneralspacer1 = {
					order = 19,
					type = "description",
					name = "\n",
				},
				dockhoverstyle = {
					order = 20,
					type = 'select',
					name = L["Hover Color Style"],
					get = function(info) return E.db[mPlugin].mDock.hover.style end,
					set = function(info, value)
						E.db[mPlugin].mDock.hover.style = value
						DT:LoadDataTexts()
					end,
					values = {
						class = L["Class"],
						custom = L["Custom"],
					},
				},
				dockhovercolor = {
					type = 'color',
					order = 21,
					name = L["Custom hover Color"],
					hasAlpha = true,
					get = function(info)
						local t = E.db[mPlugin].mDock.hover
						return t.r, t.g, t.b, t.a
					end,
					set = function(info, r, g, b, a)
						local t = E.db[mPlugin].mDock.hover
						t.r, t.g, t.b, t.a = r, g, b, a
						DT:LoadDataTexts()
					end,
				},
				dockgeneralspacer2 = {
					order = 29,
					type = "description",
					name = "\n",
				},
				dockclickstyle = {
					order = 30,
					type = 'select',
					name = L["Click Color Style"],
					get = function(info) return E.db[mPlugin].mDock.click.style end,
					set = function(info, value)
						E.db[mPlugin].mDock.click.style = value
						DT:LoadDataTexts()
					end,
					values = {
						class = L["Class"],
						custom = L["Custom"],
					},
				},
				dockclickcolor = {
					type = 'color',
					order = 31,
					name = L["Custom click Color"],
					hasAlpha = true,
					get = function(info)
						local t = E.db[mPlugin].mDock.click
						return t.r, t.g, t.b, t.a
					end,
					set = function(info, r, g, b, a)
						local t = E.db[mPlugin].mDock.click
						t.r, t.g, t.b, t.a = r, g, b, a
						DT:LoadDataTexts()
					end,
				},
				dockgeneralspacer3 = {
					order = 39,
					type = "description",
					name = "\n",
				},
				docknotificationstyle = {
					order = 40,
					type = 'select',
					name = L["Nottification Color Style"],
					get = function(info) return E.db[mPlugin].mDock.nottification.style end,
					set = function(info, value)
						E.db[mPlugin].mDock.nottification.style = value
						DT:LoadDataTexts()
					end,
					values = {
						class = L["Class"],
						custom = L["Custom"],
					},
				},
				docknotificationcolor = {
					type = 'color',
					order = 42,
					name = L["Custom nottification Color"],
					hasAlpha = true,
					get = function(info)
						local t = E.db[mPlugin].mDock.nottification
						return t.r, t.g, t.b, t.a
					end,
					set = function(info, r, g, b, a)
						local t = E.db[mPlugin].mDock.nottification
						t.r, t.g, t.b, t.a = r, g, b, a
						DT:LoadDataTexts()
					end,
				},
				headerdockgeneralsettings= {
					order = 50,
					type = "header",
					name = L["Settings"],
				},
				
				dockgeneraltip = {
					order = 56,
					type = 'toggle',
					name = L["Tooltip"],
					get = function(info) return E.db[mPlugin].mDock.tip.enable end,
					set = function(info, value)
						E.db[mPlugin].mDock.tip.enable = value
					end,
				},
				dockgeneralspacer6 = {
					order = 59,
					type = "description",
					name = "\n",
				},
				headerdockgeneralfont= {
					order = 60,
					type = "header",
					name = L["Font"],
				},
				dockgeneralfont = {
					type = 'select', dialogControl = 'LSM30_Font',
					order = 61,
					name = L["Default Font"],
					values = LSM:HashTable('font'),
					get = function(info) return E.db[mPlugin].mDock.font end,
					set = function(info, value) E.db[mPlugin].mDock.font = value; DT:LoadDataTexts(); end,
				},
				dockgeneralfontStyle = {
					type = 'select',
					order = 62,
					name = L["Font contour"],
					values = mFontFlags,
					get = function(info) return E.db[mPlugin].mDock.fontflag end,
					set = function(info, value) E.db[mPlugin].mDock.fontflag = value; DT:LoadDataTexts(); end,
				},
				dockgeneralcustomfontSize = {
					order = 63,
					name = L["Custom Font Size"],
					type = 'toggle',
					get = function(info) return E.db[mPlugin].mDock.customfontzise end,
					set = function(info, value) E.db[mPlugin].mDock.customfontzise = value; DT:LoadDataTexts(); end,
				},
				dockgeneralfontSize = {
					order = 64,
					name = L["Font Size"],
					type = 'range',
					min = 6, max = 64, step = 1,
					softMin = 8, softMax = 32,
					get = function(info) return E.db[mPlugin].mDock.fontSize end,
					set = function(info, value) E.db[mPlugin].mDock.fontSize = value; DT:LoadDataTexts(); end,
					disabled = function() return not E.db[mPlugin].mDock.customfontzise end,
				},
			},
		},
		dockachievment = {
			order = 20,
			type = "group",
			name = ACHIEVEMENT_BUTTON,
			args = {
				dockachievmenticon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.achievement.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.achievement.name = value
						E.db[mPlugin].mDock.achievement.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mAchievement")
					end,
					values = mTextureList(),
				},
			},
		},
		dockblizzardstore = {
			order = 30,
			type = "group",
			name = BLIZZARD_STORE,
			args = {
				dockblizzardstoreicon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.blizzardstore.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.blizzardstore.name = value
						E.db[mPlugin].mDock.blizzardstore.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mBlizzardStore")
					end,
					values = mTextureList(),
				},
			},
		},
		dockcharcter = {
			order = 40,
			type = "group",
			name = CHARACTER_BUTTON,
			args = {
				dockcharctericon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.character.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.character.name = value
						E.db[mPlugin].mDock.character.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mCharacter")
					end,
					values = mTextureList(),
				},
				dockcharcteroptioncolor = {
					order = 2,
					type = 'select',
					name = L["Text Color Styl"],
					get = function(info) return E.db[mPlugin].mDock.character.color end,
					set = function(info, value)
						E.db[mPlugin].mDock.character.color = value
						DT:ForceUpdate_DataText("mCharacter")
					end,
					values = {
						default = L["Default"],
						elvui = L["ElvUI"],
					},
				},
				dockcharcteroption = {
					order = 3,
					type = 'select',
					name = L["Show Text on Icon"],
					get = function(info) return E.db[mPlugin].mDock.character.option end,
					set = function(info, value)
						E.db[mPlugin].mDock.character.option = value
						DT:ForceUpdate_DataText("mCharacter")
					end,
					values = {
						none = L["NONE"],
						durability = L["Durability"],
						ilvl = L["Itemlevel"],
					},
				},
			},
		},
		dockcollection = {
			order = 50,
			type = "group",
			name = COLLECTIONS,
			args = {
				dockcollectionicon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.collection.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.collection.name = value
						E.db[mPlugin].mDock.collection.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mCollectionsJourna")
					end,
					values = mTextureList(),
				},
			},
		},
		dockencounter = {
			order = 60,
			type = "group",
			name = ENCOUNTER_JOURNAL,
			args = {
				dockencountericon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.encounter.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.encounter.name = value
						E.db[mPlugin].mDock.encounter.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mEncounterJournal")
					end,
					values = mTextureList(),
				},
			},
		},
		dockguild = {
			order = 70,
			type = "group",
			name = GUILD_AND_COMMUNITIES,
			args = {
				dockguildicon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.guild.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.guild.name = value
						E.db[mPlugin].mDock.guild.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mGuild")
					end,
					values = mTextureList(),
				},
			},
		},
		docklfd = {
			order = 80,
			type = "group",
			name = DUNGEONS_BUTTON,
			args = {
				docklfdicon = {
					order = 10,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.lfd.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.lfd.name = value
						E.db[mPlugin].mDock.lfd.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mLFDTool")
					end,
					values = mTextureList(),
				},
				docklfdgreatvault = {
					order = 20,
					type = 'toggle',
					name = L["Great Vault"],
					desc = L["Show Greaut Vault infos in the Tooltip and opens the Great Vault"],
					get = function(info)
						return E.db[mPlugin].mDock.lfd.greatvault
					end,
					set = function(info, value)
						E.db[mPlugin].mDock.lfd.greatvault = value
					end,
				},
				docklfdaffixes = {
					order = 40,
					type = 'toggle',
					name = L["Weekly Affixes"],
					desc = L["Shows the Weekly Affixes."],
					get = function(info)
						return E.db[mPlugin].mDock.lfd.affix
					end,
					set = function(info, value)
						E.db[mPlugin].mDock.lfd.affix = value
					end,
				},
				docklfdkeystone = {
					order = 50,
					type = 'toggle',
					name = L["Tooltip Keystone"],
					desc = L["Shows your Keystone in the tooltip."],
					get = function(info)
						return E.db[mPlugin].mDock.lfd.keystone
					end,
					set = function(info, value)
						E.db[mPlugin].mDock.lfd.keystone = value
					end,
				},
				docklfddifficulty = {
					order = 60,
					type = 'toggle',
					name = L["Difficulty Text"],
					get = function(info)
						return E.db[mPlugin].mDock.lfd.difficulty
					end,
					set = function(info, value)
						E.db[mPlugin].mDock.lfd.difficulty = value
						DT:ForceUpdate_DataText("mLFDTool")
					end,
				},
			},
		},
		dockmainmenu = {
			order = 90,
			type = "group",
			name = MAINMENU_BUTTON,
			args = {
				dockmainmenuicon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.mainmenu.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.mainmenu.name = value
						E.db[mPlugin].mDock.mainmenu.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mMainMenu")
					end,
					values = mTextureList(),
				},
				dockmainmenucolor = {
					order = 2,
					type = 'select',
					name = L["Text Color Styl"],
					get = function(info) return E.db[mPlugin].mDock.mainmenu.color end,
					set = function(info, value)
						E.db[mPlugin].mDock.mainmenu.color = value
						DT:ForceUpdate_DataText("mMainMenu")
					end,
					values = {
						default = L["Default"],
						elvui = L["ElvUI"],
					},
				},
				dockmainmenuoption = {
					order = 3,
					type = 'select',
					name = L["Show Text on Icon"],
					get = function(info) return E.db[mPlugin].mDock.mainmenu.option end,
					set = function(info, value)
						E.db[mPlugin].mDock.mainmenu.option = value
						if value == "fps" then
							E.db[mPlugin].mDock.mainmenu.text = "FPS"
						else
							E.db[mPlugin].mDock.mainmenu.text = "MS"
						end
						DT:ForceUpdate_DataText("mMainMenu")
					end,
					values = {
						none = L["NONE"],
						fps = L["FPS"],
						ms = L["MS"],
					},
				},
				dockmainmenutext = {
					order = 4,
					name = L["Text"],
					type = 'input',
					width = 'smal',
					get = function() return E.db[mPlugin].mDock.mainmenu.text end,
					set = function(info, value)
						E.db[mPlugin].mDock.mainmenu.text = value
						DT:ForceUpdate_DataText("mMainMenu")
					end,
				},
			},
		},
		dockquest = {
			order = 100,
			type = "group",
			name = QUESTLOG_BUTTON,
			args = {
				dockquesticon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.quest.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.quest.name = value
						E.db[mPlugin].mDock.quest.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mQuest")
					end,
					values = mTextureList(),
				},
			},
		},
		dockspellbook = {
			order = 110,
			type = "group",
			name = SPELLBOOK_ABILITIES_BUTTON,
			args = {
				dockspellbookicon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.spellbook.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.spellbook.name = value
						E.db[mPlugin].mDock.spellbook.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mSpellBook")
					end,
					values = mTextureList(),
				},
			},
		},
		docktalent = {
			order = 120,
			type = "group",
			name = TALENTS_BUTTON,
			args = {
				docktalenticon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.talent.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.talent.name = value
						E.db[mPlugin].mDock.talent.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mTalent")
					end,
					values = mTextureList(),
				},
				docktalentrole = {
					order = 2,
					type = 'toggle',
					name = L["Show Role if in Group"],
					get = function(info) return E.db[mPlugin].mDock.talent.showrole end,
					set = function(info, value)
						E.db[mPlugin].mDock.talent.showrole = value
					end,
				},
			},
		},
		dockitemlevel = {
			order = 130,
			type = "group",
			name = L["Itemlevel"],
			args = {
				dockitemlevelicon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.itemlevel.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.itemlevel.name = value
						E.db[mPlugin].mDock.itemlevel.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mItemLevel")
					end,
					values = mTextureList(),
				},
				dockitemleveltext = {
					order = 2,
					name = L["Text"],
					type = 'input',
					width = 'smal',
					get = function() return E.db[mPlugin].mDock.itemlevel.text end,
					set = function(info, value)
						E.db[mPlugin].mDock.itemlevel.text = value
						DT:ForceUpdate_DataText("mItemLevel")
					end,
				},
			},
		},
		dockfriends = {
			order = 140,
			type = "group",
			name = L["Friends"],
			args = {
				dockfriendsicon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.friends.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.friends.name = value
						E.db[mPlugin].mDock.friends.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mFriends")
					end,
					values = mTextureList(),
				},
			},
		},
		dockdurability = {
			order = 150,
			type = "group",
			name = L["Durability"],
			args = {
				dockdurabilityicon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.durability.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.durability.name = value
						E.db[mPlugin].mDock.durability.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mDurability")
					end,
					values = mTextureList(),
				},
				dockdurabilitycolor = {
					order = 2,
					type = 'select',
					name = L["Text Color Styl"],
					get = function(info) return E.db[mPlugin].mDock.durability.color end,
					set = function(info, value)
						E.db[mPlugin].mDock.durability.color = value
						DT:ForceUpdate_DataText("mDurability")
					end,
					values = {
						default = L["Default"],
						elvui = L["ElvUI"],
					},
				},
			},
		},
		dockfpsms = {
			order = 160,
			type = "group",
			name = L["FPS / MS"],
			args = {
				dockfpsmsicon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.fpsms.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.fpsms.name = value
						E.db[mPlugin].mDock.fpsms.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mFPSMS")
					end,
					values = mTextureList(),
				},
				dockfpsmscolor = {
					order = 2,
					type = 'select',
					name = L["Text Color Styl"],
					get = function(info) return E.db[mPlugin].mDock.fpsms.color end,
					set = function(info, value)
						E.db[mPlugin].mDock.fpsms.color = value
						DT:ForceUpdate_DataText("mFPSMS")
					end,
					values = {
						default = L["Default"],
						elvui = L["ElvUI"],
					},
				},
				dockfpsmsoption = {
					order = 3,
					type = 'select',
					name = L["Show Text on Icon"],
					get = function(info) return E.db[mPlugin].mDock.fpsms.option end,
					set = function(info, value)
						E.db[mPlugin].mDock.fpsms.option = value
						if value == "fps" then
							E.db[mPlugin].mDock.fpsms.text = "FPS"
						else
							E.db[mPlugin].mDock.fpsms.text = "MS"
						end
						DT:ForceUpdate_DataText("mFPSMS")
					end,
					values = {
						fps = L["FPS"],
						ms = L["MS"],
					},
				},
				dockfpsmstext = {
					order = 4,
					name = L["Text"],
					type = 'input',
					width = 'smal',
					get = function() return E.db[mPlugin].mDock.fpsms.text end,
					set = function(info, value)
						E.db[mPlugin].mDock.fpsms.text = value
						DT:ForceUpdate_DataText("mFPSMS")
					end,
				},
			},
		},
		dockprofession = {
			order = 170,
			type = "group",
			name = L["Professions"],
			args = {
				dockprofessionicon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.profession.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.profession.name = value
						E.db[mPlugin].mDock.profession.path = mIconsList[value].file
						DT:ForceUpdate_DataText("mProfession")
					end,
					values = mTextureList(),
				},
			},
		},
		docknottification = {
			order = 200,
			type = "group",
			name = L["Nottification"],
			args = {
				docknottificationicon = {
					order = 1,
					type = 'select',
					name = L["Icon"],
					get = function(info) return E.db[mPlugin].mDock.nottification.name end,
					set = function(info, value)
						E.db[mPlugin].mDock.nottification.name = value
						E.db[mPlugin].mDock.nottification.path = mIconsList[value].file
						DT:LoadDataTexts()
					end,
					values = mTextureList(),
				},
				docknottificationiconsize = {
					order = 2,
					name = L["Icon size"],
					type = "range",
					min = 16, max = 128, step = 2,
					get = function(info)
						return E.db[mPlugin].mDock.nottification.size
					end,
					set = function(info, value)
						E.db[mPlugin].mDock.nottification.size = value
						DT:LoadDataTexts()
					end,
				},
				docknottificationspacer1 = {
					order = 3,
					type = "description",
					name = "\n",
				},
				docknottificationiconflash = {
					order = 4,
					type = 'toggle',
					name = L["Icon flash"],
					get = function(info)
						return E.db[mPlugin].mDock.nottification.flash
					end,
					set = function(info, value)
						E.db[mPlugin].mDock.nottification.flash = value
					end,
				},
			},
		},
	}
end

mInsert(ns.Config, OptionsDock)