Quantcast

Clearing out for new approach

Brandon Talbot [06-29-16 - 06:22]
Clearing out for new approach
Filename
.gitignore
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/misc.xml
.idea/modules.xml
DJBags.iml
DJBags.toc
LICENSE
README.md
art/Border.tga
bag/bag.xml
bag/button.lua
bag/container.lua
bag/core.lua
bag/events.lua
bag/settings.lua
diff --git a/.gitignore b/.gitignore
index 6fd0a37..6d9b1d3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,3 +39,14 @@ luac.out
 *.x86_64
 *.hex

+### Iea ###
+
+# User-specific stuff:
+.idea/workspace.xml
+.idea/tasks.xml
+.idea/dictionaries
+.idea/vcs.xml
+.idea/jsLibraryMappings.xml
+
+# IntelliJ
+/out/
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..96cc43e
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <resourceExtensions />
+    <wildcardResourcePatterns>
+      <entry name="!?*.java" />
+      <entry name="!?*.form" />
+      <entry name="!?*.class" />
+      <entry name="!?*.groovy" />
+      <entry name="!?*.scala" />
+      <entry name="!?*.flex" />
+      <entry name="!?*.kt" />
+      <entry name="!?*.clj" />
+      <entry name="!?*.aj" />
+    </wildcardResourcePatterns>
+    <annotationProcessing>
+      <profile default="true" name="Default" enabled="false">
+        <processorPath useClasspath="true" />
+      </profile>
+    </annotationProcessing>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
new file mode 100644
index 0000000..e7bedf3
--- /dev/null
+++ b/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,3 @@
+<component name="CopyrightManager">
+  <settings default="" />
+</component>
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..b248dfa
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="MavenImportPreferences">
+    <option name="generalSettings">
+      <MavenGeneralSettings>
+        <option name="mavenHome" value="Bundled (Maven 3)" />
+      </MavenGeneralSettings>
+    </option>
+  </component>
+  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
+    <OptionsSetting value="true" id="Add" />
+    <OptionsSetting value="true" id="Remove" />
+    <OptionsSetting value="true" id="Checkout" />
+    <OptionsSetting value="true" id="Update" />
+    <OptionsSetting value="true" id="Status" />
+    <OptionsSetting value="true" id="Edit" />
+    <ConfirmationsSetting value="0" id="Add" />
+    <ConfirmationsSetting value="0" id="Remove" />
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_3" default="true" assert-keyword="false" jdk-15="false" project-jdk-name="Lua 5.3.3" project-jdk-type="Lua SDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+  <component name="masterDetails">
+    <states>
+      <state key="ProjectJDKs.UI">
+        <settings>
+          <last-edited>Lua 5.3.3</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+    </states>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..2256453
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/DJBags.iml" filepath="$PROJECT_DIR$/DJBags.iml" />
+    </modules>
+  </component>
+</project>
\ No newline at end of file
diff --git a/DJBags.iml b/DJBags.iml
new file mode 100644
index 0000000..21fd7f8
--- /dev/null
+++ b/DJBags.iml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="LUA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>
\ No newline at end of file
diff --git a/DJBags.toc b/DJBags.toc
index 61b4128..3065f24 100644
--- a/DJBags.toc
+++ b/DJBags.toc
@@ -1,7 +1,8 @@
-## Interface: 60200
-## Author: Darkjaguar91
-## Version: 0.01
-## Title: DJUI
-## Notes: NOTE!!
+## Interface: 70000
+## Title: DJBags
+## Author: DarkJaguar91
+## Notes: BagAddon - Alpha
+## Version: 0.0.4
+## SavedVariables: DJBagsConfig

