This commit is contained in:
Crum
2018-10-09 19:16:17 -05:00
parent d7f77ec694
commit 4044259cc9
7 changed files with 362 additions and 69 deletions
+150 -31
View File
@@ -7,7 +7,7 @@ local LIP = LibStub("ItemPrice-1.1");
--Lua functions --Lua functions
local _G = _G local _G = _G
local type, ipairs, pairs, unpack, select, assert, pcall = type, ipairs, pairs, unpack, select, assert, pcall local type, ipairs, pairs, unpack, select, assert, pcall = type, ipairs, pairs, unpack, select, assert, pcall
local tinsert = table.insert local tinsert, tremove, twipe, tmaxn = table.insert, table.remove, table.wipe, table.maxn
local floor = math.floor local floor = math.floor
local len, gsub, sub, match = string.len, string.gsub, string.sub, string.match local len, gsub, sub, match = string.len, string.gsub, string.sub, string.match
--WoW API / Variables --WoW API / Variables
@@ -471,15 +471,25 @@ function B:Layout(isBank)
local numContainerColumns = floor(containerWidth / (buttonSize + buttonSpacing)) local numContainerColumns = floor(containerWidth / (buttonSize + buttonSpacing))
local holderWidth = ((buttonSize + buttonSpacing) * numContainerColumns) - buttonSpacing local holderWidth = ((buttonSize + buttonSpacing) * numContainerColumns) - buttonSpacing
local numContainerRows = 0 local numContainerRows = 0
local numBags = 0
local numBagSlots = 0
local bagSpacing = self.db.split.bagSpacing
local countColor = E.db.bags.countFontColor local countColor = E.db.bags.countFontColor
E:Width(f.holderFrame, holderWidth) E:Width(f.holderFrame, holderWidth)
local isSplit = self.db.split[isBank and "bank" or "player"]
f.totalSlots = 0 f.totalSlots = 0
local lastButton local lastButton
local lastRowButton local lastRowButton
local lastContainerButton local lastContainerButton
local numContainerSlots = GetNumBankSlots() local numContainerSlots = GetNumBankSlots()
local newBag
for i, bagID in ipairs(f.BagIDs) do for i, bagID in ipairs(f.BagIDs) do
if isSplit then
newBag = (bagID ~= -1 or bagID ~= 0) and self.db.split["bag"..bagID] or false
end
--Bag Containers --Bag Containers
if (not isBank and bagID <= 3 ) or (isBank and bagID ~= -1 and numContainerSlots >= 1 and not (i - 1 > numContainerSlots)) then if (not isBank and bagID <= 3 ) or (isBank and bagID ~= -1 and numContainerSlots >= 1 and not (i - 1 > numContainerSlots)) then
if not f.ContainerHolder[i] then if not f.ContainerHolder[i] then
@@ -603,21 +613,36 @@ function B:Layout(isBank)
f.Bags[bagID][slotID]:ClearAllPoints() f.Bags[bagID][slotID]:ClearAllPoints()
end end
local anchorPoint, relativePoint
if lastButton then if lastButton then
if mod(f.totalSlots - 1, numContainerColumns) == 0 then anchorPoint, relativePoint = (self.db.reverseSlots and "BOTTOM" or "TOP"), (self.db.reverseSlots and "TOP" or "BOTTOM")
E:Point(f.Bags[bagID][slotID], "TOP", lastRowButton, "BOTTOM", 0, -buttonSpacing) if isSplit and newBag and slotID == 1 then
E:Point(f.Bags[bagID][slotID], anchorPoint, lastRowButton, relativePoint, 0, self.db.reverseSlots and (buttonSpacing + bagSpacing) or -(buttonSpacing + bagSpacing))
lastRowButton = f.Bags[bagID][slotID]
numContainerRows = numContainerRows + 1
numBags = numBags + 1
numBagSlots = 0
elseif isSplit and mod(numBagSlots, numContainerColumns) == 0 then
E:Point(f.Bags[bagID][slotID], anchorPoint, lastRowButton, relativePoint, 0, self.db.reverseSlots and buttonSpacing or -buttonSpacing)
lastRowButton = f.Bags[bagID][slotID]
numContainerRows = numContainerRows + 1
elseif (not isSplit) and mod((f.totalSlots - 1) , numContainerColumns) == 0 then
E:Point(f.Bags[bagID][slotID], anchorPoint, lastRowButton, relativePoint, 0, self.db.reverseSlots and buttonSpacing or -buttonSpacing)
lastRowButton = f.Bags[bagID][slotID] lastRowButton = f.Bags[bagID][slotID]
numContainerRows = numContainerRows + 1 numContainerRows = numContainerRows + 1
else else
E:Point(f.Bags[bagID][slotID], "LEFT", lastButton, "RIGHT", buttonSpacing, 0) anchorPoint, relativePoint = (self.db.reverseSlots and "RIGHT" or "LEFT"), (self.db.reverseSlots and "LEFT" or "RIGHT")
E:Point(f.Bags[bagID][slotID], anchorPoint, lastButton, relativePoint, self.db.reverseSlots and -buttonSpacing or buttonSpacing, 0)
end end
else else
E:Point(f.Bags[bagID][slotID], "TOPLEFT", f.holderFrame, "TOPLEFT") anchorPoint = self.db.reverseSlots and "BOTTOMRIGHT" or "TOPLEFT"
E:Point(f.Bags[bagID][slotID], anchorPoint, f.holderFrame, anchorPoint)
lastRowButton = f.Bags[bagID][slotID] lastRowButton = f.Bags[bagID][slotID]
numContainerRows = numContainerRows + 1 numContainerRows = numContainerRows + 1
end end
lastButton = f.Bags[bagID][slotID] lastButton = f.Bags[bagID][slotID]
numBagSlots = numBagSlots + 1
end end
else else
for i = 1, MAX_CONTAINER_ITEMS do for i = 1, MAX_CONTAINER_ITEMS do
@@ -688,7 +713,7 @@ function B:Layout(isBank)
E:Size(f.keyFrame, ((buttonSize + buttonSpacing) * numKeyColumns) + buttonSpacing, ((buttonSize + buttonSpacing) * numKeyRows) + buttonSpacing) E:Size(f.keyFrame, ((buttonSize + buttonSpacing) * numKeyColumns) + buttonSpacing, ((buttonSize + buttonSpacing) * numKeyRows) + buttonSpacing)
end end
E:Size(f, containerWidth, (((buttonSize + buttonSpacing) * numContainerRows) - buttonSpacing) + f.topOffset + f.bottomOffset) E:Size(f, containerWidth, (((buttonSize + buttonSpacing) * numContainerRows) - buttonSpacing) + (isSplit and (numBags * bagSpacing) or 0 ) + f.topOffset + f.bottomOffset) -- 8 is the cussion of the f.holderFrame
end end
function B:UpdateKeySlot(slotID) function B:UpdateKeySlot(slotID)
@@ -788,7 +813,14 @@ function B:OnEvent()
if not this:IsShown() then return end if not this:IsShown() then return end
this:UpdateCooldowns() this:UpdateCooldowns()
elseif event == "PLAYERBANKSLOTS_CHANGED" then elseif event == "PLAYERBANKSLOTS_CHANGED" then
this:UpdateAllSlots(-1) local slot = unpack(arg)
print(event, slot)
local bagID = (slot <= NUM_BANKGENERIC_SLOTS) and -1 or (slot - NUM_BANKGENERIC_SLOTS)
if bagID > -1 then
B:Layout(true)
else
this:UpdateBagSlots(-1)
end
end end
end end
@@ -841,39 +873,41 @@ function B:GetGraysValue()
end end
function B:VendorGrays(delete) function B:VendorGrays(delete)
if not MerchantFrame or not MerchantFrame:IsShown() and not delete then if B.SellFrame:IsShown() then return end
if (not MerchantFrame or not MerchantFrame:IsShown()) and not delete then
E:Print(L["You must be at a vendor."]) E:Print(L["You must be at a vendor."])
return return
end end
local goldGained, itemLink, itype, rarity, stackCount, stackPrice, _ = 0 local itemLink, rarity, itype, itemPrice, _
for bag = 0, NUM_BAG_FRAMES, 1 do for bag = 0, NUM_BAG_FRAMES, 1 do
for slot = 1, GetContainerNumSlots(bag), 1 do for slot = 1, GetContainerNumSlots(bag), 1 do
itemLink = GetContainerItemLink(bag, slot) itemLink = GetContainerItemLink(bag, slot)
if itemLink then if itemLink then
_, _, rarity, _, _, itype = GetItemInfo(match(itemLink, "item:(%d+)")) _, _, rarity, _, _, itype = GetItemInfo(match(itemLink, "item:(%d+)"))
stackCount = select(2, GetContainerItemInfo(bag, slot)) or 1 itemPrice = LIP:GetSellValue(itemLink) or 0
if (rarity and rarity == 0) and (itype and itype ~= "Quest") then if (rarity and rarity == 0) and (itype and itype ~= "Quest") and (itemPrice and itemPrice > 0) then
if delete then tinsert(B.SellFrame.Info.itemList, {bag, slot, itemLink, itemPrice})
PickupContainerItem(bag, slot)
DeleteCursorItem()
else
stackPrice = (LIP:GetSellValue(itemLink) or 0) * stackCount
goldGained = goldGained + stackPrice
if E.db.general.vendorGraysDetails and itemLink then
E:Print(format("%s|cFF00DDDDx%d|r %s", itemLink, stackCount, B:FormatMoney(stackPrice)))
end
UseContainerItem(bag, slot)
end
end end
end end
end end
end end
if goldGained > 0 then if not B.SellFrame.Info.itemList then return end
E:Print(format(L["Vendored gray items for: %s"], B:FormatMoney(goldGained))) if tmaxn(B.SellFrame.Info.itemList) < 1 then return end
end --Resetting stuff
B.SellFrame.Info.delete = delete or false
B.SellFrame.Info.ProgressTimer = 0
B.SellFrame.Info.SellInterval = E.db.bags.vendorGrays.interval
B.SellFrame.Info.ProgressMax = tmaxn(B.SellFrame.Info.itemList)
B.SellFrame.Info.goldGained = 0
B.SellFrame.Info.itemsSold = 0
B.SellFrame.statusbar:SetValue(0)
B.SellFrame.statusbar:SetMinMaxValues(0, B.SellFrame.Info.ProgressMax)
B.SellFrame.statusbar.ValueText:SetText("0 / "..B.SellFrame.Info.ProgressMax)
--Time to sell
B.SellFrame:Show()
end end
function B:VendorGrayCheck() function B:VendorGrayCheck()
@@ -897,13 +931,12 @@ function B:ContructContainerFrame(name, isBank)
f.UpdateAllSlots = B.UpdateAllSlots f.UpdateAllSlots = B.UpdateAllSlots
f.UpdateBagSlots = B.UpdateBagSlots f.UpdateBagSlots = B.UpdateBagSlots
f.UpdateCooldowns = B.UpdateCooldowns f.UpdateCooldowns = B.UpdateCooldowns
f:RegisterEvent("ITEM_LOCK_CHANGED") f:RegisterEvent("BAG_UPDATE") -- Has to be on both frames
f:RegisterEvent("ITEM_UNLOCKED") f:RegisterEvent("BAG_UPDATE_COOLDOWN") -- Has to be on both frames
f:RegisterEvent("BAG_UPDATE_COOLDOWN") f.events = isBank and {"PLAYERBANKSLOTS_CHANGED"} or {"ITEM_LOCK_CHANGED", "ITEM_UNLOCKED"}
f:RegisterEvent("BAG_UPDATE")
if isBank then for _, event in pairs(f.events) do
f:RegisterEvent("PLAYERBANKSLOTS_CHANGED") f:RegisterEvent(event)
end end
f:SetScript("OnEvent", B.OnEvent) f:SetScript("OnEvent", B.OnEvent)
@@ -1423,6 +1456,87 @@ function B:PostBagMove()
end end
end end
function B:MERCHANT_CLOSED()
B.SellFrame:Hide()
twipe(B.SellFrame.Info.itemList)
B.SellFrame.Info.delete = false
B.SellFrame.Info.ProgressTimer = 0
B.SellFrame.Info.SellInterval = E.db.bags.vendorGrays.interval
B.SellFrame.Info.ProgressMax = 0
B.SellFrame.Info.goldGained = 0
B.SellFrame.Info.itemsSold = 0
end
function B:ProgressQuickVendor()
local item = B.SellFrame.Info.itemList[1]
if not item then return nil, true end --No more to sell
local bag, slot, itemLink, itemPrice = unpack(item)
local stackPrice
local stackCount = select(2, GetContainerItemInfo(bag, slot)) or 1
if B.SellFrame.Info.delete then
PickupContainerItem(bag, slot)
DeleteCursorItem()
else
stackPrice = (itemPrice or 0) * stackCount
if E.db.bags.vendorGrays.details and itemLink then
E:Print(format("%s|cFF00DDDDx%d|r %s", itemLink, stackCount, B:FormatMoney(stackPrice)))
end
UseContainerItem(bag, slot)
end
tremove(B.SellFrame.Info.itemList, 1)
return stackPrice
end
function B:VendorGreys_OnUpdate()
B.SellFrame.Info.ProgressTimer = B.SellFrame.Info.ProgressTimer - arg1
if B.SellFrame.Info.ProgressTimer > 0 then return end
B.SellFrame.Info.ProgressTimer = B.SellFrame.Info.SellInterval
local goldGained, lastItem = B:ProgressQuickVendor();
if goldGained then
B.SellFrame.Info.goldGained = B.SellFrame.Info.goldGained + goldGained
B.SellFrame.Info.itemsSold = B.SellFrame.Info.itemsSold + 1
B.SellFrame.statusbar:SetValue(B.SellFrame.Info.itemsSold)
local timeLeft = (B.SellFrame.Info.ProgressMax - B.SellFrame.Info.itemsSold)*B.SellFrame.Info.SellInterval
B.SellFrame.statusbar.ValueText:SetText(B.SellFrame.Info.itemsSold.." / "..B.SellFrame.Info.ProgressMax.." ( "..timeLeft.."s )")
elseif lastItem then
B.SellFrame:Hide()
if B.SellFrame.Info.goldGained > 0 then
E:Print(format(L["Vendored gray items for: %s"], B:FormatMoney(B.SellFrame.Info.goldGained)))
end
end
end
function B:CreateSellFrame()
B.SellFrame = CreateFrame("Frame", "ElvUIVendorGraysFrame", E.UIParent)
E:Size(B.SellFrame, 200,40)
E:Point(B.SellFrame, "CENTER", UIParent)
E:CreateBackdrop(B.SellFrame, "Transparent")
B.SellFrame.title = B.SellFrame:CreateFontString(nil, "OVERLAY")
E:FontTemplate(B.SellFrame.title, nil, 12, "OUTLINE")
E:Point(B.SellFrame.title, "TOP", B.SellFrame, "TOP", 0, -2)
B.SellFrame.title:SetText(L["Vendoring Grays"])
B.SellFrame.statusbar = CreateFrame("StatusBar", "ElvUIVendorGraysFrameStatusbar", B.SellFrame)
E:Size(B.SellFrame.statusbar, 180, 16)
E:Point(B.SellFrame.statusbar, "BOTTOM", B.SellFrame, "BOTTOM", 0, 4)
B.SellFrame.statusbar:SetStatusBarTexture(E["media"].normTex)
E:CreateBackdrop(B.SellFrame.statusbar, "Transparent")
B.SellFrame.statusbar.ValueText = B.SellFrame.statusbar:CreateFontString(nil, "OVERLAY")
E:FontTemplate(B.SellFrame.statusbar.ValueText, nil, 12, "OUTLINE")
E:Point(B.SellFrame.statusbar.ValueText, "CENTER", B.SellFrame.statusbar)
B.SellFrame.statusbar.ValueText:SetText("0 / 0 ( 0s )")
B.SellFrame.Info = {
delete = false,
ProgressTimer = 0,
SellInterval = E.db.bags.vendorGrays.interval,
ProgressMax = 0,
goldGained = 0,
itemsSold = 0,
itemList = {}
}
B.SellFrame:SetScript("OnUpdate", B.VendorGreys_OnUpdate)
B.SellFrame:Hide()
end
function B:Initialize() function B:Initialize()
self:LoadBagBar() self:LoadBagBar()
@@ -1432,6 +1546,11 @@ function B:Initialize()
E:Height(BagFrameHolder, 22) E:Height(BagFrameHolder, 22)
BagFrameHolder:SetFrameLevel(BagFrameHolder:GetFrameLevel() + 400) BagFrameHolder:SetFrameLevel(BagFrameHolder:GetFrameLevel() + 400)
--Creating vendor grays frame
B:CreateSellFrame()
self:RegisterEvent("MERCHANT_CLOSED")
if not E.private.bags.enable then if not E.private.bags.enable then
--Set a different default anchor --Set a different default anchor
E:Point(BagFrameHolder, "BOTTOMRIGHT", RightChatPanel, "BOTTOMRIGHT", -(E.Border*2), 22 + E.Border*4 - E.Spacing*2) E:Point(BagFrameHolder, "BOTTOMRIGHT", RightChatPanel, "BOTTOMRIGHT", -(E.Border*2), 22 + E.Border*4 - E.Spacing*2)
+5 -5
View File
@@ -643,12 +643,12 @@ local function RegisterUpdateDelayed()
bagFrame:UpdateAllSlots() bagFrame:UpdateAllSlots()
bagFrame.registerUpdate = nil -- call update and re-register events, keep this after UpdateAllSlots bagFrame.registerUpdate = nil -- call update and re-register events, keep this after UpdateAllSlots
shouldUpdateFade = true -- we should refresh the bag search after sorting shouldUpdateFade = true -- we should refresh the bag search after sorting
bagFrame:RegisterEvent("ITEM_LOCK_CHANGED")
bagFrame:RegisterEvent("ITEM_UNLOCKED")
bagFrame:RegisterEvent("BAG_UPDATE_COOLDOWN")
bagFrame:RegisterEvent("BAG_UPDATE") bagFrame:RegisterEvent("BAG_UPDATE")
if bagFrame.isBank then bagFrame:RegisterEvent("BAG_UPDATE_COOLDOWN")
bagFrame:RegisterEvent("PLAYERBANKSLOTS_CHANGED")
for _, event in pairs(bagFrame.events) do
bagFrame:RegisterEvent(event)
end end
end end
end end
+4 -1
View File
@@ -75,7 +75,7 @@ function M:COMBAT_LOG_EVENT_UNFILTERED(_, _, event, _, sourceName, _, _, destNam
end end
function M:MERCHANT_SHOW() function M:MERCHANT_SHOW()
if E.db.general.vendorGrays then if E.db.bags.vendorGrays.enable then
E:GetModule("Bags"):VendorGrays(nil, true) E:GetModule("Bags"):VendorGrays(nil, true)
end end
@@ -173,6 +173,9 @@ function M:ForceCVars()
end end
function M:Initialize() function M:Initialize()
--DB conversion
if E.db.general.vendorGrays then E.db.bags.vendorGrays.enable = E.db.general.vendorGrays end
self:LoadRaidMarker() self:LoadRaidMarker()
self:LoadLoot() self:LoadLoot()
self:LoadLootRoll() self:LoadLootRoll()
+2
View File
@@ -238,7 +238,9 @@ local function LoadSkin()
S:HandleButton(CoinPickupCancelButton) S:HandleButton(CoinPickupCancelButton)
-- Stack Split Frame -- Stack Split Frame
E:SetTemplate(StackSplitFrame, "Transparent")
StackSplitFrame:GetRegions():Hide() StackSplitFrame:GetRegions():Hide()
StackSplitFrame:SetFrameStrata("DIALOG")
StackSplitFrame.bg1 = CreateFrame("Frame", nil, StackSplitFrame) StackSplitFrame.bg1 = CreateFrame("Frame", nil, StackSplitFrame)
E:SetTemplate(StackSplitFrame.bg1, "Transparent") E:SetTemplate(StackSplitFrame.bg1, "Transparent")
+22 -1
View File
@@ -9,7 +9,6 @@ P["general"] = {
["loginmessage"] = true, ["loginmessage"] = true,
["autoRepair"] = "NONE", ["autoRepair"] = "NONE",
["autoRoll"] = false, ["autoRoll"] = false,
["vendorGrays"] = false,
["autoAcceptInvite"] = false, ["autoAcceptInvite"] = false,
["bottomPanel"] = true, ["bottomPanel"] = true,
["hideErrorFrame"] = true, ["hideErrorFrame"] = true,
@@ -564,9 +563,31 @@ P["bags"] = {
["countFontSize"] = 10, ["countFontSize"] = 10,
["countFontOutline"] = "MONOCHROMEOUTLINE", ["countFontOutline"] = "MONOCHROMEOUTLINE",
["countFontColor"] = {r = 1, g = 1, b = 1}, ["countFontColor"] = {r = 1, g = 1, b = 1},
["reverseSlots"] = false,
["clearSearchOnClose"] = false, ["clearSearchOnClose"] = false,
["disableBagSort"] = false, ["disableBagSort"] = false,
["disableBankSort"] = false, ["disableBankSort"] = false,
["vendorGrays"] = {
["enable"] = false,
["interval"] = 0.2,
["details"] = false
},
["split"] = {
["bagSpacing"] = 5,
["player"] = false,
["bank"] = false,
["bag1"] = false,
["bag2"] = false,
["bag3"] = false,
["bag4"] = false,
["bag5"] = false,
["bag6"] = false,
["bag7"] = false,
["bag8"] = false,
["bag9"] = false,
["bag10"] = false,
["bag11"] = false,
},
["bagBar"] = { ["bagBar"] = {
["growthDirection"] = "VERTICAL", ["growthDirection"] = "VERTICAL",
["sortDirection"] = "ASCENDING", ["sortDirection"] = "ASCENDING",
+162 -8
View File
@@ -60,20 +60,26 @@ E.Options.args.bags = {
name = L["Clear Search On Close"], name = L["Clear Search On Close"],
set = function(info, value) E.db.bags[ info[getn(info)] ] = value end set = function(info, value) E.db.bags[ info[getn(info)] ] = value end
}, },
disableBagSort = { reverseSlots = {
order = 3, order = 3,
type = "toggle", type = "toggle",
name = L["Reverse Bag Slots"],
set = function(info, value) E.db.bags[info[getn(info)]] = value B:UpdateAll() end,
},
disableBagSort = {
order = 4,
type = "toggle",
name = L["Disable Bag Sort"], name = L["Disable Bag Sort"],
set = function(info, value) E.db.bags[ info[getn(info)] ] = value; B:ToggleSortButtonState(false) end set = function(info, value) E.db.bags[ info[getn(info)] ] = value; B:ToggleSortButtonState(false) end
}, },
disableBankSort = { disableBankSort = {
order = 4, order = 5,
type = "toggle", type = "toggle",
name = L["Disable Bank Sort"], name = L["Disable Bank Sort"],
set = function(info, value) E.db.bags[ info[getn(info)] ] = value; B:ToggleSortButtonState(true) end set = function(info, value) E.db.bags[ info[getn(info)] ] = value; B:ToggleSortButtonState(true) end
}, },
countGroup = { countGroup = {
order = 5, order = 6,
type = "group", type = "group",
name = L["Item Count Font"], name = L["Item Count Font"],
guiInline = true, guiInline = true,
@@ -123,7 +129,7 @@ E.Options.args.bags = {
} }
}, },
itemLevelGroup = { itemLevelGroup = {
order = 6, order = 7,
type = "group", type = "group",
name = L["Item Level"], name = L["Item Level"],
guiInline = true, guiInline = true,
@@ -307,9 +313,152 @@ E.Options.args.bags = {
} }
} }
}, },
bagSortingGroup = { split = {
order = 6, order = 6,
type = "group", type = "group",
name = L["Split"],
get = function(info) return E.db.bags.split[ info[getn(info)] ] end,
set = function(info, value) E.db.bags.split[ info[getn(info)] ] = value B:UpdateAll() end,
disabled = function() return not E.bags end,
args = {
header = {
order = 1,
type = "header",
name = L["Split"]
},
bagSpacing = {
order = 2,
type = "range",
name = L["Bag Spacing"],
min = 0, max = 20, step = 1
},
player = {
order = 3,
type = "toggle",
set = function(info, value) E.db.bags.split[ info[getn(info)] ] = value B:Layout() end,
name = L["Bag"]
},
bank = {
order = 4,
type = "toggle",
set = function(info, value) E.db.bags.split[ info[getn(info)] ] = value B:Layout(true) end,
name = L["Bank"]
},
splitbags = {
order = 5,
type = "group",
name = L["Player"],
get = function(info) return E.db.bags.split[ info[getn(info)] ] end,
set = function(info, value) E.db.bags.split[ info[getn(info)] ] = value B:Layout() end,
disabled = function() return not E.db.bags.split.player end,
guiInline = true,
args = {
bag1 = {
order = 2,
type = "toggle",
name = L["Bag 1"]
},
bag2 = {
order = 3,
type = "toggle",
name = L["Bag 2"]
},
bag3 = {
order = 4,
type = "toggle",
name = L["Bag 3"]
},
bag4 = {
order = 5,
type = "toggle",
name = L["Bag 4"]
}
}
},
splitbank = {
order = 6,
type = "group",
name = L["Bank"],
get = function(info) return E.db.bags.split[ info[getn(info)] ] end,
set = function(info, value) E.db.bags.split[ info[getn(info)] ] = value B:Layout(true) end,
disabled = function() return not E.db.bags.split.bank end,
guiInline = true,
args = {
bag5 = {
order = 2,
type = "toggle",
name = L["Bank 1"]
},
bag6 = {
order = 3,
type = "toggle",
name = L["Bank 2"]
},
bag7 = {
order = 4,
type = "toggle",
name = L["Bank 3"]
},
bag8 = {
order = 5,
type = "toggle",
name = L["Bank 4"]
},
bag9 = {
order = 6,
type = "toggle",
name = L["Bank 5"]
},
bag10 = {
order = 7,
type = "toggle",
name = L["Bank 6"]
},
bag11 = {
order = 8,
type = "toggle",
name = L["Bank 7"]
}
}
}
}
},
vendorGrays = {
order = 7,
type = "group",
name = L["Vendor Grays"],
get = function(info) return E.db.bags.vendorGrays[ info[getn(info)] ] end,
set = function(info, value) E.db.bags.vendorGrays[ info[getn(info)] ] = value end,
args = {
header = {
order = 1,
type = "header",
name = L["Vendor Grays"]
},
enable = {
order = 2,
type = "toggle",
name = L["Enable"],
desc = L["Automatically vendor gray items when visiting a vendor."]
},
interval = {
order = 3,
type = "range",
name = L["Sell Interval"],
desc = L["Will attempt to sell another item in set interval after previous one was sold."],
min = 0.1, max = 1, step = 0.1
},
details = {
order = 4,
type = "toggle",
name = L["Vendor Gray Detailed Report"],
desc = L["Displays a detailed report of every item sold when enabled."]
}
}
},
bagSortingGroup = {
order = 8,
type = "group",
name = L["Bag Sorting"], name = L["Bag Sorting"],
disabled = function() return not E.bags end, disabled = function() return not E.bags end,
args = { args = {
@@ -347,7 +496,7 @@ E.Options.args.bags = {
desc = L["Add an item or search syntax to the ignored list. Items matching the search syntax will be ignored."], desc = L["Add an item or search syntax to the ignored list. Items matching the search syntax will be ignored."],
get = function(info) return "" end, get = function(info) return "" end,
set = function(info, value) set = function(info, value)
if(value == "" or gsub(value, "%s+", "") == "") then return end if value == "" or gsub(value, "%s+", "") == "" then return end
local itemID = match(value, "item:(%d+)") local itemID = match(value, "item:(%d+)")
E.db.bags.ignoredItems[(itemID or value)] = value E.db.bags.ignoredItems[(itemID or value)] = value
@@ -403,13 +552,18 @@ E.Options.args.bags = {
} }
}, },
search_syntax = { search_syntax = {
order = 7, order = 9,
type = "group", type = "group",
name = L["Search Syntax"], name = L["Search Syntax"],
disabled = function() return not E.bags end, disabled = function() return not E.bags end,
args = { args = {
text = { header = {
order = 1, order = 1,
type = "header",
name = L["Search Syntax"]
},
text = {
order = 2,
type = "input", type = "input",
multiline = 30, multiline = 30,
width = "full", width = "full",
+15 -21
View File
@@ -81,21 +81,15 @@ E.Options.args.general = {
name = L["Accept Invites"], name = L["Accept Invites"],
desc = L["Automatically accept invites from guild/friends."] desc = L["Automatically accept invites from guild/friends."]
}, },
vendorGrays = {
order = 6,
type = "toggle",
name = L["Vendor Grays"],
desc = L["Automatically vendor gray items when visiting a vendor."]
},
autoRoll = { autoRoll = {
order = 7, order = 6,
type = "toggle", type = "toggle",
name = L["Auto Greed/DE"], name = L["Auto Greed/DE"],
desc = L["Automatically select greed or disenchant (when available) on green quality items. This will only work if you are the max level."], desc = L["Automatically select greed or disenchant (when available) on green quality items. This will only work if you are the max level."],
disabled = function() return not E.private.general.lootRoll; end disabled = function() return not E.private.general.lootRoll; end
}, },
loot = { loot = {
order = 8, order = 7,
type = "toggle", type = "toggle",
name = L["Loot"], name = L["Loot"],
desc = L["Enable/Disable the loot frame."], desc = L["Enable/Disable the loot frame."],
@@ -103,7 +97,7 @@ E.Options.args.general = {
set = function(info, value) E.private.general.loot = value; E:StaticPopup_Show("PRIVATE_RL"); end set = function(info, value) E.private.general.loot = value; E:StaticPopup_Show("PRIVATE_RL"); end
}, },
lootRoll = { lootRoll = {
order = 9, order = 8,
type = "toggle", type = "toggle",
name = L["Loot Roll"], name = L["Loot Roll"],
desc = L["Enable/Disable the loot roll frame."], desc = L["Enable/Disable the loot roll frame."],
@@ -111,7 +105,7 @@ E.Options.args.general = {
set = function(info, value) E.private.general.lootRoll = value; E:StaticPopup_Show("PRIVATE_RL"); end set = function(info, value) E.private.general.lootRoll = value; E:StaticPopup_Show("PRIVATE_RL"); end
}, },
lootUnderMouse = { lootUnderMouse = {
order = 10, order = 9,
type = "toggle", type = "toggle",
name = L["Loot Under Mouse"], name = L["Loot Under Mouse"],
desc = L["Enable/Disable loot frame under the mouse cursor."], desc = L["Enable/Disable loot frame under the mouse cursor."],
@@ -120,7 +114,7 @@ E.Options.args.general = {
disabled = function() return not E.private.general.loot; end disabled = function() return not E.private.general.loot; end
}, },
eyefinity = { eyefinity = {
order = 11, order = 10,
name = L["Multi-Monitor Support"], name = L["Multi-Monitor Support"],
desc = L["Attempt to support eyefinity/nvidia surround."], desc = L["Attempt to support eyefinity/nvidia surround."],
type = "toggle", type = "toggle",
@@ -128,13 +122,13 @@ E.Options.args.general = {
set = function(info, value) E.global.general[ info[getn(info)] ] = value; E:StaticPopup_Show("GLOBAL_RL"); end set = function(info, value) E.global.general[ info[getn(info)] ] = value; E:StaticPopup_Show("GLOBAL_RL"); end
}, },
hideErrorFrame = { hideErrorFrame = {
order = 12, order = 11,
type = "toggle", type = "toggle",
name = L["Hide Error Text"], name = L["Hide Error Text"],
desc = L["Hides the red error text at the top of the screen while in combat."] desc = L["Hides the red error text at the top of the screen while in combat."]
}, },
bottomPanel = { bottomPanel = {
order = 13, order = 12,
type = "toggle", type = "toggle",
name = L["Bottom Panel"], name = L["Bottom Panel"],
desc = L["Display a panel across the bottom of the screen. This is for cosmetic only."], desc = L["Display a panel across the bottom of the screen. This is for cosmetic only."],
@@ -142,7 +136,7 @@ E.Options.args.general = {
set = function(info, value) E.db.general.bottomPanel = value; E:GetModule("Layout"):BottomPanelVisibility(); end set = function(info, value) E.db.general.bottomPanel = value; E:GetModule("Layout"):BottomPanelVisibility(); end
}, },
topPanel = { topPanel = {
order = 14, order = 13,
type = "toggle", type = "toggle",
name = L["Top Panel"], name = L["Top Panel"],
desc = L["Display a panel across the top of the screen. This is for cosmetic only."], desc = L["Display a panel across the top of the screen. This is for cosmetic only."],
@@ -150,7 +144,7 @@ E.Options.args.general = {
set = function(info, value) E.db.general.topPanel = value; E:GetModule("Layout"):TopPanelVisibility(); end set = function(info, value) E.db.general.topPanel = value; E:GetModule("Layout"):TopPanelVisibility(); end
}, },
afk = { afk = {
order = 15, order = 14,
type = "toggle", type = "toggle",
name = L["AFK Mode"], name = L["AFK Mode"],
desc = L["When you go AFK display the AFK screen."], desc = L["When you go AFK display the AFK screen."],
@@ -158,13 +152,13 @@ E.Options.args.general = {
set = function(info, value) E.db.general.afk = value; E:GetModule("AFK"):Toggle(); end set = function(info, value) E.db.general.afk = value; E:GetModule("AFK"):Toggle(); end
}, },
enhancedPvpMessages = { enhancedPvpMessages = {
order = 16, order = 15,
type = "toggle", type = "toggle",
name = L["Enhanced PVP Messages"], name = L["Enhanced PVP Messages"],
desc = L["Display battleground messages in the middle of the screen."], desc = L["Display battleground messages in the middle of the screen."],
}, },
raidUtility = { raidUtility = {
order = 17, order = 16,
type = "toggle", type = "toggle",
name = RAID_CONTROL, name = RAID_CONTROL,
desc = L["Enables the ElvUI Raid Control panel."], desc = L["Enables the ElvUI Raid Control panel."],
@@ -172,7 +166,7 @@ E.Options.args.general = {
set = function(info, value) E.private.general.raidUtility = value; E:StaticPopup_Show("PRIVATE_RL") end set = function(info, value) E.private.general.raidUtility = value; E:StaticPopup_Show("PRIVATE_RL") end
}, },
autoScale = { autoScale = {
order = 18, order = 17,
name = L["Auto Scale"], name = L["Auto Scale"],
desc = L["Automatically scale the User Interface based on your screen resolution"], desc = L["Automatically scale the User Interface based on your screen resolution"],
type = "toggle", type = "toggle",
@@ -180,7 +174,7 @@ E.Options.args.general = {
set = function(info, value) E.global.general[ info[getn(info)] ] = value; E:StaticPopup_Show("GLOBAL_RL") end set = function(info, value) E.global.general[ info[getn(info)] ] = value; E:StaticPopup_Show("GLOBAL_RL") end
}, },
minUiScale = { minUiScale = {
order = 19, order = 18,
type = "range", type = "range",
name = L["Lowest Allowed UI Scale"], name = L["Lowest Allowed UI Scale"],
min = 0.32, max = 0.64, step = 0.01, min = 0.32, max = 0.64, step = 0.01,
@@ -188,7 +182,7 @@ E.Options.args.general = {
set = function(info, value) E.global.general.minUiScale = value; E:StaticPopup_Show("GLOBAL_RL"); end set = function(info, value) E.global.general.minUiScale = value; E:StaticPopup_Show("GLOBAL_RL"); end
}, },
numberPrefixStyle = { numberPrefixStyle = {
order = 20, order = 19,
type = "select", type = "select",
name = L["Number Prefix"], name = L["Number Prefix"],
get = function(info) return E.db.general.numberPrefixStyle; end, get = function(info) return E.db.general.numberPrefixStyle; end,
@@ -202,7 +196,7 @@ E.Options.args.general = {
} }
}, },
decimalLength = { decimalLength = {
order = 21, order = 20,
type = "range", type = "range",
name = L["Decimal Length"], name = L["Decimal Length"],
desc = L["Controls the amount of decimals used in values displayed on elements like NamePlates and UnitFrames."], desc = L["Controls the amount of decimals used in values displayed on elements like NamePlates and UnitFrames."],