mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
update Sort price
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||||
local B = E:NewModule("Bags", "AceHook-3.0", "AceEvent-3.0", "AceTimer-3.0");
|
local B = E:NewModule("Bags", "AceHook-3.0", "AceEvent-3.0", "AceTimer-3.0");
|
||||||
local Search = LibStub("LibItemSearch-1.2");
|
local Search = LibStub("LibItemSearch-1.2");
|
||||||
local LIP = LibStub("ItemPrice-1.1", true);
|
local LIP = LibStub("ItemPrice-1.1");
|
||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
@@ -526,7 +526,7 @@ function B:Layout(isBank)
|
|||||||
E:SetTemplate(f.Bags[bagID][slotID], "Default", true)
|
E:SetTemplate(f.Bags[bagID][slotID], "Default", true)
|
||||||
f.Bags[bagID][slotID]:SetNormalTexture("")
|
f.Bags[bagID][slotID]:SetNormalTexture("")
|
||||||
f.Bags[bagID][slotID]:SetCheckedTexture("")
|
f.Bags[bagID][slotID]:SetCheckedTexture("")
|
||||||
|
|
||||||
f.Bags[bagID][slotID]:SetScript("OnClick", buttonOnClick)
|
f.Bags[bagID][slotID]:SetScript("OnClick", buttonOnClick)
|
||||||
f.Bags[bagID][slotID]:SetScript("OnDragStart", buttonOnDragStart)
|
f.Bags[bagID][slotID]:SetScript("OnDragStart", buttonOnDragStart)
|
||||||
f.Bags[bagID][slotID]:SetScript("OnReceiveDrag", buttonOnReceiveDrag)
|
f.Bags[bagID][slotID]:SetScript("OnReceiveDrag", buttonOnReceiveDrag)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||||
local B = E:GetModule("Bags");
|
local B = E:GetModule("Bags");
|
||||||
local Search = LibStub("LibItemSearch-1.2");
|
local Search = LibStub("LibItemSearch-1.2");
|
||||||
|
local LIP = LibStub("ItemPrice-1.1");
|
||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
@@ -149,13 +150,20 @@ local function UpdateLocation(from, to)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function PrimarySort(a, b)
|
local function PrimarySort(a, b)
|
||||||
local aName, _, _, aLvl = GetItemInfo(bagIDs[a])
|
local aName, aLink, _, aLvl = GetItemInfo(bagIDs[a])
|
||||||
local bName, _, _, bLvl = GetItemInfo(bagIDs[b])
|
local bName, bLink, _, bLvl = GetItemInfo(bagIDs[b])
|
||||||
|
|
||||||
|
local aPrice = LIP:GetSellValue(aLink)
|
||||||
|
local bPrice = LIP:GetSellValue(bLink)
|
||||||
|
|
||||||
if aLvl ~= bLvl and aLvl and bLvl then
|
if aLvl ~= bLvl and aLvl and bLvl then
|
||||||
return aLvl > bLvl
|
return aLvl > bLvl
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if aPrice ~= bPrice and aPrice and bPrice then
|
||||||
|
return aPrice > bPrice
|
||||||
|
end
|
||||||
|
|
||||||
if aName and bName then
|
if aName and bName then
|
||||||
return aName < bName
|
return aName < bName
|
||||||
end
|
end
|
||||||
@@ -181,7 +189,7 @@ local function DefaultSort(a, b)
|
|||||||
|
|
||||||
local _, _, _, _, aType, aSubType, _, aEquipLoc = GetItemInfo(aID)
|
local _, _, _, _, aType, aSubType, _, aEquipLoc = GetItemInfo(aID)
|
||||||
local _, _, _, _, bType, bSubType, _, bEquipLoc = GetItemInfo(bID)
|
local _, _, _, _, bType, bSubType, _, bEquipLoc = GetItemInfo(bID)
|
||||||
|
|
||||||
local aRarity, bRarity = bagQualities[a], bagQualities[b]
|
local aRarity, bRarity = bagQualities[a], bagQualities[b]
|
||||||
|
|
||||||
if aRarity ~= bRarity and aRarity and bRarity then
|
if aRarity ~= bRarity and aRarity and bRarity then
|
||||||
|
|||||||
Reference in New Issue
Block a user