-bag/bag.xml
+src/manifest.xml
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 1a4c7f9..7f375f7 100644
--- a/LICENSE
+++ b/LICENSE
@@ -18,5 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
+SOFTWARE.
\ No newline at end of file
diff --git a/README.md b/README.md
index 4504ad1..c1d2cc0 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,3 @@
-# DJUI-WOW
-WOW UI Mod
+# DJBags
+
+A Bag replacement addon.
\ No newline at end of file
diff --git a/art/Border.tga b/art/Border.tga
deleted file mode 100644
index 41fca51..0000000
Binary files a/art/Border.tga and /dev/null differ
diff --git a/bag/bag.xml b/bag/bag.xml
deleted file mode 100644
index 34af90c..0000000
--- a/bag/bag.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/  http://wowprogramming.com/FrameXML/UI.xsd">
-	<Script file="bag/settings.lua" />
-	<Script file="bag/container.lua" />
-	<Script file="bag/button.lua" />
-	<Script file="bag/core.lua" />
-	<Script file="bag/events.lua" />
-</Ui>
\ No newline at end of file
diff --git a/bag/button.lua b/bag/button.lua
deleted file mode 100644
index 940bd12..0000000
--- a/bag/button.lua
+++ /dev/null
@@ -1,175 +0,0 @@
-local _, ns = ...
-
-local settings = ns.settings
-local containers = ns.containers
-
-local button = {}
-button.__index = button
-
-local buttons = {}
-buttons.__index = buttons
-
-buttons.list = {}
-
-ns.buttons = buttons
-
-function buttons:GetButton(bag, slot)
-	if not self.list[bag] then
-		self.list[bag] = {}
-	end
-	if not self.list[bag][slot] then
-		self.list[bag][slot] = button(bag, slot)
-	end
-	return self.list[bag][slot]
-end
-
-local mt = {}
-mt.__call = function(tbl, bag, slot)
-	local parentFrame = CreateFrame("Frame",
-		string.format("FJUIBagButtonParent%d_%d", bag, slot), nil)
-	local btn = CreateFrame("Button",
-		string.format("DJUIBagButton%d_%d", bag, slot), parentFrame,
-		"ContainerFrameItemButtonTemplate")
-
-	btn.parent = parentFrame
-	parentFrame.button = btn
-
-	for k, v in pairs(button) do
-		parentFrame[k] = v
-	end
-
-	parentFrame:Init(bag, slot)
-	return parentFrame
-end
-setmetatable(button, mt)
-
-function button:Init(bag, slot)
-	self.bag = bag
-	self.slot = slot
-
-	self:SetID(bag)
-	self.button:SetID(slot)
-	self.button:SetAllPoints()
-
-	self.button.BattlepayItemTexture:Hide()
-
-	self.button.Count:SetFont("Fonts\\FRIZQT__.TTF", settings.saved.countFontSize, "OUTLINE")
-	self.button.Count:ClearAllPoints()
-	self.button.Count:SetPoint("BOTTOMRIGHT",  -settings.saved.countFontSidePadding,
-		settings.saved.countFontBotPadding)
-
-	self.button.IconBorder:SetTexture([[Interface\AddOns\DJUI-WOW\art\Border]])
-	self.button.icon:ClearAllPoints()
-	self.button.icon:SetPoint("TOPLEFT", -1, 1)
-	self.button.icon:SetPoint("BOTTOMRIGHT", 1, -1)
-
-	local NT = _G[self.button:GetName() .. "NormalTexture"]
-	NT:SetTexture([[Interface\AddOns\DJUI-WOW\art\Border]])
-	NT:ClearAllPoints()
-	NT:SetAllPoints()
-
-	self:Show()
-	self.button:Show()
-end
-
-function button:GetInformation()
-	local id = GetContainerItemID(self.bag, self.slot)
-	if id then
-		local texture, count, locked, quality, readable, lootable, link, isFiltered = GetContainerItemInfo(self.bag, self.slot)
-		local name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(id)
-
-		return id, name, texture, count, quality, iLevel
-	end
-end
-
-function button:GetContainerName()
-	local id = GetContainerItemID(self.bag, self.slot)
-
-	if id then
-		local name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(id)
-		local isInSet, setName = GetContainerItemEquipmentSetInfo(self.bag, self.slot)
-
-		if isInSet then
-			settings.setNames[setName] = true
-			setName = string.gsub(setName, ",", " &")
-		end
-		return settings.saved.types[id] or (isInSet and setName) or (quality == 0 and "Junk") or class
-	end
-end
-
-function button:Update()
-	local id, name, texture, count, quality, ilevel = self:GetInformation()
-
-	if id then
-		self:UpdateItem(id, name, texture, count, quality, ilevel)
-	else
-		self:Clear()
-	end
-
-	self:UpdateContainer()
-end
-
-function button:UpdateContainer()
-	local name = self:GetContainerName()
-
-	if self.container then
-		if self.container.name == name then
-			return
-		end
-		self.container:RemoveItem(self)
-	end
-
-	if name then
-		local container = containers:GetContainer(name)
-
-		container:AddItem(self)
-	else
-		self:Hide() -- TODO fix this!!
-	end
-end
-
-function button:UpdateItem(id, name, texture, count, quality, ilevel)
-	local button = self.button
-
-	self.name = name
-	self.quality = quality
-	self.count = count
-
-	button.icon:SetTexture(texture)
-
-	if count > 1 then
-		button.Count:SetText(count)
-		button.Count:SetVertexColor(1, 1, 1, 1)
-		button.Count:Show()
-	elseif IsEquippableItem(id) then
-		button.Count:SetText(ilevel)
-		button.Count:SetVertexColor(GetItemQualityColor(quality))
-		button.Count:Show()
-	else
-		button.Count:Hide()
-	end
-
-	if quality <= 0 then
-		button.JunkIcon:Show()
-	else
-		button.JunkIcon:Hide()
-	end
-	button.IconBorder:SetVertexColor(GetItemQualityColor(quality))
-	button.IconBorder:Show()
-
-	if C_NewItems.IsNewItem(self.bag, self.slot) then
-		button.newitemglowAnim:Play()
-	end
-end
-
-function button:Clear()
-	local button = self.button
-
-	self.name = nil
-	self.quality = nil
-	self.count = nil
-
-	button.icon:SetTexture(nil)
-	button.Count:Hide()
-end
-
diff --git a/bag/container.lua b/bag/container.lua
deleted file mode 100644
index b91f6c9..0000000
--- a/bag/container.lua
+++ /dev/null
@@ -1,255 +0,0 @@
-local _, ns = ...
-
-local settings = ns.settings
-
-local container = {}
-container.__index = container
-local containers = {}
-containers.__index = containers
-
-containers.list = {}
-
-ns.containers = containers
-
-function containers:GetCurrencyBar()
-	if not self.currencyBar then
-		self.currencyBar = CreateFrame("Frame", "DJUICurrencyBar", UIParent)
-		self.currencyBar:SetSize(container:GetWidth(), settings.saved.titleSize)
-		self.currencyBar:SetPoint("BOTTOMRIGHT", -300, 125)
-
-		self.currencyBar:SetBackdrop({
-	        bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
-	        edgeFile = "Interface\\Buttons\\WHITE8x8",
-	        tile = false, tileSize = 16, edgeSize = 1,
-    	})
-    	self.currencyBar:SetBackdropColor(unpack(settings.saved.containerColor))
-
-		self.currencyBar:SetMovable(true)
-		self.currencyBar:EnableMouse(true)
-		self.currencyBar:RegisterForDrag("LeftButton")
-		self.currencyBar:SetScript("OnDragStart", self.currencyBar.StartMoving)
-		self.currencyBar:SetScript("OnDragStop", self.currencyBar.StopMovingOrSizing)
-		tinsert(UISpecialFrames, self.currencyBar:GetName());
-	end
-
-	return self.currencyBar
-end
-
-function containers:GetContainer(name)
-	if not self.list[name] then
-		self.list[name] = container(name, UIParent)
-	end
-
-	return self.list[name]
-end
-
-function containers:Toggle()
-	if containers.currencyBar:IsShown() then
-		containers:Hide()
-	else
-		containers:Show()
-	end
-end
-
-function containers:Show()
-	containers.currencyBar:Show()
-	for k, v in pairs(containers.list) do
-		v:Show()
-	end
-end
-
-function containers:Hide()
-	containers.currencyBar:Hide()
-	for k, v in pairs(containers.list) do
-		v:Hide()
-	end
-end
-
-local mt = {}
-mt.__call = function(tbl, name, parent)
-	local obj = CreateFrame("Frame", "DJUIBag" .. name, parent)
-
-	for k, v in pairs(container) do
-		obj[k] = v
-	end
-
-	obj:Init(name)
-
-	return obj
-end
-setmetatable(container, mt)
-
-function container:Init(name)
-	self.name = name
-	self.items = {}
-
-	self:SetFrameLevel(5)
-
-	self.title = self:CreateFontString(self:GetName() .. "Title", "OVERLAY")
-	self.title:SetFont("Fonts\\FRIZQT__.TTF", settings.saved.titleSize, "OUTLINE")
-	self.title:SetText(name)
-	self.title:SetPoint("TOPLEFT", settings.saved.titlePadding, -settings.saved.titlePadding)
-	self.title:SetTextColor(unpack(settings.saved.titleColor))
-
-	self.itemContainer = CreateFrame("Frame", self:GetName() .. "ItemContainer", self)
-	self.itemContainer:SetPoint("TOPLEFT", self, "TOPLEFT", settings.saved.padding, -settings.saved.titleSize - settings.saved.padding)
-	self.itemContainer:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -settings.saved.padding, settings.saved.padding)
-
-	self:SetBackdrop({
-        bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
-        edgeFile = "Interface\\Buttons\\WHITE8x8",
-        tile = false, tileSize = 16, edgeSize = 1,
-    })
-    self:SetBackdropColor(unpack(settings.saved.containerColor))
-    tinsert(UISpecialFrames, self:GetName());
-
-	self:Position()
-end
-
-function container:Position()
-	local col, index = self:GetBagPosition()
-
-	self:ClearAllPoints()
-
-	local parentContainer = self:GetParentContainer(col, index)
-
-	if not parentContainer then
-		local parentPoint = col == 1 and "TOPRIGHT" or "BOTTOMLEFT"
-		local offsetX = col == 1 and 0 or (settings.saved.bagPadding * (col - 1) + (col - 2) * self:GetWidth())
-		local offsetY = col == 1 and settings.saved.bagPadding or 0
-		self:SetPoint("BOTTOMRIGHT", containers:GetCurrencyBar(), parentPoint, -offsetX, offsetY)
-	else
-		local parentPoint = "TOPRIGHT"
-		local offsetX = 0
-		local offsetY = settings.saved.bagPadding
-		self:SetPoint("BOTTOMRIGHT", parentContainer, parentPoint, offsetX, offsetY)
-	end
-end
-
-function container:RepositionChildren()
-	local col, index = self:GetBagPosition()
-
-	local child = nil
-
-	repeat
-		index = index + 1
-		child = settings.saved.bagColumns[col][index]
-
-		if child then
-			containers:GetContainer(child):Position()
-		end
-	until child == nil
-end
-
-function container:GetParentContainer(col, index)
-	while index > 0 do
-		if index == 1 then
-			return nil
-		else
-			local container = containers:GetContainer(settings.saved.bagColumns[col][index - 1])
-			if container:GetHeight() > 0 then
-				return container
-			end
-		end
-
-		index = index - 1
-	end
-end
-
-function container:GetBagPosition()
-	for c, list in pairs(settings.saved.bagColumns) do
-		for i, name in pairs(list) do
-			if name == self.name then
-				return c, i
-			end
-		end
-	end
-
-	table.insert(settings.saved.bagColumns[#settings.saved.bagColumns], self.name)
-	local col = #settings.saved.bagColumns
-	local index = #settings.saved.bagColumns[#settings.saved.bagColumns]
-	return col, index
-end
-
-function container:AddItem(item)
-	item:SetParent(self)
-	item.container = self
-
-	table.insert(self.items, item)
-
-	self:Arrange()
-	if #self.items % settings.saved.columns == 1 then
-		self:RepositionChildren()
-	end
-end
-
-function container:RemoveItem(item)
-	item:SetParent(nil)
-	item.container = nil
-
-	for i = 1, #self.items do
-		if self.items[i] == item then
-			table.remove(self.items, i)
-			self:Arrange()
-			if #self.items == 0 then
-				self:RepositionChildren()
-			end
-			break
-		end
-	end
-end
-
-function container:GetWidth()
-	local numItems = settings.saved.columns
-	return settings.saved.padding * 2 +
-			(numItems - 1) * settings.saved.itemPadding +
-			numItems * settings.saved.itemSize
-end
-
-function container:GetHeight()
-	if #self.items == 0 then return 0 end
-
-	local rows = math.ceil(#self.items / settings.saved.columns)
-	return settings.saved.titleSize +
-	        settings.saved.padding * 2 +
-	        (rows - 1) * settings.saved.itemPadding +
-	        rows * settings.saved.itemSize
-end
-
-function container:Arrange()
-	local w = self:GetWidth()
-	local h = self:GetHeight()
-
-	if h == 0 then
-		self:Hide()
-		return
-	end
-
-	if containers.currencyBar:IsShown() then
-		self:Show()
-	end
-
-	self:SetSize(w, h)
-
-	self:ArrangeItems()
-	self:Position()
-end
-
-function container:ArrangeItems()
-	if #self.items == 0 then return end
-
-	table.sort(self.items, settings.sortingFunction["default"]) -- TODO add bag settings
-
-	for i = 1, #self.items do
-		local col = math.ceil((i - 1) % settings.saved.columns)
-		local row = math.floor((i - 1) / settings.saved.columns)
-		local x = col * settings.saved.itemSize + col * settings.saved.itemPadding
-		local y = -(row * settings.saved.itemSize + row * settings.saved.itemPadding)
-
-		local item = self.items[i]
-		item:SetSize(settings.saved.itemSize, settings.saved.itemSize)
-		item:ClearAllPoints()
-		item:SetPoint("TOPLEFT", self.itemContainer, "TOPLEFT", x, y)
-		item:Show()
-	end
-end
\ No newline at end of file
diff --git a/bag/core.lua b/bag/core.lua
deleted file mode 100644
index e7a6fe3..0000000
--- a/bag/core.lua
+++ /dev/null
@@ -1,62 +0,0 @@
-local addonName, ns = ...
-
-local settings = ns.settings
-local containers = ns.containers
-local buttons = ns.buttons
-
-local impl = {}
-impl.__index = impl
-
-ns.impl = impl
-
-function impl:ADDON_LOADED(name)
-	if addonName == name then
-		for bag = 0, NUM_BAG_SLOTS do
-			for slot = 1, GetContainerNumSlots(bag) do
-				local button = buttons:GetButton(bag, slot)
-				button:Update()
-			end
-		end
-	end
-end
-
-function impl:BAG_UPDATE(bag, slot)
-	if bag >= 0 and bag <= NUM_BAG_SLOTS then
-		for slot = 1, GetContainerNumSlots(bag) do
-			local button = buttons:GetButton(bag, slot)
-			button:Update()
-		end
-	end
-end
-
--- Replace the standard bags
-
-ToggleAllBags = function()
-	containers:Toggle()
-end
-
-ToggleBag = function()
-	containers:Toggle()
-end
-
-ToggleBackpack = function()
-	containers:Toggle()
-end
-
-OpenAllBags = function()
-	containers:Show()
-end
-
-OpenBackpack = function()
-	containers:Show()
-end
-
-CloseAllBags = function()
-	containers:Hide()
-end
-
-CloseBackpack = function()
-	containers:Hide()
-end
-
--- BankFrame:UnregisterAllEvents()
\ No newline at end of file
diff --git a/bag/events.lua b/bag/events.lua
deleted file mode 100644
index 05bbebc..0000000
--- a/bag/events.lua
+++ /dev/null
@@ -1,18 +0,0 @@
-local _, ns = ...
-
-local impl = ns.impl
-local eventFrame = CreateFrame("Frame", "DJUIBagEventFrame", nil)
-eventFrame:Hide()
-
-SLASH_DJBAG1, SLASH_DJBAG2 = '/djb', '/djbag'
-function SlashCmdList.DJBAG(msg, editbox)
-
-end
-
-eventFrame:RegisterEvent("ADDON_LOADED")
-eventFrame:RegisterEvent("BAG_UPDATE")
-eventFrame:SetScript("OnEvent", function(self, event, ...)
-	if impl[event] then
-		impl[event](impl, ...)
-	end
-end)
\ No newline at end of file
diff --git a/bag/settings.lua b/bag/settings.lua
deleted file mode 100644
index 07c88e3..0000000
--- a/bag/settings.lua
+++ /dev/null
@@ -1,50 +0,0 @@
-local _, ns = ...
-
-local settings = {}
-ns.settings = settings
-
-settings.saved = {
-	itemSize = 37,
-	columns = 8,
-	itemPadding = 3,
-	padding = 5,
-	bagPadding = 3,
-	containerColor = {0, 0, 0, 0.6},
-	titleSize = 11,
-	titlePadding = 2,
-	titleColor = {0.8, 0.8, 0.8, 1},
-	countFontSize = 11,
-	countFontBotPadding = 2,
-	countFontSidePadding = 2,
-	types = {},
-	bagColumns = {
-		{
-			"Miscellaneous",
-			"Consumable",
-			"Trade Goods",
-			"Junk",
-			"Quest",
-		},
-		{
-			"Armor",
-			"Weapon"
-		}
-	},
-}
-
-settings.setNames = {}
-
-settings.sortingFunction = {
-	["default"] = function (a, b)
-		if a.quality == b.quality then
-			if a.name == b.name then
-				return a.count > b.count
-			end
-			return a.name < b.name
-		end
-		return a.quality > b.quality
-	end,
-	["name"] = function (a, b)
-		return a.name < b.name
-	end,
-}
\ No newline at end of file