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)发送的
    出价
]=]
local ZL = ZLAUTO.mainFrame
local PlayerIsML = ZL.PlayerIsML
ZL.addonVersion = "V2.1.22"
ZL.WAVersion = "V1.0.15"

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 = 0.5,
			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权限",
			args = {
				startBid = {
					type = "range",
					name = "起拍价(默认)",
					min = 0,
					max = 100000,
					softMax = 100000,
					softMin = 0,
					step = 1,
					get = function() return ZL.opt.startBid end,
					set = function(info, value) ZL.opt.startBid = value end,
					order = 1,
                    width = "double",
				},
				minIncrement = {
					type = "range",
					name = "加价幅度(默认)",
					min = 0,
					max = 10000,
					softMax = 10000,
					softMin = 0,
					step = 1,
					get = function() return ZL.opt.increment end,
					set = function(info, value) ZL.opt.increment = value end,
					order = 2,
                    width = "double",
				},
				intervalBidIncrement = {
					dialogInline = true,
					name = "区间加价幅度",
					order = 2.1,
					type = "group",
					args = {
						intervalBidIncrement = {
							type = "toggle",
							name = "按区间自动调整加价幅度",
							desc = "勾选后:按照初始加价幅度和区间加价幅度较大的进行\n比如：\n初始500，区间100，按500加价幅度\n初始100，区间500，按500加价幅度",
							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()
						ZL.ItemSettingFrame:Show()
					end,
					order = 2.5,
					width = "full",
				},
				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 = 2.6,
					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.6,
					width = "twoThirds",
				},
				auctionTimer = {
					type = "range",
					softMin = 10,
					softMax = 3600,
                    step = 1,
					order = 4,
					name = "初始拍卖时间",
					desc = "因未收到出价而结束拍卖所必须等待的秒数\n\n会自动同步ML的设置(单位：秒)",
					set = function(info, value) ZL.opt.auctionTimer = value end,
					get = function()
						return ZL.opt.auctionTimer
					end,
					-- disabled = function () return (not PlayerIsML()) end,
				},
				auctionTimerRefresh = {
					type = "range",
					softMin = 5,
					softMax = 3600,
                    step = 1,
					order = 5,
					name = "重置拍卖时间",
					desc = "收到最后出价后直到拍卖成功所需要等待的秒数\n\n会自动同步ML的设置(单位：秒)",
					set = function(info, value)
						ZL.opt.auctionTimerRefresh = value
					end,
					get = function()
						if PlayerIsML() then ZL.TransmitAddonInfo_Pro() end
						return ZL.opt.auctionTimerRefresh
					end,
				},
				manualCountdownTimer = {
					type = "range",
					softMin = 5,
					softMax = 30,
                    step = 1,
					order = 6,
					name = "手动倒数时间",
					desc = "手动倒计时后直到拍卖结束所需要等待的秒数\n\n会自动同步ML的设置(单位：秒)",
					set = function(info, value) ZL.opt.manualCountdownTimer = value end,
					get = function() return ZL.opt.manualCountdownTimer end,
					disabled = true
				},
				reloadUITimerJump = {
					type = "range",
					softMin = 60,
					softMax = 1800,
                    step = 1,
					order = 7,
					name = "保存数据提醒频率",
					desc = "重新加载人物界面后将重新计时\n(单位：秒)",
					set = function(info, value)
						ZL.opt.reloadUITimerJump = value
					end,
					get = function()
						return ZL.opt.reloadUITimerJump
					end,
				},
				isReloadUI = {
					type = "toggle",
					name = "保存数据提醒|cffffd100(重要)|r",
					desc = "·勾选后将按照设置好的提醒频率在屏幕上方提醒\n·重新加载人物界面后将重新计时\n·战斗状态不会提醒",
					set = function(info, value) ZL.opt.isReloadUI = value end,
					get = function() return ZL.opt.isReloadUI end,
					width = "full",
					order = 7.5,
				},
				isSYNCAll = {
					type = "toggle",
					name = "自动同步数据给其他成员",
					desc = "·保存数据提醒同时同步当前所有数据给其他成员\n·当前存在正在拍卖物品时不同步",
					set = function(info, value) ZL.opt.isSYNCAll = value end,
					get = function() return ZL.opt.isSYNCAll end,
					width = "full",
					order = 7.6,
				},
				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 = 8,
				},
				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 = 9,
				},
				confirmLootAnnounce= {
					type = "toggle",
					name = "是否拾取通报",
					width = "full",
					set = function(info, value) ZL.opt.confirmLootAnnounce = value end,
					get = function() return ZL.opt.confirmLootAnnounce end,
					order = 10,
				},
				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 = 11,
				},
				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 = 11.5,
				},
				remindInvalidBid = {
					type = "toggle",
					name = "向不符合出价的成员发送密语提醒",
					width = "full",
					set = function(info, value) ZL.opt.remindInvalidBid = value end,
					get = function() return ZL.opt.remindInvalidBid end,
					order = 12,
				},
				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 = 13,
				},
				-- auctionFaildNotCountdown = {
				-- 	type = "toggle",
				-- 	name = "无人出价拍品手动倒数时不5秒倒数",
				-- 	desc = "勾选后点手动倒数将直接发布流拍信息，避免团队频道信息过多",
				-- 	width = "full",
				-- 	set = function(info, value) ZL.opt.auctionFaildNotCountdown = value end,
				-- 	get = function() return ZL.opt.auctionFaildNotCountdown end,
				-- 	order = 13,
				-- },
			},
			order = 1.5,
			-- disabled = function ()
			-- 	 return (not PlayerIsML()) 
			-- end,
		},
		butie = {
			type = "group",
			name = "补贴设置",
			desc = "ML权限，会自动同步ML设置",
			order = 2,
			-- disabled = function () return (not PlayerIsML()) end,
			args = {
				customSettings = {
					type = "execute",
					name = "清空",
					func = function()
						ZL.opt.selectHistoryProfile = 1
						ZL.opt.RLBuTieType = 1
						ZL.opt.raidLeaderTiCheng = 0
						ZL.opt.raidLeaderbutie = 0
						ZL.opt.Tbutie = 0
						ZL.opt.Nbutie = 0
						ZL.opt.DPSbutie = 0
						ZL.opt.FOODbutie = 0
						ZL.opt.xiuXingbutie = 0
						ZL.opt.ANMUbutie = 0
						-- ZL.TransmitAddonInfo_Pro()
						ZL.AuctionRecordFrame.currentIncomeFrame:Update()
						ZL.AuctionRecordFrame.playerBalanceFrame:Update()
					end,
					order = 0.1,
					width = "full",
				},
				profile = {
					dialogInline = true,
					name = "|cffffffff快速配置|r",
					order = 0.12,
					type = "group",
					args = {
						saveNewProfile = {
							type = "input",
							name = "保存新的配置",
							order = 1,
							multiline = false,
							get = function (info)
								return ""
							end,
							set = function(info, value)
								local name = value:gsub("^%s*(.-)%s*$", "%1")
								if name == "" then return end
								if not ZL_SETTING["buTieSetting"] then ZL_SETTING["buTieSetting"] = {} end
								local index
								if #ZL_SETTING["buTieSetting"] > 0 then
									for _index, data in ipairs(ZL_SETTING["buTieSetting"]) do
										if data.name == name then
											index = _index
											break
										end
									end
								end
								if index then
									ZL_SETTING["buTieSetting"][index].name = name
									ZL_SETTING["buTieSetting"][index].RLBuTieType = ZL.opt.RLBuTieType
									ZL_SETTING["buTieSetting"][index].raidLeaderTiCheng = ZL.opt.raidLeaderTiCheng
									ZL_SETTING["buTieSetting"][index].raidLeaderbutie = ZL.opt.raidLeaderbutie
									ZL_SETTING["buTieSetting"][index].Tbutie = ZL.opt.Tbutie
									ZL_SETTING["buTieSetting"][index].Nbutie = ZL.opt.Nbutie
									ZL_SETTING["buTieSetting"][index].DPSbutie = ZL.opt.DPSbutie
									ZL_SETTING["buTieSetting"][index].FOODbutie = ZL.opt.FOODbutie
									ZL_SETTING["buTieSetting"][index].xiuXingbutie = ZL.opt.xiuXingbutie
									ZL_SETTING["buTieSetting"][index].ANMUbutie = ZL.opt.ANMUbutie
								else
									table.insert(ZL_SETTING["buTieSetting"], {
										name = value,
										RLBuTieType = ZL.opt.RLBuTieType,
										raidLeaderTiCheng = ZL.opt.raidLeaderTiCheng,
										raidLeaderbutie = ZL.opt.raidLeaderbutie,
										Tbutie = ZL.opt.Tbutie,
										Nbutie = ZL.opt.Nbutie,
										DPSbutie = ZL.opt.DPSbutie,
										FOODbutie = ZL.opt.FOODbutie,
										xiuXingbutie = ZL.opt.xiuXingbutie,
										ANMUbutie = ZL.opt.ANMUbutie,
									})
									ZL.opt.selectHistoryProfile = #ZL_SETTING["buTieSetting"] + 1
								end
							end,
							width = "twoThirds",
						},
						selectHistoryProfile = {
							type = "select",
							name = "选择历史配置",
							width = "twoThirds",
							order = 2,
							values = function ()
								local list = {""}
								if ZL_SETTING["buTieSetting"] and #ZL_SETTING["buTieSetting"] > 0 then
									for _, data in ipairs(ZL_SETTING["buTieSetting"]) do
										table.insert(list, data.name)
									end
								end
								return list
							end,
							get = function(info)
								return ZL.opt.selectHistoryProfile
							end,
							set = function(info, value)
								ZL.opt.selectHistoryProfile = value
								if value > 1 then
									local data = ZL_SETTING["buTieSetting"][value-1]
									ZL.opt.RLBuTieType = data.RLBuTieType
									ZL.opt.raidLeaderTiCheng = data.raidLeaderTiCheng
									ZL.opt.raidLeaderbutie = data.raidLeaderbutie
									ZL.opt.Tbutie = data.Tbutie
									ZL.opt.Nbutie = data.Nbutie
									ZL.opt.DPSbutie = data.DPSbutie
									ZL.opt.FOODbutie = data.FOODbutie
									ZL.opt.xiuXingbutie = data.xiuXingbutie
									ZL.opt.ANMUbutie = data.ANMUbutie
								end
							end,
						},
						deleteHistoryProfile = {
							type = "execute",
							name = "删除",
							func = function()
								if ZL.opt.selectHistoryProfile > 1 then
									table.remove(ZL_SETTING["buTieSetting"], ZL.opt.selectHistoryProfile-1)
								end
							end,
							order = 3,
							width = "half",
						},
					},
				},
				raidLeader = {
					dialogInline = true,
					name = "|cffffffff团长补贴|r",
					order = 0.2,
					type = "group",
					args = {
						raidLeaderType = {
							type = "select",
							name = "补贴方式",
							width = "twoThirds",
							order = 1,
							values = {
								"无", "固定补贴", "双倍工资", "按点提成",
							},
							get = function(info)
								local isHidden
								local descStr = ""
								if ZL.opt.RLBuTieType == 1 then
									ZL.options.args.butie.args.raidLeader.args.raidLeaderbutie.hidden = true
									ZL.options.args.butie.args.raidLeader.args.raidLeaderTiCheng.hidden = true
									descStr = "团长无补贴"
								elseif ZL.opt.RLBuTieType == 2 then
									ZL.options.args.butie.args.raidLeader.args.raidLeaderbutie.hidden = false
									ZL.options.args.butie.args.raidLeader.args.raidLeaderTiCheng.hidden = true
									descStr = "请在右边输入固定补贴金额"
								elseif ZL.opt.RLBuTieType == 3 then
									ZL.options.args.butie.args.raidLeader.args.raidLeaderbutie.hidden = true
									ZL.options.args.butie.args.raidLeader.args.raidLeaderTiCheng.hidden = true
									descStr = [=[
|cffff0000团长双倍工资|r
]=]

-- |cffff0000计算逻辑：|r
-- 工资人数 = 现有团员数 - 老板数 + 1
-- 净收入 = 总收入 - 所有支出
-- 平均工资 = 净收入 / 工资人数
-- 团双工资 = 平均工资 * 2
								elseif ZL.opt.RLBuTieType == 4 then
									ZL.options.args.butie.args.raidLeader.args.raidLeaderbutie.hidden = true
									ZL.options.args.butie.args.raidLeader.args.raidLeaderTiCheng.hidden = false
									descStr = [=[
|cffff0000按百分比提成|r
]=]

-- |cffff0000计算逻辑：|r
-- 工资人数 = 现有团员数 - 老板数
-- 净收入1 = 总收入 - 所有支出
-- 团长提成 = 净收入1 * 5%
-- 净收入2 = 净收入1 - 团长提成
-- 平均工资 = 净收入2 / 工资人数
-- 团长工资 = 平均工资 + 团长提成
								end
								ZL.options.args.butie.args.raidLeader.args.raidLeaderType.desc = descStr
								return ZL.opt.RLBuTieType or 1 -- 这里返回当前选中的值
							end,
							set = function(info, value)
								ZL.opt.RLBuTieType = value -- 这里设置选中的值
							end,
						},
						raidLeaderbutie = {
							type = "input",
							name = "|cff0000ff团长补贴|r",
							desc = "请输入大于0的数",
							order = 2,
							multiline = false,
							get = function()
								-- ZL.TransmitAddonInfo_Pro()
								ZL.AuctionRecordFrame.currentIncomeFrame:Update()
								ZL.AuctionRecordFrame.playerBalanceFrame:Update()
								return tostring(ZL.opt.raidLeaderbutie or "")
							end,
							set = function(info, value)
								ZL.opt.raidLeaderbutie = tonumber(value) or 0
							end,
							width = "twoThirds",
						},
						raidLeaderTiCheng = {
							type = "input",
							name = "|cffff0000团长提成|r",
							desc = "请输入大于0，小于100的数\n比如提成5%，输入5\n|cffff0000不需要输入%号|r",
							order = 2,
							multiline = false,
							get = function()
								-- ZL.TransmitAddonInfo_Pro()
								ZL.AuctionRecordFrame.currentIncomeFrame:Update()
								ZL.AuctionRecordFrame.playerBalanceFrame:Update()
								return tostring(ZL.opt.raidLeaderTiCheng or "")
							end,
							set = function(info, value)
								ZL.opt.raidLeaderTiCheng = tonumber(value) or 0
							end,
							width = "twoThirds",
						},
					},
				},
				tanke = {
					type = "input",
					name = "坦克补贴",
					order = 1,
					multiline = false,
					get = function()
						-- ZL.TransmitAddonInfo_Pro()
						ZL.AuctionRecordFrame.currentIncomeFrame:Update()
						ZL.AuctionRecordFrame.playerBalanceFrame:Update()
						return tostring(ZL.opt.Tbutie or "")
					end,
					set = function(info, value)
						ZL.opt.Tbutie = tonumber(value) or 0
					end,
					width = "twoThirds",
				},
				zhiliao = {
					type = "input",
					name = "治疗补贴",
					order = 2,
					multiline = false,
					get = function()
						-- ZL.TransmitAddonInfo_Pro()
						ZL.AuctionRecordFrame.currentIncomeFrame:Update()
						ZL.AuctionRecordFrame.playerBalanceFrame:Update()
						return tostring(ZL.opt.Nbutie or "")
					end,
					set = function(info, value)
						ZL.opt.Nbutie = tonumber(value) or 0
					end,
					width = "twoThirds",
				},
				DPS = {
					type = "input",
					name = "DPS补贴",
					order = 3,
					multiline = false,
					get = function()
						-- ZL.TransmitAddonInfo_Pro()
						ZL.AuctionRecordFrame.currentIncomeFrame:Update()
						ZL.AuctionRecordFrame.playerBalanceFrame:Update()
						return tostring(ZL.opt.DPSbutie or "")
					end,
					set = function(info, value)
						ZL.opt.DPSbutie = tonumber(value) or 0
					end,
					width = "twoThirds",
				},
				food = {
					type = "input",
					name = "食物补贴",
					order = 4,
					multiline = false,
					get = function()
						-- ZL.TransmitAddonInfo_Pro()
						ZL.AuctionRecordFrame.currentIncomeFrame:Update()
						ZL.AuctionRecordFrame.playerBalanceFrame:Update()
						return tostring(ZL.opt.FOODbutie or "")
					end,
					set = function(info, value)
						ZL.opt.FOODbutie = tonumber(value) or 0
					end,
					width = "twoThirds",
				},
				xiuXing = {
					type = "input",
					name = "修星补贴",
					order = 5,
					multiline = false,
					get = function()
						-- ZL.TransmitAddonInfo_Pro()
						ZL.AuctionRecordFrame.currentIncomeFrame:Update()
						ZL.AuctionRecordFrame.playerBalanceFrame:Update()
						return tostring(ZL.opt.xiuXingbutie or "")
					end,
					set = function(info, value)
						ZL.opt.xiuXingbutie = tonumber(value) or 0
					end,
					width = "twoThirds",
				},
				anMu = {
					type = "input",
					name = "工具人补贴",
					desc = "如：暗牧、战斗贼、增强萨等",
					order = 6,
					multiline = false,
					get = function()
						-- ZL.TransmitAddonInfo_Pro()
						ZL.AuctionRecordFrame.currentIncomeFrame:Update()
						ZL.AuctionRecordFrame.playerBalanceFrame:Update()
						return tostring(ZL.opt.ANMUbutie or "")
					end,
					set = function(info, value)
						ZL.opt.ANMUbutie = tonumber(value) or 0
					end,
					width = "twoThirds",
				},
			},
		},
		lootToBags = {
			type = "group",
			name = "背包设置",
			-- desc = "设置流拍、自己买的物品放到哪个背包",
			order = 2.1,
			args = {
				tipShow = {
					type = "toggle",
					name = "鼠标提示",
					desc = "鼠标移动到背包物品，如果已创建拍卖，则提示当前拍卖状态",
					width = "full",
					order = 1,
					set = function(info, value)
						ZL.opt.tipShow = value
					end,
					get = function() return ZL.opt.tipShow end,
				},
				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",
						},
					},
				},
				IsTradeRemainingVoiceReminder = {
					dialogInline = true,
					name = "交易剩余时间语音提醒",
					order = 2.1,
					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,
						},
					},
				},
				IsVoiceReminder = {
					type = "toggle",
					name = "拍卖语音提醒",
					set = function(info, value)
						ZL.opt.IsVoiceReminder = value
					end,
					get = function() return ZL.opt.IsVoiceReminder end,
					width = "twoThirds",
					order = 2.2,
				},
				VoiceReminderSoundType = {
					type = "select",
					name = "语音类型",
					width = "twoThirds",
					order = 2.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 "甜美女声"
					end,
				},
				startAuctionSound = {
					type = "toggle",
					name = "开始拍卖使用系统语音",
					set = function(info, value)
						ZL.opt.startAuctionSound = value
					end,
					get = function() return ZL.opt.startAuctionSound end,
					width = "full",
					order = 2.4,
				},
				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,
				},
			},
		},
		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,
						},
					},
				},
				auctionWindow = {
					dialogInline = false,
					type = "group",
					name = "拍卖清单窗口设置",
					order = 4,
					args = {
						maxFrameHide = {
							type = "toggle",
							name = "隐藏最小化拍卖清单窗口",
							desc = "不在团队并且不是ML时隐藏窗口",
							set = function(info, value)
								ZL.opt.maxFrameHide = value
								if (not ZL.opt.ZLAuctionFrameIsShown) and (PlayerIsML() or IsInGroup() or (not ZL.opt.maxFrameHide)) then
									ZL.maxFrame:Show()
								else
									ZL.maxFrame:Hide()
								end
							end,
							get = function() return ZL.opt.maxFrameHide end,
							width = "full",
							order = 0.1,
						},
						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,
								},
								recordShortcutTipHide = {
									type = "toggle",
									name = "快捷键",
									set = function(info, value)
										ZL.opt.recordShortcutTipHide = value
									end,
									get = function() return ZL.opt.recordShortcutTipHide end,
									width = "twoThirds",
									order = 4,
								},
							},
						},
						columnHide = {
							dialogInline = true,
							type = "group",
							name = "隐藏列",
							order = 1,
							args={
								bidColumnHide = {
									type = "toggle",
									name = "出价",
									set = function(info, value)
										ZL.opt.bidColumnHide = 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.startbidColumnHide or (ZL.opt.startBidHide and ZL.opt.inrementHide)) then
											needWidth = needWidth + startbidColumnWidth
										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.syncBtnHide and ZL.opt.delAuctionBtnHide)) then
											needWidth = needWidth + functionColumnWidth
										end
										if (ZL.opt.bidColumnHide or (ZL.opt.bidEditBoxHide and ZL.opt.bidBtnHide and ZL.opt.bidCountsHide)) then
											if (totalWidth - bidColumnWidth) >= needWidth then
												AuctionFrame:SetWidth(width - bidColumnWidth)
											else
												AuctionFrame:Update(true)
											end
										else
											if width + bidColumnWidth <= GetScreenWidth()-30 then
												AuctionFrame:SetWidth(width + bidColumnWidth)
											else
												AuctionFrame:Update(true)
											end
										end
									end,
									get = function() return ZL.opt.bidColumnHide end,
									width = "twoThirds",
									order = 1,
								},
								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.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(true)
											end
										else
											if width + startbidColumnWidth <= GetScreenWidth()-30 then
												AuctionFrame:SetWidth(width + startbidColumnWidth)
											else
												AuctionFrame:Update(true)
											end
										end
									end,
									get = function() return ZL.opt.startbidColumnHide end,
									width = "twoThirds",
									order = 2,
									-- disabled = function () return (not PlayerIsML()) end,
								},
								functionColumnHide = {
									type = "toggle",
									name = "功能按钮",
									set = function(info, value)
										ZL.opt.functionColumnHide = 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.startbidColumnHide or (ZL.opt.startBidHide and ZL.opt.inrementHide))) then
											needWidth = needWidth + startbidColumnWidth
										end
										if (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.syncBtnHide and ZL.opt.delAuctionBtnHide)) then
											if (totalWidth - functionColumnWidth) >= needWidth then
												AuctionFrame:SetWidth(width - functionColumnWidth)
											else
												AuctionFrame:Update(true)
											end
										else
											if width + functionColumnWidth <= GetScreenWidth()-30 then
												AuctionFrame:SetWidth(width + functionColumnWidth)
											else
												AuctionFrame:Update(true)
											end
										end
									end,
									get = function() return ZL.opt.functionColumnHide end,
									width = "twoThirds",
									order = 3,
									-- disabled = function () return (not PlayerIsML()) end,
								},
							},
						},
						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,
								},
								bidEditBoxHide = {
									type = "toggle",
									name = "|cffA335EE出价文本框|r",
									set = function(info, value)
										ZL.opt.bidEditBoxHide = value
									end,
									get = function() return ZL.opt.bidEditBoxHide end,
									width = "twoThirds",
									order = 5,
								},
								bidBtnHide = {
									type = "toggle",
									name = "|cffA335EE出价按钮|r",
									set = function(info, value)
										ZL.opt.bidBtnHide = value
									end,
									get = function() return ZL.opt.bidBtnHide end,
									width = "twoThirds",
									order = 6,
								},
								bidCountsHide = {
									type = "toggle",
									name = "|cffA335EE竞拍数量|r",
									set = function(info, value)
										ZL.opt.bidCountsHide = value
									end,
									get = function() return ZL.opt.bidCountsHide end,
									width = "twoThirds",
									order = 7,
								},
								startBidHide = {
									type = "toggle",
									name = "|cff0070DD起拍价|r",
									set = function(info, value)
										ZL.opt.startBidHide = value
									end,
									get = function() return ZL.opt.startBidHide end,
									width = "twoThirds",
									order = 8,
									-- disabled = function () return (not PlayerIsML()) end,
								},
								inrementHide = {
									type = "toggle",
									name = "|cff0070DD加价|r",
									set = function(info, value)
										ZL.opt.inrementHide = value
									end,
									get = function() return ZL.opt.inrementHide end,
									width = "twoThirds",
									order = 9,
									-- disabled = function () return (not PlayerIsML()) end,
								},
								startBtnHide = {
									type = "toggle",
									name = "|cffFF8000开始|r",
									set = function(info, value)
										ZL.opt.startBtnHide = value
									end,
									get = function() return ZL.opt.startBtnHide end,
									width = "twoThirds",
									order = 10,
									-- disabled = function () return (not PlayerIsML()) end,
								},
								pauseBtnHide = {
									type = "toggle",
									name = "|cffFF8000暂停|r",
									set = function(info, value)
										ZL.opt.pauseBtnHide = value
									end,
									get = function() return ZL.opt.pauseBtnHide end,
									width = "twoThirds",
									order = 11,
									-- disabled = function () return (not PlayerIsML()) end,
								},
								countdownBtnHide = {
									type = "toggle",
									name = "|cffFF8000倒数|r",
									set = function(info, value)
										ZL.opt.countdownBtnHide = value
									end,
									get = function() return ZL.opt.countdownBtnHide end,
									width = "twoThirds",
									order = 12,
									-- disabled = function () return (not PlayerIsML()) end,
								},
								packageBtnHide = {
									type = "toggle",
									name = "|cffFF8000打包|r",
									set = function(info, value)
										ZL.opt.packageBtnHide = value
									end,
									get = function() return ZL.opt.packageBtnHide end,
									width = "twoThirds",
									order = 13,
									-- disabled = function () return (not PlayerIsML()) end,
								},
								reverseBidBtnHide = {
									type = "toggle",
									name = "|cffFF8000撤销出价|r",
									set = function(info, value)
										ZL.opt.reverseBidBtnHide = value
									end,
									get = function() return ZL.opt.reverseBidBtnHide end,
									width = "twoThirds",
									order = 14,
									-- disabled = function () return (not PlayerIsML()) end,
								},
								syncBtnHide = {
									type = "toggle",
									name = "|cffFF8000同步|r",
									set = function(info, value)
										ZL.opt.syncBtnHide = value
									end,
									get = function() return ZL.opt.syncBtnHide end,
									width = "twoThirds",
									order = 15,
									-- disabled = function () return (not PlayerIsML()) end,
								},
								delAuctionBtnHide = {
									type = "toggle",
									name = "|cffFF8000删除|r",
									set = function(info, value)
										ZL.opt.delAuctionBtnHide = value
									end,
									get = function() return ZL.opt.delAuctionBtnHide end,
									width = "twoThirds",
									order = 16,
									-- disabled = function () return (not PlayerIsML()) end,
								},
							},
						},
						floatContentHide = {
							dialogInline = true,
							type = "group",
							name = "悬浮窗内容隐藏",
							order = 3,
							args={
								floatBidFrameHide = {
									type = "toggle",
									name = "出价",
									set = function(info, value)
										ZL.opt.floatBidFrameHide = value
										
									end,
									get = function() return ZL.opt.floatBidFrameHide end,
									width = "twoThirds",
									order = 1,
								},
								floatStartBidFrameHide = {
									type = "toggle",
									name = "起拍价/加价",
									set = function(info, value)
										ZL.opt.floatStartBidFrameHide = value
										
									end,
									get = function() return ZL.opt.floatStartBidFrameHide end,
									width = "twoThirds",
									order = 2,
									-- disabled = function () return (not PlayerIsML()) end,
								},
								floatFunctionFrameHide = {
									type = "toggle",
									name = "功能按钮",
									set = function(info, value)
										ZL.opt.floatFunctionFrameHide = value
										
									end,
									get = function() return ZL.opt.floatFunctionFrameHide end,
									width = "twoThirds",
									order = 3,
									-- disabled = function () return (not PlayerIsML()) end,
								},
							},
						},
					},
				},
			},
		},
		help = {
			type = "group",
			name = "帮助反馈",
			order = 5,
			args = {
				curseforgeURL = {
					type = "input",
					name = "插件下载",
					desc = "也可以在【|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",
				},
				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",
				},
			},
		},
	},
}


