local addonName, ZLAUTO = ...

--多个相同物品，通过获取先后顺序从1开始做标记，所以整个框架标识通过itemlink+标记区分
--LOOT_OPENED事件监控掉落物品清单，全部循环查找auctionFrames里是否存在掉落物品的itemlink，如果存在，循环结束后判断存在几个，记录itemlink物品的标记，然后添加新的待拍卖框架里，
--[=[
    ItemAuctionFrame.state = "waiting" --waiting,auctioning,success,failed，会变
    ItemAuctionFrame.lgnore = false --是否忽略，玩家自己控制
    ItemAuctionFrame.itemlink = itemlink  --不会变
    ItemAuctionFrame.itemindex = 1 --标记，用于区分多个相同物品，不会变
    ItemAuctionFrame.startbidamount = 500 --起拍价
    ItemAuctionFrame.curbidamount = 600 --当前出价
    ItemAuctionFrame.bidIncrement = 100 --每次最低加价，不会变
    ItemAuctionFrame.curbidder = nil --当前出价者，会变

    需监听的话：
    --ML发送的：
    开始拍卖："开始拍卖[%d]%s，请在团队聊天中出价，起步价：%dg，每次最低加价：%dg"
    取消拍卖：
    暂停拍卖："[%d]%s已暂停拍卖！"
    继续拍卖：
    撤销最高价：
    拍卖结束：
    全部开始：--没必要，已取消
    全部停止：--没必要，已取消
    全部暂停：
    全部继续：
    --全员(包刮ML)发送的
    出价

记录：[[Interface\Buttons\UI-GuildButton-PublicNote-Up.blp]]  130781
规则通知："Interface\\Buttons\\UI-GuildButton-MOTD-Up.blp" 
规则通知2：[[Interface\FriendsFrame\UI-FriendsList-Large-Up.blp]]
通知：[[Interface\COMMON\VOICECHAT-SPEAKER.BLP]]  130979 音量图标
同步：[[Interface\AddOns\AutoAuction\Images\sync.png]]
聊天："Interface\\CHATFRAME\\UI-ChatIcon-Chat-Up.blp"
开始：[[Interface\BUTTONS\UI-SpellbookIcon-NextPage-Up.blp]]  130866
暂停：[[Interface\TIMEMANAGER\PauseButton.blp]]  137047
停止：[[Interface\TIMEMANAGER\ResetButton.blp]]  137048
流拍：[[Interface\COMMON\icon-noloot.blp]]  576625
出价：[[Interface\CURSOR\Buy.blp]]
警告：[[Interface\DialogFrame\UI-Dialog-Icon-AlertNew.blp]]
倒数：[[Interface\AddOns\AutoAuction\Images\5countdown_normal.png]]
撤销：[[Interface\GLUES\CHARACTERCREATE\UI-RotationRight-Big-Up.blp]]
问号：[[Interface\GossipFrame\ActiveQuestIcon.blp]]
邮寄：[[Interface\MINIMAP\TRACKING\Mailbox.blp]]
忽略：[[Interface\PaperDollInfoFrame\UI-GearManager-LeaveItem-Transparent.blp]]
打包：[[Interface\TUTORIALFRAME\UI-TutorialFrame-Bag.blp]]  346111
快速拍卖：[[Interface\FriendsFrame\UI-Toast-FriendRequestIcon.blp]]  384756
X：[[Interface\raidframe\ReadyCheck-NotReady]]  136813
√：[interface/raidframe/readycheck-ready]]  136814
？：[[interface/raidframe/ReadyCheck-Waiting]]  136815

√：[[Interface\Buttons\UI-CheckBox-Check]]  --130751
筛子：[[Interface\BUTTONS\UI-GroupLoot-Dice-Up.blp]] 130772
忽略：[[Interface\BUTTONS\UI-GroupLoot-Pass-Up]] 130775
五角星：[[Interface\COMMON\FavoritesIcon.blp]] 922035
团长：[[Interface\GROUPFRAME\UI-Group-LeaderIcon.blp]] 132062
拉升按钮：[[Interface\ChatFrame\UI-ChatIM-SizeGrabber-Up]] 386864
"Interface\\ChatFrame\\UI-ChatIM-SizeGrabber-Highlight" 386863
"Interface\\ChatFrame\\UI-ChatIM-SizeGrabber-Down" 386862
"Interface\\ChatFrame\\ChatFrameTab" 130942
"Interface\\Buttons\\UI-OptionsButton.blp" 851903
"Interface\\Buttons\\UI-PlusButton-Up" 130838
"Interface\\Buttons\\UI-PlusButton-Hilight" 130837
"Interface\\Buttons\\UI-PlusButton-DOWN" 130836
团队标记："Interface\\TargetingFrame\\UI-RaidTargetingIcon_1" 137001-137008
警告：[[Interface\DialogFrame\DialogAlertIcon.blp]] 131070

关注五角星："|A:auctionhouse-icon-favorite:13:13:2:2|a "
取消关注："|A:auctionhouse-icon-favorite-off:13:13:2:2|a "
倒计时沙漏："|A:ClassTrial-Timer:13:13:2:0|a "
喇叭：chatframe-button-icon-voicechat
金币："|A:auctionhouse-icon-coin-gold:13:13|a"
坦克："|A:UI-LFG-RoleIcon-Tank:12:12|a"
dps:"|A:UI-LFG-RoleIcon-DPS:12:12|a"
N:"|A:UI-LFG-RoleIcon-Healer:12:12|a"

系统蓝色：|cff4080FF  0.25, 0.5, 1
系统黄：|CFFFFDE00  1, 0.82, 0
豆绿色：
]=]
local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetadata
local ZL = ZLAUTO.mainFrame
local MyAddon = ZL.MyAddon
ZL.addonVersion = GetAddOnMetadata(addonName, "Version")
ZL.addonVersionA, ZL.addonVersionB, ZL.addonVersionC = ZL.addonVersion:match("^V(%d+)%.(%d+)%.(%d+)")
ZL.addonVersionA = tonumber(ZL.addonVersionA) or 0
ZL.addonVersionB = tonumber(ZL.addonVersionB) or 0
ZL.addonVersionC = tonumber(ZL.addonVersionC) or 0

