Quantcast

Further work on refactor of settings:

Brandon Talbot [07-19-16 - 19:27]
Further work on refactor of settings:
Still outstadning:
* Settings finished
* Bank
* linking to normal keybindings
Filename
src/lua/constants/contstants.lua
src/lua/controller/bag.lua
src/lua/element/container.lua
src/lua/element/item.lua
src/lua/settings/settingsController.lua
src/lua/settings/settingsElements.lua
src/lua/tools/masonryFormatter.lua
src/manifest.xml
src/xml/element/itemContainer.xml
src/xml/settings/checkBox.xml
src/xml/settings/containerSettings.xml
src/xml/settings/itemContainerSettings.xml
src/xml/settings/mainBarSettings.xml
src/xml/settings/settingsContainer.xml
src/xml/settings/subClassSettings.xml
diff --git a/src/lua/constants/contstants.lua b/src/lua/constants/contstants.lua
index d64348c..a2fafb2 100644
--- a/src/lua/constants/contstants.lua
+++ b/src/lua/constants/contstants.lua
@@ -4,6 +4,10 @@ local NAME, ADDON = ...

 DJBags_TYPE_CONTAINER = 'container'
 DJBags_TYPE_ITEM_CONTAINER = 'itemContainer'
+DJBags_TYPE_SUB_CLASS = 'djbags_sub_classes'
+
+DJBags_FORMATTER_MASONRY = 'djbags_masonry'
+DJBags_FORMATTER_BLOCK = 'djbags_block'

 --endregion

@@ -29,12 +33,16 @@ DJBags_SETTING_TEXT_SIZE = 'djbags_truncate_text_size'
 local localeText= {}
 localeText['enUS'] = function()
     DJBags_LOCALE_ITEM_CONTAINER_SETTINGS = 'Item Container Settings:'
+    DJBags_LOCALE_CONTAINER_SETTINGS = 'Category Container Settings:'
+    DJBags_LOCALE_SUB_CLASS_SETTINGS = 'Sub Class Settings:'
+    DJBags_LOCALE_SETTINGS = 'DJBags Settings:'
     DJBags_LOCALE_CLEAR_NEW_ITEMS = 'Clear new items'
     DJBags_LOCALE_BACKGROUND_COLOR = 'Background color'
     DJBags_LOCALE_BORDER_COLOR = 'Border color'
     DJBags_LOCALE_TEXT_COLOR = 'Text color'
     DJBags_LOCALE_PADDING = 'Padding'
     DJBags_LOCALE_SPACING = 'Spacing'
+    DJBags_LOCALE_SCALE = 'Scale'
     DJBags_LOCALE_TEXT_SIZE = 'Text size'
 end

diff --git a/src/lua/controller/bag.lua b/src/lua/controller/bag.lua
index b19dbb4..677fe22 100644
--- a/src/lua/controller/bag.lua
+++ b/src/lua/controller/bag.lua
@@ -35,9 +35,13 @@ function DJDBagsBagsButton_OnClick(self)
     end
 end

-function controller:Open()
+function controller:Update()
     ADDON:UpdateBags({0, 1, 2, 3, 4})
     DJBagsBagContainer:Arrange()
+end
+
+function controller:Open()
+    self:Update()
     DJBagsBagContainer:Show()
 end

diff --git a/src/lua/element/container.lua b/src/lua/element/container.lua
index 23c0e30..43f3b95 100644
--- a/src/lua/element/container.lua
+++ b/src/lua/element/container.lua
@@ -65,7 +65,7 @@ function container:AddItem(item)
 end

 function container:Arrange(override)
