WoWInterface SVN cargBags_Gnomed

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

trunk/cargBags_Gnomed/layout.lua
1,3 → 1,9
--[[
TODO
-- Bank filtering
-- maybe subcategories)
]]--
 
local L = {}
local gl = GetLocale()
if gl == "enGB" or gl == "enUS" then
199,8 → 205,10
--end
 
if(self.Name =="cB_Gnomed_Keyring") then
self.Columns = 3 -- 5 item button columns for the key ring
self:SetScale(0.75) -- Make key ring a bit smaller
self:SetScale(0.75) -- Make key ring a bit smaller
self.Columns = 8
elseif(self.Name == "cB_Gnomed_Bank") then
self.Columns = 14
else
self.Columns = 8
end
213,7 → 221,7
self:UpdateDimensions()
self:SetWidth(38*self.Columns) -- Set the frame's width based on the columns
 
if(self.Name == "cB_Gnomed_Bag" or self.Name == "cB_Gnomed_Bank" or self.Name == "cB_Gnomed_Armor" or self.Name == "cB_Gnomed_Weapon" or self.Name == "cB_Gnomed_Quest" or self.Name == "cB_Gnomed_Consumables") then
--if(self.Name == "cB_Gnomed_Bag" or self.Name == "cB_Gnomed_Bank" or self.Name == "cB_Gnomed_Armor" or self.Name == "cB_Gnomed_Weapon" or self.Name == "cB_Gnomed_Quest" or self.Name == "cB_Gnomed_Consumables" or self.Name == "cB_Gnomed_TradeGoods") then
 
-- Caption and close button
local caption = self:CreateFontString(nil, "OVERLAY", "GameFontNormal")
293,7 → 301,7
 
end
 
end
 
 
-- For purchasing bank slots
if(self.Name == "cB_Gnomed_Bank") then
310,17 → 318,22
end
 
-- And the frame background!
local color_rb
local color_gb
local color_bb
local alpha_fb
 
if self.Name == "cB_Gnomed_Bank" then
local color_rb = 0
local color_gb = 0
local color_bb = 0
local alpha_fb = 1
if (self.Name == "cB_Gnomed_Bank" or self.Name =="cB_Gnomed_Bank-Armor") then
color_rb = 0
color_gb = 0,25
color_bb = 0,53
alpha_fb = 1
 
else
local color_rb = 0
local color_gb = 0.63
local color_bb = 1
local alpha_fb = 1
color_rb = 0
color_gb = 0
color_bb = 0
alpha_fb = 1
end
 
local background = CreateFrame("Frame", nil, self)
407,12 → 420,21
 
local INVERTED = -1 -- with inverted filters (using -1), everything goes into this bag when the filter returns false
 
--------------------
--General filters
--------------------
 
-- Bag filter
local onlyBags = function(item) return item.bagID >= 0 and item.bagID <= 4 end
--Keyring filter
local onlyKeyring = function(item) return item.bagID == -2 end
-- Bank filter
local onlyBank = function(item) return item.bagID == -1 or item.bagID >= 5 and item.bagID <= 11 end
 
----------------
-- Bag filters
----------------
 
-- Stuff filter
local onlyArmor = function(item) return item.type and item.type == L.Armor end -- for stuff
local onlyWeapon = function(item) return item.type and item.type == L.Weapon end
427,50 → 449,77
-- Trade goods filter
local onlyTradeGoods = function(item) return item.type and item.type == L.Trades end
-- Gem filter
local onlyGems = function(item) return item.type and item.type == L.Gem end -
local onlyGems = function(item) return item.type and item.type == L.Gem end
 
-----------------
-- Bank filters
----------------- +local onlyBankArmor = function(item) return item.bagID == -1 or (item.bagID >= 5 and item.bagID <= 11) and item.type and item.type == L.Armor end
local onlyBankWeapons = function(item) return item.bagID == -1 or (item.bagID >= 5 and item.bagID <= 11) and item.type and item.type == L.Weapon end
local onlyBankConsumables = function(item) return item.bagID == -1 or (item.bagID >= 5 and item.bagID <= 11) and item.type and item.type == L.Consumables end
 
-- Frames Spawns
 
