Quantcast

Added all the settings up till now

Brandon Talbot [07-01-16 - 17:33]
Added all the settings up till now
Filename
src/lua/cache/cache.lua
src/lua/controllers/bag.lua
src/lua/core.lua
src/lua/elements/item.lua
src/lua/elements/mainBar.lua
src/lua/event/eventManager.lua
src/lua/settings/defaults/category.lua
src/lua/settings/defaults/mainBar.lua
src/lua/settings/editor.lua
src/lua/settings/settings.lua
src/lua/utils/utils.lua
diff --git a/src/lua/cache/cache.lua b/src/lua/cache/cache.lua
index 2253857..34208bb 100644
--- a/src/lua/cache/cache.lua
+++ b/src/lua/cache/cache.lua
@@ -18,7 +18,7 @@ function cache:GetBagItemContainer(name)
     return self.bagContainers[name]
 end

-function cache:UpdateSettings()
+function cache:UpdateSettings(arrange)
     for _, slots in pairs(self.items) do
         for _, item in pairs(slots) do
             item:Setup()
@@ -26,6 +26,8 @@ function cache:UpdateSettings()
     end
     for _, container in pairs(cache.bagContainers) do
         container:Setup()
-        container:Arrange()
+        if arrange then
+            container:Arrange()
+        end
     end
 end
\ No newline at end of file
diff --git a/src/lua/controllers/bag.lua b/src/lua/controllers/bag.lua
index cec2bbd..448032a 100644
--- a/src/lua/controllers/bag.lua
+++ b/src/lua/controllers/bag.lua
@@ -102,6 +102,7 @@ function bag:Register()
     ADDON.eventManager:AddEvent(self, 'BAG_UPDATE')
     ADDON.eventManager:AddEvent(self, 'BAG_UPDATE_COOLDOWN')
     ADDON.eventManager:AddEvent(self, 'ITEM_LOCK_CHANGED')
+    ADDON.eventManager:AddEvent(self, 'PLAYER_MONEY')
 end

 function bag:UnRegister()
@@ -109,17 +110,22 @@ function bag:UnRegister()
     ADDON.eventManager:RemoveEvent(self, 'BAG_UPDATE')
     ADDON.eventManager:RemoveEvent(self, 'BAG_UPDATE_COOLDOWN')
     ADDON.eventManager:RemoveEvent(self, 'ITEM_LOCK_CHANGED')
+    ADDON.eventManager:RemoveEvent(self, 'PLAYER_MONEY')
 end

-function bag:UpdateSettings()
+function bag:UpdateSettings(arrange)
     self.frame:Setup()
     self.frame.mainBar:Setup()
     self.frame.mainBar:Update()
-    if self.frame:IsVisible() then
+    if self.frame:IsVisible() and arrange then
         self:Open()
     end
 end

+function bag:PLAYER_MONEY()
+    self.frame.mainBar:Update()
+end
+
 function bag:BAG_UPDATE(bag)
     if bag >= 0 and bag <= NUM_BAG_SLOTS then
         self:UpdateAllItemsForBag(bag)
diff --git a/src/lua/core.lua b/src/lua/core.lua
index 45c5fce..94f49fa 100644
--- a/src/lua/core.lua
+++ b/src/lua/core.lua
@@ -17,24 +17,60 @@ function core:ADDON_LOADED(name)
     ADDON.eventManager:RemoveEvent(self, 'ADDON_LOADED')
 end

-function core:SETTINGS_UPDATE()
-    ADDON.cache:UpdateSettings()
-    ADDON.bag:UpdateSettings()
+function core:SETTINGS_UPDATE(arrange)
+    ADDON.cache:UpdateSettings(arrange)
+    ADDON.bag:UpdateSettings(arrange)
     ADDON.categoryDialog:Setup()
 end

 ADDON.eventManager:AddEvent(core, 'ADDON_LOADED')