-    ADDON.format['massonry'](
+    ADDON.format[ADDON.settings:GetSettings(self.__type)[DJBags_SETTING_FORMATTER]](
         self,
         ADDON.settings:GetSettings(self.__type)[DJBags_SETTING_FORMATTER_MAX_ITEMS],
         ADDON.settings:GetSettings(self.__type)[DJBags_SETTING_FORMATTER_MAX_HEIGHT],
diff --git a/src/lua/element/item.lua b/src/lua/element/item.lua
index e12280e..4d2b0f5 100644
--- a/src/lua/element/item.lua
+++ b/src/lua/element/item.lua
@@ -66,7 +66,7 @@ function item:GetContainerName()
             return globalDefinedList[self.id] .. '**'
         end

-        local subClassSplitList = ADDON.settings:GetSubClassList()
+        local subClassSplitList = ADDON.settings:GetSettings(DJBags_TYPE_SUB_CLASS)
         if subClassSplitList[self.classId] then
             return self.class .. (self.subClass == BAG_FILTER_JUNK and '' or '_' .. self.subClass)
         end
diff --git a/src/lua/settings/settingsController.lua b/src/lua/settings/settingsController.lua
index 93ffd71..752439e 100644
--- a/src/lua/settings/settingsController.lua
+++ b/src/lua/settings/settingsController.lua
@@ -36,7 +36,7 @@ function settings:Init()
             [DJBags_SETTING_PADDING] = 5,
             [DJBags_SETTING_SPACING] = 5,
             [DJBags_SETTING_SCALE] = 1,
-            [DJBags_SETTING_FORMATTER] = 'massonry',
+            [DJBags_SETTING_FORMATTER] = DJBags_FORMATTER_MASONRY,
             [DJBags_SETTING_FORMATTER_VERT] = false,
             [DJBags_SETTING_FORMATTER_MAX_ITEMS] = 12,
             [DJBags_SETTING_FORMATTER_MAX_HEIGHT] = 0.5,
@@ -50,34 +50,36 @@ function settings:Init()
             [DJBags_SETTING_PADDING] = 3,
             [DJBags_SETTING_SPACING] = 3,
         },
-    }
-    self.defaultSubclass = {
-        [LE_ITEM_CLASS_ARMOR] = false,
-        [LE_ITEM_CLASS_CONSUMABLE] = true,
-        [LE_ITEM_CLASS_GEM] = false,
-        [LE_ITEM_CLASS_GLYPH] = false,
-        [LE_ITEM_CLASS_ITEM_ENHANCEMENT] = false,
-        [LE_ITEM_CLASS_MISCELLANEOUS] = true,
-        [LE_ITEM_CLASS_RECIPE] = false,
-        [LE_ITEM_CLASS_TRADEGOODS] = true,
-        [LE_ITEM_CLASS_WEAPON] = false,
+        [DJBags_TYPE_SUB_CLASS] = {
+            [LE_ITEM_CLASS_ARMOR] = false,
+            [LE_ITEM_CLASS_CONSUMABLE] = true,
+            [LE_ITEM_CLASS_GEM] = false,
+            [LE_ITEM_CLASS_GLYPH] = false,
+            [LE_ITEM_CLASS_ITEM_ENHANCEMENT] = false,
+            [LE_ITEM_CLASS_MISCELLANEOUS] = true,
+            [LE_ITEM_CLASS_RECIPE] = false,
+            [LE_ITEM_CLASS_TRADEGOODS] = true,
+            [LE_ITEM_CLASS_WEAPON] = false,
+        },
     }

     self:Update()
 end

 function settings:Update(force)
-    self:UpdateBag(DJBagsBagContainer, ADDON.cache.bagContainers, force)
+    self:UpdateBag(DJBagsBagContainer, ADDON.bagController, ADDON.cache.bagContainers, force)
 end

-function settings:UpdateBag(bag, list, force)
+function settings:UpdateBag(bag, controller, list, force)
     bag:UpdateFromSettings()
     for _, container in pairs(list) do
         container:UpdateFromSettings()
     end

-    if bag:IsVisible() and force then
+    if bag:IsVisible() and force == 1 then
         bag:Arrange(true)
+    elseif bag:IsVisible() and force == 2 then
+        controller:Update()
     end
 end

@@ -104,10 +106,6 @@ function settings:GetGlobalUserDefinedList()
     return DJBags_DB.global.userDefined
 end

-function settings:GetSubClassList()
-    return DJBags_DB[self.realm][self.player].subClass or self.defaultSubclass
-end
-
 function settings:MigrateSettings(table, default)
     for k, v in pairs(default) do
         if table[k] ~= nil then
diff --git a/src/lua/settings/settingsElements.lua b/src/lua/settings/settingsElements.lua
index 3b3c1b5..250b074 100644
--- a/src/lua/settings/settingsElements.lua
+++ b/src/lua/settings/settingsElements.lua
@@ -16,13 +16,16 @@ function DJBagsInitSettingsSlider(slider, name, min, max, step, type, setting)
     slider.setting = setting
     slider.name = name