--local bankArmor = cargBags:Spawn("cB_Gnomed_Bank-Armor",bank)
--bankArmor:SetFilter(onlyBankArmor, true)
 
 
-- Bank frame and bank bags
local bank = cargBags:Spawn("cB_Gnomed_Bank")
bank:SetFilter(onlyBank, true)
bank:SetPoint("LEFT", 15, 0)
--bank:SetPoint("LEFT", 15, 0)
 
-- Stuff frames
local armor = cargBags:Spawn("cB_Gnomed_Armor",main)
armor:SetFilter(onlyArmor , true)
armor:SetFilter(hideEmpty, true)
armor:SetPoint("BOTTOMRIGHT",UIParent,"RIGHT", -400,-200)
--armor:SetPoint("BOTTOMRIGHT",UIParent,"RIGHT", -400,-200)
 
local weapon = cargBags:Spawn("cB_Gnomed_Weapon",main)
weapon:SetFilter(onlyWeapon, true)
weapon:SetFilter(hideEmpty, true)
weapon:SetPoint("BOTTOMRIGHT", armor, "TOPRIGHT", 0,15)
--weapon:SetPoint("BOTTOMRIGHT", armor, "TOPRIGHT", 0,15)
 
 
-- Quest frame
local quest = cargBags:Spawn("cB_Gnomed_Quest",main)
quest:SetFilter(onlyQuest, true)
quest:SetFilter(hideEmpty, true)
quest:SetPoint("BOTTOMRIGHT", weapon, "TOPRIGHT", 0,15)
--quest:SetPoint("BOTTOMRIGHT", weapon, "TOPRIGHT", 0,15)
 
-- Consumable
local consumables = cargBags:Spawn("cB_Gnomed_Consumables",main)
consumables:SetFilter(onlyConsumables, true)
consumables:SetFilter(hideEmpty, true)
consumables:SetPoint("BOTTOMRIGHT", quest, "TOPRIGHT", 0,15)
--consumables:SetPoint("BOTTOMRIGHT", quest, "TOPRIGHT", 0,15)
 
-- Trade goods
local tgoods = cargBags:Spawn("cB_Gnomed_TradeGoods",main)
tgoods:SetFilter(onlyTradeGoods, true)
tgoods:SetFilter(hideEmpty, true)
 
-- Bagpack and bags
local main = cargBags:Spawn("cB_Gnomed_Bag")
main:SetFilter(onlyBags, true)
main:SetPoint("RIGHT", -25, 0)
--main:SetPoint("RIGHT", -25, 0)
 
-- Keyring
local key = cargBags:Spawn("cB_Gnomed_Keyring")
key:SetFilter(onlyKeyring, true)
key:SetFilter(hideEmpty, true)
key:SetPoint("TOPRIGHT", main, "BOTTOMRIGHT", 1, -15)
--key:SetPoint("TOPRIGHT", main, "BOTTOMRIGHT", 1, -15)
 
-- Now let's set the points
-- Bags
main:SetPoint("RIGHT",-65,0)
key:SetPoint("BOTTOMLEFT",main,"TOPLEFT",0,15)
consumables:SetPoint("TOP",main,"BOTTOM",0,-15)
tgoods:SetPoint("TOP",consumables,"BOTTOM",0,-15)
armor:SetPoint("TOPRIGHT",main,"TOPLEFT",-15,0)
weapon:SetPoint("TOP",armor,"BOTTOM",0,-15)
quest:SetPoint("TOP",weapon,"BOTTOM",0,-15)
-- Bank
bank:SetPoint("LEFT", 15, 0)
--bankArmor:SetPoint("TOPLEFT",bank,"BOTTOMLEFT",0,-15)
 
 
-- Opening / Closing Functions
480,6 → 529,7
weapon:Show()
quest:Show()
consumables:Show()
tgoods:Show()
--key:Show()
end
 
490,7 → 540,7
weapon:Hide()
quest:Hide()
consumables:Hide()
main:Hide()
tgoods:Hide()
key:Hide()
end
 
505,9 → 555,11
bankToggle:RegisterEvent"BANKFRAME_CLOSED"
bankToggle:SetScript("OnEvent", function(self, event)
if(event == "BANKFRAME_OPENED") then
bank:Show()
bank:Show()
--bankArmor:Show()
else
bank:Hide()
bank:Hide()
--bankArmor:Hide()
end
end)