+--region Bag commands
+
+ToggleAllBags = function()
+    ADDON.bag:Toggle()
+end
+
+local oldToggleBag = ToggleBag
+ToggleBag = function(id, ...)
+    if id < 5 and id > -1 then
+        ADDON.bag:Toggle()
+    else
+        oldToggleBag(id, ...)
+    end
+end
+
+ToggleBackpack = function()
+    ADDON.bag:Toggle()
+end
+
+OpenAllBags = function()
+    ADDON.bag:Open()
+end
+
+OpenBackpack = function()
+    ADDON.bag:Open()
+end
+
+CloseAllBags = function()
+    ADDON.bag:Close()
+end
+
+CloseBackpack = function()
+    ADDON.bag:Close()
+end
+
+--endregion
+
 --region Slash Commands

 SLASH_DJBAGS1, SLASH_DJBAGS2 = '/db', '/djbags';
 function SlashCmdList.DJBAGS(msg, editbox)
-    ADDON.bag:Open()
+    ADDON.settingsController:ShowSettings()
 end

 SLASH_TDJBAGS1, SLASH_TDJBAGS2 = '/tt', '/ttt';
 function SlashCmdList.TDJBAGS(msg, editbox)
-    ADDON.settingsController:ShowSettings()
 end

 SLASH_RELOAD1 = '/rl'
diff --git a/src/lua/elements/item.lua b/src/lua/elements/item.lua
index 5e10756..d5ec641 100644
--- a/src/lua/elements/item.lua
+++ b/src/lua/elements/item.lua
@@ -46,6 +46,10 @@ function item:Init()

     self.button.cooldown = _G[self.button:GetName() .. "Cooldown"]

+    self.button.Count:ClearAllPoints()
+    self.button.Count:SetJustifyH('LEFT')
+    self.button.Count:SetPoint('BOTTOMRIGHT', -1, 3)
+
     self.button:Show()

     self.button:HookScript('OnClick', self.OnClick)
@@ -55,7 +59,7 @@ function item:Setup()
     local settings = ADDON.settings.item
     self:SetSize(settings.size, settings.size)
     local name, _, outline = self.button.Count:GetFont()
-    self.button.Count:SetFont(name, math.min(settings.size / 4, 13), outline)
+    self.button.Count:SetFont(name, math.min(settings.size / 3, 13), outline)
 end

 --region Update Events
diff --git a/src/lua/elements/mainBar.lua b/src/lua/elements/mainBar.lua
index 5645dc0..0ea7168 100644
--- a/src/lua/elements/mainBar.lua
+++ b/src/lua/elements/mainBar.lua
@@ -69,7 +69,7 @@ end
 function bar:Setup()
     ADDON.container.Setup(self)

-    local settings = ADDON.settings.moneyBar
+    local settings = ADDON.settings.mainBar
     self.currency:SetFont(settings.currencyFont, settings.currencyFontSize, '')
     self.currency:SetTextColor(unpack(settings.currencyFontColor))
     self.slots:SetFont(settings.slotsFont, settings.slotsFontSize, '')
@@ -87,5 +87,5 @@ function bar:Update()
     self.slots:SetText(string.format("%d/%d", total - free, total))

     self.currencyBox:SetWidth(self.currency:GetStringWidth())
-    self:SetSize(self.currency:GetStringWidth() + self.slots:GetStringWidth() + 165, self.currency:GetStringHeight() + 12)
+    self:SetSize(self.currency:GetStringWidth() + self.slots:GetStringWidth() + 165, math.max(self.currency:GetStringHeight(), self.slots:GetStringHeight()) + 12)
 end
diff --git a/src/lua/event/eventManager.lua b/src/lua/event/eventManager.lua
index 573a8fc..d527be2 100644
--- a/src/lua/event/eventManager.lua
+++ b/src/lua/event/eventManager.lua
@@ -20,7 +20,7 @@ eventFrame:SetScript("OnEvent", eventFrame.FireEvent)
 function eventFrame:AddEvent(obj, event)
     if not obj[event] then return end