+    local onChange = slider:GetScript('OnValueChanged')
+    slider:SetScript('OnValueChanged', nil)
     slider:SetValue(value)
     slider:SetValueStep(step)
+    slider:SetScript('OnValueChanged', onChange)
 end

 function DJBagsSettingsSlider_OnChange(self, value)
     _G[self:GetName() .. 'Text']:SetText(tostring(self.name) .. ' - ' .. round(value, 1))
-    ADDON.settings:SetSettings(self.type, self.setting, value, true)
+    ADDON.settings:SetSettings(self.type, self.setting, value, 1)
 end

 function DJBagsInitSettingsColorPicker(picker, type, setting)
@@ -52,4 +55,17 @@ function DJBagsSettingsColorPicker_OnClick(self)
     ColorPickerFrame.hasOpacity, ColorPickerFrame.opacity = (a ~= nil), a;
     ColorPickerFrame.previousValues = { r, g, b, a };
     ShowUIPanel(ColorPickerFrame)
+end
+
+function DJBagsInitSettingsCheckBox(checkbox, name, type, setting)
+    checkbox.type = type
+    checkbox.setting = setting
+
+    _G[checkbox:GetName() .. "Text"]:SetText(name)
+
+    checkbox:SetChecked(ADDON.settings:GetSettings(type)[setting])
+end
+
+function DJBagsSettingsCheckBox_OnChange(checkbox, checked)
+    ADDON.settings:SetSettings(checkbox.type, checkbox.setting, checked, 2)
 end
\ No newline at end of file
diff --git a/src/lua/tools/masonryFormatter.lua b/src/lua/tools/masonryFormatter.lua
index a439620..f3d5b69 100644
--- a/src/lua/tools/masonryFormatter.lua
+++ b/src/lua/tools/masonryFormatter.lua
@@ -20,7 +20,7 @@ local sorter = function(A, B)
     end
 end

-ADDON.format['massonry'] = function(frame, maxItems, _, vert, override)
+ADDON.format[DJBags_FORMATTER_MASONRY] = function(frame, maxItems, _, vert, override)
     local h = 0
     local x = 0
     local mH = 0
diff --git a/src/manifest.xml b/src/manifest.xml
index 53747ef..460dfc3 100644
--- a/src/manifest.xml
+++ b/src/manifest.xml
@@ -36,7 +36,11 @@
     <Script file="src/lua/settings/settingsElements.lua" />
     <Include file="src/xml/settings/colorPicker.xml" />
     <Include file="src/xml/settings/slider.xml" />
+    <Include file="src/xml/settings/checkBox.xml" />
     <Include file="src/xml/settings/itemContainerSettings.xml" />
+    <Include file="src/xml/settings/containerSettings.xml" />
+    <Include file="src/xml/settings/subClassSettings.xml" />
+    <Include file="src/xml/settings/settingsContainer.xml" />

     <!-- Core (Load last) -->
     <Script file="src/lua/core.lua"/>
diff --git a/src/xml/element/itemContainer.xml b/src/xml/element/itemContainer.xml
index 5b1529e..c6ed28c 100644
--- a/src/xml/element/itemContainer.xml
+++ b/src/xml/element/itemContainer.xml
@@ -37,7 +37,7 @@
                     </OnLeave>
                     <OnMouseUp>
                         if IsAltKeyDown() and button == 'RightButton' then
-                            DJBagsItemContainerSettings:Open(self:GetParent())
+                            DJBagsSettingsContainer:Open()
                         end
                     </OnMouseUp>
                 </Scripts>
@@ -46,7 +46,7 @@
         <Scripts>
             <OnMouseUp>
                 if IsAltKeyDown() and button == 'RightButton' then
-                    DJBagsItemContainerSettings:Open(self)
+                    DJBagsSettingsContainer:Open()
                 end
             </OnMouseUp>
         </Scripts>