ZL.options = {
	type = "group",
	args = {
		show = {
			type = "toggle",
			name = "显示",
			desc = "显示插件界面，不勾选将全部隐藏\n\n|cffff0000注意：不勾选将无法使用插件的拍卖和竞拍功能！|r",
			get = function() return not ZL.opt.hide end,
			set = function(info, value)
				ZL.opt.hide = not value
				if value then
                    ZL:Show()
                else
                    ZL:Hide()
                end
			end,
			order = 1,
			width = "half",
		},
		-- DeveloperMode = {
		-- 	type = "toggle",
		-- 	name = "开发者模式",
		-- 	desc = "1个人的情况下，勾选后可以测试部分功能\n\n团队或小队模式不生效\n开发者模式下一些发言无法生效\n|cffff0000注意：条件允许的话，尽量在团队，ML模式测试，1个人开发者模式下可能存在一些未知BUG|r",
		-- 	get = function()
		-- 		ZL.AuctionFrame2:Update(true)
		-- 		return ZL.opt.developerMode
		-- 	end,
		-- 	set = function(info, value)
		-- 		ZL.opt.developerMode = value
		-- 	end,
		-- 	order = 1,
		-- 	width = "twoThirds",
		-- },
		behaviour = {
			type = "group",
			name = "行为选项",
			desc = "ML权限",
			order = 1.5,
			args = {
				startBidAndMinIncrement = {
					dialogInline = false,
					type = "group",
					name = "起拍价/加价幅度",
					order = 1,
					args = {
						startBid = {
							type = "range",
							name = "起拍价(默认)",
							min = 0,
							max = 1000000,
							softMax = 1000000,
							softMin = 0,
							step = 1,
							get = function() ZL.TransmitAddonInfo_Pro() return ZL.opt.startBid end,
							set = function(info, value) ZL.opt.startBid = value end,
							order = 1,
							width = "full",
						},
						minIncrement = {
							type = "range",
							name = "加价幅度(默认)",
							min = 0,
							max = 100000,
							softMax = 100000,
							softMin = 0,
							step = 1,
							get = function() return ZL.opt.increment end,
							set = function(info, value) ZL.opt.increment = value end,
							order = 2,
							width = "full",
						},
						intervalBidIncrement = {
							dialogInline = true,
							name = "区间加价幅度",
							order = 3,
							type = "group",
							args = {
								intervalBidIncrement = {
									type = "toggle",
									name = "按区间自动调整加价幅度",
									desc = "勾选后：手动设置的加价幅度无效\n小于最低档将按照默认加价幅度",
									width = "full",
									set = function(info, value) ZL.opt.intervalBidIncrement = value end,
									get = function() return ZL.opt.intervalBidIncrement end,
									order = 1,
								},
								baseAmount1 = {
									type = "input",
									name = "大于",
									order = 2,
									multiline = false,
									get = function()
										return tostring(ZL.opt.baseAmount1 or 5000)
									end,
									set = function(info, value)
										ZL.opt.baseAmount1 = tonumber(value) or 5000
									end,
									width = "twoThirds",
								},
								bidIncrement1 = {
									type = "input",
									name = "加价幅度",
									order = 3,
									multiline = false,
									get = function()
										return tostring(ZL.opt.bidIncrement1 or 500)
									end,
									set = function(info, value)
										ZL.opt.bidIncrement1 = tonumber(value) or 500
									end,
									width = "twoThirds",
								},
								baseAmount2 = {
									type = "input",
									name = "大于",
									order = 4,
									multiline = false,
									get = function()
										return tostring(ZL.opt.baseAmount2 or 10000)
									end,
									set = function(info, value)
										ZL.opt.baseAmount2 = tonumber(value) or 10000
									end,
									width = "twoThirds",
								},
								bidIncrement2 = {
									type = "input",
									name = "加价幅度",
									order = 5,
									multiline = false,
									get = function()
										return tostring(ZL.opt.bidIncrement2 or 1000)
									end,
									set = function(info, value)
										ZL.opt.bidIncrement2 = tonumber(value) or 1000
									end,
									width = "twoThirds",
								},
								baseAmount3 = {
									type = "input",
									name = "大于",
									order = 6,
									multiline = false,
									get = function()
										return tostring(ZL.opt.baseAmount3 or 50000)
									end,
									set = function(info, value)
										ZL.opt.baseAmount3 = tonumber(value) or 50000
									end,
									width = "twoThirds",
								},
								bidIncrement3 = {
									type = "input",
									name = "加价幅度",
									order = 7,
									multiline = false,
									get = function()
										return tostring(ZL.opt.bidIncrement3 or 1000)
									end,
									set = function(info, value)
										ZL.opt.bidIncrement3 = tonumber(value) or 1000
									end,
									width = "twoThirds",
								},
							},
						},
						customSettings = {
							type = "execute",
							name = "高级物品拍卖设置",
							func = function()
								LibStub("AceConfigDialog-3.0"):Close("金团拍卖助手")
								ZL.ItemSettingFrame:Show()
							end,
							order = 4,
							width = "full",
						},
					},
				},
				AuctionTime = {
					dialogInline = false,
					type = "group",
					name = "拍卖及其它时间",
					order = 2,
					args = {
						auctionTimer = {
							type = "range",
							softMin = 10,
							softMax = 3600,
							step = 1,
							order = 1,
							width = "full",
							name = "初始拍卖时间",
							desc = "因未收到出价而结束拍卖所必须等待的秒数(ML功能)",
							set = function(info, value) ZL.opt.auctionTimer = value end,
							get = function()
								ZL.TransmitAddonInfo_Pro()
								return ZL.opt.auctionTimer
							end,
						},
						auctionTimerRefresh = {
							type = "range",
							softMin = 5,
							softMax = 3600,
							step = 1,
							order = 2,
							width = "full",
							name = "重置拍卖时间",
							desc = "收到最后出价后直到拍卖成功所需要等待的秒数(ML功能)",
							set = function(info, value)
								ZL.opt.auctionTimerRefresh = value
							end,
							get = function()
								return ZL.opt.auctionTimerRefresh
							end,
						},
						reloadUITimerJump = {
							type = "range",
							softMin = 60,
							softMax = 1800,
							step = 1,
							order = 3,
							width = "full",
							name = "保存数据提醒频率",
							desc = "重新加载人物界面后将重新计时\n(单位：秒)",
							set = function(info, value)
								if ZL.opt.reloadUITimerJump ~= value then
									ZL.opt.reloadUITimerJump = value
									ZL.SaveDataRemind(true)
								end
							end,
							get = function()
								return ZL.opt.reloadUITimerJump
							end,
						},
						NoticeTimerJump = {
							type = "range",
							softMin = 0,
							softMax = 1,
							step = 0.1,
							order = 4,
							width = "full",
							name = "团队通报账单频率",
							desc = "通报速度过快，有些消息可能会被屏蔽(单位：秒)",
							set = function(info, value)
								ZL.opt.NoticeTimerJump = value
							end,
							get = function()
								return ZL.opt.NoticeTimerJump
							end,
						}
					},
				},
				LootQuality = {
					dialogInline = false,
					type = "group",
					name = "拾取分配及品质",
					order = 3,
					args = {
						minQuality = {
							type = "select",
							values = function()
								local vtab = {}
								for key, tab in pairs(ITEM_QUALITY_COLORS) do
									if _G["ITEM_QUALITY" .. key .. "_DESC"] then
										vtab[key] = tab.hex .. _G["ITEM_QUALITY" .. key .. "_DESC"] .. "|r"
									end
								end
								vtab[-1] = "|cffaa2222" .. "使用拾取分配" .. "|r"
								return vtab
							end,
							name = "拍卖最低品质",
							set = function(info, value) ZL.opt.minQuality = value end,
							get = function() return ZL.opt.minQuality end,
							order = 1,
							width = "twoThirds",
						},
						lootMinQuality = {
							type = "select",
							values = function()
								local vtab = {}
								for key, tab in pairs(ITEM_QUALITY_COLORS) do
									if _G["ITEM_QUALITY" .. key .. "_DESC"] then
										vtab[key] = tab.hex .. _G["ITEM_QUALITY" .. key .. "_DESC"] .. "|r"
									end
								end
								vtab[-1] = "|cffaa2222" .. "使用拾取分配" .. "|r"
								return vtab
							end,
							name = "自动拾取最低品质",
							set = function(info, value) ZL.opt.lootMinQuality = value end,
							get = function() return ZL.opt.lootMinQuality end,
							order = 2,
							width = "twoThirds",
						},
						AutoChangeLootMethod = {
							type = "toggle",
							name = "自动更改拾取分配方式",
							desc = "团队模式才生效",
							set = function(info, value) ZL.opt.AutoChangeLootMethod = value end,
							get = function() return ZL.opt.AutoChangeLootMethod end,
							width = "full",
							order = 3,
						},
						SelectLootMethod = {
							type = "select",
							name = "分配方式",
							order = 4,
							width = "twoThirds",
							values = {"队长分配", "个人拾取"}, --对应2'master'， 5'personalloot'
							set = function(info, value)
								ZL.opt.SelectLootMethod = value
							end,
							get = function()
								ZL.autoChangeLootMethod()
								return ZL.opt.SelectLootMethod
							end,
						},
						MarsterLootQuality = {
							type = "select",
							name = "队长分配品质",
							order = 5,
							width = "twoThirds",
							values = {"|cff1eff00优秀|t", "|cff0070dd精良|r", "|cffa335ee史诗|r"}, --对应2, 3, 4
							set = function(info, value)
								ZL.opt.MarsterLootQuality = value
							end,
							get = function()
								return ZL.opt.MarsterLootQuality
							end,
						}
					},
				},
				OtherToggle = {
					dialogInline = false,
					type = "group",
					name = "其它选项",
					order = 4,
					args = {
						isReloadUI = {
							type = "toggle",
							name = "保存数据提醒|cffffd100(重要)|r",
							desc = "·勾选后将按照设置好的提醒频率在屏幕上方提醒\n·重新加载人物界面后将重新计时\n·战斗状态不会提醒",
							set = function(info, value) ZL.TransmitAddonInfo_Pro() ZL.opt.isReloadUI = value end,
							get = function() return ZL.opt.isReloadUI end,
							width = "full",
							order = 1,
						},
						saveGroupMembersSound = {
							type = "toggle",
							name = "保存团员名单",
							set = function(info, value)
								ZL.opt.saveGroupMembersSound = value
							end,
							get = function() return ZL.opt.saveGroupMembersSound end,
							width = "full",
							order = 1.1,
						},
						MLlootNoticeReloadUI = {
							type = "toggle",
							name = "队长分配模式才提醒保存数据和团员名单",
							set = function(info, value)
								ZL.opt.MLlootNoticeReloadUI = value
							end,
							get = function() return ZL.opt.MLlootNoticeReloadUI end,
							width = "full",
							order = 1.1,
						},
						isSYNCAll = {
							type = "toggle",
							name = "自动同步数据给其他成员",
							desc = "·保存数据提醒同时同步当前所有数据给其他成员\n·当前存在正在拍卖物品时不同步\n·|cffff0000会大量占用通信资源，可能造成拍卖反应延迟|r",
							set = function(info, value) ZL.opt.isSYNCAll = value end,
							get = function() return ZL.opt.isSYNCAll end,
							width = "full",
							order = 2,
						},
						awardToML = {
							type = "toggle",
							name = "自动分配物品给ML",
							desc = "注意提前将拾取绑定并且没有2小时交易时间的物品添加到【物品设置】——【过滤】里面",
							set = function(info, value) ZL.opt.awardToML = value end,
							get = function() return ZL.opt.awardToML end,
							width = "full",
							order = 3,
						},
						allowMultiple = {
							type = "toggle",
							name = "允许同时拍卖多项物品",
							desc = "如果不是全团都装了插件，建议使用单拍模式！",
							width = "full",
							set = function(info, value) ZL.opt.allowMultipleAuctions = value end,
							get = function() return ZL.opt.allowMultipleAuctions end,
							-- disabled = function() return ((ZL.curAuctions and (#ZL.curAuctions > 0)) or (ZL.curAuction.item)) end, --临时取消，做测试
							order = 4,
						},
						notItemStack = {
							type = "toggle",
							name = "相同拍卖物品不堆叠",
							desc = "相同拍卖物品分开创建拍卖记录",
							width = "full",
							set = function(info, value) ZL.opt.notItemStack = value end,
							get = function() return ZL.opt.notItemStack end,
							-- disabled = function() return ((ZL.curAuctions and (#ZL.curAuctions > 0)) or (ZL.curAuction.item)) end, --临时取消，做测试
							order = 5,
						},
						confirmLootAnnounce= {
							type = "toggle",
							name = "是否拾取通报",
							width = "full",
							set = function(info, value) ZL.opt.confirmLootAnnounce = value end,
							get = function()
								if IsInRaid(1) then
									local data = {type="request"}
									MyAddon:TransmitAddonInfo2("AUTOAUC VER", data, "RAID", nil, "BULK")
								end
								return ZL.opt.confirmLootAnnounce
							end,
							order = 6,
						},
						announceRW = {
							type = "toggle",
							name = "拍卖时在团队通知频道(/rw)发送信息",
							desc = "如果开通了游戏系统提示音，会比较吵",
							set = function(info, value) ZL.opt.announceRaidWarning = value end,
							get = function() return ZL.opt.announceRaidWarning end,
							width = "full",
							order = 7,
						},
						CountdownAnnounceRW = {
							type = "toggle",
							name = "5秒倒数强制在团队通知频道(/rw)发送信息",
							desc = "不管是否勾选上面的，只要这个勾选了5秒倒数都会在团队通知频道发送信息",
							set = function(info, value) ZL.opt.CountdownAnnounceRaidWarning = value end,
							get = function() return ZL.opt.CountdownAnnounceRaidWarning end,
							width = "full",
							order = 8,
						},
						remindInvalidBid = {
							type = "toggle",
							name = "向不符合出价的成员发送密语提醒",
							width = "full",
							set = function(info, value) ZL.opt.remindInvalidBid = value end,
							get = function() return ZL.opt.remindInvalidBid end,
							order = 9,
						},
						NoticeAveWages = {
							type = "toggle",
							name = "通报详细收支包含:工资总览",
							desc = "人均工资和小队工资",
							width = "full",
							set = function(info, value) ZL.opt.NoticeAveWages = value end,
							get = function() return ZL.opt.NoticeAveWages end,
							order = 9.1,
						},
						NotieWagesBili = {
							type = "toggle",
							name = "通报详细收支包含:工资比例总览",
							width = "full",
							set = function(info, value) ZL.opt.NotieWagesBili = value end,
							get = function() return ZL.opt.NotieWagesBili end,
							order = 9.2,
						},
						MLChangeGroup = {
							type = "toggle",
							name = "通报详细收支:将ML调整到后面队伍",
							desc = "可以减轻ML发工资的事情，让其他人发",
							width = "full",
							set = function(info, value) ZL.opt.MLChangeGroup = value end,
							get = function() return ZL.opt.MLChangeGroup end,
							order = 10,
						},
						autoPackage = {
							type = "toggle",
							name = "不是拾取绑定物品自动添加到打包拍卖",
							desc = "不是拾取绑定物品自动添加到打包拍卖",
							width = "full",
							set = function(info, value) ZL.opt.autoPackage = value end,
							get = function() return ZL.opt.autoPackage end,
							order = 11,
						},
						autoShowAuctionFrame = {
							type = "toggle",
							name = "有新的物品拍卖，自动弹窗",
							width = "full",
							set = function(info, value) ZL.opt.autoShowAuctionFrame = value end,
							get = function() return ZL.opt.autoShowAuctionFrame end,
							order = 12,
						},
						hideWaitingAuctionCantUseItem= {
							type = "toggle",
							name = "隐藏拍卖中不适合当前专精物品",
							width = "full",
							set = function(info, value) ZL.opt.hideWaitingAuctionCantUseItem = value end,
							get = function() return ZL.opt.hideWaitingAuctionCantUseItem end,
							order = 13,
						},
					},
				},

			},
		},
		butie = {
			type = "group",
			name = "补贴设置",
			desc = "ML权限，会自动同步ML设置",
			order = 2,
			args = {
				tipDescription = {
					type = "description",
					name = "|cffFFDE00补贴功能已升级，请点击下面按钮到补贴设置窗口进行重新设置：|r\n\n1、支持按照原补贴方式：补贴方案选择“|cfff58cba按父补贴金额|r”即可；\n2、新增高级功能：|cff4080FF子补贴类型|r（还未适配正式服）",
					order = 1,
					width = "full",
					fontSize = "medium",
				},
				customSettings = {
					type = "execute",
					name = "补贴设置",
					func = function()
						LibStub("AceConfigDialog-3.0"):Close("金团拍卖助手")
						ZL.SubsidyFrame:Show()
					end,
					order = 2,
					width = "full",
				},
			},
		},
		lootToBags = {
			type = "group",
			name = "背包设置",
			order = 2.1,
			args = {
				bagHighLight = {
					dialogInline = true,
					name = "背包拍卖物品按不同状态显示高亮颜色",
					order = 2,
					type = "group",
					args = {
						waitingBagHighLight = {
							order = 1,
							type = "toggle",
							name = function ()
								local r, g, b, a = unpack(ZL.colorList["waiting"])
								return ZL.RGBAToHex(r*255, g*255, b*255, a*255) .. "待拍卖" .. "|r   "
							end,
							set = function(info, value) ZL.opt.waitingBagHighLight = value end,
							get = function()
								ZL.BagHighLight()
								return ZL.opt.waitingBagHighLight
							end,
							width = "half",
						},
						auctioningBagHighLight = {
							order = 3,
							type = "toggle",
							name = function ()
								local r, g, b, a = unpack(ZL.colorList["auctioning"])
								return ZL.RGBAToHex(r*255, g*255, b*255, a*255) .. "拍卖中" .. "|r   "
							end,
							set = function(info, value) ZL.opt.auctioningBagHighLight = value end,
							get = function()
								ZL.BagHighLight()
								return ZL.opt.auctioningBagHighLight
							end,
							width = "half",
						},
						successBagHighLight = {
							order = 4,
							type = "toggle",
							name = function ()
								local r, g, b, a = unpack(ZL.colorList["success"])
								return ZL.RGBAToHex(r*255, g*255, b*255, a*255) .. "成功" .. "|r"
							end,
							set = function(info, value) ZL.opt.successBagHighLight = value end,
							get = function()
								ZL.BagHighLight()
								return ZL.opt.successBagHighLight
							end,
							width = "half",
						},
						failedBagHighLight = {
							order = 5,
							type = "toggle",
							name = function ()
								local r, g, b, a = unpack(ZL.colorList["failed"])
								return ZL.RGBAToHex(r*255, g*255, b*255, a*255) .. "流拍" .. "|r"
							end,
							set = function(info, value) ZL.opt.failedBagHighLight = value end,
							get = function()
								ZL.BagHighLight()
								return ZL.opt.failedBagHighLight
							end,
							width = "half",
						},
						lgnoreBagHighLight = {
							order = 6,
							type = "toggle",
							name = function ()
								local r, g, b, a = unpack(ZL.colorList["lgnore"])
								return ZL.RGBAToHex(r*255, g*255, b*255, a*255) .. "忽略" .. "|r "
							end,
							set = function(info, value) ZL.opt.lgnoreBagHighLight = value end,
							get = function()
								ZL.BagHighLight()
								return ZL.opt.lgnoreBagHighLight
							end,
							width = "half",
						},
						tipsDescription = {
							type = "description",
							name = "支持原始背包、BagBrother、Combuctor、NDui、ElvUI、\nArkInventory背包",
							order = 7,
							width = "full",
							fontSize = "medium",
						},
					},
				},
				kongDescription = {
					type = "description",
					name = " ",
					order = 3,
					width = "half",
					fontSize = "medium",
				},
				lootToBag = {
					dialogInline = true,
					name = "流拍、自己买的物品放到指定背包",
					order = 4,
					type = "group",
					args = {
						emptyOneSpace = {
							type = "toggle",
							name = "空一格",
							desc = "每个背包之间空一格，以便区分",
							width = "full",
							order = 1,
							set = function(info, value)
								ZL.opt.emptyOneSpace = value
							end,
							get = function() return ZL.opt.emptyOneSpace end,
						},
						warningDescription = {
							type = "description",
							name = "|cffff0000注意：如两种物品放同一个背包，分解或售卖时注意看清楚|r",
							order = 2,
							width = "full",
							fontSize = "medium",
						},
						liupaiToggle = {
							type = "toggle",
							name = "流拍",
							desc = "当背包满了后将无法继续自动放\n|cffff0000只对拾取绑定的物品有效|r",
							width = 0.4,
							order = 3,
							set = function(info, value)
								ZL.opt.liupaiToggle = value
							end,
							get = function() return ZL.opt.liupaiToggle end,
						},
						liupaiBagId = {
							type = "select",
							name = "",
							order = 4,
							width = 0.3,
							values = function ()
								local list = {}
								for i = 0, NUM_BAG_SLOTS do
									if i ~= tonumber(ZL.opt.liupaiBagId2) and i ~= tonumber(ZL.opt.selfBagId) then
										list[tostring(i)] = tostring(i+1)
									end
								end
								return list
							end,
							set = function(info, value)
								ZL.opt.liupaiBagId = value
								local num = C_Container.GetContainerNumFreeSlots(ZL.opt.liupaiBagId)
								local text
								if num <= 5 then
									text = "|cffff0000" .. tostring(num) .. "|r"
								else
									text = tostring(num)
								end
								ZL.options.args.lootToBags.args.lootToBag.args.liupaiDescription.name = " 剩余" .. text .. "格"
							end,
							get = function()
								local num = C_Container.GetContainerNumFreeSlots(ZL.opt.liupaiBagId)
								local text
								if num <= 5 then
									text = "|cffff0000" .. tostring(num) .. "|r"
								else
									text = tostring(num)
								end
								ZL.options.args.lootToBags.args.lootToBag.args.liupaiDescription.name = " 剩余" .. text .. "格"
								return ZL.opt.liupaiBagId
							end,
						},
						liupaiDescription = {
							type = "description",
							name = " ",
							order = 5,
							width = "half",
							fontSize = "medium",
						},
						liupaiBagId2 = {
							type = "select",
							name = "",
							order = 5.1,
							width = 0.3,
							values = function ()
								local list = {}
								for i = 0, NUM_BAG_SLOTS do
									if i ~= tonumber(ZL.opt.liupaiBagId) and i ~= tonumber(ZL.opt.selfBagId) then
										list[tostring(i)] = tostring(i+1)
									end
								end
								return list
							end,
							set = function(info, value)
								ZL.opt.liupaiBagId2 = value
								local num = C_Container.GetContainerNumFreeSlots(ZL.opt.liupaiBagId2)
								local text
								if num <= 5 then
									text = "|cffff0000" .. tostring(num) .. "|r"
								else
									text = tostring(num)
								end
								ZL.options.args.lootToBags.args.lootToBag.args.liupaiDescription2.name = " 剩余" .. text .. "格"
							end,
							get = function()
								local num = C_Container.GetContainerNumFreeSlots(ZL.opt.liupaiBagId2)
								local text
								if num <= 5 then
									text = "|cffff0000" .. tostring(num) .. "|r"
								else
									text = tostring(num)
								end
								ZL.options.args.lootToBags.args.lootToBag.args.liupaiDescription2.name = " 剩余" .. text .. "格"
								return ZL.opt.liupaiBagId2
							end,
						},
						liupaiDescription2 = {
							type = "description",
							name = " ",
							order = 5.2,
							width = "half",
							fontSize = "medium",
						},
						liupaiDirection = {
							type = "toggle",
							name = "倒置",
							desc = "勾选后将从后往前放置物品",
							width = "half",
							order = 6,
							set = function(info, value)
								ZL.opt.liupaiDirection = value
							end,
							get = function() return ZL.opt.liupaiDirection end,
						},
						selfToggle = {
							type = "toggle",
							name = "自拍",
							desc = "当背包满了后将无法继续自动放\n|cffff0000只对自己拍到的物品有效|r",
							width = 0.4,
							order = 7,
							set = function(info, value)
								ZL.opt.selfToggle = value
							end,
							get = function() return ZL.opt.selfToggle end,
						},
						selfBagId = {
							type = "select",
							name = "",
							order = 8,
							width = 0.3,
							values = function ()
								local list = {}
								for i = 0, NUM_BAG_SLOTS do
									if i ~= tonumber(ZL.opt.liupaiBagId) and i ~= tonumber(ZL.opt.liupaiBagId2) then
										list[tostring(i)] = tostring(i+1)
									end
								end
								return list
							end,
							set = function(info, value)
								ZL.opt.selfBagId = value
								local num = C_Container.GetContainerNumFreeSlots(ZL.opt.selfBagId)
								local text
								if num <= 5 then
									text = "|cffff0000" .. tostring(num) .. "|r"
								else
									text = tostring(num)
								end
								ZL.options.args.lootToBags.args.lootToBag.args.selfDescription.name = " 剩余" .. text .. "格"
							end,
							get = function()
								local num = C_Container.GetContainerNumFreeSlots(ZL.opt.selfBagId)
								local text
								if num <= 5 then
									text = "|cffff0000" .. tostring(num) .. "|r"
								else
									text = tostring(num)
								end
								ZL.options.args.lootToBags.args.lootToBag.args.selfDescription.name = " 剩余" .. text .. "格"
								return ZL.opt.selfBagId
							end,
						},
						selfDescription = {
							type = "description",
							name = " ",
							order = 9,
							width = "half",
							fontSize = "medium",
						},
						selfDirection = {
							type = "toggle",
							name = "倒置",
							desc = "勾选后将从后往前放置物品",
							width = "half",
							order = 10,
							set = function(info, value)
								ZL.opt.selfDirection = value
							end,
							get = function() return ZL.opt.selfDirection end,
						},
					},
				},
			},
		},
		notification = {
			type = "group",
			name = "提示选项",
			order = 3,
			args = {
				rules = {
					type = "input",
					name = "拍卖规则",
					order = 1,
					multiline = true,
					get = function() return ZL.opt.rulesString or "" end,
					set = function(info, value)
						ZL.opt.rulesString = string.len(value) > 0 and value
					end,
					width = "full",
				},
				welcomeMessage = {
					dialogInline = true,
					name = "加入团队时欢迎语(RL或ML权限)",
					order = 2,
					type = "group",
					args = {
						isEnabled = {
							order = 1,
							type = "toggle",
							name = "启用",
							set = function(info, value) ZL.opt.welcomeMessageEnable = value end,
							get = function() 
								return ZL.opt.welcomeMessageEnable
								-- if ZL.opt.MessageString and string.len(ZL.opt.MessageString) > 0 then
								-- 	return ZL.opt.welcomeMessageEnable
								-- else
								-- 	ZL.opt.welcomeMessageEnable = false
								-- 	return ZL.opt.welcomeMessageEnable
								-- end
							end,
							width = "half",
						},
						Message = {
							type = "input",
							name = "欢迎语",
							order = 2,
							multiline = true,
							get = function() return ZL.opt.MessageString or "" end,
							set = function(info, value)
								if string.len(value) > 0 then
									ZL.opt.MessageString = value
								else
									ZL.opt.MessageString = ""
								end
							end,
							width = "full",
						},
					},
				},

				-- overrideArchive = {
				-- 	type = "toggle",
				-- 	name = "反和谐",
				-- 	-- desc = "",
				-- 	set = function(info, value) 
				-- 		ZL.opt.overrideArchive = value 
				-- 		if ZL.opt.overrideArchive then
				-- 			SetCVar("overrideArchive", "0")
				-- 		else
				-- 			SetCVar("overrideArchive", "1")
				-- 		end
				-- 	end,
				-- 	get = function() return ZL.opt.overrideArchive end,
				-- 	width = "full",
				-- 	order = 3,
				-- },
				-- profanityFilter = {
				-- 	type = "toggle",
				-- 	name = "强制关闭系统语言过滤",
				-- 	desc = "部分信息就算关闭了系统语言过滤也还是一样会看不到",
				-- 	set = function(info, value)
				-- 		ZL.opt.profanityFilter = value
				-- 		if ZL.opt.profanityFilter then
				-- 			SetCVar("profanityFilter", "0")
				-- 		else
				-- 			SetCVar("profanityFilter", "1")
				-- 		end
				-- 	end,
				-- 	get = function() return ZL.opt.profanityFilter end,
				-- 	width = "full",
				-- 	order = 4,
				-- },
			},
		},
		VoiceSetting = {
			type = "group",
			name = "语音设置",
			order = 3.1,
			args = {
				IsVoiceReminder = {
					type = "toggle",
					name = "拍卖语音提醒",
					set = function(info, value)
						ZL.opt.IsVoiceReminder = value
					end,
					get = function() return ZL.opt.IsVoiceReminder end,
					width = "twoThirds",
					order = 2,
				},
				VoiceReminderSoundType = {
					type = "select",
					name = "语音类型",
					width = "twoThirds",
					order = 3,
					values = ZL.SoundTypeList,
					get = function(info)
						return ZL.opt.VoiceReminderSoundType
					end,
					set = function(info, value)
						ZL.opt.VoiceReminderSoundType = value
						ZL.SoundType = ZL.SoundTypeList[ZL.opt.VoiceReminderSoundType or 1] or "甜美女声"
					end,
				},
				startAuctionSound = {
					type = "toggle",
					name = "开始拍卖使用系统语音",
					set = function(info, value)
						ZL.opt.startAuctionSound = value
					end,
					get = function() return ZL.opt.startAuctionSound end,
					width = "full",
					order = 4,
				},
				conciseSound = {
					type = "toggle",
					name = "系统语音简洁模式",
					set = function(info, value)
						ZL.opt.conciseSound = value
					end,
					get = function() return ZL.opt.conciseSound end,
					width = "full",
					order = 5,
				},
				YYSound = {
					type = "toggle",
					name = "关闭其他成员语音播报",
					desc = "ML开了YY语音播放伴奏，勾选这个功能后非ML团队其他成员将不会播报自己的语音，防止出现重复声音",
					width = "full",
					set = function(info, value) ZL.opt.YYSound = value end,
					get = function() return ZL.opt.YYSound end,
					order = 6,
				},
				IsTradeRemainingVoiceReminder = {
					dialogInline = true,
					name = "交易剩余时间语音提醒",
					order = 20,
					type = "group",
					args = {
						isEnabled = {
							order = 1,
							type = "toggle",
							name = "启用",
							desc = "在团队副本中才会提醒",
							set = function(info, value)
								ZL.opt.IsTradeRemainingVoiceReminder = value
							end,
							get = function() return ZL.opt.IsTradeRemainingVoiceReminder end,
							width = "full",
						},
						TradeRemainingTimer = {
							type = "range",
							softMin = 10,
							softMax = 60,
							step = 1,
							order = 2,
							width = "twoThirds",
							name = "交易剩余时间",
							desc = "当存在交易剩余时间低于设定时间语音提醒(单位：分钟)",
							set = function(info, value) ZL.opt.TradeRemainingTimer = value end,
							get = function() return ZL.opt.TradeRemainingTimer end,
						},
						TradeRemainingReminderPinlv = {
							type = "range",
							softMin = 1,
							softMax = 10,
							step = 1,
							order = 3,
							width = "twoThirds",
							name = "语音提醒频率",
							desc = "单位：分钟",
							set = function(info, value) ZL.opt.TradeRemainingReminderPinlv = value end,
							get = function() return ZL.opt.TradeRemainingReminderPinlv end,
						},
					},
				},
				IsComeOnVoiceReminder = {
					dialogInline = true,
					name = "拍卖加油",
					order = 21,
					type = "group",
					args = {
						isEnabled = {
							order = 1,
							type = "toggle",
							name = "启用",
							width = "full",
							set = function(info, value)
								ZL.opt.IsComeOnVoiceReminder = value
							end,
							get = function() return ZL.opt.IsComeOnVoiceReminder end,
						},
						ComeOnVoiceReminderInterval = {
							type = "range",
							softMin = 30,
							softMax = 300,
							step = 1,
							order = 2,
							width = "full",
							name = "播放频率",
							desc = "单位：秒",
							set = function(info, value) ZL.opt.ComeOnVoiceReminderInterval = value end,
							get = function() return ZL.opt.ComeOnVoiceReminderInterval end,
						},
						ComeOnVoiceReminderBidAmount = {
							type = "input",
							name = "拍卖竞价大于等于",
							order = 3,
							multiline = false,
							width = 1.2,
							get = function()
								return tostring(ZL.opt.ComeOnVoiceReminderBidAmount or 100000)
							end,
							set = function(info, value)
								ZL.opt.ComeOnVoiceReminderBidAmount = tonumber(value) or 100000
							end,
						},
						ComeOnVoiceReminderBidIncrement = {
							type = "input",
							name = "|cffffffff或|r拍卖竞价幅度大于等于",
							order = 4,
							multiline = false,
							width = 1.2,
							get = function()
								return tostring(ZL.opt.ComeOnVoiceReminderBidIncrement or 1000000)
							end,
							set = function(info, value)
								ZL.opt.ComeOnVoiceReminderBidIncrement = tonumber(value) or 1000000
							end,
						},
					},
				},
			},
		},
		windowsSetting = {
			type = "group",
			name = "窗口设置",
			order = 4,
			args = {
				guiScale = {
					dialogInline = false,
					type = "group",
					name = "窗口缩放",
					order = 2,
					args = {
						ZLAuctionFrameScale = {
							type = "range",
							name = "拍卖窗口缩放",
							min = 0.5,
							max = 2,
							softMax = 2,
							softMin = 0.5,
							step = 0.01,
							get = function() return ZL.opt.ZLAuctionFrameScale end,
							set = function(info, value)
								ZL.opt.ZLAuctionFrameScale = value
								ZL.AuctionFrame2:SetScale(ZL.opt.ZLAuctionFrameScale)
								ZL.FloatAuctionFrame:SetScale(ZL.opt.ZLAuctionFrameScale)
							end,
							order = 1,
							width = "twoThirds",
						},
						ZLAuctionRecordFrameScale = {
							type = "range",
							name = "拍卖记录窗口缩放",
							min = 0.5,
							max = 2,
							softMax = 2,
							softMin = 0.5,
							step = 0.01,
							get = function() return ZL.opt.ZLAuctionRecordFrameScale end,
							set = function(info, value)
								ZL.opt.ZLAuctionRecordFrameScale = value
								ZL.AuctionRecordFrame:SetScale(ZL.opt.ZLAuctionRecordFrameScale)
								ZL.AuctionRecordFrame:SetResizeBounds(530, 300, 530, GetScreenHeight()/ZL.opt.ZLAuctionRecordFrameScale-30)
								if ZL.AuctionRecordFrame:GetHeight() > GetScreenHeight()/ZL.opt.ZLAuctionRecordFrameScale-30 then
									ZL.AuctionRecordFrame:SetHeight(GetScreenHeight()/ZL.opt.ZLAuctionRecordFrameScale-30)
								end
							end,
							order = 2,
							width = "twoThirds",
						},
						ZLItemSettingFrameScale = {
							type = "range",
							name = "物品拍卖设置窗口缩放",
							min = 0.5,
							max = 2,
							softMax = 2,
							softMin = 0.5,
							step = 0.01,
							get = function() return ZL.opt.ZLItemSettingFrameScale end,
							set = function(info, value)
								ZL.opt.ZLItemSettingFrameScale = value
								ZL.ItemSettingFrame:SetScale(ZL.opt.ZLItemSettingFrameScale)
							end,
							order = 3,
							width = "twoThirds",
						},
						ZLRemainingTradeTimeFrameScale = {
							type = "range",
							name = "交易剩余时间窗口缩放",
							min = 0.5,
							max = 2,
							softMax = 2,
							softMin = 0.5,
							step = 0.01,
							get = function() return ZL.opt.ZLRemainingTradeTimeFrameScale end,
							set = function(info, value)
								ZL.opt.ZLRemainingTradeTimeFrameScale = value
								ZL.ZLRemainingTradeTimeFrame:SetScale(ZL.opt.ZLRemainingTradeTimeFrameScale)
							end,
							order = 4,
							width = "twoThirds",
						},
					},
				},
				hideWindows = {
					dialogInline = false,
					type = "group",
					name = "战斗时隐藏窗口",
					order = 3,
					args = {
						AuctionFrameHide = {
							type = "toggle",
							name = "拍卖清单窗口",
							set = function(info, value) ZL.opt.AuctionFrameHide = value end,
							get = function() return ZL.opt.AuctionFrameHide end,
							width = "twoThirds",
							order = 1,
						},
						RemainingTradeTimeFrameHide = {
							type = "toggle",
							name = "交易剩余时间窗口",
							set = function(info, value) ZL.opt.RemainingTradeTimeFrameHide = value end,
							get = function() return ZL.opt.RemainingTradeTimeFrameHide end,
							width = "twoThirds",
							order = 2,
						},
						ItemSettingFrameHide = {
							type = "toggle",
							name = "物品拍卖设置窗口",
							set = function(info, value) ZL.opt.ItemSettingFrameHide = value end,
							get = function() return ZL.opt.ItemSettingFrameHide end,
							width = "twoThirds",
							order = 3,
						},
						AuctionRecordFrameHide = {
							type = "toggle",
							name = "拍卖记录窗口",
							set = function(info, value) ZL.opt.AuctionRecordFrameHide = value end,
							get = function() return ZL.opt.AuctionRecordFrameHide end,
							width = "twoThirds",
							order = 4,
						},
						SettingFrameHide = {
							type = "toggle",
							name = "设置窗口",
							set = function(info, value) ZL.opt.SettingFrameHide = value end,
							get = function() return ZL.opt.SettingFrameHide end,
							width = "twoThirds",
							order = 5,
						},
						RolesOverViewFrameHide = {
							type = "toggle",
							name = "角色信息总览窗口",
							set = function(info, value) ZL.opt.RolesOverViewFrameHide = value end,
							get = function() return ZL.opt.RolesOverViewFrameHide end,
							width = "twoThirds",
							order = 6,
						},
					},
				},
				auctionWindow = {
					dialogInline = false,
					type = "group",
					name = "窗口功能隐藏",
					order = 4,
					args = {
						overviewFramePlayerModelHide = {
							type = "toggle",
							name = "隐藏账单窗口跳舞NPC",
							set = function(info, value)
								ZL.opt.overviewFramePlayerModelHide = value
								if value then
									ZL.OverviewFrame.playerModel:Hide()
								else
									ZL.OverviewFrame.playerModel:Show()
								end
							end,
							get = function() return ZL.opt.overviewFramePlayerModelHide end,
							width = "full",
							order = 0.01,
						},
						minIconHide = {
							type = "toggle",
							name = "隐藏小地图按钮",
							desc = "|cffff0000警告：隐藏后无法直接使用角色信息总览等功能|r",
							set = function(info, value)
								ZL.opt.minIconHide = value
								if value then
									ZL.minimapicon:Hide("AUTOAUCTION")
									local msgStr = "输入|cffffaa00/aa roles|r 可快捷打开角色信息总览窗口"
									DEFAULT_CHAT_FRAME:AddMessage(ZL.Prefix(msgStr))
									ZL.ScrollingMessageFrame:AddMessage(msgStr)
								else
									ZL.minimapicon:Show("AUTOAUCTION")
								end
							end,
							get = function() 
								return ZL.opt.minIconHide
							end,
							width = "full",
							order = 0.11,
						},
						minIconTooltipHide = {
							type = "toggle",
							name = "隐藏小地图按钮提示",
							set = function(info, value)
								ZL.opt.minIconTooltipHide = value
							end,
							get = function()
								return ZL.opt.minIconTooltipHide
							end,
							width = "full",
							order = 0.12,
						},
						minIconReloadUI = {
							type = "toggle",
							name = "小地图按钮 Shift+左键点击：|cffffff00加载UI|r",
							set = function(info, value)
								ZL.opt.minIconReloadUI = value
							end,
							get = function()
								return ZL.opt.minIconReloadUI
							end,
							width = "full",
							order = 0.13,
						},
						ShortcutTipHide = {
							type = "toggle",
							name = "隐藏|cffff0000竞拍信息|r快捷键提示窗口",
							set = function(info, value)
								ZL.opt.ShortcutTipHide = value
							end,
							get = function() return ZL.opt.ShortcutTipHide end,
							width = "full",
							order = 0.2,
							hidden = true,
						},
						RecordShortcutTipHide = {
							dialogInline = true,
							type = "group",
							name = "隐藏|cffff0000记录按钮|r提示窗口——|cffffffff收支记录|r不可隐藏",
							order = 0.3,
							args = {
								currentDetailToolTipHide = {
									type = "toggle",
									name = "收支详情",
									set = function(info, value)
										ZL.opt.currentDetailToolTipHide = value
									end,
									get = function() return ZL.opt.currentDetailToolTipHide end,
									width = "twoThirds",
									order = 1,
									hidden = true,
								},
								xiaoFeiToolTipHide = {
									type = "toggle",
									name = "消费排名",
									set = function(info, value)
										ZL.opt.xiaoFeiToolTipHide = value
									end,
									get = function() return ZL.opt.xiaoFeiToolTipHide end,
									width = "twoThirds",
									order = 2,
								},
								debtToolTipHide = {
									type = "toggle",
									name = "欠款名单",
									desc = "勾选后快捷键也会隐藏",
									set = function(info, value)
										ZL.opt.debtToolTipHide = value
									end,
									get = function() return ZL.opt.debtToolTipHide end,
									width = "twoThirds",
									order = 3,
								},
							},
						},
						columnHide = {
							dialogInline = true,
							type = "group",
							name = "隐藏列",
							order = 1,
							args={
								startbidColumnHide = {
									type = "toggle",
									name = "起拍价/加价",
									set = function(info, value)
										ZL.opt.startbidColumnHide = value
										local AuctionFrame = ZL.AuctionFrame2
										local width = AuctionFrame:GetWidth()
										local totalWidth = width - 24
										local infoColumnWidth, bidderColumnWidth, bidColumnWidth = AuctionFrame.iconHeaderBtn:GetWidth()-1, 130, AuctionFrame.bidHeaderBtn:GetWidth()-1
										local startbidColumnWidth, functionColumnWidth = AuctionFrame.startbidHeaderBtn:GetWidth()-1, AuctionFrame.functionHeaderBtn:GetWidth()-1
										local needWidth = infoColumnWidth + bidderColumnWidth
										if (not (ZL.opt.bidColumnHide or (ZL.opt.bidEditBoxHide and ZL.opt.bidBtnHide and ZL.opt.bidCountsHide))) then
											needWidth = needWidth + bidColumnWidth
										end
										if (not (ZL.opt.functionColumnHide or (ZL.opt.startBtnHide and ZL.opt.pauseBtnHide and ZL.opt.countdownBtnHide and
										ZL.opt.packageBtnHide and ZL.opt.reverseBidBtnHide and ZL.opt.modifyBidBtnHide and ZL.opt.syncBtnHide and ZL.opt.delAuctionBtnHide))) then
											needWidth = needWidth + functionColumnWidth
										end
										if (ZL.opt.startbidColumnHide or (ZL.opt.startBidHide and ZL.opt.inrementHide)) then
											if (totalWidth - startbidColumnWidth) >= needWidth then
												AuctionFrame:SetWidth(width - startbidColumnWidth)
											else
												AuctionFrame:Update()
											end
										else
											if width + startbidColumnWidth <= GetScreenWidth()-30 then
												AuctionFrame:SetWidth(width + startbidColumnWidth)
											else
												AuctionFrame:Update()
											end
										end
									end,
									get = function() return ZL.opt.startbidColumnHide end,
									width = "twoThirds",
									order = 1,
								},
							},
						},
						functionHide = {
							dialogInline = true,
							type = "group",
							name = "隐藏信息",  --隐藏功能按钮
							order = 2,
							args={
								itemLevelHide = {
									type = "toggle",
									name = "装等(图标右下角)",
									set = function(info, value)
										ZL.opt.itemLevelHide = value
									end,
									get = function() return ZL.opt.itemLevelHide end,
									width = "twoThirds",
									order = 1,
								},
								itemCountHide = {
									type = "toggle",
									name = "数量(图标右上角)",
									desc = "数量1默认隐藏",
									set = function(info, value)
										ZL.opt.itemCountHide = value
									end,
									get = function() return ZL.opt.itemCountHide end,
									width = "twoThirds",
									order = 2,
								},
								itemIndexHide = {
									type = "toggle",
									name = "索引号(图标左下角)",
									desc = "索引号1默认隐藏\n大于1时表示存在多个相同物品的拍卖记录",
									set = function(info, value)
										ZL.opt.itemIndexHide = value
									end,
									get = function() return ZL.opt.itemIndexHide end,
									width = "twoThirds",
									order = 3,
								},
								itemNameHide = {
									type = "toggle",
									name = "物品名称",
									set = function(info, value)
										ZL.opt.itemNameHide = value
									end,
									get = function() return ZL.opt.itemNameHide end,
									width = "twoThirds",
									order = 4,
								},
							},
						},
					},
				},
			},
		},
		tooltip = {
			type = "group",
			name = "鼠标提示",
			order = 5,
			args = {
				auctionStateTip = {
					type = "toggle",
					name = "拍卖状态",
					desc = "鼠标移动到背包物品，如果已创建拍卖，则提示当前拍卖状态",
					width = 0.7,
					order = 1,
					set = function(info, value)
						ZL.opt.auctionStateTip = value
					end,
					get = function() return ZL.opt.auctionStateTip end,
				},
				-- showItemCounts = {
				-- 	type = "toggle",
				-- 	name = "物品数量",
				-- 	desc = "包刮背包、装备、银行、拍卖，暂时不支持邮箱",
				-- 	width = 0.7,
				-- 	order = 4,
				-- 	set = function(info, value)
				-- 		ZL.opt.showItemCounts = value
				-- 	end,
				-- 	get = function() return ZL.opt.showItemCounts end,
				-- },
			},
		},
		dataSave = {
			type = "group",
			name = "数据保存",
			order = 6,
			args = {
				tipsDescription1 = {
					type = "description",
					name = "|cff00ff00拍卖记录|r(建议30天)",
					order = 1,
					width = "full",
					fontSize = "medium",
				},
				tipsDescription2 = {
					type = "description",
					name = "保存最近",
					order = 2,
					width = 0.4,
					fontSize = "medium",
				},
				autoClearHistoryDays = {
					type = "select",
					name = "",
					order = 3,
					width = 0.5,
					values = function ()
						return ZL.historyDaysList
					end,
					set = function(info, value)
						ZL.opt.autoClearHistoryDays = value
					end,
					get = function()
						return ZL.opt.autoClearHistoryDays
					end,
				},
				tipsDescription3 = {
					type = "description",
					name = " 天拍卖记录",
					order = 4,
					width = 1.5,
					fontSize = "medium",
				},
				tipsDescription31 = {
					type = "description",
					name = function ()
						return "当前存在|cff00ff00" .. #ZL_HISTORY .. "|r条拍卖记录"
					end,
					order = 4.1,
					width = "full",
					fontSize = "medium",
				},
				tipsDescription4 = {
					type = "description",
					name = " ",
					order = 5,
					width = "full",
					fontSize = "medium",
				},
			},
		},
		help = {
			type = "group",
			name = "帮助反馈",
			order = 10,
			args = {
				curseforgeURL = {
					type = "input",
					name = "插件下载",
					desc = "也可以在【|cff00ff00网易DD|r】、【|cff00ff00新手盒子|r】、【|cff00ff00大脚客户端|r】、【|cff00ff00黑盒工坊|r】里搜索|cff00ff00AutoAuction|r下载更新",
					order = 1,
					multiline = false,
					get = function()
						return "https://www.curseforge.com/wow/addons/autoauction"
					end,
					set = function(info, value)
						
					end,
					width = "full",
				},
				bilibiliURL = {
					type = "input",
					name = "哔站视频讲解",
					order = 2,
					multiline = false,
					get = function()
						return "https://space.bilibili.com/476889394/channel/series?sid=4434542"
					end,
					set = function(info, value)
						
					end,
					width = "full",
				},
				douyinURL = {
					type = "input",
					name = "抖音视频讲解",
					order = 2.1,
					multiline = false,
					get = function()
						return "https://www.douyin.com/video/7461979939449900338"
					end,
					set = function(info, value)
						
					end,
					width = "full",
				},
				ngaURL = {
					type = "input",
					name = "NGA地址",
					order = 3,
					multiline = false,
					get = function()
						return "https://bbs.nga.cn/read.php?tid=40779551"
					end,
					set = function(info, value)
						
					end,
					width = "full",
				},
				tipsDescription = {
					type = "description",
					name = "|cffCFD100反馈建议|r",
					order = 4,
					width = "full",
					fontSize = "medium",
				},
				QQ = {
					type = "description",
					name = " ",
					order = 5,
					image = function (info)
						return "Interface\\AddOns\\" .. addonName .. "\\Images\\QQ.png", 150, 150
					end,
					width = "normal",
				},
				WX = {
					type = "description",
					name = " ",
					order = 6,
					image = function (info)
						return "Interface\\AddOns\\" .. addonName .. "\\Images\\WX.png", 150, 150
					end,
					width = "normal",
					hidden = true,
				},
				DY = {
					type = "description",
					name = " ",
					order = 7,
					image = function (info)
						return "Interface\\AddOns\\" .. addonName .. "\\Images\\dy.png", 150, 150
					end,
					width = "normal",
				},
				BILI = {
					type = "description",
					name = " ",
					order = 8,
					image = function (info)
						return "Interface\\AddOns\\" .. addonName .. "\\Images\\bili.png", 150, 150
					end,
					width = "normal",
				},
			},
		},
	},
}