-    if not self.types[event] then
+    if not self.types[event] or next(self.types[event]) == nil then
         self.types[event] = {}
         self:RegisterEvent(event)
     end
@@ -33,7 +33,7 @@ function eventFrame:RemoveEvent(obj, event)

     self.types[event][obj] = nil

-    if #self.types[event] <= 0 then
+    if next(self.types[event]) == nil then
         self:UnregisterEvent(event)
     end
 end
diff --git a/src/lua/settings/defaults/category.lua b/src/lua/settings/defaults/category.lua
index 2455a8c..482757b 100644
--- a/src/lua/settings/defaults/category.lua
+++ b/src/lua/settings/defaults/category.lua
@@ -4,23 +4,17 @@ ADDON.settings = ADDON.settings or {}

 ADDON.settings.categories = {
     subClass = {
+        [LE_ITEM_CLASS_ARMOR] = false,
         [LE_ITEM_CLASS_CONSUMABLE] = true,
-        [LE_ITEM_CLASS_CONTAINER] = false,
-        [LE_ITEM_CLASS_WEAPON] = false,
         [LE_ITEM_CLASS_GEM] = false,
-        [LE_ITEM_CLASS_ARMOR] = false,
-        [LE_ITEM_CLASS_TRADEGOODS] = true,
+        [LE_ITEM_CLASS_GLYPH] = false,
         [LE_ITEM_CLASS_ITEM_ENHANCEMENT] = false,
-        [LE_ITEM_CLASS_RECIPE] = false,
-        [LE_ITEM_CLASS_QUESTITEM] = false,
         [LE_ITEM_CLASS_MISCELLANEOUS] = true,
-        [LE_ITEM_CLASS_GLYPH] = false,
-        [LE_ITEM_CLASS_BATTLEPET] = false,
+        [LE_ITEM_CLASS_RECIPE] = false,
+        [LE_ITEM_CLASS_TRADEGOODS] = true,
+        [LE_ITEM_CLASS_WEAPON] = false,
     },
     userDefined = {
-        [12] = 'Testerize',
-        [154] = 'ASD',
-        [124] = 'ZXC',
     }
 }

diff --git a/src/lua/settings/defaults/mainBar.lua b/src/lua/settings/defaults/mainBar.lua
index ac9eeb7..40664d3 100644
--- a/src/lua/settings/defaults/mainBar.lua
+++ b/src/lua/settings/defaults/mainBar.lua
@@ -2,7 +2,7 @@ local NAME, ADDON = ...

 ADDON.settings = ADDON.settings or {}

