update bags add JunkIcon and QuestIcon to bags

This commit is contained in:
Crum
2018-11-30 20:58:20 -06:00
parent 3ebbb323a4
commit 3b9951d1b9
8 changed files with 793 additions and 284 deletions
+17
View File
@@ -32,6 +32,7 @@ local TIMEMANAGER_PM = gsub(TIME_TWELVEHOURPM, "^.-(%w+)$", "%1")
local LBC = LibStub("LibBabble-Class-3.0"):GetLookupTable() local LBC = LibStub("LibBabble-Class-3.0"):GetLookupTable()
local LBZ = LibStub("LibBabble-Zone-3.0"):GetLookupTable() local LBZ = LibStub("LibBabble-Zone-3.0"):GetLookupTable()
local IFDB = LibStub("ItemFamilyDB") local IFDB = LibStub("ItemFamilyDB")
local QIS = LibStub("QuestItemStarterDB")
CLASS_SORT_ORDER = { CLASS_SORT_ORDER = {
"WARRIOR", "WARRIOR",
@@ -559,6 +560,22 @@ function GetThreatStatus(currentThreat, maxThreat)
end end
end end
function GetQuestItemStarterInfo(link)
for _, info in pairs(QIS.QuestItemStarterIDs) do
if match(link, "item:(%d+):") == info then
return true
end
end
end
function GetInvalidQuestItemInfo(link)
for _, info in pairs(QIS.InvalidQuestItemIDs) do
if match(link, "item:(%d+):") == info then
return true
end
end
end
local LAST_ITEM_ID = 24283 local LAST_ITEM_ID = 24283
local itemInfoDB = {} local itemInfoDB = {}
+317
View File
@@ -0,0 +1,317 @@
local MAJOR_VERSION = "QuestItemStarterDB"
local MINOR_VERSION = 90000 + tonumber(string.match("$Revision: 1 $", "%d+"))
local lib = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
if not lib then return end
lib.QuestItemStarterIDs = {
"1307", -- Gold Pickup Schedule
"1357", -- Captain Sanders' Treasure Map
"1962", -- Glowing Shadowhide Pendant
"1971", -- Furlbrow's Deed
"1972", -- Westfall Deed
"2794", -- An Old History Book
"2837", -- Thurman's Letter
"2839", -- A Letter to Yvette
"2874", -- An Unsent Letter
"3082", -- Dargol's Skull
"3317", -- A Talking Head
"3668", -- Assassin's Contract
"3706", -- Ensorcelled Parchment
"3985", -- Monogrammed Sash
"4056", -- Cortello's Riddle
"4098", -- Carefully Folded Note
"4433", -- Waterlogged Envelope
"4613", -- Corroded Black Box
"4614", -- Pendant of Myzrael
"4854", -- Demon Scarred Cloak
"4881", -- Aged Envelope
"4903", -- Eye of Burning Shadow
"4926", -- Chen's Empty Keg
"5102", -- Owatanka's Tailspike
"5103", -- Washte Pawne's Feather
"5099", -- Hoof of Lakota'mani
"5138", -- Harvester's Head
"5179", -- Moss-Twined Heart
"5352", -- Book: The Powers Below
"5790", -- Lonebrow's Journal
"5877", -- Cracked Silithid Carapace
"6172", -- Lost Supplies
"6196", -- Noboru's Cudgel
"6497", -- Simple Parchment
"6775", -- Tome of Divinity
"6776", -- Tome of Valor
"6916", -- Tome of Divinity
"7666", -- Shattered Necklace
"8244", -- Flawless Draenethyst Sphere
"8524", -- Model 4711-FTZ Power Source
"8623", -- OOX-17/TN Distress Beacon
"8704", -- OOX-09/HL Distress Beacon
"8705", -- OOX-22/FE Distress Beacon
"9250", -- Ship Schedule
"9254", -- Cuergo's Treasure Map
"9326", -- Grime-Encrusted Ring
"9370", -- Gordunni Scroll
"10000", -- Margol's Horn
"10441", -- Glowing Shard
"10454", -- Essence of Eranikus
"10589", -- Oathstone of Ysera's Dragonflight
"10593", -- Imperfect Draenethyst Fragment
"10621", -- Runed Scroll
"11116", -- A Mangled Journal
"11463", -- Undelivered Parcel
"11668", -- Flute of Xavaric
"11818", -- Grimesilt Outhouse Key
"12563", -- Warlord Goretooth's Command
"12564", -- Assassination Note
"12558", -- Blue-feathered Necklace
"12771", -- Empty Firewater Flask
"12780", -- General Drakkisath's Command
"12842", -- Crudely-Written Log
"13140", -- Blood Red Key
"13250", -- Head of Balnazzar
"13920", -- Healthy Dragon Scale
"14646", -- Goldshire Gift Voucher
"14647", -- Kharanos Gift Voucher
"14648", -- Dolanaar Gift Voucher
"14649", -- Razor Hill Gift Voucher
"14650", -- Bloodhoof Village Gift Voucher
"14651", -- Brill Gift Voucher
"16303", -- Ursangous' Paw
"16304", -- Shadumbra's Head
"16305", -- Sharptalon's Claw
"16408", -- Befouled Water Globe
"16790", -- Damp Note
"16782", -- Strange Water Globe
"17008", -- Small Scroll
"17126", -- Elegant Letter
"18356", -- Garona: A Study on Stealth and Treachery
"18357", -- Codex of Defense
"18358", -- The Arcanist's Cookbook
"18359", -- The Light and How to Swing It
"18360", -- Harnessing Shadows
"18361", -- The Greatest Race of Hunters
"18362", -- Holy Bologna: What the Light Won't Tell You
"18363", -- Frost Shock and You
"18364", -- The Emerald Dream
"18401", -- Foror's Compendium of Dragon Slaying
"18422", -- Head of Onyxia
"18423", -- Head of Onyxia
"18565", -- Vessel of Rebirth DEPRECATED
"18628", -- Thorium Brotherhood Contract
"18703", -- Ancient Petrified Leaf
"18706", -- Arena Master
"18769", -- Enchanted Thorium Platemail
"18770", -- Enchanted Thorium Platemail
"18771", -- Enchanted Thorium Platemail
"18950", -- Chambermaid Pillaclencher's Pillow
"18972", -- Perfect Yeti Hide
"18969", -- Pristine Yeti Hide
"18987", -- Blackhand's Command
"19002", -- Head of Nefarian
"19003", -- Head of Nefarian
"19802", -- Heart of Hakkar
"19016", -- Vessel of Rebirth
"19018", -- Dormant Wind Kissed Blade
"19228", -- Beasts Deck
"19267", -- Elementals Deck
"19257", -- Warlords Deck
"19277", -- Portals Deck
"19423", -- Sayge's Fortune #23
"19424", -- Sayge's Fortune #24
"19443", -- Sayge's Fortune #25
"19452", -- Sayge's Fortune #27
"20310", -- Flayed Demon Skin
"20461", -- Brann Bronzebeard's Lost Letter
"20483", -- Tainted Arcane Sliver
"20644", -- Nightmare Engulfed Object
"20741", -- Deadwood Ritual Totem
"20742", -- Winterfall Ritual Totem
"20765", -- Incriminating Documents
"20806", -- Logistics Task Briefing X
"20807", -- Logistics Task Briefing I
"20938", -- Falconwing Square Gift Voucher
"20939", -- Logistics Task Briefing II
"20940", -- Logistics Task Briefing III
"20941", -- Combat Task Briefing XII
"20942", -- Combat Task Briefing III
"20943", -- Tactical Task Briefing X
"20944", -- Tactical Task Briefing IX
"20945", -- Tactical Task Briefing II
"20947", -- Tactical Task Briefing IV
"20948", -- Tactical Task Briefing V
"20949", -- Magical Ledger
"21165", -- Tactical Task Briefing VI
"21166", -- Tactical Task Briefing VII
"21167", -- Tactical Task Briefing VIII
"21220", -- Head of Ossirian the Unscarred
"21221", -- Eye of C'Thun
"21230", -- Ancient Qiraji Artifact
"21245", -- Tactical Task Briefing I
"21248", -- Combat Task Briefing IV
"21249", -- Combat Task Briefing V
"21250", -- Combat Task Briefing VI
"21251", -- Combat Task Briefing VII
"21252", -- Combat Task Briefing VIII
"21253", -- Combat Task Briefing IX
"21255", -- Combat Task Briefing X
"21256", -- Combat Task Briefing XI
"21257", -- Logistics Task Briefing IV
"21258", -- Logistics Task Briefing IV
"21259", -- Logistics Task Briefing V
"21260", -- Logistics Task Briefing VI
"21261", -- Logistics Task Briefing VI
"21262", -- Logistics Task Briefing VIII
"21263", -- Logistics Task Briefing VII
"21264", -- Logistics Task Briefing VII
"21265", -- Logistics Task Briefing IX
"21378", -- Logistics Task Briefing I
"21379", -- Logistics Task Briefing II
"21380", -- Logistics Task Briefing III
"21381", -- Logistics Task Briefing IX
"21382", -- Logistics Task Briefing V
"21384", -- Logistics Task Briefing VIII
"21385", -- Logistics Task Briefing X
"21514", -- Logistics Task Briefing XI
"21749", -- Combat Task Briefing I
"21750", -- Combat Task Briefing II
"21751", -- Tactical Task Briefing III
"21776", -- Captain Kelisendra's Lost Rutters
"22520", -- The Phylactery of Kel'Thuzad
"22597", -- The Lady's Necklace
"22600", -- Craftsman's Writ - Dense Weightstone
"22601", -- Craftsman's Writ - Imperial Plate Chest
"22602", -- Craftsman's Writ - Volcanic Hammer
"22603", -- Craftsman's Writ - Huge Thorium Battleaxe
"22604", -- Craftsman's Writ - Radiant Circlet
"22605", -- Craftsman's Writ - Wicked Leather Headband
"22606", -- Craftsman's Writ - Rugged Armor Kit
"22607", -- Craftsman's Writ - Wicked Leather Belt
"22608", -- Craftsman's Writ - Runic Leather Pants
"22609", -- Craftsman's Writ - Brightcloth Pants
"22610", -- Craftsman's Writ - Runecloth Boots
"22611", -- Craftsman's Writ - Runecloth Bag
"22612", -- Craftsman's Writ - Runecloth Robe
"22613", -- Craftsman's Writ - Goblin Sapper Charge
"22614", -- Craftsman's Writ - Thorium Grenade
"22615", -- Craftsman's Writ - Gnomish Battle Chicken
"22616", -- Craftsman's Writ - Thorium Tube
"22617", -- Craftsman's Writ - Major Mana Potion
"22618", -- Craftsman's Writ - Major Healing Potion
"22620", -- Craftsman's Writ - Greater Arcane Protection Potion
"22621", -- Craftsman's Writ - Potion of Petrification
"22622", -- Craftsman's Writ - Stonescale Eel
"22623", -- Craftsman's Writ - Plated Armorfish
"22624", -- Craftsman's Writ - Lightning Eel
"22719", -- Omarion's Handbook
"22727", -- Frame of Atiesh
"22723", -- A Letter from the Keeper of the Rolls
"22888", -- Azure Watch Gift Voucher
"22970", -- A Bloodstained Envelope
"22977", -- A Torn Letter
"22972", -- A Careworn Note
"22973", -- A Crumpled Missive
"22974", -- A Ragged Page
"22975", -- A Smudged Document
"23179", -- Flame of Orgrimmar
"23180", -- Flame of Thunder Bluff
"23181", -- Flame of the Undercity
"23182", -- Flame of Stormwind
"23183", -- Flame of Ironforge
"23184", -- Flame of Darnassus
"23228", -- Old Whitebark's Pendant
"23249", -- Amani Invasion Plans
"23338", -- Eroded Leather Case
"23580", -- Avruu's Orb
"23678", -- Faintly Glowing Crystal
"23759", -- Rune Covered Tablet
"23777", -- Diabolical Plans
"23797", -- Diabolical Plans
"23837", -- Weathered Treasure Map
"23850", -- Gurf's Dignity
"23870", -- Red Crystal Pendant
"23890", -- Ominous Letter
"23892", -- Ominous Letter
"23900", -- Tzerak's Armor Plate
"23910", -- Blood Elf Communication
"24132", -- A Letter from the Admiral
"24330", -- Drain Schematics
"24367", -- Orders from Lady Vashj
"24407", -- Uncatalogued Species
"24414", -- Blood Elf Plans
"24483", -- Withered Basidium
"24484", -- Withered Basidium
"24504", -- Howling Wind
"24558", -- Murkblood Invasion Plans
"24559", -- Murkblood Invasion Plans
"25459", -- "Count" Ungula's Mandible
"25705", -- Luanga's Orders
"25706", -- Luanga's Orders
"28552", -- A Mysterious Tome
"29233", -- Dathric's Blade
"29234", -- Belmara's Tome
"29235", -- Luminrath's Mantle
"29236", -- Cohlien's Cap
"29476", -- Crimson Crystal Shard
"29589", -- Burning Legion Missive
"29738", -- Vial of Void Horror Ooze
"30431", -- Thunderlord Clan Artifact
"30756", -- Illidari-Bane Shard
"30579", -- Illidari-Bane Shard
"31120", -- Meeting Note
"31239", -- Primed Key Mold
"31241", -- Primed Key Mold
"31345", -- The Journal of Val'zareq
"31363", -- Gorgrom's Favor
"31384", -- Damaged Mask
"31489", -- Orb of the Grishna
"31707", -- Cabal Orders
"31890", -- Blessings Deck
"31891", -- Storms Deck
"31907", -- Furies Deck
"31914", -- Lunacy Deck
"32385", -- Magtheridon's Head
"32386", -- Magtheridon's Head
"32405", -- Verdant Sphere
"32523", -- Ishaal's Almanac
"32621", -- Partially Digested Hand
"32726", -- Murkblood Escape Plans
"33102", -- Blood of Zul'jin
"33114", -- Sealed Letter
"33115", -- Sealed Letter
"33978", -- "Honorary Brewer" Hand Stamp
"34028", -- "Honorary Brewer" Hand Stamp
"34469", -- Strange Engine Part
"35568", -- Flame of Silvermoon
"35569", -- Flame of the Exodar
"35723", -- Shards of Ahune
"37571", -- "Brew of the Month" Club Membership Form
"37599", -- "Brew of the Month" Club Membership Form
"38280", -- Direbrew's Dire Brew
"38281", -- Direbrew's Dire Brew
}
-- For some reason these are tagged as quest items. They are not.
lib.InvalidQuestItemIDs = {
"20076", -- Zandalar Signet of Mojo
"20078", -- Zandalar Signet of Serenity
"20077", -- Zandalar Signet of Might
"23545", -- Power of the Scourge
"23547", -- Resilience of the Scourge
"23548", -- Might of the Scourge
"23549", -- Fortitude of the Scourge
"28886", -- Greater Inscription of Discipline
"28887", -- Greater Inscription of Faith
"28888", -- Greater Inscription of Vengeance
"28889", -- Greater Inscription of Warding
"29186", -- Glyph of the Defender
"29189", -- Glyph of Renewal
"29190", -- Glyph of Renewal
"29191", -- Glyph of Power
"29192", -- Glyph of Ferocity
"30846", -- Glyph of the Outcast
"35728", -- Greater Inscription of the Blade
"35729", -- Greater Inscription of the Knight
"35730", -- Greater Inscription of the Oracle
"35731", -- Greater Inscription of the Orb
}
+1
View File
@@ -4,4 +4,5 @@
<Script file="LibBabble-Class-3.0.lua"/> <Script file="LibBabble-Class-3.0.lua"/>
<Script file="LibBabble-Zone-3.0.lua"/> <Script file="LibBabble-Zone-3.0.lua"/>
<Script file="ItemFamilyDB.lua"/> <Script file="ItemFamilyDB.lua"/>
<Script file="QuestItemStarterDB.lua"/>
</Ui> </Ui>
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

+191 -103
View File
@@ -8,8 +8,8 @@ local LIP = LibStub("ItemPrice-1.1");
local _G = _G local _G = _G
local type, ipairs, pairs, unpack, select, assert, pcall = type, ipairs, pairs, unpack, select, assert, pcall local type, ipairs, pairs, unpack, select, assert, pcall = type, ipairs, pairs, unpack, select, assert, pcall
local tinsert, tremove, twipe, tmaxn = table.insert, table.remove, table.wipe, table.maxn local tinsert, tremove, twipe, tmaxn = table.insert, table.remove, table.wipe, table.maxn
local floor = math.floor local floor, abs, mod = math.floor, math.abs, math.fmod
local len, gsub, sub, match = string.len, string.gsub, string.sub, string.match local format, len, match, sub, gsub = string.format, string.len, string.match, string.sub, string.gsub
--WoW API / Variables --WoW API / Variables
local BankFrameItemButton_OnUpdate = BankFrameItemButton_OnUpdate local BankFrameItemButton_OnUpdate = BankFrameItemButton_OnUpdate
local BankFrameItemButton_UpdateLock = BankFrameItemButton_UpdateLock local BankFrameItemButton_UpdateLock = BankFrameItemButton_UpdateLock
@@ -23,45 +23,39 @@ local GetContainerItemLink = GetContainerItemLink
local GetContainerNumSlots = GetContainerNumSlots local GetContainerNumSlots = GetContainerNumSlots
local GetItemInfo = GetItemInfo local GetItemInfo = GetItemInfo
local GetItemQualityColor = GetItemQualityColor local GetItemQualityColor = GetItemQualityColor
local GetKeyRingSize = GetKeyRingSize
local GetMoney = GetMoney local GetMoney = GetMoney
local GetNumBankSlots = GetNumBankSlots local GetNumBankSlots = GetNumBankSlots
local GetKeyRingSize = GetKeyRingSize
local GetScreenWidth, GetScreenHeight = GetScreenWidth, GetScreenHeight
local IsBagOpen, IsOptionFrameOpen = IsBagOpen, IsOptionFrameOpen local IsBagOpen, IsOptionFrameOpen = IsBagOpen, IsOptionFrameOpen
local IsControlKeyDown = IsControlKeyDown local IsShiftKeyDown, IsControlKeyDown = IsShiftKeyDown, IsControlKeyDown
local PickupContainerItem = PickupContainerItem local PickupContainerItem = PickupContainerItem
local PickupMerchantItem = PickupMerchantItem
local PlaySound = PlaySound local PlaySound = PlaySound
local PutItemInBag = PutItemInBag
local SetItemButtonCount = SetItemButtonCount local SetItemButtonCount = SetItemButtonCount
local SetItemButtonDesaturated = SetItemButtonDesaturated local SetItemButtonDesaturated = SetItemButtonDesaturated
local SetItemButtonTexture = SetItemButtonTexture local SetItemButtonTexture = SetItemButtonTexture
local SetItemButtonTextureVertexColor = SetItemButtonTextureVertexColor local SetItemButtonTextureVertexColor = SetItemButtonTextureVertexColor
local ToggleFrame = ToggleFrame local ToggleFrame = ToggleFrame
local UseContainerItem = UseContainerItem local UseContainerItem = UseContainerItem
local BANK_CONTAINER = BANK_CONTAINER
local CONTAINER_OFFSET_X, CONTAINER_OFFSET_Y = CONTAINER_OFFSET_X, CONTAINER_OFFSET_Y local CONTAINER_OFFSET_X, CONTAINER_OFFSET_Y = CONTAINER_OFFSET_X, CONTAINER_OFFSET_Y
local CONTAINER_SCALE = CONTAINER_SCALE local CONTAINER_SCALE = CONTAINER_SCALE
local CONTAINER_SPACING, VISIBLE_CONTAINER_SPACING = CONTAINER_SPACING, VISIBLE_CONTAINER_SPACING local CONTAINER_SPACING, VISIBLE_CONTAINER_SPACING = CONTAINER_SPACING, VISIBLE_CONTAINER_SPACING
local CONTAINER_WIDTH = CONTAINER_WIDTH local CONTAINER_WIDTH = CONTAINER_WIDTH
local BANK_CONTAINER = BANK_CONTAINER
local KEYRING_CONTAINER = KEYRING_CONTAINER local KEYRING_CONTAINER = KEYRING_CONTAINER
local MAX_CONTAINER_ITEMS = MAX_CONTAINER_ITEMS local MAX_CONTAINER_ITEMS = MAX_CONTAINER_ITEMS
local NUM_BAG_FRAMES = NUM_BAG_FRAMES local NUM_BAG_FRAMES = NUM_BAG_FRAMES
local NUM_BANKGENERIC_SLOTS = NUM_BANKGENERIC_SLOTS
local NUM_CONTAINER_FRAMES = NUM_CONTAINER_FRAMES local NUM_CONTAINER_FRAMES = NUM_CONTAINER_FRAMES
local BINDING_NAME_TOGGLEKEYRING = BINDING_NAME_TOGGLEKEYRING local BINDING_NAME_TOGGLEKEYRING = BINDING_NAME_TOGGLEKEYRING
local SEARCH = SEARCH local SEARCH = SEARCH
local TooltipModule, SkinModule
local SEARCH_STRING = "" local SEARCH_STRING = ""
B.ProfessionColors = {
[1] = {225/255, 175/255, 105/255}, -- Quiver
[2] = {225/255, 175/255, 105/255}, -- Ammo Pouch
[4] = {225/255, 175/255, 105/255}, -- Soul Bag
[8] = {18/255, 181/255, 32/255}, -- Herbalism
[16] = {160/255, 3/255, 168/255}, -- Enchanting
}
function B:GetContainerFrame(arg) function B:GetContainerFrame(arg)
if type(arg) == "boolean" and arg == true then if type(arg) == "boolean" and (arg == true) then
return self.BankFrame return self.BankFrame
elseif type(arg) == "number" then elseif type(arg) == "number" then
if self.BankFrame then if self.BankFrame then
@@ -110,21 +104,19 @@ function B:SearchReset()
end end
function B:IsSearching() function B:IsSearching()
if SEARCH_STRING ~= "" and SEARCH_STRING ~= SEARCH then return (SEARCH_STRING ~= "" and SEARCH_STRING ~= SEARCH)
return true
end
return false
end end
function B:UpdateSearch() function B:UpdateSearch()
if this.Instructions then this.Instructions:SetShown(this:GetText() == "") end if this.Instructions then this.Instructions:SetShown(this:GetText() == "") end
local MIN_REPEAT_CHARACTERS = 3 local MIN_REPEAT_CHARACTERS = 3
local searchString = this:GetText() local searchString = this:GetText()
local prevSearchString = SEARCH_STRING local prevSearchString = SEARCH_STRING
if len(searchString) > MIN_REPEAT_CHARACTERS then if len(searchString) > MIN_REPEAT_CHARACTERS then
local repeatChar = true local repeatChar = true
for i = 1, MIN_REPEAT_CHARACTERS, 1 do for i = 1, MIN_REPEAT_CHARACTERS, 1 do
if sub(searchString,(0-i), (0-i)) ~= sub(searchString,(-1-i),(-1-i)) then if sub(searchString,(0 - i), (0 - i)) ~= sub(searchString,(-1 - i),(-1 - i)) then
repeatChar = false repeatChar = false
break break
end end
@@ -193,7 +185,7 @@ function B:SetSearch(query)
button:SetAlpha(1) button:SetAlpha(1)
else else
SetItemButtonDesaturated(button, 1) SetItemButtonDesaturated(button, 1)
button:SetAlpha(0.4) button:SetAlpha(0.5)
end end
end end
end end
@@ -201,6 +193,7 @@ end
function B:UpdateItemLevelDisplay() function B:UpdateItemLevelDisplay()
if E.private.bags.enable ~= true then return end if E.private.bags.enable ~= true then return end
for _, bagFrame in pairs(self.BagFrames) do for _, bagFrame in pairs(self.BagFrames) do
for _, bagID in ipairs(bagFrame.BagIDs) do for _, bagID in ipairs(bagFrame.BagIDs) do
for slotID = 1, GetContainerNumSlots(bagID) do for slotID = 1, GetContainerNumSlots(bagID) do
@@ -231,6 +224,7 @@ function B:UpdateCountDisplay()
end end
end end
end end
if bagFrame.UpdateAllSlots then if bagFrame.UpdateAllSlots then
bagFrame:UpdateAllSlots() bagFrame:UpdateAllSlots()
end end
@@ -261,20 +255,23 @@ function B:UpdateSlot(bagID, slotID)
local slot = self.Bags[bagID][slotID] local slot = self.Bags[bagID][slotID]
local bagType = self.Bags[bagID].type local bagType = self.Bags[bagID].type
local texture, count, locked = GetContainerItemInfo(bagID, slotID) local texture, count, locked, _, readable = GetContainerItemInfo(bagID, slotID)
local clink = GetContainerItemLink(bagID, slotID) local clink = GetContainerItemLink(bagID, slotID)
local itemPrice = LIP:GetSellValue(clink)
slot.name, slot.rarity = nil, nil slot.name, slot.rarity = nil, nil
slot:Show() slot:Show()
slot.QuestIcon:Hide()
slot.JunkIcon:Hide()
slot.itemLevel:SetText("") slot.itemLevel:SetText("")
if B.ProfessionColors[bagType] then if B.ProfessionColors[bagType] then
slot:SetBackdropBorderColor(unpack(B.ProfessionColors[bagType])) slot:SetBackdropBorderColor(unpack(B.ProfessionColors[bagType]))
slot.ignoreBorderColors = true slot.ignoreBorderColors = true
elseif clink then elseif clink then
local _, iLvl, itemEquipLoc local iLink, iLvl, iType, itemEquipLoc
slot.name, _, slot.rarity, iLvl, _, _, _, itemEquipLoc = GetItemInfo(match(clink, "item:(%d+)")) slot.name, iLink, slot.rarity, iLvl, _, iType, _, _, itemEquipLoc = GetItemInfo(match(clink, "item:(%d+)"))
local r, g, b local r, g, b
@@ -294,8 +291,22 @@ function B:UpdateSlot(bagID, slotID)
end end
end end
if slot.JunkIcon then
if (slot.rarity and slot.rarity == 0) and (itemPrice and itemPrice > 0) and (iType and iType ~= "Quest") and E.db.bags.junkIcon then
slot.JunkIcon:Show()
end
end
-- color slot according to item quality -- color slot according to item quality
if slot.rarity and slot.rarity > 1 then if (iType and iType == "Quest") and not GetInvalidQuestItemInfo(iLink) then
if GetQuestItemStarterInfo(iLink) then
slot.QuestIcon:Show()
slot:SetBackdropBorderColor(unpack(B.QuestColors.questStarter))
else
slot:SetBackdropBorderColor(unpack(B.QuestColors.questItem))
end
slot.ignoreBorderColors = true
elseif slot.rarity and slot.rarity > 1 then
slot:SetBackdropBorderColor(r, g, b) slot:SetBackdropBorderColor(r, g, b)
slot.ignoreBorderColors = true slot.ignoreBorderColors = true
else else
@@ -311,6 +322,11 @@ function B:UpdateSlot(bagID, slotID)
if bagID ~= BANK_CONTAINER then if bagID ~= BANK_CONTAINER then
local start, duration, enable = GetContainerItemCooldown(bagID, slotID) local start, duration, enable = GetContainerItemCooldown(bagID, slotID)
CooldownFrame_SetTimer(slot.cooldown, start, duration, enable) CooldownFrame_SetTimer(slot.cooldown, start, duration, enable)
if duration > 0 and enable == 0 then
SetItemButtonTextureVertexColor(slot, 0.4, 0.4, 0.4)
else
SetItemButtonTextureVertexColor(slot, 1, 1, 1)
end
end end
slot.hasItem = 1 slot.hasItem = 1
else else
@@ -320,6 +336,8 @@ function B:UpdateSlot(bagID, slotID)
slot.hasItem = nil slot.hasItem = nil
end end
slot.readable = readable
SetItemButtonTexture(slot, texture) SetItemButtonTexture(slot, texture)
SetItemButtonCount(slot, count) SetItemButtonCount(slot, count)
SetItemButtonDesaturated(slot, locked) SetItemButtonDesaturated(slot, locked)
@@ -345,7 +363,8 @@ end
function B:SortingFadeBags(bagFrame) function B:SortingFadeBags(bagFrame)
if not (bagFrame and bagFrame.BagIDs) then return end if not (bagFrame and bagFrame.BagIDs) then return end
for _, bagID in ipairs(bagFrame.BagIDs) do
for _, bagID in ipairs(bagFrame.BagIDs) do
for slotID = 1, GetContainerNumSlots(bagID) do for slotID = 1, GetContainerNumSlots(bagID) do
local button = bagFrame.Bags[bagID][slotID] local button = bagFrame.Bags[bagID][slotID]
SetItemButtonDesaturated(button, 1) SetItemButtonDesaturated(button, 1)
@@ -360,11 +379,6 @@ function B:UpdateCooldowns()
for slotID = 1, GetContainerNumSlots(bagID) do for slotID = 1, GetContainerNumSlots(bagID) do
local start, duration, enable = GetContainerItemCooldown(bagID, slotID) local start, duration, enable = GetContainerItemCooldown(bagID, slotID)
CooldownFrame_SetTimer(self.Bags[bagID][slotID].cooldown, start, duration, enable) CooldownFrame_SetTimer(self.Bags[bagID][slotID].cooldown, start, duration, enable)
if duration > 0 and enable == 0 then
SetItemButtonTextureVertexColor(self.Bags[bagID][slotID], 0.4, 0.4, 0.4)
else
SetItemButtonTextureVertexColor(self.Bags[bagID][slotID], 1, 1, 1)
end
end end
end end
end end
@@ -444,7 +458,7 @@ function B:Layout(isBank)
end end
--Bag Containers --Bag Containers
if (not isBank and bagID <= 3 ) or (isBank and bagID ~= -1 and numContainerSlots >= 1 and not (i - 1 > numContainerSlots)) then if (not isBank and bagID <= 3) or (isBank and bagID ~= -1 and numContainerSlots >= 1 and not (i - 1 > numContainerSlots)) then
if not f.ContainerHolder[i] then if not f.ContainerHolder[i] then
if isBank then if isBank then
f.ContainerHolder[i] = CreateFrame("CheckButton", "ElvUIBankBag"..bagID - 4, f.ContainerHolder, "BankItemButtonBagTemplate") f.ContainerHolder[i] = CreateFrame("CheckButton", "ElvUIBankBag"..bagID - 4, f.ContainerHolder, "BankItemButtonBagTemplate")
@@ -464,7 +478,7 @@ function B:Layout(isBank)
f.ContainerHolder[i].backdrop:SetAllPoints() f.ContainerHolder[i].backdrop:SetAllPoints()
E:StyleButton(f.ContainerHolder[i]) E:StyleButton(f.ContainerHolder[i])
f.ContainerHolder[i]:SetNormalTexture("") f.ContainerHolder[i]:SetNormalTexture("")
f.ContainerHolder[i]:SetCheckedTexture("") f.ContainerHolder[i]:SetCheckedTexture(nil)
f.ContainerHolder[i]:SetPushedTexture("") f.ContainerHolder[i]:SetPushedTexture("")
f.ContainerHolder[i].id = isBank and bagID or bagID + 1 f.ContainerHolder[i].id = isBank and bagID or bagID + 1
@@ -515,9 +529,9 @@ function B:Layout(isBank)
f.Bags[bagID].type = GetItemFamily(GetInventoryItemLink("player", ContainerIDToInventoryID(bagID)), true) f.Bags[bagID].type = GetItemFamily(GetInventoryItemLink("player", ContainerIDToInventoryID(bagID)), true)
--Hide unused slots --Hide unused slots
for i = 1, MAX_CONTAINER_ITEMS do for y = 1, MAX_CONTAINER_ITEMS do
if f.Bags[bagID][i] then if f.Bags[bagID][y] then
f.Bags[bagID][i]:Hide() f.Bags[bagID][y]:Hide()
end end
end end
@@ -528,20 +542,38 @@ function B:Layout(isBank)
E:StyleButton(f.Bags[bagID][slotID]) E:StyleButton(f.Bags[bagID][slotID])
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(nil)
f.Bags[bagID][slotID].Count = _G[f.Bags[bagID][slotID]:GetName().."Count"] f.Bags[bagID][slotID].Count = _G[f.Bags[bagID][slotID]:GetName().."Count"]
f.Bags[bagID][slotID].Count:ClearAllPoints() f.Bags[bagID][slotID].Count:ClearAllPoints()
E:Point(f.Bags[bagID][slotID].Count, "BOTTOMRIGHT", 0, 2) E:Point(f.Bags[bagID][slotID].Count, "BOTTOMRIGHT", 0, 3)
E:FontTemplate(f.Bags[bagID][slotID].Count, E.LSM:Fetch("font", E.db.bags.countFont), E.db.bags.countFontSize, E.db.bags.countFontOutline) E:FontTemplate(f.Bags[bagID][slotID].Count, E.LSM:Fetch("font", E.db.bags.countFont), E.db.bags.countFontSize, E.db.bags.countFontOutline)
f.Bags[bagID][slotID].Count:SetTextColor(countColor.r, countColor.g, countColor.b) f.Bags[bagID][slotID].Count:SetTextColor(countColor.r, countColor.g, countColor.b)
if not f.Bags[bagID][slotID].QuestIcon then
local QuestIcon = f.Bags[bagID][slotID]:CreateTexture(nil, "OVERLAY")
QuestIcon:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\bagQuestIcon")
QuestIcon:SetTexCoord(0, 1, 0, 1)
E:SetInside(QuestIcon)
QuestIcon:Hide()
f.Bags[bagID][slotID].QuestIcon = QuestIcon
end
if not f.Bags[bagID][slotID].JunkIcon then
local JunkIcon = f.Bags[bagID][slotID]:CreateTexture(nil, "OVERLAY")
JunkIcon:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\bagJunkIcon")
E:Point(JunkIcon, "TOPLEFT", 1, 0)
JunkIcon:Hide()
f.Bags[bagID][slotID].JunkIcon = JunkIcon
end
f.Bags[bagID][slotID].iconTexture = _G[f.Bags[bagID][slotID]:GetName().."IconTexture"] f.Bags[bagID][slotID].iconTexture = _G[f.Bags[bagID][slotID]:GetName().."IconTexture"]
E:SetInside(f.Bags[bagID][slotID].iconTexture, f.Bags[bagID][slotID]) E:SetInside(f.Bags[bagID][slotID].iconTexture, f.Bags[bagID][slotID])
f.Bags[bagID][slotID].iconTexture:SetTexCoord(unpack(E.TexCoords)) f.Bags[bagID][slotID].iconTexture:SetTexCoord(unpack(E.TexCoords))
if bagID ~= BANK_CONTAINER then if bagID ~= BANK_CONTAINER then
f.Bags[bagID][slotID].cooldown = _G[f.Bags[bagID][slotID]:GetName().."Cooldown"] f.Bags[bagID][slotID].cooldown = _G[f.Bags[bagID][slotID]:GetName().."Cooldown"]
f.Bags[bagID][slotID].cooldown.CooldownOverride = "bags"
f.Bags[bagID][slotID].cooldown:SetModelScale(buttonSize / (37 / 0.75)) f.Bags[bagID][slotID].cooldown:SetModelScale(buttonSize / (37 / 0.75))
E:RegisterCooldown(f.Bags[bagID][slotID].cooldown) E:RegisterCooldown(f.Bags[bagID][slotID].cooldown)
f.Bags[bagID][slotID].bagID = bagID f.Bags[bagID][slotID].bagID = bagID
@@ -549,13 +581,17 @@ function B:Layout(isBank)
end end
f.Bags[bagID][slotID].itemLevel = f.Bags[bagID][slotID]:CreateFontString(nil, "OVERLAY") f.Bags[bagID][slotID].itemLevel = f.Bags[bagID][slotID]:CreateFontString(nil, "OVERLAY")
E:Point(f.Bags[bagID][slotID].itemLevel, "BOTTOMRIGHT", 0, 2) E:Point(f.Bags[bagID][slotID].itemLevel, "BOTTOMRIGHT", 0, 3)
E:FontTemplate(f.Bags[bagID][slotID].itemLevel, E.LSM:Fetch("font", E.db.bags.itemLevelFont), E.db.bags.itemLevelFontSize, E.db.bags.itemLevelFontOutline) E:FontTemplate(f.Bags[bagID][slotID].itemLevel, E.LSM:Fetch("font", E.db.bags.itemLevelFont), E.db.bags.itemLevelFontSize, E.db.bags.itemLevelFontOutline)
end end
f.Bags[bagID][slotID]:SetID(slotID) f.Bags[bagID][slotID]:SetID(slotID)
E:Size(f.Bags[bagID][slotID], buttonSize) E:Size(f.Bags[bagID][slotID], buttonSize)
if f.Bags[bagID][slotID].JunkIcon then
E:Size(f.Bags[bagID][slotID].JunkIcon, buttonSize/2)
end
f:UpdateSlot(bagID, slotID) f:UpdateSlot(bagID, slotID)
if f.Bags[bagID][slotID]:GetPoint() then if f.Bags[bagID][slotID]:GetPoint() then
@@ -594,9 +630,10 @@ function B:Layout(isBank)
numBagSlots = numBagSlots + 1 numBagSlots = numBagSlots + 1
end end
else else
for i = 1, MAX_CONTAINER_ITEMS do --Hide unused slots
if f.Bags[bagID] and f.Bags[bagID][i] then for y = 1, MAX_CONTAINER_ITEMS do
f.Bags[bagID][i]:Hide() if f.Bags[bagID] and f.Bags[bagID][y] then
f.Bags[bagID][y]:Hide()
end end
end end
@@ -633,6 +670,15 @@ function B:Layout(isBank)
f.keyFrame.slots[i].cooldown:SetModelScale(buttonSize / (37 / 0.75)) f.keyFrame.slots[i].cooldown:SetModelScale(buttonSize / (37 / 0.75))
E:RegisterCooldown(f.keyFrame.slots[i].cooldown) E:RegisterCooldown(f.keyFrame.slots[i].cooldown)
if not f.keyFrame.slots[i].QuestIcon then
local QuestIcon = f.keyFrame.slots[i]:CreateTexture(nil, "OVERLAY")
QuestIcon:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\bagQuestIcon")
QuestIcon:SetTexCoord(0, 1, 0, 1)
E:SetInside(QuestIcon)
QuestIcon:Hide()
f.keyFrame.slots[i].QuestIcon = QuestIcon
end
f.keyFrame.slots[i].iconTexture = _G[f.keyFrame.slots[i]:GetName().."IconTexture"] f.keyFrame.slots[i].iconTexture = _G[f.keyFrame.slots[i]:GetName().."IconTexture"]
E:SetInside(f.keyFrame.slots[i].iconTexture, f.keyFrame.slots[i]) E:SetInside(f.keyFrame.slots[i].iconTexture, f.keyFrame.slots[i])
f.keyFrame.slots[i].iconTexture:SetTexCoord(unpack(E.TexCoords)) f.keyFrame.slots[i].iconTexture:SetTexCoord(unpack(E.TexCoords))
@@ -677,16 +723,24 @@ function B:UpdateKeySlot(slotID)
slot:Show() slot:Show()
if clink then if clink then
local _ local _, r, g, b
slot.name, _, slot.rarity = GetItemInfo(match(clink, "item:(%d+)")) local iLink, iType
local r, g, b slot.name, iLink, slot.rarity, _, _, iType = GetItemInfo(match(clink, "item:(%d+)"))
if slot.rarity then if slot.rarity then
r, g, b = GetItemQualityColor(slot.rarity) r, g, b = GetItemQualityColor(slot.rarity)
end end
if slot.rarity and slot.rarity > 1 then if iType and iType == "Quest" then
if GetQuestItemStarterInfo(iLink) then
slot.QuestIcon:Show()
slot:SetBackdropBorderColor(unpack(B.QuestColors.questStarter))
else
slot:SetBackdropBorderColor(unpack(B.QuestColors.questItem))
end
slot.ignoreBorderColors = true
elseif slot.rarity and slot.rarity > 1 then
slot:SetBackdropBorderColor(r, g, b) slot:SetBackdropBorderColor(r, g, b)
slot.ignoreBorderColors = true slot.ignoreBorderColors = true
else else
@@ -712,7 +766,7 @@ function B:UpdateKeySlot(slotID)
SetItemButtonTexture(slot, texture) SetItemButtonTexture(slot, texture)
SetItemButtonCount(slot, count) SetItemButtonCount(slot, count)
SetItemButtonDesaturated(slot, locked, 0.5, 0.5, 0.5) SetItemButtonDesaturated(slot, locked)
end end
function B:UpdateAll() function B:UpdateAll()
@@ -771,15 +825,13 @@ function B:UpdateGoldText()
end end
function B:FormatMoney(amount) function B:FormatMoney(amount)
local coppername = "|cffeda55fc|r" local str, coppername, silvername, goldname = "", "|cffeda55fc|r", "|cffc7c7cfs|r", "|cffffd700g|r"
local silvername = "|cffc7c7cfs|r"
local goldname = "|cffffd700g|r"
local value = abs(amount) local value = abs(amount)
local gold = floor(value / 10000) local gold = floor(value / 10000)
local silver = floor(mod(value / 100, 100)) local silver = floor(mod(value / 100, 100))
local copper = floor(mod(value, 100)) local copper = floor(mod(value, 100))
local str = ""
if gold > 0 then if gold > 0 then
str = format("%d%s%s", gold, goldname, (silver > 0 or copper > 0) and " " or "") str = format("%d%s%s", gold, goldname, (silver > 0 or copper > 0) and " " or "")
end end
@@ -794,7 +846,7 @@ function B:FormatMoney(amount)
end end
function B:GetGraysValue() function B:GetGraysValue()
local value, itemLink, rarity, itemPrice, itype, stackCount, stackPrice, _ = 0 local value, itemLink, rarity, itype, itemPrice, stackCount, stackPrice, _ = 0
for bag = 0, NUM_BAG_FRAMES do for bag = 0, NUM_BAG_FRAMES do
for slot = 1, GetContainerNumSlots(bag) do for slot = 1, GetContainerNumSlots(bag) do
@@ -802,6 +854,7 @@ function B:GetGraysValue()
if itemLink then if itemLink then
_, _, rarity, _, _, itype = GetItemInfo(match(itemLink, "item:(%d+)")) _, _, rarity, _, _, itype = GetItemInfo(match(itemLink, "item:(%d+)"))
itemPrice = LIP:GetSellValue(itemLink) itemPrice = LIP:GetSellValue(itemLink)
if itemPrice then if itemPrice then
stackCount = select(2, GetContainerItemInfo(bag, slot)) or 1 stackCount = select(2, GetContainerItemInfo(bag, slot)) or 1
stackPrice = itemPrice * stackCount stackPrice = itemPrice * stackCount
@@ -840,17 +893,20 @@ function B:VendorGrays(delete)
if not B.SellFrame.Info.itemList then return end if not B.SellFrame.Info.itemList then return end
if tmaxn(B.SellFrame.Info.itemList) < 1 then return end if tmaxn(B.SellFrame.Info.itemList) < 1 then return end
--Resetting stuff
--Resetting stuff
B.SellFrame.Info.delete = delete or false B.SellFrame.Info.delete = delete or false
B.SellFrame.Info.ProgressTimer = 0 B.SellFrame.Info.ProgressTimer = 0
B.SellFrame.Info.SellInterval = E.db.bags.vendorGrays.interval B.SellFrame.Info.SellInterval = E.db.bags.vendorGrays.interval
B.SellFrame.Info.ProgressMax = tmaxn(B.SellFrame.Info.itemList) B.SellFrame.Info.ProgressMax = tmaxn(B.SellFrame.Info.itemList)
B.SellFrame.Info.goldGained = 0 B.SellFrame.Info.goldGained = 0
B.SellFrame.Info.itemsSold = 0 B.SellFrame.Info.itemsSold = 0
B.SellFrame.statusbar:SetValue(0)
B.SellFrame.statusbar:SetValue(0)
B.SellFrame.statusbar:SetMinMaxValues(0, B.SellFrame.Info.ProgressMax) B.SellFrame.statusbar:SetMinMaxValues(0, B.SellFrame.Info.ProgressMax)
B.SellFrame.statusbar.ValueText:SetText("0 / "..B.SellFrame.Info.ProgressMax) B.SellFrame.statusbar.ValueText:SetText("0 / "..B.SellFrame.Info.ProgressMax)
--Time to sell
--Time to sell
B.SellFrame:Show() B.SellFrame:Show()
end end
@@ -859,7 +915,7 @@ function B:VendorGrayCheck()
if value == 0 then if value == 0 then
E:Print(L["No gray items to delete."]) E:Print(L["No gray items to delete."])
elseif (not MerchantFrame or not MerchantFrame:IsShown()) then elseif not MerchantFrame or not MerchantFrame:IsShown() then
E.PopupDialogs["DELETE_GRAYS"].Money = value E.PopupDialogs["DELETE_GRAYS"].Money = value
E:StaticPopup_Show("DELETE_GRAYS") E:StaticPopup_Show("DELETE_GRAYS")
else else
@@ -868,7 +924,9 @@ function B:VendorGrayCheck()
end end
function B:ContructContainerFrame(name, isBank) function B:ContructContainerFrame(name, isBank)
local strata = E.db.bags.strata or "HIGH" if not SkinModule then SkinModule = E:GetModule("Skins") end
local strata = E.db.bags.strata or "MEDIUM"
local f = CreateFrame("Button", name, E.UIParent) local f = CreateFrame("Button", name, E.UIParent)
E:SetTemplate(f, "Transparent") E:SetTemplate(f, "Transparent")
@@ -889,12 +947,12 @@ function B:ContructContainerFrame(name, isBank)
f:Hide() f:Hide()
f.isBank = isBank f.isBank = isBank
f.bottomOffset = isBank and 8 or 28 f.bottomOffset = 8
f.topOffset = isBank and 45 or 50 f.topOffset = isBank and 45 or 50
f.BagIDs = isBank and {-1, 5, 6, 7, 8, 9, 10, 11} or {0, 1, 2, 3, 4} f.BagIDs = isBank and {-1, 5, 6, 7, 8, 9, 10, 11} or {0, 1, 2, 3, 4}
f.Bags = {} f.Bags = {}
local mover = (isBank and ElvUIBankMover or ElvUIBagMover) local mover = (isBank and ElvUIBankMover) or ElvUIBagMover
if mover then if mover then
E:Point(f, mover.POINT, mover) E:Point(f, mover.POINT, mover)
f.mover = mover f.mover = mover
@@ -907,20 +965,19 @@ function B:ContructContainerFrame(name, isBank)
f:SetScript("OnDragStart", function() if IsShiftKeyDown() then this:StartMoving() end end) f:SetScript("OnDragStart", function() if IsShiftKeyDown() then this:StartMoving() end end)
f:SetScript("OnDragStop", function() this:StopMovingOrSizing() end) f:SetScript("OnDragStop", function() this:StopMovingOrSizing() end)
f:SetScript("OnClick", function() if IsControlKeyDown() then B.PostBagMove(this.mover) end end) f:SetScript("OnClick", function() if IsControlKeyDown() then B.PostBagMove(this.mover) end end)
f:SetScript("OnLeave", function() GameTooltip:Hide() end)
f:SetScript("OnEnter", function() f:SetScript("OnEnter", function()
GameTooltip:SetOwner(this, "ANCHOR_TOPLEFT", 0, 4) GameTooltip:SetOwner(this, "ANCHOR_TOPLEFT", 0, 4)
GameTooltip:ClearLines() GameTooltip:ClearLines()
GameTooltip:AddDoubleLine(L["Hold Shift + Drag:"], L["Temporary Move"], 1, 1, 1) GameTooltip:AddDoubleLine(L["Hold Shift + Drag:"], L["Temporary Move"], 1, 1, 1)
GameTooltip:AddDoubleLine(L["Hold Control + Right Click:"], L["Reset Position"], 1, 1, 1) GameTooltip:AddDoubleLine(L["Hold Control + Right Click:"], L["Reset Position"], 1, 1, 1)
GameTooltip:Show() GameTooltip:Show()
end) end)
f:SetScript("OnLeave", function() GameTooltip:Hide() end)
f.closeButton = CreateFrame("Button", name.."CloseButton", f, "UIPanelCloseButton") f.closeButton = CreateFrame("Button", name.."CloseButton", f, "UIPanelCloseButton")
E:Point(f.closeButton, "TOPRIGHT", 2, 2) E:Point(f.closeButton, "TOPRIGHT", 2, 2)
E:GetModule("Skins"):HandleCloseButton(f.closeButton) SkinModule:HandleCloseButton(f.closeButton)
f.holderFrame = CreateFrame("Frame", nil, f) f.holderFrame = CreateFrame("Frame", nil, f)
E:Point(f.holderFrame, "TOP", f, "TOP", 0, -f.topOffset) E:Point(f.holderFrame, "TOP", f, "TOP", 0, -f.topOffset)
@@ -931,7 +988,6 @@ function B:ContructContainerFrame(name, isBank)
E:SetTemplate(f.ContainerHolder, "Transparent") E:SetTemplate(f.ContainerHolder, "Transparent")
f.ContainerHolder:Hide() f.ContainerHolder:Hide()
if isBank then if isBank then
--Bag Text --Bag Text
f.bagText = f:CreateFontString(nil, "OVERLAY") f.bagText = f:CreateFontString(nil, "OVERLAY")
@@ -1206,9 +1262,7 @@ function B:ToggleBags(id)
end end
function B:ToggleBackpack() function B:ToggleBackpack()
if IsOptionFrameOpen() then if IsOptionFrameOpen() then return end
return
end
if IsBagOpen(0) then if IsBagOpen(0) then
self:OpenBags() self:OpenBags()
@@ -1218,9 +1272,7 @@ function B:ToggleBackpack()
end end
function B:OpenAllBags() function B:OpenAllBags()
if IsOptionFrameOpen() then if IsOptionFrameOpen() then return end
return
end
if self.BagFrame:IsShown() then if self.BagFrame:IsShown() then
self:CloseBags() self:CloseBags()
@@ -1251,7 +1303,8 @@ function B:OpenBags()
self.BagFrame:UpdateAllSlots() self.BagFrame:UpdateAllSlots()
PlaySound("igBackPackOpen") PlaySound("igBackPackOpen")
E:GetModule("Tooltip"):GameTooltip_SetDefaultAnchor(GameTooltip) if not TooltipModule then TooltipModule = E:GetModule("Tooltip") end
TooltipModule:GameTooltip_SetDefaultAnchor(GameTooltip)
end end
function B:CloseBags() function B:CloseBags()
@@ -1262,7 +1315,8 @@ function B:CloseBags()
self.BankFrame:Hide() self.BankFrame:Hide()
end end
E:GetModule("Tooltip"):GameTooltip_SetDefaultAnchor(GameTooltip) if not TooltipModule then TooltipModule = E:GetModule("Tooltip") end
TooltipModule:GameTooltip_SetDefaultAnchor(GameTooltip)
end end
function B:OpenBank() function B:OpenBank()
@@ -1314,6 +1368,7 @@ function B:updateContainerFrameAnchors()
freeScreenHeight = screenHeight - yOffset freeScreenHeight = screenHeight - yOffset
leftMostPoint = screenWidth - xOffset leftMostPoint = screenWidth - xOffset
column = 1 column = 1
local frameHeight local frameHeight
for _, frameName in ipairs(ContainerFrame1.bags) do for _, frameName in ipairs(ContainerFrame1.bags) do
frameHeight = _G[frameName]:GetHeight() frameHeight = _G[frameName]:GetHeight()
@@ -1354,21 +1409,21 @@ function B:updateContainerFrameAnchors()
if index == 1 then if index == 1 then
-- First bag -- First bag
frame:SetPoint("BOTTOMRIGHT", ElvUIBagMover, "BOTTOMRIGHT", E.Spacing, -E.Border) E:Point(frame, "BOTTOMRIGHT", ElvUIBagMover, "BOTTOMRIGHT", E.Spacing, -E.Border)
bagsPerColumn = bagsPerColumn + 1 bagsPerColumn = bagsPerColumn + 1
elseif freeScreenHeight < frame:GetHeight() then elseif freeScreenHeight < frame:GetHeight() then
-- Start a new column -- Start a new column
column = column + 1 column = column + 1
freeScreenHeight = screenHeight - yOffset freeScreenHeight = screenHeight - yOffset
if column > 1 then if column > 1 then
frame:SetPoint("BOTTOMRIGHT", ContainerFrame1.bags[(index - bagsPerColumn) - 1], "BOTTOMLEFT", -CONTAINER_SPACING, 0) E:Point(frame, "BOTTOMRIGHT", ContainerFrame1.bags[(index - bagsPerColumn) - 1], "BOTTOMLEFT", -CONTAINER_SPACING, 0)
else else
frame:SetPoint("BOTTOMRIGHT", ContainerFrame1.bags[index - bagsPerColumn], "BOTTOMLEFT", -CONTAINER_SPACING, 0) E:Point(frame, "BOTTOMRIGHT", ContainerFrame1.bags[index - bagsPerColumn], "BOTTOMLEFT", -CONTAINER_SPACING, 0)
end end
bagsPerColumn = 0 bagsPerColumn = 0
else else
-- Anchor to the previous bag -- Anchor to the previous bag
frame:SetPoint("BOTTOMRIGHT", ContainerFrame1.bags[index - 1], "TOPRIGHT", 0, CONTAINER_SPACING) E:Point(frame, "BOTTOMRIGHT", ContainerFrame1.bags[index - 1], "TOPRIGHT", 0, CONTAINER_SPACING)
bagsPerColumn = bagsPerColumn + 1 bagsPerColumn = bagsPerColumn + 1
end end
@@ -1381,10 +1436,8 @@ function B:PostBagMove()
-- self refers to the mover (bag or bank) -- self refers to the mover (bag or bank)
local x, y = self:GetCenter() local x, y = self:GetCenter()
local screenHeight = UIParent:GetTop() local screenHeight = E.UIParent:GetTop()
local screenWidth = UIParent:GetRight() local screenWidth = E.UIParent:GetRight()
if not x then return end
if y > (screenHeight / 2) then if y > (screenHeight / 2) then
self:SetText(self.textGrowDown) self:SetText(self.textGrowDown)
@@ -1409,7 +1462,8 @@ end
function B:MERCHANT_CLOSED() function B:MERCHANT_CLOSED()
B.SellFrame:Hide() B.SellFrame:Hide()
twipe(B.SellFrame.Info.itemList)
twipe(B.SellFrame.Info.itemList)
B.SellFrame.Info.delete = false B.SellFrame.Info.delete = false
B.SellFrame.Info.ProgressTimer = 0 B.SellFrame.Info.ProgressTimer = 0
B.SellFrame.Info.SellInterval = E.db.bags.vendorGrays.interval B.SellFrame.Info.SellInterval = E.db.bags.vendorGrays.interval
@@ -1417,7 +1471,8 @@ function B:MERCHANT_CLOSED()
B.SellFrame.Info.goldGained = 0 B.SellFrame.Info.goldGained = 0
B.SellFrame.Info.itemsSold = 0 B.SellFrame.Info.itemsSold = 0
end end
function B:ProgressQuickVendor()
function B:ProgressQuickVendor()
local item = B.SellFrame.Info.itemList[1] local item = B.SellFrame.Info.itemList[1]
if not item then return nil, true end --No more to sell if not item then return nil, true end --No more to sell
local bag, slot, itemPrice, itemLink = unpack(item) local bag, slot, itemPrice, itemLink = unpack(item)
@@ -1434,14 +1489,18 @@ end
end end
UseContainerItem(bag, slot) UseContainerItem(bag, slot)
end end
tremove(B.SellFrame.Info.itemList, 1)
return stackPrice tremove(B.SellFrame.Info.itemList, 1)
return stackPrice
end end
function B:VendorGreys_OnUpdate()
function B:VendorGreys_OnUpdate()
B.SellFrame.Info.ProgressTimer = B.SellFrame.Info.ProgressTimer - arg1 B.SellFrame.Info.ProgressTimer = B.SellFrame.Info.ProgressTimer - arg1
if B.SellFrame.Info.ProgressTimer > 0 then return end if B.SellFrame.Info.ProgressTimer > 0 then return end
B.SellFrame.Info.ProgressTimer = B.SellFrame.Info.SellInterval B.SellFrame.Info.ProgressTimer = B.SellFrame.Info.SellInterval
local goldGained, lastItem = B:ProgressQuickVendor()
local goldGained, lastItem = B:ProgressQuickVendor()
if goldGained then if goldGained then
B.SellFrame.Info.goldGained = B.SellFrame.Info.goldGained + goldGained B.SellFrame.Info.goldGained = B.SellFrame.Info.goldGained + goldGained
B.SellFrame.Info.itemsSold = B.SellFrame.Info.itemsSold + 1 B.SellFrame.Info.itemsSold = B.SellFrame.Info.itemsSold + 1
@@ -1455,21 +1514,27 @@ end
end end
end end
end end
function B:CreateSellFrame()
function B:CreateSellFrame()
B.SellFrame = CreateFrame("Frame", "ElvUIVendorGraysFrame", E.UIParent) B.SellFrame = CreateFrame("Frame", "ElvUIVendorGraysFrame", E.UIParent)
E:Size(B.SellFrame, 200,40) E:Size(B.SellFrame, 200,40)
E:Point(B.SellFrame, "CENTER", UIParent) E:Point(B.SellFrame, "CENTER", E.UIParent)
E:CreateBackdrop(B.SellFrame, "Transparent") E:CreateBackdrop(B.SellFrame, "Transparent")
B.SellFrame.title = B.SellFrame:CreateFontString(nil, "OVERLAY") B.SellFrame:SetAlpha(E.db.bags.vendorGrays.progressBar and 1 or 0)
B.SellFrame.title = B.SellFrame:CreateFontString(nil, "OVERLAY")
E:FontTemplate(B.SellFrame.title, nil, 12, "OUTLINE") E:FontTemplate(B.SellFrame.title, nil, 12, "OUTLINE")
E:Point(B.SellFrame.title, "TOP", B.SellFrame, "TOP", 0, -2) E:Point(B.SellFrame.title, "TOP", B.SellFrame, "TOP", 0, -2)
B.SellFrame.title:SetText(L["Vendoring Grays"]) B.SellFrame.title:SetText(L["Vendoring Grays"])
B.SellFrame.statusbar = CreateFrame("StatusBar", "ElvUIVendorGraysFrameStatusbar", B.SellFrame)
B.SellFrame.statusbar = CreateFrame("StatusBar", "ElvUIVendorGraysFrameStatusbar", B.SellFrame)
E:Size(B.SellFrame.statusbar, 180, 16) E:Size(B.SellFrame.statusbar, 180, 16)
E:Point(B.SellFrame.statusbar, "BOTTOM", B.SellFrame, "BOTTOM", 0, 4) E:Point(B.SellFrame.statusbar, "BOTTOM", B.SellFrame, "BOTTOM", 0, 4)
B.SellFrame.statusbar:SetStatusBarTexture(E["media"].normTex) B.SellFrame.statusbar:SetStatusBarTexture(E["media"].normTex)
B.SellFrame.statusbar:SetStatusBarColor(1, 0, 0)
E:CreateBackdrop(B.SellFrame.statusbar, "Transparent") E:CreateBackdrop(B.SellFrame.statusbar, "Transparent")
B.SellFrame.statusbar.ValueText = B.SellFrame.statusbar:CreateFontString(nil, "OVERLAY")
B.SellFrame.statusbar.ValueText = B.SellFrame.statusbar:CreateFontString(nil, "OVERLAY")
E:FontTemplate(B.SellFrame.statusbar.ValueText, nil, 12, "OUTLINE") E:FontTemplate(B.SellFrame.statusbar.ValueText, nil, 12, "OUTLINE")
E:Point(B.SellFrame.statusbar.ValueText, "CENTER", B.SellFrame.statusbar) E:Point(B.SellFrame.statusbar.ValueText, "CENTER", B.SellFrame.statusbar)
B.SellFrame.statusbar.ValueText:SetText("0 / 0 ( 0s )") B.SellFrame.statusbar.ValueText:SetText("0 / 0 ( 0s )")
@@ -1483,8 +1548,17 @@ end
itemsSold = 0, itemsSold = 0,
itemList = {} itemList = {}
} }
B.SellFrame:SetScript("OnUpdate", B.VendorGreys_OnUpdate)
B.SellFrame:Hide() B.SellFrame:SetScript("OnUpdate", B.VendorGreys_OnUpdate)
B.SellFrame:Hide()
end
function B:UpdateSellFrameSettings()
if not B.SellFrame or not B.SellFrame.Info then return end
B.SellFrame.Info.SellInterval = E.db.bags.vendorGrays.interval
B.SellFrame:SetAlpha(E.db.bags.vendorGrays.progressBar and 1 or 0)
end end
B.BagIndice = { B.BagIndice = {
@@ -1495,10 +1569,19 @@ B.BagIndice = {
enchanting = 16, enchanting = 16,
} }
B.QuestKeys = {
questStarter = "questStarter",
questItem = "questItem"
}
function B:UpdateBagColors(table, indice, r, g, b) function B:UpdateBagColors(table, indice, r, g, b)
self[table][B.BagIndice[indice]] = {r, g, b} self[table][B.BagIndice[indice]] = {r, g, b}
end end
function B:UpdateQuestColors(table, indice, r, g, b)
self[table][B.QuestKeys[indice]] = {r, g, b}
end
function B:Initialize() function B:Initialize()
self:LoadBagBar() self:LoadBagBar()
@@ -1511,14 +1594,15 @@ function B:Initialize()
--Creating vendor grays frame --Creating vendor grays frame
B:CreateSellFrame() B:CreateSellFrame()
self:RegisterEvent("MERCHANT_CLOSED") self:RegisterEvent("MERCHANT_CLOSED")
if not E.private.bags.enable then if not E.private.bags.enable then
--Set a different default anchor --Set a different default anchor
E:Point(BagFrameHolder, "BOTTOMRIGHT", RightChatPanel, "BOTTOMRIGHT", -(E.Border*2), 22 + E.Border*4 - E.Spacing*2) E:Point(BagFrameHolder, "BOTTOMRIGHT", RightChatPanel, "BOTTOMRIGHT", -(E.Border*2), 22 + E.Border*4 - E.Spacing*2)
E:CreateMover(BagFrameHolder, "ElvUIBagMover", L["Bag Mover"], nil, nil, B.PostBagMove) E:CreateMover(BagFrameHolder, "ElvUIBagMover", L["Bag Mover"], nil, nil, B.PostBagMove, nil, nil, "bags,general")
self:SecureHook("updateContainerFrameAnchors") self:SecureHook("updateContainerFrameAnchors")
return return
end end
@@ -1534,24 +1618,30 @@ function B:Initialize()
[16] = {self.db.colors.profession.enchanting.r, self.db.colors.profession.enchanting.g, self.db.colors.profession.enchanting.b}, [16] = {self.db.colors.profession.enchanting.r, self.db.colors.profession.enchanting.g, self.db.colors.profession.enchanting.b},
} }
self.QuestColors = {
["questStarter"] = {self.db.colors.items.questStarter.r, self.db.colors.items.questStarter.g, self.db.colors.items.questStarter.b},
["questItem"] = {self.db.colors.items.questItem.r, self.db.colors.items.questItem.g, self.db.colors.items.questItem.b}
}
--Bag Mover: Set default anchor point and create mover --Bag Mover: Set default anchor point and create mover
E:Point(BagFrameHolder, "BOTTOMRIGHT", RightChatPanel, "BOTTOMRIGHT", 0, 22 + E.Border*4 - E.Spacing*2) E:Point(BagFrameHolder, "BOTTOMRIGHT", RightChatPanel, "BOTTOMRIGHT", 0, 22 + E.Border*4 - E.Spacing*2)
E:CreateMover(BagFrameHolder, "ElvUIBagMover", L["Bag Mover (Grow Up)"], nil, nil, B.PostBagMove) E:CreateMover(BagFrameHolder, "ElvUIBagMover", L["Bag Mover (Grow Up)"], nil, nil, B.PostBagMove, nil, nil, "bags,general")
--Bank Mover --Bank Mover
local BankFrameHolder = CreateFrame("Frame", nil, E.UIParent) local BankFrameHolder = CreateFrame("Frame", nil, E.UIParent)
E:Size(BankFrameHolder, 200, 22) E:Width(BankFrameHolder, 200)
E:Height(BankFrameHolder, 22)
E:Point(BankFrameHolder, "BOTTOMLEFT", LeftChatPanel, "BOTTOMLEFT", 0, 22 + E.Border*4 - E.Spacing*2) E:Point(BankFrameHolder, "BOTTOMLEFT", LeftChatPanel, "BOTTOMLEFT", 0, 22 + E.Border*4 - E.Spacing*2)
BankFrameHolder:SetFrameLevel(BankFrameHolder:GetFrameLevel() + 400) BankFrameHolder:SetFrameLevel(BankFrameHolder:GetFrameLevel() + 400)
E:CreateMover(BankFrameHolder, "ElvUIBankMover", L["Bank Mover (Grow Up)"], nil, nil, B.PostBagMove) E:CreateMover(BankFrameHolder, "ElvUIBankMover", L["Bank Mover (Grow Up)"], nil, nil, B.PostBagMove, nil, nil, "bags,general")
--Set some variables on movers --Set some variables on movers
ElvUIBagMover.textGrowUp = L["Bag Mover (Grow Up)"] ElvUIBagMover.textGrowUp = L["Bag Mover (Grow Up)"]
ElvUIBagMover.textGrowDown = L["Bag Mover (Grow Down)"] ElvUIBagMover.textGrowDown = L["Bag Mover (Grow Down)"]
ElvUIBagMover.POINT = "BOTTOMRIGHT" ElvUIBagMover.POINT = "BOTTOM"
ElvUIBankMover.textGrowUp = L["Bank Mover (Grow Up)"] ElvUIBankMover.textGrowUp = L["Bank Mover (Grow Up)"]
ElvUIBankMover.textGrowDown = L["Bank Mover (Grow Down)"] ElvUIBankMover.textGrowDown = L["Bank Mover (Grow Down)"]
ElvUIBankMover.POINT = "BOTTOMLEFT" ElvUIBankMover.POINT = "BOTTOM"
--Create Bag Frame --Create Bag Frame
self.BagFrame = self:ContructContainerFrame("ElvUI_ContainerFrame") self.BagFrame = self:ContructContainerFrame("ElvUI_ContainerFrame")
@@ -1575,12 +1665,10 @@ function B:Initialize()
self:RegisterEvent("BANKFRAME_OPENED", "OpenBank") self:RegisterEvent("BANKFRAME_OPENED", "OpenBank")
self:RegisterEvent("BANKFRAME_CLOSED", "CloseBank") self:RegisterEvent("BANKFRAME_CLOSED", "CloseBank")
self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED") self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED")
StackSplitFrame:SetFrameStrata("DIALOG")
end end
local function InitializeCallback() local function InitializeCallback()
B:Initialize() B:Initialize()
end end
E:RegisterModule(B:GetName(), InitializeCallback) E:RegisterModule(B:GetName(), InitializeCallback)
+95 -89
View File
@@ -97,100 +97,106 @@ P["databars"] = {
}, },
} }
--Bags --Bags
P["bags"] = { P["bags"] = {
["sortInverted"] = true, ["sortInverted"] = true,
["bagSize"] = 34, ["bagSize"] = 34,
["bankSize"] = 34, ["bankSize"] = 34,
["bagWidth"] = 406, ["bagWidth"] = 406,
["bankWidth"] = 406, ["bankWidth"] = 406,
["moneyFormat"] = "SMART", ["moneyFormat"] = "SMART",
["moneyCoins"] = true, ["moneyCoins"] = true,
["ignoredItems"] = {}, ["junkIcon"] = false,
["itemLevel"] = true, ["ignoredItems"] = {},
["itemLevelThreshold"] = 1, ["itemLevel"] = true,
["itemLevelFont"] = "Homespun", ["itemLevelThreshold"] = 1,
["itemLevelFontSize"] = 10, ["itemLevelFont"] = "Homespun",
["itemLevelFontOutline"] = "MONOCHROMEOUTLINE", ["itemLevelFontSize"] = 10,
["itemLevelCustomColorEnable"] = false, ["itemLevelFontOutline"] = "MONOCHROMEOUTLINE",
["itemLevelCustomColor"] = {r = 1, g = 1, b = 1}, ["itemLevelCustomColorEnable"] = false,
["countFont"] = "Homespun", ["itemLevelCustomColor"] = {r = 1, g = 1, b = 1},
["countFontSize"] = 10, ["countFont"] = "Homespun",
["countFontOutline"] = "MONOCHROMEOUTLINE", ["countFontSize"] = 10,
["countFontColor"] = {r = 1, g = 1, b = 1}, ["countFontOutline"] = "MONOCHROMEOUTLINE",
["reverseSlots"] = false, ["countFontColor"] = {r = 1, g = 1, b = 1},
["clearSearchOnClose"] = false, ["reverseSlots"] = false,
["disableBagSort"] = false, ["clearSearchOnClose"] = false,
["disableBankSort"] = false, ["disableBagSort"] = false,
["strata"] = "DIALOG", ["disableBankSort"] = false,
["colors"] = { ["strata"] = "DIALOG",
["profession"] = { ["colors"] = {
["quiver"] = {r = 1, g = 0.56, b = 0.73}, ["profession"] = {
["ammoPouch"] = {r = 1, g = 0.56, b = 0.73}, ["quiver"] = {r = 1, g = 0.56, b = 0.73},
["soulBag"] = {r = 0.47, g = 0.26, b = 1}, ["ammoPouch"] = {r = 1, g = 0.56, b = 0.73},
["leatherworking"] = {r = 0.88, g = 0.73, b = 0.29}, ["soulBag"] = {r = 0.47, g = 0.26, b = 1},
["herbs"] = {r = 0.07, g = 0.71, b = 0.13}, ["leatherworking"] = {r = 0.88, g = 0.73, b = 0.29},
["enchanting"] = {r = 0.76, g = 0.02, b = 0.8}, ["herbs"] = {r = 0.07, g = 0.71, b = 0.13},
["engineering"] = {r = 0.91, g = 0.46, b = 0.18}, ["enchanting"] = {r = 0.76, g = 0.02, b = 0.8},
["gems"] = {r = 0.03, g = 0.71, b = 0.81}, ["engineering"] = {r = 0.91, g = 0.46, b = 0.18},
["gems"] = {r = 0.03, g = 0.71, b = 0.81},
["mining"] = {r = 0.54, g = 0.40, b = 0.04} ["mining"] = {r = 0.54, g = 0.40, b = 0.04}
},
["items"] = {
["questStarter"] = {r = 1, g = 1, b = 0},
["questItem"] = {r = 1, g = 0.30, b = 0.30}
} }
}, },
["vendorGrays"] = { ["vendorGrays"] = {
["enable"] = false, ["enable"] = false,
["interval"] = 0.2, ["interval"] = 0.2,
["details"] = false ["details"] = false,
}, ["progressBar"] = true
["split"] = { },
["bagSpacing"] = 5, ["split"] = {
["player"] = false, ["bagSpacing"] = 5,
["bank"] = false, ["player"] = false,
["bag1"] = false, ["bank"] = false,
["bag2"] = false, ["bag1"] = false,
["bag3"] = false, ["bag2"] = false,
["bag4"] = false, ["bag3"] = false,
["bag5"] = false, ["bag4"] = false,
["bag6"] = false, ["bag5"] = false,
["bag7"] = false, ["bag6"] = false,
["bag8"] = false, ["bag7"] = false,
["bag9"] = false, ["bag8"] = false,
["bag10"] = false, ["bag9"] = false,
["bag11"] = false, ["bag10"] = false,
}, ["bag11"] = false,
["cooldown"] = { },
["threshold"] = 4, ["cooldown"] = {
["override"] = false, ["threshold"] = 4,
["reverse"] = false, ["override"] = false,
["expiringColor"] = {r = 1, g = 0, b = 0}, ["reverse"] = false,
["secondsColor"] = {r = 1, g = 1, b = 1}, ["expiringColor"] = {r = 1, g = 0, b = 0},
["minutesColor"] = {r = 1, g = 1, b = 1}, ["secondsColor"] = {r = 1, g = 1, b = 1},
["hoursColor"] = {r = 1, g = 1, b = 1}, ["minutesColor"] = {r = 1, g = 1, b = 1},
["daysColor"] = {r = 1, g = 1, b = 1}, ["hoursColor"] = {r = 1, g = 1, b = 1},
["daysColor"] = {r = 1, g = 1, b = 1},
["checkSeconds"] = false, ["checkSeconds"] = false,
["hhmmColor"] = {r = 1, g = 1, b = 1}, ["hhmmColor"] = {r = 1, g = 1, b = 1},
["mmssColor"] = {r = 1, g = 1, b = 1}, ["mmssColor"] = {r = 1, g = 1, b = 1},
["hhmmThreshold"] = -1, ["hhmmThreshold"] = -1,
["mmssThreshold"] = -1, ["mmssThreshold"] = -1,
["fonts"] = { ["fonts"] = {
["enable"] = false, ["enable"] = false,
["font"] = "PT Sans Narrow", ["font"] = "PT Sans Narrow",
["fontOutline"] = "OUTLINE", ["fontOutline"] = "OUTLINE",
["fontSize"] = 18 ["fontSize"] = 18
} }
}, },
["bagBar"] = { ["bagBar"] = {
["growthDirection"] = "VERTICAL", ["growthDirection"] = "VERTICAL",
["sortDirection"] = "ASCENDING", ["sortDirection"] = "ASCENDING",
["size"] = 30, ["size"] = 30,
["spacing"] = 4, ["spacing"] = 4,
["backdropSpacing"] = 4, ["backdropSpacing"] = 4,
["showBackdrop"] = false, ["showBackdrop"] = false,
["mouseover"] = false, ["mouseover"] = false,
["visibility"] = "", ["visibility"] = "",
} }
} }
P["nameplates"] = { P["nameplates"] = {
["statusbar"] = "ElvUI Norm", ["statusbar"] = "ElvUI Norm",
+172 -92
View File
@@ -3,10 +3,13 @@ local B = E:GetModule("Bags");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local _G = _G
local gsub, match = string.gsub, string.match local gsub, match = string.gsub, string.match
local getn = table.getn local getn = table.getn
--WoW API / Variables --WoW API / Variables
local COLOR, GENERAL, NONE = COLOR, GENERAL, NONE local GameTooltip = _G["GameTooltip"]
local FONT_SIZE, NONE, COLOR = FONT_SIZE, NONE, COLOR
local GENERAL = GENERAL
E.Options.args.bags = { E.Options.args.bags = {
type = "group", type = "group",
@@ -26,7 +29,7 @@ E.Options.args.bags = {
name = L["Enable"], name = L["Enable"],
desc = L["Enable/Disable the all-in-one bag."], desc = L["Enable/Disable the all-in-one bag."],
get = function(info) return E.private.bags.enable end, get = function(info) return E.private.bags.enable end,
set = function(info, value) E.private.bags.enable = value; E:StaticPopup_Show("PRIVATE_RL") end set = function(info, value) E.private.bags.enable = value E:StaticPopup_Show("PRIVATE_RL") end
}, },
general = { general = {
order = 3, order = 3,
@@ -68,32 +71,39 @@ E.Options.args.bags = {
}, },
set = function(info, value) E.db.bags[ info[getn(info)] ] = value; B:UpdateGoldText() end set = function(info, value) E.db.bags[ info[getn(info)] ] = value; B:UpdateGoldText() end
}, },
clearSearchOnClose = { junkIcon = {
order = 4, order = 4,
type = "toggle", type = "toggle",
name = L["Show Junk Icon"],
desc = L["Display the junk icon on all grey items that can be vendored."],
set = function(info, value) E.db.bags[ info[getn(info)] ] = value B:UpdateAllBagSlots() end
},
clearSearchOnClose = {
order = 5,
type = "toggle",
name = L["Clear Search On Close"], name = L["Clear Search On Close"],
set = function(info, value) E.db.bags[ info[getn(info)] ] = value end set = function(info, value) E.db.bags[ info[getn(info)] ] = value end
}, },
reverseSlots = { reverseSlots = {
order = 5, order = 6,
type = "toggle", type = "toggle",
name = L["Reverse Bag Slots"], name = L["Reverse Bag Slots"],
set = function(info, value) E.db.bags[info[getn(info)]] = value B:UpdateAll() end, set = function(info, value) E.db.bags[info[getn(info)]] = value B:UpdateAll() end,
}, },
disableBagSort = { disableBagSort = {
order = 6,
type = "toggle",
name = L["Disable Bag Sort"],
set = function(info, value) E.db.bags[ info[getn(info)] ] = value; B:ToggleSortButtonState(false) end
},
disableBankSort = {
order = 7, order = 7,
type = "toggle", type = "toggle",
name = L["Disable Bag Sort"],
set = function(info, value) E.db.bags[ info[getn(info)] ] = value B:ToggleSortButtonState(false) end
},
disableBankSort = {
order = 8,
type = "toggle",
name = L["Disable Bank Sort"], name = L["Disable Bank Sort"],
set = function(info, value) E.db.bags[ info[getn(info)] ] = value; B:ToggleSortButtonState(true) end set = function(info, value) E.db.bags[ info[getn(info)] ] = value B:ToggleSortButtonState(true) end
}, },
countGroup = { countGroup = {
order = 8, order = 9,
type = "group", type = "group",
name = L["Item Count Font"], name = L["Item Count Font"],
guiInline = true, guiInline = true,
@@ -104,20 +114,20 @@ E.Options.args.bags = {
dialogControl = "LSM30_Font", dialogControl = "LSM30_Font",
name = L["Font"], name = L["Font"],
values = AceGUIWidgetLSMlists.font, values = AceGUIWidgetLSMlists.font,
set = function(info, value) E.db.bags.countFont = value; B:UpdateCountDisplay() end set = function(info, value) E.db.bags.countFont = value B:UpdateCountDisplay() end
}, },
countFontSize = { countFontSize = {
order = 2, order = 2,
type = "range", type = "range",
name = FONT_SIZE, name = FONT_SIZE,
min = 4, max = 22, step = 1, min = 4, max = 22, step = 1,
set = function(info, value) E.db.bags.countFontSize = value; B:UpdateCountDisplay() end set = function(info, value) E.db.bags.countFontSize = value B:UpdateCountDisplay() end
}, },
countFontOutline = { countFontOutline = {
order = 3, order = 3,
type = "select", type = "select",
name = L["Font Outline"], name = L["Font Outline"],
set = function(info, value) E.db.bags.countFontOutline = value; B:UpdateCountDisplay() end, set = function(info, value) E.db.bags.countFontOutline = value B:UpdateCountDisplay() end,
values = { values = {
["NONE"] = NONE, ["NONE"] = NONE,
["OUTLINE"] = "OUTLINE", ["OUTLINE"] = "OUTLINE",
@@ -143,7 +153,7 @@ E.Options.args.bags = {
} }
}, },
itemLevelGroup = { itemLevelGroup = {
order = 7, order = 10,
type = "group", type = "group",
name = L["Item Level"], name = L["Item Level"],
guiInline = true, guiInline = true,
@@ -153,7 +163,7 @@ E.Options.args.bags = {
type = "toggle", type = "toggle",
name = L["Display Item Level"], name = L["Display Item Level"],
desc = L["Displays item level on equippable items."], desc = L["Displays item level on equippable items."],
set = function(info, value) E.db.bags.itemLevel = value; B:UpdateItemLevelDisplay() end set = function(info, value) E.db.bags.itemLevel = value B:UpdateItemLevelDisplay() end
}, },
itemLevelCustomColorEnable = { itemLevelCustomColorEnable = {
order = 2, order = 2,
@@ -179,17 +189,17 @@ E.Options.args.bags = {
}, },
itemLevelThreshold = { itemLevelThreshold = {
order = 4, order = 4,
type = "range",
name = L["Item Level Threshold"], name = L["Item Level Threshold"],
desc = L["The minimum item level required for it to be shown."], desc = L["The minimum item level required for it to be shown."],
type = "range", min = 1, max = 175, step = 1,
min = 1, max = 1000, step = 1,
disabled = function() return not E.db.bags.itemLevel end, disabled = function() return not E.db.bags.itemLevel end,
set = function(info, value) E.db.bags.itemLevelThreshold = value; B:UpdateItemLevelDisplay() end set = function(info, value) E.db.bags.itemLevelThreshold = value B:UpdateItemLevelDisplay() end
}, },
spacer = { spacer = {
order = 5, order = 5,
type = "description", type = "description",
name = " " name = ""
}, },
itemLevelFont = { itemLevelFont = {
order = 6, order = 6,
@@ -198,7 +208,7 @@ E.Options.args.bags = {
name = L["Font"], name = L["Font"],
values = AceGUIWidgetLSMlists.font, values = AceGUIWidgetLSMlists.font,
disabled = function() return not E.db.bags.itemLevel end, disabled = function() return not E.db.bags.itemLevel end,
set = function(info, value) E.db.bags.itemLevelFont = value; B:UpdateItemLevelDisplay() end set = function(info, value) E.db.bags.itemLevelFont = value B:UpdateItemLevelDisplay() end
}, },
itemLevelFontSize = { itemLevelFontSize = {
order = 7, order = 7,
@@ -206,14 +216,14 @@ E.Options.args.bags = {
name = FONT_SIZE, name = FONT_SIZE,
min = 6, max = 33, step = 1, min = 6, max = 33, step = 1,
disabled = function() return not E.db.bags.itemLevel end, disabled = function() return not E.db.bags.itemLevel end,
set = function(info, value) E.db.bags.itemLevelFontSize = value; B:UpdateItemLevelDisplay() end set = function(info, value) E.db.bags.itemLevelFontSize = value B:UpdateItemLevelDisplay() end
}, },
itemLevelFontOutline = { itemLevelFontOutline = {
order = 8, order = 8,
type = "select", type = "select",
name = L["Font Outline"], name = L["Font Outline"],
disabled = function() return not E.db.bags.itemLevel end, disabled = function() return not E.db.bags.itemLevel end,
set = function(info, value) E.db.bags.itemLevelFontOutline = value; B:UpdateItemLevelDisplay() end, set = function(info, value) E.db.bags.itemLevelFontOutline = value B:UpdateItemLevelDisplay() end,
values = { values = {
["NONE"] = NONE, ["NONE"] = NONE,
["OUTLINE"] = "OUTLINE", ["OUTLINE"] = "OUTLINE",
@@ -242,28 +252,28 @@ E.Options.args.bags = {
name = L["Button Size (Bag)"], name = L["Button Size (Bag)"],
desc = L["The size of the individual buttons on the bag frame."], desc = L["The size of the individual buttons on the bag frame."],
min = 15, max = 45, step = 1, min = 15, max = 45, step = 1,
set = function(info, value) E.db.bags[ info[getn(info)] ] = value; B:Layout() end set = function(info, value) E.db.bags[ info[getn(info)] ] = value B:Layout() end
},
bankSize = {
order = 2,
type = "range",
name = L["Button Size (Bank)"],
desc = L["The size of the individual buttons on the bank frame."],
min = 15, max = 45, step = 1,
set = function(info, value) E.db.bags[ info[getn(info)] ] = value; B:Layout(true) end
},
spacer = {
order = 3,
type = "description",
name = " "
}, },
bagWidth = { bagWidth = {
order = 4, order = 2,
type = "range", type = "range",
name = L["Panel Width (Bags)"], name = L["Panel Width (Bags)"],
desc = L["Adjust the width of the bag frame."], desc = L["Adjust the width of the bag frame."],
min = 150, max = 1400, step = 1, min = 150, max = 1400, step = 1,
set = function(info, value) E.db.bags[ info[getn(info)] ] = value; B:Layout() end set = function(info, value) E.db.bags[ info[getn(info)] ] = value B:Layout() end
},
spacer = {
order = 3,
type = "description",
name = ""
},
bankSize = {
order = 4,
type = "range",
name = L["Button Size (Bank)"],
desc = L["The size of the individual buttons on the bank frame."],
min = 15, max = 45, step = 1,
set = function(info, value) E.db.bags[ info[getn(info)] ] = value B:Layout(true) end
}, },
bankWidth = { bankWidth = {
order = 5, order = 5,
@@ -271,7 +281,7 @@ E.Options.args.bags = {
name = L["Panel Width (Bank)"], name = L["Panel Width (Bank)"],
desc = L["Adjust the width of the bank frame."], desc = L["Adjust the width of the bank frame."],
min = 150, max = 1400, step = 1, min = 150, max = 1400, step = 1,
set = function(info, value) E.db.bags[ info[getn(info)] ] = value; B:Layout(true) end set = function(info, value) E.db.bags[ info[getn(info)] ] = value B:Layout(true) end
} }
} }
}, },
@@ -285,47 +295,86 @@ E.Options.args.bags = {
type = "header", type = "header",
name = COLOR name = COLOR
}, },
profession = { bags = {
order = 2, order = 2,
type = "group", type = "group",
name = L["Profession Bags"], name = L["Bags"],
guiInline = true,
args = {
profession = {
order = 1,
type = "group",
name = L["Profession Bags"],
guiInline = true,
get = function(info)
local t = E.db.bags.colors.profession[ info[getn(info)] ]
local d = P.bags.colors.profession[ info[getn(info)] ]
return t.r, t.g, t.b, t.a, d.r, d.g, d.b
end,
set = function(info, r, g, b)
local t = E.db.bags.colors.profession[ info[getn(info)] ]
t.r, t.g, t.b = r, g, b
if not E.bags then return end
B:UpdateBagColors("ProfessionColors", info[getn(info)], r, g, b)
B:UpdateAllBagSlots()
end,
args = {
quiver = {
order = 1,
type = "color",
name = L["Quiver"]
},
ammoPouch = {
order = 2,
type = "color",
name = L["Ammo Pouch"]
},
soulBag = {
order = 3,
type = "color",
name = L["Soul Bag"]
},
herbs = {
order = 4,
type = "color",
name = L["Herbalism"]
},
enchanting = {
order = 5,
type = "color",
name = L["Enchanting"]
}
}
}
}
},
items = {
order = 3,
type = "group",
name = ITEMS,
guiInline = true, guiInline = true,
get = function(info) get = function(info)
local t = E.db.bags.colors.profession[ info[getn(info)] ] local t = E.db.bags.colors.items[ info[getn(info)] ]
local d = P.bags.colors.profession[info[getn(info)]] local d = P.bags.colors.items[info[getn(info)]]
return t.r, t.g, t.b, t.a, d.r, d.g, d.b return t.r, t.g, t.b, t.a, d.r, d.g, d.b
end, end,
set = function(info, r, g, b) set = function(info, r, g, b)
local t = E.db.bags.colors.profession[ info[getn(info)] ] local t = E.db.bags.colors.items[ info[getn(info)] ]
t.r, t.g, t.b = r, g, b t.r, t.g, t.b = r, g, b
B:UpdateBagColors("ProfessionColors", info[getn(info)], r, g, b) if not E.bags then return end
B:UpdateQuestColors("QuestColors", info[getn(info)], r, g, b)
B:UpdateAllBagSlots() B:UpdateAllBagSlots()
end, end,
args = { args = {
quiver = { questStarter = {
order = 1, order = 1,
type = "color", type = "color",
name = L["Quiver"] name = L["Quest Starter"]
}, },
ammoPouch = { questItem = {
order = 2, order = 2,
type = "color", type = "color",
name = L["Ammo Pouch"] name = ITEM_BIND_QUEST
},
soulBag = {
order = 3,
type = "color",
name = L["Soul Bag"]
},
herbs = {
order = 4,
type = "color",
name = L["Herbalism"]
},
enchanting = {
order = 5,
type = "color",
name = L["Enchanting"]
} }
} }
} }
@@ -336,72 +385,95 @@ E.Options.args.bags = {
type = "group", type = "group",
name = L["Bag-Bar"], name = L["Bag-Bar"],
get = function(info) return E.db.bags.bagBar[ info[getn(info)] ] end, get = function(info) return E.db.bags.bagBar[ info[getn(info)] ] end,
set = function(info, value) E.db.bags.bagBar[ info[getn(info)] ] = value; B:SizeAndPositionBagBar() end, set = function(info, value) E.db.bags.bagBar[ info[getn(info)] ] = value B:SizeAndPositionBagBar() end,
args = { args = {
header = { header = {
order = 0, order = 1,
type = "header", type = "header",
name = L["Bag-Bar"] name = L["Bag-Bar"]
}, },
enable = { enable = {
order = 1, order = 2,
type = "toggle", type = "toggle",
name = L["Enable"], name = L["Enable"],
desc = L["Enable/Disable the Bag-Bar."], desc = L["Enable/Disable the Bag-Bar."],
get = function(info) return E.private.bags.bagBar end, get = function(info) return E.private.bags.bagBar end,
set = function(info, value) E.private.bags.bagBar = value; E:StaticPopup_Show("PRIVATE_RL") end set = function(info, value) E.private.bags.bagBar = value E:StaticPopup_Show("PRIVATE_RL") end
}, },
showBackdrop = { showBackdrop = {
order = 2, order = 3,
type = "toggle", type = "toggle",
name = L["Backdrop"] name = L["Backdrop"],
disabled = function() return not E.private.bags.bagBar end
}, },
mouseover = { mouseover = {
order = 3, order = 4,
type = "toggle",
name = L["Mouse Over"], name = L["Mouse Over"],
desc = L["The frame is not shown unless you mouse over the frame."], desc = L["The frame is not shown unless you mouse over the frame."],
type = "toggle" disabled = function() return not E.private.bags.bagBar end
}, },
size = { size = {
order = 4, order = 5,
type = "range", type = "range",
name = L["Button Size"], name = L["Button Size"],
desc = L["Set the size of your bag buttons."], desc = L["Set the size of your bag buttons."],
min = 24, max = 60, step = 1 min = 24, max = 60, step = 1,
disabled = function() return not E.private.bags.bagBar end
}, },
spacing = { spacing = {
order = 5, order = 6,
type = "range", type = "range",
name = L["Button Spacing"], name = L["Button Spacing"],
desc = L["The spacing between buttons."], desc = L["The spacing between buttons."],
min = 1, max = 10, step = 1 min = -1, max = 10, step = 1,
disabled = function() return not E.private.bags.bagBar end
}, },
backdropSpacing = { backdropSpacing = {
order = 6, order = 7,
type = "range", type = "range",
name = L["Backdrop Spacing"], name = L["Backdrop Spacing"],
desc = L["The spacing between the backdrop and the buttons."], desc = L["The spacing between the backdrop and the buttons."],
min = 0, max = 10, step = 1 min = 0, max = 10, step = 1,
disabled = function() return not E.private.bags.bagBar end
}, },
sortDirection = { sortDirection = {
order = 7, order = 8,
type = "select", type = "select",
name = L["Sort Direction"], name = L["Sort Direction"],
desc = L["The direction that the bag frames will grow from the anchor."], desc = L["The direction that the bag frames will grow from the anchor."],
values = { values = {
["ASCENDING"] = L["Ascending"], ["ASCENDING"] = L["Ascending"],
["DESCENDING"] = L["Descending"] ["DESCENDING"] = L["Descending"]
} },
disabled = function() return not E.private.bags.bagBar end
}, },
growthDirection = { growthDirection = {
order = 7, order = 9,
type = "select", type = "select",
name = L["Bar Direction"], name = L["Bar Direction"],
desc = L["The direction that the bag frames be (Horizontal or Vertical)."], desc = L["The direction that the bag frames be (Horizontal or Vertical)."],
values = { values = {
["VERTICAL"] = L["Vertical"], ["VERTICAL"] = L["Vertical"],
["HORIZONTAL"] = L["Horizontal"] ["HORIZONTAL"] = L["Horizontal"]
} },
disabled = function() return not E.private.bags.bagBar end
},
visibility = {
order = 10,
type = "input",
name = L["Visibility State"],
desc = L["This works like a macro, you can run different situations to get the actionbar to show/hide differently.\n Example: '[combat] show;hide'"],
width = "full",
multiline = true,
set = function(info, value)
if value and match(value, "[\n\r]") then
value = gsub(value, "[\n\r]","")
end
E.db.bags.bagBar["visibility"] = value
B:SizeAndPositionBagBar()
end,
disabled = function() return not E.private.bags.bagBar end
} }
} }
}, },
@@ -427,14 +499,14 @@ E.Options.args.bags = {
player = { player = {
order = 3, order = 3,
type = "toggle", type = "toggle",
set = function(info, value) E.db.bags.split[ info[getn(info)] ] = value B:Layout() end, name = L["Bag"],
name = L["Bag"] set = function(info, value) E.db.bags.split[ info[getn(info)] ] = value B:Layout() end
}, },
bank = { bank = {
order = 4, order = 4,
type = "toggle", type = "toggle",
set = function(info, value) E.db.bags.split[ info[getn(info)] ] = value B:Layout(true) end, name = L["Bank"],
name = L["Bank"] set = function(info, value) E.db.bags.split[ info[getn(info)] ] = value B:Layout(true) end
}, },
splitbags = { splitbags = {
order = 5, order = 5,
@@ -538,13 +610,21 @@ E.Options.args.bags = {
type = "range", type = "range",
name = L["Sell Interval"], name = L["Sell Interval"],
desc = L["Will attempt to sell another item in set interval after previous one was sold."], desc = L["Will attempt to sell another item in set interval after previous one was sold."],
min = 0.1, max = 1, step = 0.1 min = 0.1, max = 1, step = 0.1,
disabled = function() return not E.db.bags.vendorGrays.enable end
}, },
details = { details = {
order = 4, order = 4,
type = "toggle", type = "toggle",
name = L["Vendor Gray Detailed Report"], name = L["Vendor Gray Detailed Report"],
desc = L["Displays a detailed report of every item sold when enabled."] desc = L["Displays a detailed report of every item sold when enabled."],
disabled = function() return not E.db.bags.vendorGrays.enable end
},
progressBar = {
order = 5,
type = "toggle",
name = L["Progress Bar"],
disabled = function() return not E.db.bags.vendorGrays.enable end
} }
} }
}, },
@@ -607,7 +687,7 @@ E.Options.args.bags = {
desc = L["Add an item or search syntax to the ignored list. Items matching the search syntax will be ignored."], desc = L["Add an item or search syntax to the ignored list. Items matching the search syntax will be ignored."],
get = function(info) return "" end, get = function(info) return "" end,
set = function(info, value) set = function(info, value)
if (value == "" or gsub(value, "%s+", "") == "") then return end if value == "" or gsub(value, "%s+", "") == "" then return end
local itemID = match(value, "item:(%d+)") local itemID = match(value, "item:(%d+)")
E.global.bags.ignoredItems[(itemID or value)] = value E.global.bags.ignoredItems[(itemID or value)] = value
@@ -666,4 +746,4 @@ E.Options.args.bags = {
} }
} }
} }
} }