Compare commits
20 Commits
Author | SHA1 | Date |
---|---|---|
Robin Hüskes | 050f77bc1d | |
Robin Hüskes | 70ef3cfde1 | |
Robin Hüskes | 5a826dada9 | |
Robin Hüskes | d808ff9cd3 | |
Robin Hüskes | b711bb8fc4 | |
Robin Hüskes | ef759c0ed1 | |
Robin Hüskes | 42fdfd738f | |
Robin Hüskes | f42cfe02e2 | |
Robin Hüskes | f27faf0f04 | |
Robin Hüskes | 5058a4dea8 | |
Robin Hüskes | 24456c952b | |
Robin Hüskes | a07944dbb1 | |
Robin Hüskes | 213b3456dd | |
Robin Hüskes | c3c0a92463 | |
Robin Hüskes | 458b011c2b | |
Robin Hüskes | 264ed57138 | |
Robin Hüskes | 62a79752b7 | |
Robin Hüskes | 728ec4548a | |
Robin Hüskes | 9ac1a6948a | |
Robin Hüskes | 61748c4730 |
|
@ -1,52 +0,0 @@
|
|||
local addonName, addon = ...
|
||||
local childName = addon['childName']
|
||||
local child = addon[childName]
|
||||
local events, db = {}
|
||||
local hookedCraft = {}
|
||||
local craftTip = CreateFrame("GameTooltip", format("%sCraftReagentTip",childName), nil, "GameTooltipTemplate")
|
||||
local function CraftReagent_OnLeave(self)
|
||||
craftTip:Hide()
|
||||
end
|
||||
local function CraftReagent_OnEnter(self)
|
||||
if(self.hasItem==1) then
|
||||
local itemName = self['Name']:GetText()
|
||||
if(itemName) then
|
||||
local id = GetItemInfoInstant(itemName)
|
||||
craftTip:Hide()
|
||||
craftTip:ClearLines()
|
||||
craftTip:SetOwner(self, "ANCHOR_TOPLEFT")
|
||||
if(id) then
|
||||
craftTip:SetItemByID(id)
|
||||
child.GameTooltip_OnTooltipSetItem(craftTip)
|
||||
else
|
||||
craftTip:SetCraftItem(GetCraftSelectionIndex(), self:GetID())
|
||||
end
|
||||
craftTip:Show()
|
||||
CursorUpdate()
|
||||
end
|
||||
end
|
||||
end
|
||||
function events:CRAFT_SHOW()
|
||||
if(not db['donthookCraftFrame']) then
|
||||
for i = 1, MAX_CRAFT_REAGENTS do
|
||||
local reag = format("CraftReagent%i", i)
|
||||
if(not hookedCraft[reag]) then
|
||||
_G[reag]:SetScript("OnEnter", CraftReagent_OnEnter)
|
||||
_G[reag]:SetScript("OnLeave", CraftReagent_OnLeave)
|
||||
hookedCraft[reag] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
child:IgnoreRetail("CRAFT_SHOW")
|
||||
child:AddEvent(events)
|
||||
local init = {
|
||||
Setup = function(self)
|
||||
db = child['db']
|
||||
if(not db["CraftTipScale"]) then
|
||||
db["CraftTipScale"] = 0.9
|
||||
end
|
||||
craftTip:SetScale(db["CraftTipScale"])
|
||||
end
|
||||
}
|
||||
addon.RegisterCallback(init, format("Init%s", childName), 'Setup')
|
|
@ -1,5 +1,5 @@
|
|||
--[[ $Id: CallbackHandler-1.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $ ]]
|
||||
local MAJOR, MINOR = "CallbackHandler-1.0", 7
|
||||
--[[ $Id: CallbackHandler-1.0.lua 26 2022-12-12 15:09:39Z nevcairiel $ ]]
|
||||
local MAJOR, MINOR = "CallbackHandler-1.0", 8
|
||||
local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
|
||||
if not CallbackHandler then return end -- No upgrade needed
|
||||
|
@ -7,21 +7,16 @@ if not CallbackHandler then return end -- No upgrade needed
|
|||
local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end}
|
||||
|
||||
-- Lua APIs
|
||||
local error = error
|
||||
local securecallfunction, error = securecallfunction, error
|
||||
local setmetatable, rawget = setmetatable, rawget
|
||||
local next, select, pairs, type, tostring = next, select, pairs, type, tostring
|
||||
|
||||
local xpcall = xpcall
|
||||
|
||||
local function errorhandler(err)
|
||||
return geterrorhandler()(err)
|
||||
end
|
||||
|
||||
local function Dispatch(handlers, ...)
|
||||
local index, method = next(handlers)
|
||||
if not method then return end
|
||||
repeat
|
||||
xpcall(method, errorhandler, ...)
|
||||
securecallfunction(method, ...)
|
||||
index, method = next(handlers, index)
|
||||
until not method
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
--@curseforge-project-slug: libdbicon-1-0@
|
||||
-----------------------------------------------------------------------
|
||||
-- LibDBIcon-1.0
|
||||
--
|
||||
|
@ -6,7 +6,7 @@
|
|||
--
|
||||
|
||||
local DBICON10 = "LibDBIcon-1.0"
|
||||
local DBICON10_MINOR = 44 -- Bump on changes
|
||||
local DBICON10_MINOR = 45 -- Bump on changes
|
||||
if not LibStub then error(DBICON10 .. " requires LibStub.") end
|
||||
local ldb = LibStub("LibDataBroker-1.1", true)
|
||||
if not ldb then error(DBICON10 .. " requires LibDataBroker-1.1.") end
|
||||
|
@ -218,37 +218,49 @@ local function createButton(name, object, db)
|
|||
button.dataObject = object
|
||||
button.db = db
|
||||
button:SetFrameStrata("MEDIUM")
|
||||
if button.SetFixedFrameStrata then -- Classic support
|
||||
button:SetFixedFrameStrata(true)
|
||||
end
|
||||
button:SetFixedFrameStrata(true)
|
||||
button:SetFrameLevel(8)
|
||||
if button.SetFixedFrameLevel then -- Classic support
|
||||
button:SetFixedFrameLevel(true)
|
||||
end
|
||||
button:SetFixedFrameLevel(true)
|
||||
button:SetSize(31, 31)
|
||||
button:RegisterForClicks("anyUp")
|
||||
button:RegisterForDrag("LeftButton")
|
||||
button:SetHighlightTexture(136477) --"Interface\\Minimap\\UI-Minimap-ZoomButton-Highlight"
|
||||
local overlay = button:CreateTexture(nil, "OVERLAY")
|
||||
overlay:SetSize(53, 53)
|
||||
overlay:SetTexture(136430) --"Interface\\Minimap\\MiniMap-TrackingBorder"
|
||||
overlay:SetPoint("TOPLEFT")
|
||||
local background = button:CreateTexture(nil, "BACKGROUND")
|
||||
background:SetSize(20, 20)
|
||||
background:SetTexture(136467) --"Interface\\Minimap\\UI-Minimap-Background"
|
||||
background:SetPoint("TOPLEFT", 7, -5)
|
||||
local icon = button:CreateTexture(nil, "ARTWORK")
|
||||
icon:SetSize(17, 17)
|
||||
icon:SetTexture(object.icon)
|
||||
icon:SetPoint("TOPLEFT", 7, -6)
|
||||
button.icon = icon
|
||||
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
|
||||
local overlay = button:CreateTexture(nil, "OVERLAY")
|
||||
overlay:SetSize(50, 50)
|
||||
overlay:SetTexture(136430) --"Interface\\Minimap\\MiniMap-TrackingBorder"
|
||||
overlay:SetPoint("TOPLEFT", button, "TOPLEFT", 0, 0)
|
||||
local background = button:CreateTexture(nil, "BACKGROUND")
|
||||
background:SetSize(24, 24)
|
||||
background:SetTexture(136467) --"Interface\\Minimap\\UI-Minimap-Background"
|
||||
background:SetPoint("CENTER", button, "CENTER", 0, 1)
|
||||
local icon = button:CreateTexture(nil, "ARTWORK")
|
||||
icon:SetSize(18, 18)
|
||||
icon:SetTexture(object.icon)
|
||||
icon:SetPoint("CENTER", button, "CENTER", 0, 1)
|
||||
button.icon = icon
|
||||
else
|
||||
local overlay = button:CreateTexture(nil, "OVERLAY")
|
||||
overlay:SetSize(53, 53)
|
||||
overlay:SetTexture(136430) --"Interface\\Minimap\\MiniMap-TrackingBorder"
|
||||
overlay:SetPoint("TOPLEFT")
|
||||
local background = button:CreateTexture(nil, "BACKGROUND")
|
||||
background:SetSize(20, 20)
|
||||
background:SetTexture(136467) --"Interface\\Minimap\\UI-Minimap-Background"
|
||||
background:SetPoint("TOPLEFT", 7, -5)
|
||||
local icon = button:CreateTexture(nil, "ARTWORK")
|
||||
icon:SetSize(17, 17)
|
||||
icon:SetTexture(object.icon)
|
||||
icon:SetPoint("TOPLEFT", 7, -6)
|
||||
button.icon = icon
|
||||
end
|
||||
|
||||
button.isMouseDown = false
|
||||
local r, g, b = button.icon:GetVertexColor()
|
||||
button.icon:SetVertexColor(object.iconR or r, object.iconG or g, object.iconB or b)
|
||||
|
||||
local r, g, b = icon:GetVertexColor()
|
||||
icon:SetVertexColor(object.iconR or r, object.iconG or g, object.iconB or b)
|
||||
|
||||
icon.UpdateCoord = updateCoord
|
||||
icon:UpdateCoord()
|
||||
button.icon.UpdateCoord = updateCoord
|
||||
button.icon:UpdateCoord()
|
||||
|
||||
button:SetScript("OnEnter", onEnter)
|
||||
button:SetScript("OnLeave", onLeave)
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
local lib = LibStub:NewLibrary("zzAddOn", 10)
|
||||
local lib = LibStub:NewLibrary("zzAddOn", 12)
|
||||
if not lib then return end
|
||||
local config = LibStub:GetLibrary("zzConfig")
|
||||
lib['callbacks'] = lib['callbacks'] or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib)
|
||||
lib['addons'] = lib['addons'] or {}
|
||||
lib['managerframe'] = lib['managerframe'] or CreateFrame("FRAME")
|
||||
lib['events'] = lib['events'] or CreateFrame("FRAME")
|
||||
local function errormsg(err)
|
||||
print(format("|cffff0000Error:|r %s",err))
|
||||
end
|
||||
local mixins = {'NewAddOn', 'GetAddOn', 'AddChild', 'HasChild', 'IsChild', 'HasParent', 'GetParent', 'GetOptions', 'RegisterEvent','UnregisterEvent','IsClassic','IsBCC','IsRetail', 'GetSpecs', 'Fire'}
|
||||
local mixins = {'NewAddOn', 'GetAddOn', 'AddChild', 'HasChild', 'IsChild', 'HasParent', 'GetParent', 'GetOptions', 'RegisterEvent','UnregisterEvent','IsClassic','IsBCC','IsRetail', 'GetSpecs', 'Fire', 'RegisterOpen', 'RegisterClose'}
|
||||
function lib:Fire(...)
|
||||
lib['callbacks']:Fire(...)
|
||||
end
|
||||
|
@ -103,6 +104,44 @@ end
|
|||
function lib:IsRetail()
|
||||
return WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
|
||||
end
|
||||
local function handleManagerFrame(self, event, num)
|
||||
if(event == "PLAYER_INTERACTION_MANAGER_FRAME_SHOW") then
|
||||
lib['callbacks']:Fire(format("show-%i", num))
|
||||
else
|
||||
lib['callbacks']:Fire(format("hide-%i", num))
|
||||
end
|
||||
end
|
||||
local function addManagerFrame(self, mode, num, globalfunc)
|
||||
if(type(num) == 'table') then
|
||||
for k, v in pairs(num) do
|
||||
local n = k
|
||||
local func = v
|
||||
if(type(v) == 'number') then
|
||||
n = v
|
||||
func = globalfunc
|
||||
end
|
||||
addManagerFrame(self, mode, n, func)
|
||||
end
|
||||
elseif(type(num) == 'number') then
|
||||
lib.RegisterCallback(self, format("%s-%i", mode, num), globalfunc)
|
||||
end
|
||||
end
|
||||
function lib:RegisterOpen(num, func)
|
||||
if(not num) then return end
|
||||
if(not lib['managerframe']:IsEventRegistered("PLAYER_INTERACTION_MANAGER_FRAME_SHOW")) then
|
||||
lib['managerframe']:RegisterEvent("PLAYER_INTERACTION_MANAGER_FRAME_SHOW")
|
||||
lib['managerframe']:SetScript("OnEvent", handleManagerFrame)
|
||||
end
|
||||
addManagerFrame(self, 'show', num, func)
|
||||
end
|
||||
function lib:RegisterClose(num, func)
|
||||
if(not num) then return end
|
||||
if(not lib['managerframe']:IsEventRegistered("PLAYER_INTERACTION_MANAGER_FRAME_HIDE")) then
|
||||
lib['managerframe']:RegisterEvent("PLAYER_INTERACTION_MANAGER_FRAME_HIDE")
|
||||
lib['managerframe']:SetScript("OnEvent", handleManagerFrame)
|
||||
end
|
||||
addManagerFrame(self, 'hide', num, func)
|
||||
end
|
||||
function lib:NewAddOn(addonName, addonTable)
|
||||
local specs = self['specs']
|
||||
local childName = specs['name']
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local lib = LibStub:NewLibrary("zzHelper", 3)
|
||||
local lib = LibStub:NewLibrary("zzHelper", 4)
|
||||
if not lib then return end
|
||||
lib['targets'] = lib['targets'] or {}
|
||||
local mixins = {'colorize', 'round', 'sortArray', 'IsTwink', 'classcolor', 'MoneyString', 'MoneyStringSetString', 'MoneyStringSetSize'}
|
||||
|
@ -34,7 +34,7 @@ function lib:MoneyStringSetSize(size)
|
|||
iconSize = size
|
||||
end
|
||||
end
|
||||
function lib:MoneyString(money, color, abrevK, abrevM, noicon, noiconcolor, size)
|
||||
function lib:MoneyString(money, color, abrevK, abrevM, noicon, noiconcolor, size, seperate)
|
||||
local iconSize = size or iconSize
|
||||
local goldicon = noicon and (noiconcolor and moneyText['goldColor'] or moneyText['gold']) or format(iconbase, 'Gold', iconSize, iconSize)
|
||||
local silvericon = noicon and (noiconcolor and moneyText['silverColor'] or moneyText['silver']) or format(iconbase, 'Silver', iconSize, iconSize)
|
||||
|
@ -66,6 +66,9 @@ function lib:MoneyString(money, color, abrevK, abrevM, noicon, noiconcolor, size
|
|||
end
|
||||
if(money > 0) then
|
||||
if(g>0) then
|
||||
if(seperate) then
|
||||
g = BreakUpLargeNumbers(g)
|
||||
end
|
||||
moneystring = format("%s%s%s", color and lib:colorize(g, neg and "ff0000" or "44dd44") or g,abrev, goldicon)
|
||||
end
|
||||
if(s>0) then
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local lib = LibStub:NewLibrary("zzLDB", 5)
|
||||
local lib = LibStub:NewLibrary("zzLDB", 6)
|
||||
if not lib then return end
|
||||
local ldb = LibStub:GetLibrary("LibDataBroker-1.1")
|
||||
local ldbicon = LibStub:GetLibrary("LibDBIcon-1.0")
|
||||
|
@ -25,7 +25,8 @@ function lib:DefaultOnClick(_, button, addon, childName)
|
|||
if(not InCombatLockdown()) then
|
||||
if(SettingsPanel) then
|
||||
if(SettingsPanel:IsVisible()) then
|
||||
SettingsPanel:Hide()
|
||||
HideUIPanel(SettingsPanel)
|
||||
HideUIPanel(GameMenuFrame)
|
||||
else
|
||||
Settings.OpenToCategory(childName)
|
||||
end
|
||||
|
|
6
core.lua
6
core.lua
|
@ -99,11 +99,11 @@ local function OnEvent(lib, self, event, ...)
|
|||
print("[itemsdb] Failed", ...)
|
||||
end
|
||||
end
|
||||
function child.events:PLAYER_ENTERING_WORLD(event)
|
||||
child:UnregisterEvent('PLAYER_ENTERING_WORLD')
|
||||
function child.events:PLAYER_ENTERING_WORLD(lib, event)
|
||||
child:UnregisterEvent(event)
|
||||
local list = {}
|
||||
for event,func in pairs(events) do
|
||||
if(child:IsClassic() or (not child:IsClassic() and not skipRetail[event])) then
|
||||
if(not skipRetail[event]) then
|
||||
list[#list+1] = event
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,14 +9,44 @@ local modul = {
|
|||
}
|
||||
local db
|
||||
local desc = format('%sCount', modulname)
|
||||
local GetContainerItemInfo = GetContainerItemInfo
|
||||
if(C_Container and C_Container.GetContainerItemInfo) then
|
||||
GetContainerItemInfo2 = C_Container.GetContainerItemInfo
|
||||
else
|
||||
GetContainerItemInfo2 = function(bag, slot)
|
||||
local icon, itemCount, locked, quality, readable, lootable, itemLink, isFiltered, noValue, itemID, isBound = GetContainerItemInfo(bag, slot)
|
||||
if(icon) then
|
||||
return {
|
||||
['iconFileID'] = icon,
|
||||
['stackCount'] = itemCount,
|
||||
['isLocked'] = locked,
|
||||
['quality'] = quality,
|
||||
['isReadable'] = readable,
|
||||
['hasLoot'] = lootable,
|
||||
['hyperlink'] = itemLink,
|
||||
['isFiltered'] = isFiltered,
|
||||
['hasNoValue'] = noValue,
|
||||
['itemID'] = itemID,
|
||||
['isBound'] = isBound
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function GetContainerNumSlots2(bag, slot)
|
||||
if(C_Container and C_Container.GetContainerNumSlots) then
|
||||
return C_Container.GetContainerNumSlots(bag, slot)
|
||||
end
|
||||
return GetContainerNumSlots(bag, slot)
|
||||
end
|
||||
function child:scanBag(bag)
|
||||
local slot = 1
|
||||
local itemlist = {}
|
||||
local empty = true
|
||||
while(slot<=C_Container.GetContainerNumSlots(bag)) do
|
||||
while(slot<=GetContainerNumSlots2(bag)) do
|
||||
local item = Item:CreateFromBagAndSlot(bag, slot)
|
||||
if(item) then
|
||||
local itemInfo = C_Container.GetContainerItemInfo(bag, slot)
|
||||
local itemInfo = GetContainerItemInfo2(bag, slot)
|
||||
local id = item:GetItemID()
|
||||
if(itemInfo and id) then
|
||||
empty = false
|
||||
|
@ -30,16 +60,25 @@ function child:scanBag(bag)
|
|||
end
|
||||
return empty and nil or itemlist
|
||||
end
|
||||
local startbag, endbag
|
||||
if(Enum and Enum.BagIndex) then
|
||||
startbag = Enum.BagIndex.Backpack
|
||||
endbag = Enum.BagIndex.ReagentBag
|
||||
else
|
||||
startbag = BACKPACK_CONTAINER
|
||||
endbag = NUM_BAG_SLOTS
|
||||
end
|
||||
local function scanAllBags(delayed)
|
||||
if(not child:funcSync(scanAllBags, delayed)) then return end
|
||||
local playerID = child.getPID()
|
||||
if(playerID) then
|
||||
local tab = modul['db'][playerID]
|
||||
for bag=Enum.BagIndex.Backpack ,Enum.BagIndex.ReagentBag do
|
||||
print()
|
||||
for bag=startbag ,endbag do
|
||||
tab[bag] = child:scanBag(bag) -- loop all bought bags
|
||||
end
|
||||
for k,v in pairs(modul['db'][playerID]) do
|
||||
if(k<Enum.BagIndex.Backpack or k>Enum.BagIndex.ReagentBag) then
|
||||
if(k < startbag or k > endbag) then
|
||||
tab[k] = nil -- prevent bogus bags
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,6 +11,20 @@ local db
|
|||
local desc = format('%sCount', modulname)
|
||||
local desc2 = 'reagentCount'
|
||||
local BankIsOpen = false
|
||||
local startbag, endbag, bankbag, reagentbankbag = 0, 4, -1, -3
|
||||
if(Enum and Enum.BagIndex) then
|
||||
startbag = Enum.BagIndex.Backpack
|
||||
endbag = Enum.BagIndex.ReagentBag
|
||||
bankbag = Enum.BagIndex.Bank
|
||||
reagentbankbag = Enum.BagIndex.Reagentbank
|
||||
reagentbag = Enum.BagIndex.ReagentBag
|
||||
else
|
||||
startbag = 6
|
||||
endbag = startbag + GetNumBankSlots()
|
||||
bankbag = BANK_CONTAINER
|
||||
reagentbankbag = -3
|
||||
reagentbag = BACKPACK_CONTAINER + NUM_BAG_SLOTS + 1
|
||||
end
|
||||
function modul.Guess(id)
|
||||
local dbcount = modul.Get(id)
|
||||
local count = GetItemCount(id,true)
|
||||
|
@ -20,7 +34,7 @@ function modul.Guess(id)
|
|||
local dif = dbcount - count
|
||||
modul['db'][playerID] = modul['db'][playerID] or {}
|
||||
local tab = modul['db'][playerID]
|
||||
for bag = Enum.BagIndex.BankBag_1 ,Enum.BagIndex.BankBag_1 + GetNumBankSlots() - 1 do
|
||||
for bag = startbag ,endbag - 1 do
|
||||
local btab = tab[bag]
|
||||
if(btab and btab[id] and btab[id]['count'] > 0) then
|
||||
while(dif > 0 and btab[id]['count'] > 0) do
|
||||
|
@ -54,7 +68,7 @@ local function scanAllBankBags(delayed)
|
|||
if(playerID) then
|
||||
modul['db'][playerID] = modul['db'][playerID] or {}
|
||||
local tab = modul['db'][playerID]
|
||||
for bag = Enum.BagIndex.BankBag_1 ,Enum.BagIndex.BankBag_1 + GetNumBankSlots() - 1 do
|
||||
for bag = startbag ,endbag - 1 do
|
||||
tab[bag] = tab[bag] or {}
|
||||
if(BankIsOpen) then
|
||||
tab[bag] = child:scanBag(bag) -- loop all bought bankbags
|
||||
|
@ -63,13 +77,17 @@ local function scanAllBankBags(delayed)
|
|||
end
|
||||
end
|
||||
if(BankIsOpen) then
|
||||
tab[Enum.BagIndex.Bank] = child:scanBag(Enum.BagIndex.Bank) -- Main bankbag
|
||||
tab[bankbag] = child:scanBag(bankbag) -- Main bankbag
|
||||
else
|
||||
guess(tab[Enum.BagIndex.Bank])
|
||||
guess(tab[bankbag])
|
||||
end
|
||||
if(BankIsOpen) then
|
||||
tab[reagentbankbag] = child:scanBag(reagentbankbag) -- Main reagentbag
|
||||
else
|
||||
guess(tab[reagentbankbag])
|
||||
end
|
||||
tab[Enum.BagIndex.Reagentbank] = child:scanBag(Enum.BagIndex.Reagentbank) -- Main reagentbag
|
||||
for k,v in pairs(modul['db'][playerID]) do
|
||||
if(not(k == Enum.BagIndex.Bank) and not(k == Enum.BagIndex.Reagentbank) and not(k > Enum.BagIndex.ReagentBag and k <= GetNumBankSlots() + Enum.BagIndex.ReagentBag)) then
|
||||
if(not(k == bankbag) and not(k == reagentbankbag) and not(k > reagentbag and k <= GetNumBankSlots() + reagentbag)) then
|
||||
tab[k] = nil -- prevent bogus bankbags
|
||||
end
|
||||
end
|
||||
|
@ -85,7 +103,7 @@ local function bagLoop(id, res)
|
|||
if(playerID and units[k]['faction'] == units[playerID]['faction']) then
|
||||
local unitname = units[k]['name']
|
||||
for bag, list in pairs(v) do
|
||||
dName = (bag == Enum.BagIndex.Reagentbank) and desc2 or desc
|
||||
dName = (bag == reagentbankbag) and desc2 or desc
|
||||
for a, b in pairs(list) do
|
||||
if(a == id) then
|
||||
res[unitname] = res[unitname] or {
|
||||
|
@ -131,11 +149,13 @@ function events:PLAYERBANKBAGSLOTS_CHANGED(...)
|
|||
scanAllBankBags()
|
||||
end
|
||||
events.PLAYERBANKSLOTS_CHANGED = events.PLAYERBANKBAGSLOTS_CHANGED
|
||||
events.PLAYERREAGENTBANKSLOTS_CHANGED = events.PLAYERBANKBAGSLOTS_CHANGED
|
||||
if(BuyReagentBank) then
|
||||
events.PLAYERREAGENTBANKSLOTS_CHANGED = events.PLAYERBANKBAGSLOTS_CHANGED
|
||||
end
|
||||
events.ITEM_UNLOCKED = events.PLAYERBANKBAGSLOTS_CHANGED
|
||||
events.BAG_UPDATE_DELAYED = events.PLAYERBANKBAGSLOTS_CHANGED
|
||||
local function OnEvent(self, event, ...)
|
||||
-- print(modulname, event, ...)
|
||||
-- print(modulname, event, ...)
|
||||
local playerID = child.getPID()
|
||||
if(playerID and type(events[event])=='function') then
|
||||
modul['db'] = child:GetNamespace(modul.name)
|
||||
|
@ -167,19 +187,11 @@ function modul:Delete(id, typ)
|
|||
self['db'][id] = nil
|
||||
end
|
||||
end
|
||||
local skip = {
|
||||
[WOW_PROJECT_CLASSIC] = {
|
||||
['PLAYERREAGENTBANKSLOTS_CHANGED'] = true
|
||||
}
|
||||
}
|
||||
if(WOW_PROJECT_WRATH_CLASSIC) then
|
||||
skip[WOW_PROJECT_WRATH_CLASSIC] = {
|
||||
['PLAYERREAGENTBANKSLOTS_CHANGED'] = true
|
||||
}
|
||||
end
|
||||
if(WOW_PROJECT_BURNING_CRUSADE_CLASSIC) then
|
||||
skip[WOW_PROJECT_BURNING_CRUSADE_CLASSIC] = {
|
||||
['PLAYERREAGENTBANKSLOTS_CHANGED'] = true
|
||||
local skip = {}
|
||||
if(WOW_PROJECT_MAINLINE) then
|
||||
skip[WOW_PROJECT_MAINLINE] = {
|
||||
['BANKFRAME_OPENED'] = true,
|
||||
['BANKFRAME_CLOSED'] = true
|
||||
}
|
||||
end
|
||||
function modul:Enable()
|
||||
|
@ -194,6 +206,10 @@ function modul:Enable()
|
|||
self['frame']:RegisterEvent(list[i])
|
||||
end
|
||||
self['frame']:SetScript("OnEvent", OnEvent)
|
||||
if(WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
child:RegisterOpen(8, events.BANKFRAME_OPENED)
|
||||
child:RegisterClose(8, events.BANKFRAME_CLOSED)
|
||||
end
|
||||
end
|
||||
function modul:Disable()
|
||||
self['status'] = false
|
||||
|
|
|
@ -126,6 +126,7 @@ function modul:Enable()
|
|||
for i = 1, #list do
|
||||
self['frame']:RegisterEvent(list[i])
|
||||
end
|
||||
self['frame']:SetScript("OnEvent", OnEvent)
|
||||
OnEvent(child, "PLAYER_EQUIPMENT_CHANGED")
|
||||
end
|
||||
function modul:Disable()
|
||||
|
@ -133,6 +134,7 @@ function modul:Disable()
|
|||
for event, func in pairs(events) do
|
||||
self['frame']:UnregisterEvent(event)
|
||||
end
|
||||
self['frame']:SetScript("OnEvent", nil)
|
||||
end
|
||||
local init = {
|
||||
Setup = function(self)
|
||||
|
|
|
@ -172,11 +172,6 @@ local skip = {
|
|||
['CURRENCY_DISPLAY_UPDATE'] = true
|
||||
}
|
||||
}
|
||||
if(WOW_PROJECT_BURNING_CRUSADE_CLASSIC) then
|
||||
skip[WOW_PROJECT_BURNING_CRUSADE_CLASSIC] = {
|
||||
['PLAYERREAGENTBANKSLOTS_CHANGED'] = true
|
||||
}
|
||||
end
|
||||
function modul:Enable()
|
||||
if(child:IsRetail()) then
|
||||
self.status = true
|
||||
|
@ -206,8 +201,9 @@ function modul:Disable()
|
|||
end
|
||||
end
|
||||
end
|
||||
child:IgnoreClassic(modulname)
|
||||
child:IgnoreBCC(modulname)
|
||||
if(not LE_EXPANSION_WRATH_OF_THE_LICH_KING or LE_EXPANSION_LEVEL_CURRENT<LE_EXPANSION_WRATH_OF_THE_LICH_KING or not _G['GetCurrencyListInfo']) then
|
||||
child:addIgnore(WOW_PROJECT_ID, modulname)
|
||||
end
|
||||
local init = {
|
||||
Setup = function(self)
|
||||
modul.db, modul.status = child:RegisterModul(modul, modulname)
|
||||
|
|
|
@ -176,23 +176,38 @@ function modul:Delete(id, typ)
|
|||
self['db'][id] = nil
|
||||
end
|
||||
end
|
||||
local function MFOpen()
|
||||
GuildBankIsOpen = true
|
||||
events.GUILDBANKBAGSLOTS_CHANGED()
|
||||
end
|
||||
local function MFClose()
|
||||
GuildBankIsOpen = false
|
||||
end
|
||||
local skip = {
|
||||
[WOW_PROJECT_MAINLINE] = {
|
||||
['GUILDBANKFRAME_OPENED'] = true,
|
||||
['GUILDBANKFRAME_CLOSED'] = true
|
||||
}
|
||||
}
|
||||
function modul:Enable()
|
||||
if(child:IsRetail()) then
|
||||
self.status = true
|
||||
local list = {}
|
||||
for event, func in pairs(events) do
|
||||
list[#list+1] = event
|
||||
self.status = true
|
||||
local list = {}
|
||||
for event, func in pairs(events) do
|
||||
list[#list+1] = event
|
||||
end
|
||||
lgbc = LibStub("LibGuildBankComm-1.0",true)
|
||||
if(lgbc) then
|
||||
lgbc.RegisterCallback(self, "GuildBankComm_PageUpdate", "OnPageSync")
|
||||
end
|
||||
for i = 1, #list do
|
||||
if(not skip[WOW_PROJECT_ID] or not skip[WOW_PROJECT_ID][event]) then
|
||||
self['frame']:RegisterEvent(list[i])
|
||||
end
|
||||
lgbc = LibStub("LibGuildBankComm-1.0",true)
|
||||
if(lgbc) then
|
||||
lgbc.RegisterCallback(self, "GuildBankComm_PageUpdate", "OnPageSync")
|
||||
end
|
||||
for i = 1, #list do
|
||||
self['frame']:RegisterEvent(list[i])
|
||||
end
|
||||
self['frame']:SetScript("OnEvent", OnEvent)
|
||||
else
|
||||
self.status = false
|
||||
end
|
||||
self['frame']:SetScript("OnEvent", OnEvent)
|
||||
if(WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
child:RegisterOpen(10, MFOpen)
|
||||
child:RegisterClose(10, MFClose)
|
||||
end
|
||||
end
|
||||
function modul:Disable()
|
||||
|
@ -206,8 +221,9 @@ function modul:Disable()
|
|||
end
|
||||
end
|
||||
end
|
||||
child:IgnoreClassic(modulname)
|
||||
child:IgnoreBCC(modulname)
|
||||
if(LE_EXPANSION_LEVEL_CURRENT<LE_EXPANSION_BURNING_CRUSADE or not GetGuildBankItemInfo) then
|
||||
child:addIgnore(WOW_PROJECT_ID, modulname)
|
||||
end
|
||||
local init = {
|
||||
Setup = function(self)
|
||||
db = child['db']
|
||||
|
|
|
@ -10,34 +10,16 @@ local modul = {
|
|||
local desc = format('%sCount', modulname)
|
||||
local mailOpen = false
|
||||
local db
|
||||
--[[CLOSE_INBOX_ITEM: mailIndex
|
||||
MAIL_CLOSED
|
||||
MAIL_FAILED: itemID
|
||||
MAIL_INBOX_UPDATE
|
||||
MAIL_LOCK_SEND_ITEMS: attachSlot, itemLink
|
||||
MAIL_SEND_INFO_UPDATE
|
||||
MAIL_SEND_SUCCESS
|
||||
MAIL_SHOW
|
||||
MAIL_SUCCESS: itemID
|
||||
MAIL_UNLOCK_SEND_ITEMS
|
||||
SEND_MAIL_COD_CHANGED
|
||||
SEND_MAIL_MONEY_CHANGED
|
||||
UPDATE_PENDING_MAIL
|
||||
]]
|
||||
local function scan()
|
||||
if(not mailOpen) then return end
|
||||
local numItems, totalItems = GetInboxNumItems()
|
||||
-- print("Found",numItems, totalItems)
|
||||
local playerID = child.getPID()
|
||||
local db = modul['db'][playerID]
|
||||
db[1] = {}
|
||||
for index = 1, numItems do
|
||||
local packageIcon, stationeryIcon, sender, subject, money, CODAmount, daysLeft, hasItem, wasRead, wasReturned,
|
||||
textCreated, canReply, isGM = GetInboxHeaderInfo(index)
|
||||
-- print("Index", index, hasItem)
|
||||
if(hasItem) then
|
||||
|
||||
-- print("Mail has item", index)
|
||||
for itemIndex = 1, ATTACHMENTS_MAX_RECEIVE do
|
||||
local name, itemID, texture, count, quality, canUse = GetInboxItem(index, itemIndex)
|
||||
if(name) then
|
||||
|
@ -51,48 +33,19 @@ local function scan()
|
|||
end
|
||||
end
|
||||
function events:MAIL_INBOX_UPDATE()
|
||||
-- print("MIU")
|
||||
scan()
|
||||
end
|
||||
function events:MAIL_FAILED()
|
||||
-- print('failed')
|
||||
function events:MAIL_SHOW()
|
||||
mailOpen = true
|
||||
end
|
||||
function events:MAIL_CLOSED()
|
||||
-- print('closed')
|
||||
mailOpen = false
|
||||
end
|
||||
function events:MAIL_SEND_SUCCESS()
|
||||
-- print("mail_send_success")
|
||||
end
|
||||
function events:MAIL_SUCCESS(event, itemID) --fires along with MAIL_SEND_SUCCESS, itemID always nil, fires when deleting mail
|
||||
scan()
|
||||
end
|
||||
function events:MAIL_SEND_INFO_UPDATE() -- item changed
|
||||
-- print("update")
|
||||
for index = 1, ATTACHMENTS_MAX_SEND do
|
||||
local name, itemID, texture, count, quality = GetSendMailItem(index)
|
||||
if name then
|
||||
-- print("You are sending", name, "x", count)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
--[[function events:SEND_MAIL_COD_CHANGED() -- price added
|
||||
print("cod changed")
|
||||
end]]
|
||||
function events:MAIL_LOCK_SEND_ITEMS(event, attachSlot, itemLink)
|
||||
-- print(event, attachSlot, itemLink)
|
||||
end
|
||||
function events:UPDATE_PENDING_MAIL()
|
||||
-- print("Update pending mail")
|
||||
end
|
||||
function events:MAIL_SHOW()
|
||||
-- print("Mail show")
|
||||
mailOpen = true
|
||||
end
|
||||
local function OnEvent(self, event, ...)
|
||||
local playerID = child.getPID()
|
||||
-- print(modulname, event, ...)
|
||||
if(playerID and type(events[event])=='function') then
|
||||
modul['db'] = child:GetNamespace(modul.name)
|
||||
modul['db'][playerID] = modul['db'][playerID] or {}
|
||||
|
@ -142,6 +95,19 @@ function modul:Delete(id, typ)
|
|||
self['db'][id] = nil
|
||||
end
|
||||
end
|
||||
local function MFOpen()
|
||||
mailOpen = true
|
||||
scan()
|
||||
end
|
||||
local function MFClose()
|
||||
mailOpen = false
|
||||
end
|
||||
local skip = {
|
||||
[WOW_PROJECT_MAINLINE] = {
|
||||
['MAIL_SHOW'] = true,
|
||||
['MAIL_CLOSED'] = true
|
||||
}
|
||||
}
|
||||
function modul:Enable()
|
||||
self['status'] = true
|
||||
local list = {}
|
||||
|
@ -149,9 +115,15 @@ function modul:Enable()
|
|||
list[#list+1] = event
|
||||
end
|
||||
for i = 1, #list do
|
||||
self['frame']:RegisterEvent(list[i])
|
||||
if(not skip[WOW_PROJECT_ID] or not skip[WOW_PROJECT_ID][event]) then
|
||||
self['frame']:RegisterEvent(list[i])
|
||||
end
|
||||
end
|
||||
self['frame']:SetScript("OnEvent", OnEvent)
|
||||
if(WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
child:RegisterOpen(17, MFOpen)
|
||||
child:RegisterClose(17, MFClose)
|
||||
end
|
||||
end
|
||||
function modul:Disable()
|
||||
self['status'] = false
|
||||
|
|
|
@ -12,7 +12,7 @@ local voidOpen
|
|||
local failCount = 0
|
||||
local dName = format("%sCount", modulname)
|
||||
local function scanVoid()
|
||||
-- if(not voidOpen) then return end
|
||||
if(not voidOpen) then return end
|
||||
local playerID = child.getPID()
|
||||
if(playerID) then
|
||||
local itemlist = {}
|
||||
|
@ -79,13 +79,13 @@ function modul.Output(input, sum, b)
|
|||
end
|
||||
return input, sum
|
||||
end
|
||||
-- function events:VOID_STORAGE_CLOSE()
|
||||
-- voidOpen = false
|
||||
-- end
|
||||
-- function events:VOID_STORAGE_OPEN()
|
||||
-- voidOpen = true
|
||||
-- scanVoid()
|
||||
-- end
|
||||
function events:VOID_STORAGE_CLOSE()
|
||||
voidOpen = false
|
||||
end
|
||||
function events:VOID_STORAGE_OPEN()
|
||||
voidOpen = true
|
||||
scanVoid()
|
||||
end
|
||||
events.VOID_STORAGE_CONTENTS_UPDATE = scanVoid
|
||||
events.VOID_STORAGE_DEPOSIT_UPDATE = scanVoid
|
||||
events.ITEM_UNLOCKED = scanVoid
|
||||
|
@ -104,6 +104,26 @@ function modul:Delete(id, typ)
|
|||
self['db'][id] = nil
|
||||
end
|
||||
end
|
||||
local function MFOpen()
|
||||
voidOpen = true
|
||||
scanVoid()
|
||||
end
|
||||
local function MFClose()
|
||||
voidOpen = false
|
||||
end
|
||||
local skip = {}
|
||||
if(WOW_PROJECT_MAINLINE) then
|
||||
skip[WOW_PROJECT_MAINLINE] = {
|
||||
['VOID_STORAGE_CLOSE'] = true,
|
||||
['VOID_STORAGE_OPEN'] = true
|
||||
}
|
||||
end
|
||||
if(WOW_PROJECT_WRATH_CLASSIC) then
|
||||
skip[WOW_PROJECT_WRATH_CLASSIC] = {
|
||||
['VOID_STORAGE_CLOSE'] = true,
|
||||
['VOID_STORAGE_OPEN'] = true
|
||||
}
|
||||
end
|
||||
function modul:Enable()
|
||||
self['status'] = true
|
||||
local list = {}
|
||||
|
@ -111,9 +131,15 @@ function modul:Enable()
|
|||
list[#list+1] = event
|
||||
end
|
||||
for i = 1, #list do
|
||||
self['frame']:RegisterEvent(list[i])
|
||||
if(not skip[WOW_PROJECT_ID] or not skip[WOW_PROJECT_ID][list[i]]) then
|
||||
self['frame']:RegisterEvent(list[i])
|
||||
end
|
||||
end
|
||||
self['frame']:SetScript("OnEvent", OnEvent)
|
||||
if(WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
child:RegisterOpen(26, MFOpen)
|
||||
child:RegisterClose(26, MFClose)
|
||||
end
|
||||
end
|
||||
function modul:Disable()
|
||||
self['status'] = false
|
||||
|
@ -121,8 +147,9 @@ function modul:Disable()
|
|||
self['frame']:UnregisterEvent(event)
|
||||
end
|
||||
end
|
||||
child:IgnoreClassic(modulname)
|
||||
child:IgnoreBCC(modulname)
|
||||
if(not LE_EXPANSION_CATACLYSM or LE_EXPANSION_LEVEL_CURRENT<LE_EXPANSION_CATACLYSM or not _G['GetVoidItemInfo']) then
|
||||
child:addIgnore(WOW_PROJECT_ID, modulname)
|
||||
end
|
||||
local init = {
|
||||
Setup = function(self)
|
||||
db = child['db']
|
||||
|
|
15
moduls.lua
15
moduls.lua
|
@ -7,9 +7,6 @@ local db
|
|||
local skip = {
|
||||
[WOW_PROJECT_CLASSIC] = {}
|
||||
}
|
||||
if(WOW_PROJECT_BURNING_CRUSADE_CLASSIC) then
|
||||
skip[WOW_PROJECT_BURNING_CRUSADE_CLASSIC] = {}
|
||||
end
|
||||
function child:GetModul(modName)
|
||||
for k,modul in pairs(moduls) do
|
||||
if(modul.name==modName) then
|
||||
|
@ -17,12 +14,12 @@ function child:GetModul(modName)
|
|||
end
|
||||
end
|
||||
end
|
||||
function child:IgnoreClassic(ign)
|
||||
skip[WOW_PROJECT_CLASSIC][ign] = true
|
||||
end
|
||||
function child:IgnoreBCC(ign)
|
||||
if(WOW_PROJECT_BURNING_CRUSADE_CLASSIC) then
|
||||
skip[WOW_PROJECT_BURNING_CRUSADE_CLASSIC][ign] = true
|
||||
function child:addIgnore(pid, ign)
|
||||
if(pid) then
|
||||
if(ign) then
|
||||
skip[pid] = skip[pid] or {}
|
||||
skip[pid][ign] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
function child:RegisterModul(modul, namespace)
|
||||
|
|
1
pack.xml
1
pack.xml
|
@ -15,6 +15,5 @@
|
|||
<Script file="core.lua"/>
|
||||
<Script file="items.lua"/>
|
||||
<Script file="tooltip.lua"/>
|
||||
<Script file="CRAFT_SHOW.lua"/>
|
||||
<Script file="slashcmd.lua"/>
|
||||
</Ui>
|
50
tooltip.lua
50
tooltip.lua
|
@ -75,36 +75,36 @@ local function GameTooltip_OnTooltipSetItem(tooltip)
|
|||
tooltip:Show()
|
||||
end
|
||||
local function GameTooltip_OnTooltipSetItem2(tooltip, tooltipData)
|
||||
-- local tooltipData = tooltip:GetTooltipData()
|
||||
if(tooltipData and tooltipData.id and tooltipData.type == 0) then -- type -> 0 = item, 1 = spell
|
||||
curItem = tooltipData.id
|
||||
tooltip.zzInfo = true
|
||||
child:setTT(curItem,tooltip)
|
||||
tooltip:AddLine()
|
||||
for name,b in pairs(child:Search(curItem)) do
|
||||
local dname, drealm = strsplit(" - ",name)
|
||||
local input,sum = child:output(b)
|
||||
if(sum>0) then
|
||||
tooltip:AddLine(format(L['tooltip_main_string'],child:getIcon(curItem),dname,sum,child:colorize(table.concat(input,', '),"ffffff")))
|
||||
end
|
||||
input = nil
|
||||
-- local tooltipData = tooltip:GetTooltipData()
|
||||
if(tooltipData and tooltipData.id and tooltipData.type == 0) then -- type -> 0 = item, 1 = spell
|
||||
curItem = tooltipData.id
|
||||
tooltip.zzInfo = true
|
||||
child:setTT(curItem,tooltip)
|
||||
tooltip:AddLine()
|
||||
for name,b in pairs(child:Search(curItem)) do
|
||||
local dname, drealm = strsplit(" - ",name)
|
||||
local input,sum = child:output(b)
|
||||
if(sum>0) then
|
||||
tooltip:AddLine(format(L['tooltip_main_string'],child:getIcon(curItem),dname,sum,child:colorize(table.concat(input,', '),"ffffff")))
|
||||
end
|
||||
child:specialoutput(tooltip, curItem)
|
||||
if(db['showID']) then
|
||||
tooltip:AddLine(format(L['tooltip_id_string'],curItem))
|
||||
end
|
||||
GameTooltip_CalculatePadding(tooltip)
|
||||
-- tooltip:Show()
|
||||
elseif(tooltipData) then
|
||||
|
||||
input = nil
|
||||
end
|
||||
child:specialoutput(tooltip, curItem)
|
||||
if(db['showID']) then
|
||||
tooltip:AddLine(format(L['tooltip_id_string'],curItem))
|
||||
end
|
||||
GameTooltip_CalculatePadding(tooltip)
|
||||
-- tooltip:Show()
|
||||
elseif(tooltipData) then
|
||||
|
||||
end
|
||||
if(GameTooltip.OnTooltipSetItem) then
|
||||
child.GameTooltip_OnTooltipSetItem = GameTooltip_OnTooltipSetItem
|
||||
GameTooltip:HookScript("OnTooltipSetItem", GameTooltip_OnTooltipSetItem)
|
||||
else
|
||||
end
|
||||
if(TooltipDataProcessor) then
|
||||
child.GameTooltip_OnTooltipSetItem = GameTooltip_OnTooltipSetItem2
|
||||
TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Item, GameTooltip_OnTooltipSetItem2)
|
||||
else
|
||||
child.GameTooltip_OnTooltipSetItem = GameTooltip_OnTooltipSetItem
|
||||
GameTooltip:HookScript("OnTooltipSetItem", GameTooltip_OnTooltipSetItem)
|
||||
end
|
||||
function events:TRADE_SKILL_LIST_UPDATE(event)
|
||||
child:updateTT()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
## Interface: 100002
|
||||
## Interface: 100005
|
||||
## Title: itemsdb
|
||||
## X-Curse-Project-ID: 290291
|
||||
## X-WoWI-ID: 24579
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
## Interface: 30400
|
||||
## Interface: 30401
|
||||
## Title: itemsdb
|
||||
## X-Curse-Project-ID: 290291
|
||||
## X-WoWI-ID: 24579
|
Loading…
Reference in New Issue