-ADDON.settings.moneyBar = {
+ADDON.settings.mainBar = {
     currencyFontSize = 12,
     currencyFontColor = { 1, 1, 1, 1 },
     currencyFont = 'Fonts\\FRIZQT__.TTF',
diff --git a/src/lua/settings/editor.lua b/src/lua/settings/editor.lua
index c2c4058..35d1300 100644
--- a/src/lua/settings/editor.lua
+++ b/src/lua/settings/editor.lua
@@ -1,7 +1,7 @@
 local NAME, ADDON = ...

 local STEP = 1
-local SCROLL = 1
+local SCROLL = 20
 local MAX = 1

 ADDON.settingsEditor = {}
@@ -15,7 +15,6 @@ setmetatable(settings, {
 })

 function settings:UpdateSettings()
-    print('asd')
     if self.frame then
         self.frame:Setup()
         if self.containers then
@@ -53,7 +52,7 @@ function settings:CreateFrame()

     self.scrollFrame = CreateFrame("ScrollFrame", 'DJBagsSettingsScreenScrollFrame', self.frame)
     self.scrollFrame:SetPoint('TOPLEFT', 5, -30)
-    self.scrollFrame:SetPoint('BOTTOMRIGHT', self.scrollBar, 'BOTTOMLEFT', -5, 0)
+    self.scrollFrame:SetPoint('BOTTOMRIGHT', self.scrollBar, 'BOTTOMLEFT', -5, -15)
     self.scrollBar:SetValue(1)

     self.scrollFrame:EnableMouseWheel(true)
@@ -76,8 +75,19 @@ function settings:CreateFrame()

     self.scrollFrame:SetScrollChild(self.content)

+    self:CreateCategorySettings()
+    self:CreateItemSettings()
     self:CreateContainerSettings()
     self:CreateItemContainerSettings()
+    self:CreateCategoryContainerSettings()
+    self:CreateMainBarSettings()
+
+    self.settingsFrame = CreateFrame('FRAME', 'DJBagsSettingsOpenFrame', UIParent)
+    self.settingsFrame.name = 'DJBags'
+    self.settingsTextInfo = self.settingsFrame:CreateFontString('DJBagsSettingsInfo', 'OVERLAY', 'GameFontNormal')
+    self.settingsTextInfo:SetPoint('CENTER')
+    self.settingsTextInfo:SetText('In order to access DJBag\'s settings, please type:\n\n/db\n\nor\n\n/djbags\n\nin the game chat window.')
+    InterfaceOptions_AddCategory(self.settingsFrame);

     return self.frame
 end
@@ -95,7 +105,7 @@ function settings:AddSettingsPanel(panel)
 end

 local function CreateColorSelector(name, parent, getColor, callBack)
-    local colourSelector = CreateFrame('BUTTON', 'DJBagsSettingsColourSelector' .. name, parent)
+    local colourSelector = CreateFrame('BUTTON', 'DJBagsSettingsColourSelector' .. name .. ADDON.uuid(), parent)
     colourSelector:SetNormalFontObject("GameFontHighlight")
     colourSelector:SetText(name)
     colourSelector:SetBackdrop({
@@ -139,8 +149,8 @@ local function round(num)
     end
 end

-local function CreateSlider(parent, name, min, max, value, callBack)
-    local slider = CreateFrame('Slider', name .. 'slider', parent, 'OptionsSliderTemplate')
+local function CreateSlider(name, parent, min, max, value, callBack)
+    local slider = CreateFrame('Slider', 'DJBagsSettingsColourSelector' .. name .. ADDON.uuid(), parent, 'OptionsSliderTemplate')
     getglobal(slider:GetName() .. "Text"):SetText(name .. ' - ' .. tostring(value()));
     getglobal(slider:GetName() .. "High"):SetText(max);
     getglobal(slider:GetName() .. "Low"):SetText(min);
@@ -158,11 +168,40 @@ local function CreateSlider(parent, name, min, max, value, callBack)
 end

 local function CreateTitle(title, parent)
-    parent.title = parent:CreateFontString('DJBagsSettingsScreenTitle' .. title, nil, 'GameFontNormal')
+    parent.title = parent:CreateFontString('DJBagsSettingsScreenTitle' .. title .. ADDON.uuid(), nil, 'GameFontNormal')
     parent.title:SetText(title)
     parent.title:SetPoint('TOPLEFT', 5, -5)
 end

+local function CreateCheckBox(name, container, checked, callBack)
+    local check = CreateFrame('CHECKBUTTON', 'DJBagsSettingsCheckButton' .. name .. ADDON.uuid(), container, 'UICheckButtonTemplate')
+    _G[check:GetName() .. "Text"]:SetText(name)
+    check.textW = _G[check:GetName() .. "Text"]:GetStringWidth()
+    check.call = callBack
+    check:SetChecked(checked)
+    check:SetScript('OnClick', function(self)
+        self.call(self:GetChecked())
+    end)
+    return check
+end
+
+function settings:CreateItemSettings()
+    local container = ADDON.container('DJBagsSettingsItemScreen', nil)
+
+    CreateTitle('Item settings', container)
+
+    container.size = CreateSlider('Size', container, 18, 50, function()
+        return ADDON.settings.item.size
+    end, function(value)
+        ADDON.settings.item.size = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
+    end)
+    container.size:SetPoint('TOPLEFT', 10, -35)
+
+    container:SetHeight(65)
+    self:AddSettingsPanel(container)
+end
+
 function settings:CreateContainerSettings()
     local container = ADDON.container('DJBagsSettingsContainerScreen', nil)

@@ -184,7 +223,7 @@ function settings:CreateContainerSettings()
     end)
     container.backgroundPicker:SetPoint('TOPLEFT', container.borderPicker, 'TOPRIGHT', 15, 0)

-    container.borderWidth = CreateSlider(container, 'Border Width', 1, 4, function()
+    container.borderWidth = CreateSlider('Border Width', container, 1, 4, function()
         return ADDON.settings.container.borderWidth
     end, function(value)
         ADDON.settings.container.borderWidth = value
@@ -192,7 +231,6 @@ function settings:CreateContainerSettings()
     end)
     container.borderWidth:SetPoint('TOPLEFT', container.backgroundPicker, 'TOPRIGHT', 15, 0)

-
     container:SetHeight(55)
     self:AddSettingsPanel(container)
 end
@@ -210,38 +248,176 @@ function settings:CreateItemContainerSettings()
     end)
     container.fontColor:SetPoint('TOPLEFT', 5, -25)

-    container.fontSize = CreateSlider(container, 'Font size', 8, 18, function()
+    container.fontSize = CreateSlider('Font size', container, 8, 18, function()
         return ADDON.settings.itemContainer.fontSize
     end, function(value)
         ADDON.settings.itemContainer.fontSize = value
-        ADDON.eventManager:FireEvent('SETTINGS_UPDATE')
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
     end)
     container.fontSize:SetPoint('TOPLEFT', container.fontColor, 'TOPRIGHT', 15, 0)

-    container.colsSlider = CreateSlider(container, 'Columns', 4, 10, function()
+    container.colsSlider = CreateSlider('Columns', container, 4, 10, function()
         return ADDON.settings.itemContainer.cols
     end, function(value)
         ADDON.settings.itemContainer.cols = value
-        ADDON.eventManager:FireEvent('SETTINGS_UPDATE')
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
     end)
     container.colsSlider:SetPoint('TOPLEFT', container.fontSize, 'TOPRIGHT', 15, 0)

-    container.padding = CreateSlider(container, 'Padding', 1, 10, function()
+    container.padding = CreateSlider('Padding', container, 1, 10, function()
         return ADDON.settings.itemContainer.padding
     end, function(value)
         ADDON.settings.itemContainer.padding = value
-        ADDON.eventManager:FireEvent('SETTINGS_UPDATE')
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
     end)
     container.padding:SetPoint('TOPLEFT', container.fontColor, 'BOTTOMLEFT', 2, -20)

-    container.spacing = CreateSlider(container, 'Item Spacing', 1, 10, function()
+    container.spacing = CreateSlider('Item Spacing', container, 1, 10, function()
         return ADDON.settings.itemContainer.spacing
     end, function(value)
         ADDON.settings.itemContainer.spacing = value
-        ADDON.eventManager:FireEvent('SETTINGS_UPDATE')
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
     end)
     container.spacing:SetPoint('TOPLEFT', container.padding, 'TOPRIGHT', 15, 0)

     container:SetHeight(95)
     self:AddSettingsPanel(container)
+end
+
+function settings:CreateCategoryContainerSettings()
+    local container = ADDON.container('DJBagsSettingsCategoryContainerScreen', nil)
+
+    CreateTitle('Bag container settings', container)
+
+    container.padding = CreateSlider('Padding', container, 1, 10, function()
+        return ADDON.settings.categoryContainer.padding
+    end, function(value)
+        ADDON.settings.categoryContainer.padding = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
+    end)
+    container.padding:SetPoint('TOPLEFT', 15, -35)
+
+    container.spacing = CreateSlider('Container spacing', container, 1, 10, function()
+        return ADDON.settings.categoryContainer.spacing
+    end, function(value)
+        ADDON.settings.categoryContainer.spacing = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
+    end)
+    container.spacing:SetPoint('TOPLEFT', container.padding, 'TOPRIGHT', 15, 0)
+
+    container.maxHeight = CreateSlider('Max height', container, 250, 1000, function()
+        return ADDON.settings.categoryContainer.maxHeight
+    end, function(value)
+        ADDON.settings.categoryContainer.maxHeight = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
+    end)
+    container.maxHeight:SetPoint('TOPLEFT', container.spacing, 'TOPRIGHT', 15, 0)
+
+    container:SetHeight(70)
+    self:AddSettingsPanel(container)
+end
+
+function settings:CreateMainBarSettings()
+    local container = ADDON.container('DJBagsSettingsMainBarScreen', nil)
+
+    CreateTitle('Main Bar', container)
+
+    container.currencyFontColor = CreateColorSelector('Currency Font Colour', container, function()
+        return ADDON.settings.mainBar.currencyFontColor
+    end, function(r, g, b, a)
+        ADDON.settings.mainBar.currencyFontColor = { r, g, b, a }
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE')
+    end)
+    container.currencyFontColor:SetPoint('TOPLEFT', 5, -25)
+
+    container.slotFontColor = CreateColorSelector('Slot Font Colour', container, function()
+        return ADDON.settings.mainBar.slotsFontColor
+    end, function(r, g, b, a)
+        ADDON.settings.mainBar.slotsFontColor = { r, g, b, a }
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE')
+    end)
+    container.slotFontColor:SetPoint('TOPLEFT', container.currencyFontColor, 'TOPRIGHT', 15, 0)
+
+    container.currencyFontSize = CreateSlider('Currency font size', container, 8, 18, function()
+        return ADDON.settings.mainBar.currencyFontSize
+    end, function(value)
+        ADDON.settings.mainBar.currencyFontSize = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE')
+    end)
+    container.currencyFontSize:SetPoint('TOPLEFT', container.slotFontColor, 'TOPRIGHT', 15, 0)
+
+    container.slotFontSize = CreateSlider('Currency font size', container, 8, 18, function()
+        return ADDON.settings.mainBar.slotsFontSize
+    end, function(value)
+        ADDON.settings.mainBar.slotsFontSize = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE')
+    end)
+    container.slotFontSize:SetPoint('TOPLEFT', container.currencyFontColor, 'BOTTOMLEFT', 2, -20)
+
+    container:SetHeight(95)
+    self:AddSettingsPanel(container)
+end
+
+function settings:CreateCategorySettings()
+    local container = ADDON.container('DJBagsSettingsMainBarScreen', nil)
+
+    CreateTitle('Category Subclassing', container)
+
+    function container:Add(item)
+        self.items = self.items or {}
+        tinsert(self.items, item)
+    end
+
+    container:Add(CreateCheckBox(AUCTION_CATEGORY_ARMOR, container, ADDON.settings.categories.subClass[LE_ITEM_CLASS_ARMOR], function(value)
+        ADDON.settings.categories.subClass[LE_ITEM_CLASS_ARMOR] = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
+    end))
+    container:Add(CreateCheckBox(AUCTION_CATEGORY_CONSUMABLES, container, ADDON.settings.categories.subClass[LE_ITEM_CLASS_CONSUMABLE], function(value)
+        ADDON.settings.categories.subClass[LE_ITEM_CLASS_CONSUMABLE] = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
+    end))
+    container:Add(CreateCheckBox(AUCTION_CATEGORY_GEMS, container, ADDON.settings.categories.subClass[LE_ITEM_CLASS_GEM], function(value)
+        ADDON.settings.categories.subClass[LE_ITEM_CLASS_GEM] = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
+    end))
+    container:Add(CreateCheckBox(AUCTION_CATEGORY_GLYPHS, container, ADDON.settings.categories.subClass[LE_ITEM_CLASS_GLYPH], function(value)
+        ADDON.settings.categories.subClass[LE_ITEM_CLASS_GLYPH] = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
+    end))
+    container:Add(CreateCheckBox(AUCTION_CATEGORY_ITEM_ENHANCEMENT, container, ADDON.settings.categories.subClass[LE_ITEM_CLASS_ITEM_ENHANCEMENT], function(value)
+        ADDON.settings.categories.subClass[LE_ITEM_CLASS_ITEM_ENHANCEMENT] = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
+    end))
+    container:Add(CreateCheckBox(AUCTION_CATEGORY_MISCELLANEOUS, container, ADDON.settings.categories.subClass[LE_ITEM_CLASS_MISCELLANEOUS], function(value)
+        ADDON.settings.categories.subClass[LE_ITEM_CLASS_MISCELLANEOUS] = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
+    end))
+    container:Add(CreateCheckBox(AUCTION_CATEGORY_RECIPES, container, ADDON.settings.categories.subClass[LE_ITEM_CLASS_RECIPE], function(value)
+        ADDON.settings.categories.subClass[LE_ITEM_CLASS_RECIPE] = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
+    end))
+    container:Add(CreateCheckBox(AUCTION_CATEGORY_TRADE_GOODS, container, ADDON.settings.categories.subClass[LE_ITEM_CLASS_TRADEGOODS], function(value)
+        ADDON.settings.categories.subClass[LE_ITEM_CLASS_TRADEGOODS] = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
+    end))
+    container:Add(CreateCheckBox(AUCTION_CATEGORY_WEAPONS, container, ADDON.settings.categories.subClass[LE_ITEM_CLASS_WEAPON], function(value)
+        ADDON.settings.categories.subClass[LE_ITEM_CLASS_WEAPON] = value
+        ADDON.eventManager:FireEvent('SETTINGS_UPDATE', true)
+    end))
+
+    local y = -20
+    local x = 5
+    if container.items then
+        for _, item in pairs(container.items) do
+            if x + item.textW > self.scrollFrame:GetWidth() - 10 then
+                x = 5
+                y = y - 30
+            end
+            item:SetPoint('TOPLEFT', x, y)
+            x = x + item.textW + 35
+        end
+    end
+
+    container:SetHeight(35 - y)
+    self:AddSettingsPanel(container)
 end
\ No newline at end of file
diff --git a/src/lua/settings/settings.lua b/src/lua/settings/settings.lua
index b946744..a21e3e7 100644
--- a/src/lua/settings/settings.lua
+++ b/src/lua/settings/settings.lua
@@ -19,7 +19,6 @@ function settings:ShowSettings()
 end

 function settings:SETTINGS_UPDATE()
-    print('lol')
     local realm = GetRealmName()
     local player = UnitName("player")

@@ -29,7 +28,7 @@ function settings:SETTINGS_UPDATE()
     if not DJBagsConfig[realm] then
         DJBagsConfig[realm] = {}
     end
-    --    DJBagsConfig[player] = ADDON.settings
+    DJBagsConfig[realm][player] = ADDON.settings

     ADDON.settingsEditor:UpdateSettings()
 end
@@ -39,6 +38,6 @@ function settings:GetCharacterSettings()
     local player = UnitName("player")

     if DJBagsConfig and DJBagsConfig[realm] and DJBagsConfig[realm][player] then
-        --        ADDON.settings = DJBagsConfig[realm][player]
+        ADDON.settings = DJBagsConfig[realm][player]
     end
 end
\ No newline at end of file
diff --git a/src/lua/utils/utils.lua b/src/lua/utils/utils.lua
index 921092b..e46f1b6 100644
--- a/src/lua/utils/utils.lua
+++ b/src/lua/utils/utils.lua
@@ -45,7 +45,7 @@ function utils:GetItemContainerName(bag, slot)

         local userDefinedList = ADDON.settings.categories.userDefined
         if userDefinedList[id] then
-            return userDefinedList[id]
+            return userDefinedList[id] .. '*'
         end

         local subClassSplitList = ADDON.settings.categories.subClass