local E, L, V, P, G = unpack(ElvUI);
local mPlugin = "mMediaTag"
local mMT = E:GetModule(mPlugin);
local addon, ns = ...
local LSM = LibStub("LibSharedMedia-3.0")

local function OptionsCore()
	E.Options.args.mMediaTag = {
		order = 10,
		type = "group",
		childGroups = 'tab',
		name = ns.mName,
		args = {
			logo = {
				order = 1,
				type = 'description',
				name = "",
				fontSize = 'medium',
				image = function() return 'Interface\\AddOns\\ElvUI_mMediaTag\\media\\textures\\logo.tga', 512, 128 end,
			},
			general = {
				order = 10,
				type = "group",
				name = L["General"],
				args = {
					greetingtextsetting = {
						order = 10,
						type = "group",
						name = L["Greeting text"],
						args = {
							greetingtext = {
								order = 1,
								type = 'toggle',
								name = L["Greeting text at start"],
								desc = L["Enables or disables the welcome text, at startup."],
								get = function(info)
									return E.db[mPlugin].mMsg
								end,
								set = function(info, value)
									E.db[mPlugin].mMsg = value
								end,
							},
						},
					},
					nameplatesetting = {
						order = 20,
						type = "group",
						name = L["Nameplate Settings"],
						args = {
							colorednamplates = {
							order = 1,
							type = 'toggle',
							name = L["Class colored Namplates"],
							desc = L["Class colored Namplates Hover and Boarder color."],
							get = function(info)
								return E.db[mPlugin].mClassNameplate
							end,
							set = function(info, value)
								E.db[mPlugin].mClassNameplate = value
								if value == false then
									mMT:mRestoreNameplateSettings()
								else
									mMT:mBackupNameplateSettings()
								end
								E:StaticPopup_Show("CONFIG_RL")
							end,
							},
							spacernameplate = {
							order = 2,
							type = "description",
							name = "\n\n\n",
							},
							namplaterset = {
							order = 3,
							type = "execute",
							name = L["Reset Backup"],
							desc = L["Resets Namplate Backups"],
							func = function()
								mMT:mRestoreNameplateSettings()
								E.db[mPlugin].mClassNameplate = false
								E.db[mPlugin].mBackup = false
								E:StaticPopup_Show("CONFIG_RL")
							end,
							},
						},
					},
					tooltipsettings = {
						order = 30,
						type = "group",
						name = L["Tooltip"],
						args = {
							tooltipicon = {
								order = 1,
								type = 'toggle',
								name = L["Tooltip Icon"],
								desc = L["Enables or disables Tooltip Icon"],
								get = function(info)
									return E.db[mPlugin].mTIcon
								end,
								set = function(info, value)
									E.db[mPlugin].mTIcon = value
								end,
							},
							spacertooltip = {
							order = 2,
							type = "description",
							name = "\n\n",
							},
							tooltipiconsize = {
								order = 3,
								name = L["Icon size"],
								desc = L["Tooltip Icon size."],
								type = "range",
								min = 16, max = 128, step = 2,
								get = function(info)
								return E.db[mPlugin].mTIconSize
								end,
								set = function(info, value)
									E.db[mPlugin].mTIconSize = value
								end,
							},
						},
					},
					menusettings = {
						order = 40,
						type = "group",
						name = L["Menu Settings"],
						args = {
							menucolorsetting = {
								order = 1,
								type = 'toggle',
								name = L["Class colered hover texture"],
								desc = L["Enables or disables Class colered hover texture."],
								get = function(info)
									return E.db[mPlugin].mClassColorHover
								end,
								set = function(info, value)
									E.db[mPlugin].mClassColorHover = value
									E:StaticPopup_Show("CONFIG_RL")
								end,
							},
							spacermenu = {
							order = 2,
							type = "description",
							name = "\n\n",
							},
							menutexture = {
								order = 3,
								type = "select",
								dialogControl = 'LSM30_Statusbar',
								name = L["Menu Hover Texture"],
								values = LSM:HashTable('statusbar'),
								get = function(info)
									return E.db[mPlugin].mHoverTexture
								end,
								set = function(info, value)
									E.db[mPlugin].mHoverTexture = value;
									E:StaticPopup_Show("CONFIG_RL")
								end,
							},
						},
					},
				},
			},
			datatext = {
				order = 20,
				type = "group",
				name = L["Datatext"],
				args = {
					professionsmenusettings = {
						order = 10,
						type = "group",
						name = L["Profession Menu"],
						args = {
						},
					},
					systemmenusettings = {
						order = 20,
						type = "group",
						name = L['System Menu'],
						args = {
						},
					},
					dungeonsetting = {
						order = 30,
						type = "group",
						name = L['Dungeon'],
						args = {
						},
					},
					currencys = {
						order = 40,
						type = "group",
						name = L['Currencys'],
						args = {
						},
					},
					docks = {
						order = 50,
						type = "group",
						name = L['Dock'],
						childGroups = 'tab',
						args = {
						},
					},
				},
			},
			tags = {
				order = 30,
				type = "group",
				name = L["Tags"],
				args = {
				},
			},
			chatbaground = {
				order = 40,
				type = "group",
				name = L['Chatbaground'],
				args = {
				},
			},
			maui = {
				order = 50,
				type = "group",
				name = L['MaUI v3 Support'],
				args = {
				},
			},
			about = {
				order = 60,
				type = "group",
				name = L["About"],
				args = {
					headerabout1 = {
						order = 1,
						type = "header",
						name = ns.mName,
					},
					descriptionabout1 = {
						order = 2,
						type = "description",
						name = ns.mName .. L[" is an addon for ElvUI with additional Statusbar textures, Tags, a game menu and professional menu for the datatext bars."],
					},
					spacerabout1 = {
						order = 3,
						type = "description",
						name = "\n\n",
					},
					headerabout2 = {
						order = 4,
						type = "header",
						name = L["Contact & Git"],
					},
					spacerabout2 = {
						order = 5,
						type = "description",
						name = "\n\n",
					},
					aboutcontact = {
						order = 6,
						type = "execute",
						name = L["Contact"],
						func = function() E:StaticPopup_Show('ELVUI_EDITBOX', nil, nil, 'mmediatag@gmx.de') end,
					},
					aboutgit = {
						order = 7,
						type = "execute",
						name = L["Git"],
						func = function() E:StaticPopup_Show('ELVUI_EDITBOX', nil, nil, 'https://git.tukui.org/Blinkii/mmediatag') end,
					},
					aboutchangelog = {
						order = 8,
						type = "execute",
						name = L["Changelog"],
						func = function() mMT:Changelog(true) end,
					},
				},
			},
		},
	}
end

table.insert(ns.Config, OptionsCore)