diff --git a/src/xml/settings/checkBox.xml b/src/xml/settings/checkBox.xml
new file mode 100644
index 0000000..4e64ba5
--- /dev/null
+++ b/src/xml/settings/checkBox.xml
@@ -0,0 +1,10 @@
+<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/..\FrameXML\UI.xsd">
+    <CheckButton name="DJBagsSettingsCheckBoxTemplate" inherits="UICheckButtonTemplate" virtual="true">
+        <Scripts>
+            <OnClick>
+                DJBagsSettingsCheckBox_OnChange(self, self:GetChecked())
+            </OnClick>
+        </Scripts>
+    </CheckButton>
+</Ui>
\ No newline at end of file
diff --git a/src/xml/settings/containerSettings.xml b/src/xml/settings/containerSettings.xml
new file mode 100644
index 0000000..b461681
--- /dev/null
+++ b/src/xml/settings/containerSettings.xml
@@ -0,0 +1,86 @@
+<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/..\FrameXML\UI.xsd">
+    <Frame name="DJBagsContainerSettings" inherits="DJBagsContainerTemplate" hidden="false" virtual="true">
+        <Size x="500" y="220"/>
+        <Layers>
+            <Layer level="ARTWORK">
+                <FontString name="$parentName" inherits="GameFontNormal" text="DJBags_LOCALE_CONTAINER_SETTINGS">
+                    <Anchors>
+                        <Anchor point="TOPLEFT" x="15" y="-5"/>
+                    </Anchors>
+                </FontString>
+            </Layer>
+        </Layers>
+        <Frames>
+            <Button name="$parentBackgroundColorSelect" inherits="DJBagsColorPickerTemplate" text="DJBags_LOCALE_BACKGROUND_COLOR">
+                <Anchors>
+                    <Anchor point="TOPLEFT" relativeTo="$parentName" relativePoint="BOTTOMLEFT" x="5" y="-15" />
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsColorPicker(self, DJBags_TYPE_CONTAINER, DJBags_SETTING_BACKGROUND_COLOR)
+                    </OnShow>
+                </Scripts>
+            </Button>
+            <Button name="$parentBorderColorSelect" inherits="DJBagsColorPickerTemplate" text="DJBags_LOCALE_BORDER_COLOR">
+                <Anchors>
+                    <Anchor point="LEFT" relativeTo="$parentBackgroundColorSelect" relativePoint="RIGHT" x="5" y="0" />
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsColorPicker(self, DJBags_TYPE_CONTAINER, DJBags_SETTING_BORDER_COLOR)
+                    </OnShow>
+                </Scripts>
+            </Button>
+
+            <Slider name="$parentPaddingSlider" inherits="DJBagsSettingsSliderTemplate">
+                <Anchors>
+                    <Anchor point="TOPLEFT" relativeTo="$parentBackgroundColorSelect" relativePoint="BOTTOMLEFT">
+                        <Offset>
+                            <AbsDimension x="0" y="-32"/>
+                        </Offset>
+                    </Anchor>
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsSlider(self, DJBags_LOCALE_PADDING, 2, 10, 1, DJBags_TYPE_CONTAINER, DJBags_SETTING_PADDING)
+                    </OnShow>
+                </Scripts>
+            </Slider>
+            <Slider name="$parentSpacingSlider" inherits="DJBagsSettingsSliderTemplate">
+                <Anchors>
+                    <Anchor point="TOPLEFT" relativeTo="$parentPaddingSlider" relativePoint="BOTTOMLEFT">
+                        <Offset>
+                            <AbsDimension x="0" y="-32"/>
+                        </Offset>
+                    </Anchor>
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsSlider(self, DJBags_LOCALE_SPACING, 2, 10, 1, DJBags_TYPE_CONTAINER, DJBags_SETTING_SPACING)
+                    </OnShow>
+                </Scripts>
+            </Slider>
+            <Slider name="$parentScaleSlider" inherits="DJBagsSettingsSliderTemplate">
+                <Anchors>
+                    <Anchor point="TOPLEFT" relativeTo="$parentSpacingSlider" relativePoint="BOTTOMLEFT">
+                        <Offset>
+                            <AbsDimension x="0" y="-32"/>
+                        </Offset>
+                    </Anchor>
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsSlider(self, DJBags_LOCALE_SCALE, 0.5, 2, 0.1, DJBags_TYPE_CONTAINER, DJBags_SETTING_SCALE)
+                    </OnShow>
+                </Scripts>
+            </Slider>
+        </Frames>
+        <Scripts>
+            <OnLoad>
+                self:SetBackdropColor(0, 0, 0, 0.6)
+                self:SetBackdropBorderColor(0.3, 0.3, 0.3, 1)
+            </OnLoad>
+        </Scripts>
+    </Frame>
+</Ui>
diff --git a/src/xml/settings/itemContainerSettings.xml b/src/xml/settings/itemContainerSettings.xml
index eecb878..6b6ff02 100644
--- a/src/xml/settings/itemContainerSettings.xml
+++ b/src/xml/settings/itemContainerSettings.xml
@@ -1,10 +1,7 @@
 <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/..\FrameXML\UI.xsd">
-    <Frame name="DJBagsItemContainerSettings" parent="UIParent" inherits="DJBagsContainerTemplate">
+    <Frame name="DJBagsItemContainerSettings" inherits="DJBagsContainerTemplate" hidden="false" virtual="true">
         <Size x="500" y="220"/>
-        <Anchors>
-            <Anchor point="CENTER"/>
-        </Anchors>
         <Layers>
             <Layer level="ARTWORK">
                 <FontString name="$parentName" inherits="GameFontNormal" text="DJBags_LOCALE_ITEM_CONTAINER_SETTINGS">
@@ -93,10 +90,6 @@
             <OnLoad>
                 self:SetBackdropColor(0, 0, 0, 0.6)
                 self:SetBackdropBorderColor(0.3, 0.3, 0.3, 1)
-                function self:Open(element)
-                    self.target = element
-                    self:Show()
-                end
             </OnLoad>
         </Scripts>
     </Frame>
diff --git a/src/xml/settings/mainBarSettings.xml b/src/xml/settings/mainBarSettings.xml
new file mode 100644
index 0000000..e69de29
diff --git a/src/xml/settings/settingsContainer.xml b/src/xml/settings/settingsContainer.xml
new file mode 100644
index 0000000..8c60aa5
--- /dev/null
+++ b/src/xml/settings/settingsContainer.xml
@@ -0,0 +1,105 @@
+<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/..\FrameXML\UI.xsd">
+    <Frame name="DJBagsSettingsContainer" parent="UIParent" inherits="DJBagsContainerTemplate">
+        <Size x="545" y="600"/>
+        <Anchors>
+            <Anchor point="TOPLEFT" x="200" y="-100"/>
+        </Anchors>
+        <Layers>
+            <Layer level="ARTWORK">
+                <FontString name="$parentName" inherits="GameFontNormal" text="DJBags_LOCALE_SETTINGS">
+                    <Anchors>
+                        <Anchor point="TOPLEFT" x="15" y="-5"/>
+                    </Anchors>
+                </FontString>
+            </Layer>
+        </Layers>
+        <Frames>
+            <Frame name="DJBagsSettingsContent">
+                <Size x="500" y="565" />
+                <Frames>
+                    <Frame name="$parentSubClassSettings" inherits="DJBagsSubClassSettings">
+                        <Anchors>
+                            <Anchor point="TOP" />
+                        </Anchors>
+                    </Frame>
+                    <Frame name="$parentItemContainerSettings" inherits="DJBagsItemContainerSettings">
+                        <Anchors>
+                            <Anchor point="TOP" relativeTo="$parentSubClassSettings" relativePoint="BOTTOM" />
+                        </Anchors>
+                    </Frame>
+                    <Frame name="$parentContainerSettings" inherits="DJBagsContainerSettings">
+                        <Anchors>
+                            <Anchor point="TOP" relativeTo="$parentItemContainerSettings" relativePoint="BOTTOM" />
+                        </Anchors>
+                    </Frame>
+                </Frames>
+            </Frame>
+            <ScrollFrame name="DJBagsSettingsScrollFrame">
+                <Anchors>
+                    <Anchor point="TOPLEFT" relativeTo="$parentName" relativePoint="BOTTOMLEFT" y="-15" />
+                    <Anchor point="RIGHT" relativeTo="$parent" relativePoint="RIGHT" x="-25" />
+                    <Anchor point="BOTTOM" relativeTo="$parent" relativePoint="BOTTOM" y="25" />
+                </Anchors>
+                <Scripts>
+                    <OnLoad>
+                        self:EnableMouseWheel(true)
+                        self:SetScrollChild(_G['DJBagsSettingsContent'])
+                    </OnLoad>
+                    <OnMouseWheel>
+                        local scrollBar = _G['DJBagsSettingsContainerScrollBar']
+                        local current = scrollBar:GetValue()
+
+                        local _, max = scrollBar:GetMinMaxValues()
+
+                        local up = delta > 0
+                        if IsShiftKeyDown() and up then
+                            scrollBar:SetValue(0)
+                        elseif IsShiftKeyDown() and not up then
+                            scrollBar:SetValue(max)
+                        elseif not up and not (current >= max) then
+                            scrollBar:SetValue(math.min(current + 20, max))
+                        elseif up and (current > 1) then
+                            scrollBar:SetValue(math.max(current - 20, 0))
+                        end
+                    </OnMouseWheel>
+                </Scripts>
+            </ScrollFrame>
+            <Slider name="$parentScrollBar" inherits="UIPanelScrollBarTemplate" minValue="0" maxValue="65" defaultValuie="1" valueStep="1">
+                <Backdrop bgFile="Interface\Buttons\UI-SliderBar-Background"
+                          edgeFile="Interface\Buttons\UI-SliderBar-Border" tile="true">
+                    <EdgeSize val="8"/>
+                    <TileSize val="8"/>
+                    <BackgroundInsets left="3" right="3" top="6" bottom="6"/>
+                </Backdrop>
+                <Anchors>
+                    <Anchor point="TOPLEFT" relativeTo="DJBagsSettingsScrollFrame" relativePoint="TOPRIGHT" x="5" />
+                    <Anchor point="BOTTOM" relativeTo="$parent" relativePoint="BOTTOM" y="25" />
+                </Anchors>
+                <Scripts>
+                    <OnLoad>
+                        self:SetValue(0)
+                    </OnLoad>
+                    <OnValueChanged>
+                        DJBagsSettingsScrollFrame:SetVerticalScroll(value)
+                    </OnValueChanged>
+                </Scripts>
+            </Slider>
+        </Frames>
+        <Scripts>
+            <OnLoad>
+                table.insert(UISpecialFrames, self:GetName())
+                self:RegisterForDrag("LeftButton")
+                self:SetScript("OnDragStart", self.StartMoving)
+                self:SetScript("OnDragStop", self.StopMovingOrSizing)
+                self:SetUserPlaced(true)
+
+                self:SetBackdropColor(0, 0, 0, 0.6)
+                self:SetBackdropBorderColor(0.3, 0.3, 0.3, 1)
+                function self:Open()
+                    self:Show()
+                end
+            </OnLoad>
+        </Scripts>
+    </Frame>
+</Ui>
diff --git a/src/xml/settings/subClassSettings.xml b/src/xml/settings/subClassSettings.xml
new file mode 100644
index 0000000..4a71934
--- /dev/null
+++ b/src/xml/settings/subClassSettings.xml
@@ -0,0 +1,113 @@
+<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/..\FrameXML\UI.xsd">
+    <Frame name="DJBagsSubClassSettings" inherits="DJBagsContainerTemplate" hidden="false" virtual="true">
+        <Size x="500" y="125"/>
+        <Layers>
+            <Layer level="ARTWORK">
+                <FontString name="$parentName" inherits="GameFontNormal" text="DJBags_LOCALE_SUB_CLASS_SETTINGS">
+                    <Anchors>
+                        <Anchor point="TOPLEFT" x="15" y="-5"/>
+                    </Anchors>
+                </FontString>
+            </Layer>
+        </Layers>
+        <Frames>
+            <CheckButton name="$parentArmorCheckBox" inherits="DJBagsSettingsCheckBoxTemplate">
+                <Anchors>
+                    <Anchor point="TOPLEFT" relativeTo="$parentName" relativePoint="BOTTOMLEFT" x="5" y="-5" />
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsCheckBox(self, AUCTION_CATEGORY_ARMOR, DJBags_TYPE_SUB_CLASS, LE_ITEM_CLASS_ARMOR)
+                    </OnShow>
+                </Scripts>
+            </CheckButton>
+            <CheckButton name="$parentConsumableCheckBox" inherits="DJBagsSettingsCheckBoxTemplate">
+                <Anchors>
+                    <Anchor point="LEFT" relativeTo="$parentArmorCheckBox" relativePoint="RIGHT" x="140" />
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsCheckBox(self, AUCTION_CATEGORY_CONSUMABLES, DJBags_TYPE_SUB_CLASS, LE_ITEM_CLASS_CONSUMABLE)
+                    </OnShow>
+                </Scripts>
+            </CheckButton>
+            <CheckButton name="$parentGemsCheckBox" inherits="DJBagsSettingsCheckBoxTemplate">
+                <Anchors>
+                    <Anchor point="LEFT" relativeTo="$parentConsumableCheckBox" relativePoint="RIGHT" x="140" />
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsCheckBox(self, AUCTION_CATEGORY_GEMS, DJBags_TYPE_SUB_CLASS, LE_ITEM_CLASS_GEM)
+                    </OnShow>
+                </Scripts>
+            </CheckButton>
+            <CheckButton name="$parentGlyphCheckBox" inherits="DJBagsSettingsCheckBoxTemplate">
+                <Anchors>
+                    <Anchor point="TOP" relativeTo="$parentArmorCheckBox" relativePoint="BOTTOM" />
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsCheckBox(self, AUCTION_CATEGORY_GLYPHS, DJBags_TYPE_SUB_CLASS, LE_ITEM_CLASS_GLYPH)
+                    </OnShow>
+                </Scripts>
+            </CheckButton>
+            <CheckButton name="$parentItemEnhancementCheckBox" inherits="DJBagsSettingsCheckBoxTemplate">
+                <Anchors>
+                    <Anchor point="LEFT" relativeTo="$parentGlyphCheckBox" relativePoint="RIGHT" x="140" />
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsCheckBox(self, AUCTION_CATEGORY_ITEM_ENHANCEMENT, DJBags_TYPE_SUB_CLASS, LE_ITEM_CLASS_ITEM_ENHANCEMENT)
+                    </OnShow>
+                </Scripts>
+            </CheckButton>
+            <CheckButton name="$parentMiscCheckBox" inherits="DJBagsSettingsCheckBoxTemplate">
+                <Anchors>
+                    <Anchor point="LEFT" relativeTo="$parentItemEnhancementCheckBox" relativePoint="RIGHT" x="140" />
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsCheckBox(self, AUCTION_CATEGORY_MISCELLANEOUS, DJBags_TYPE_SUB_CLASS, LE_ITEM_CLASS_MISCELLANEOUS)
+                    </OnShow>
+                </Scripts>
+            </CheckButton>
+            <CheckButton name="$parentRecipesCheckBox" inherits="DJBagsSettingsCheckBoxTemplate">
+                <Anchors>
+                    <Anchor point="TOP" relativeTo="$parentGlyphCheckBox" relativePoint="BOTTOM" />
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsCheckBox(self, AUCTION_CATEGORY_RECIPES, DJBags_TYPE_SUB_CLASS, LE_ITEM_CLASS_RECIPE)
+                    </OnShow>
+                </Scripts>
+            </CheckButton>
+            <CheckButton name="$parentTradeGoodsCheckBox" inherits="DJBagsSettingsCheckBoxTemplate">
+                <Anchors>
+                    <Anchor point="LEFT" relativeTo="$parentRecipesCheckBox" relativePoint="RIGHT" x="140" />
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsCheckBox(self, AUCTION_CATEGORY_TRADE_GOODS, DJBags_TYPE_SUB_CLASS, LE_ITEM_CLASS_TRADEGOODS)
+                    </OnShow>
+                </Scripts>
+            </CheckButton>
+            <CheckButton name="$parentWeaponsCheckBox" inherits="DJBagsSettingsCheckBoxTemplate">
+                <Anchors>
+                    <Anchor point="LEFT" relativeTo="$parentTradeGoodsCheckBox" relativePoint="RIGHT" x="140" />
+                </Anchors>
+                <Scripts>
+                    <OnShow>
+                        DJBagsInitSettingsCheckBox(self, AUCTION_CATEGORY_WEAPONS, DJBags_TYPE_SUB_CLASS, LE_ITEM_CLASS_WEAPON)
+                    </OnShow>
+                </Scripts>
+            </CheckButton>
+        </Frames>
+        <Scripts>
+            <OnLoad>
+                self:SetBackdropColor(0, 0, 0, 0.6)
+                self:SetBackdropBorderColor(0.3, 0.3, 0.3, 1)
+            </OnLoad>
+        </Scripts>
+    </Frame>
+</Ui>