update to szyler discord version 7.3.9 (#9)
* update to release 7.3.1 * minor tweaks - tweaked the drop location text to display a bit more cleanly - added boss sigils to bc raid tables - added right click context menu to boss name list so you can open db to that boss (only has raids atm) - the All dungeon items list now wont precache past the normal loot * fixs and text display change - updated old locations to have new display - frame now sits on top when selected - fixed some incorrect ids * favorites button change/loot table updates - Changed how favorites buttons are saved you now alt right click them to save - Added missing new t0 sets to classic dungeon sets - Added missing new trash loot weapons to Black temple * minor changes/fixs - fixed t3 incorrect itemids - added heroic bloodforged * merg from main repo * bug fix and item removals - some quest tooltip was showing up incorrect - removed depreciated high risk patterns * swapped to using ItemButtonTemplate for popup window buttons * added all the new heirloom items * all the changes from main git up to 7.3.9
This commit is contained in:
+119
-19
@@ -11,6 +11,9 @@ local CYAN = "|cff00ffff"
|
||||
local SPRINGGREEN = "|cFF00FF7F"
|
||||
local YELLOW = "|cffFFd200"
|
||||
|
||||
local playerName = UnitName("player")
|
||||
local realmName = GetRealmName()
|
||||
|
||||
-- Used to create a dewdrop menu from a table
|
||||
function AtlasLoot:OpenDewdropMenu(frame, menuList, skipRegister)
|
||||
if self.Dewdrop:IsOpen(frame) then self.Dewdrop:Close() return end
|
||||
@@ -125,8 +128,38 @@ On the form of {ID, {normal, heroic, mythic, mythic1, mythic2, ... ,mythicN}}
|
||||
function AtlasLoot:FindId(id, difficulty, type, sourceType)
|
||||
if not ItemIDsDatabase[id] then return nil, false end
|
||||
if difficulty == 100 then
|
||||
local newIDs = {
|
||||
(id < 1000000 and (id) + 6300000),
|
||||
(id < 1000000 and (id) + 7800000),
|
||||
(id > 1000000 and (id - 1500000) + 6300000),
|
||||
(id > 1000000 and (id - 1500000) + 7800000),
|
||||
}
|
||||
for _, newID in ipairs(newIDs) do
|
||||
local ogName = GetItemInfoInstant(id)
|
||||
local newName = GetItemInfoInstant(newID)
|
||||
if newName and ogName and string.find(newName.name, ogName.name) then
|
||||
return newID, true
|
||||
end
|
||||
end
|
||||
return ItemIDsDatabase[id]["HeroicBloodforged"], true
|
||||
end
|
||||
|
||||
if difficulty == 1 then
|
||||
local newIDs = {
|
||||
(id < 1000000 and (id) + 6000000),
|
||||
(id < 1000000 and (id) + 7500000),
|
||||
(id > 1000000 and (id - 1500000) + 6000000),
|
||||
(id > 1000000 and (id - 1500000) + 7500000),
|
||||
}
|
||||
for _, newID in ipairs(newIDs) do
|
||||
local ogName = GetItemInfoInstant(id)
|
||||
local newName = GetItemInfoInstant(newID)
|
||||
if newName and ogName and string.find(newName.name, ogName.name) then
|
||||
return newID, true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (difficulty == 4 and (type == "BCRaid" or type == "ClassicRaid") and sourceType == "Search") or
|
||||
(difficulty == 5 and (type == "BCRaid" or type == "ClassicRaid") and sourceType ~= "Search") then
|
||||
return ItemIDsDatabase[id]["MythicRaid"], true
|
||||
@@ -135,7 +168,7 @@ function AtlasLoot:FindId(id, difficulty, type, sourceType)
|
||||
difficulty = 4
|
||||
end
|
||||
return ItemIDsDatabase[id][difficulty], true
|
||||
end
|
||||
end
|
||||
|
||||
-- Create enchant tooltip
|
||||
function AtlasLoot:GetEnchantLink(enchantID)
|
||||
@@ -176,7 +209,7 @@ function AtlasLoot:GetRecipeData(recipeID, idType)
|
||||
for _,cat in pairs(prof) do
|
||||
for _,recipe in pairs(cat) do
|
||||
if (idType == "spell" and recipeID == recipe.SpellEntry) or (idType == "item" and recipeID == recipe.RecipeItemEntry) then
|
||||
local info = {{recipe.CreatedItemEntry}, "blank", "blank", "blank", "blank", "blank",spellID = recipe.SpellEntry}
|
||||
local info = {{recipe.CreatedItemEntry}, "blank", "blank", "blank", "blank", "blank",spellID = recipe.SpellEntry, skillIndex = recipe.SkillIndex}
|
||||
if ItemIDsDatabase[recipe.CreatedItemEntry] and ItemIDsDatabase[recipe.CreatedItemEntry][1] then
|
||||
info[2] = {ItemIDsDatabase[recipe.CreatedItemEntry][1]}
|
||||
end
|
||||
@@ -212,6 +245,44 @@ function AtlasLoot:GetRecipeID(spellID)
|
||||
end
|
||||
end
|
||||
|
||||
function AtlasLoot:IsRecipeKnown(ID, profile)
|
||||
if not profile or not profile.professions then return end
|
||||
for _, prof in pairs(profile.professions) do
|
||||
if prof.knownRecipes[ID] then return true end
|
||||
end
|
||||
end
|
||||
|
||||
function AtlasLoot:GetKnownRecipes(spellID)
|
||||
--returns a list of characters with the recipe
|
||||
local text
|
||||
for key, profile in pairs(self.db.profiles) do
|
||||
if gsub(key,"-",""):match(gsub(realmName,"-","")) and not gsub(key,"-",""):match(gsub(playerName,"-","")) and self:IsRecipeKnown(spellID, profile) then
|
||||
local charName = strsplit("-", key, 5)
|
||||
text = text and text..", "..gsub(charName, " ", "") or gsub(charName, " ", "")
|
||||
end
|
||||
end
|
||||
return text
|
||||
end
|
||||
|
||||
function AtlasLoot:IsProfessionKnown(skillID, profile)
|
||||
if profile and profile.professions and profile.professions[skillID] then return true end
|
||||
end
|
||||
|
||||
function AtlasLoot:IsRecipeUnknown(ID)
|
||||
local recipeData = self:GetRecipeData(ID, "item")
|
||||
if not recipeData or not recipeData.skillIndex then return end
|
||||
|
||||
local text
|
||||
for key, profile in pairs(self.db.profiles) do
|
||||
if gsub(key,"-",""):match(gsub(realmName,"-","")) and
|
||||
self:IsProfessionKnown(recipeData.skillIndex, profile) and not self:IsRecipeKnown(recipeData.spellID, profile) then
|
||||
local charName = strsplit("-", key, 5)
|
||||
text = text and text..", "..gsub(charName, " ", "") or gsub(charName, " ", "")
|
||||
end
|
||||
end
|
||||
return text
|
||||
end
|
||||
|
||||
-- Get rep faction for when you have 2 loot tables and want to show a different one depending on rep
|
||||
function AtlasLoot:GetReputationFaction(factions)
|
||||
local factionIndex = 1
|
||||
@@ -247,21 +318,11 @@ function AtlasLoot:PopoupItemFrame(frame, data)
|
||||
--creates a button only if one dosnt already exist re use old one if it does
|
||||
local function createButton(num)
|
||||
if _G["AtlasLoot_PopupButton_"..num] then return end
|
||||
local button = CreateFrame("Button", "AtlasLoot_PopupButton_"..num, AtlasLoot_PopupFrame)
|
||||
local button = CreateFrame("Button", "AtlasLoot_PopupButton_"..num, AtlasLoot_PopupFrame, "ItemButtonTemplate")
|
||||
button:SetID(num)
|
||||
button:SetSize(30,30)
|
||||
button:EnableMouse()
|
||||
button:RegisterForClicks("AnyDown")
|
||||
button:SetHighlightTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight", "ADD")
|
||||
button.icon = button:CreateTexture(nil,"ARTWORK")
|
||||
button.icon:SetSize(30,30)
|
||||
button.icon:SetPoint("CENTER")
|
||||
button.name = button:CreateFontString(nil,"ARTWORK","GameFontHighlightLarge")
|
||||
button.name:SetFont("GameFontHighlightLarge", 30)
|
||||
button.name:SetSize(30,30)
|
||||
button.name:SetPoint("CENTER", button.icon,0,0)
|
||||
button.name:SetJustifyH("CENTER")
|
||||
button.name:Hide()
|
||||
button.number = num
|
||||
button:SetScript("OnClick", function(btn, arg1) self:ItemOnClick(btn, arg1) end)
|
||||
button:SetScript("OnEnter", function(btn)
|
||||
@@ -273,6 +334,7 @@ function AtlasLoot:PopoupItemFrame(frame, data)
|
||||
self:ItemOnLeave(btn)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
if num == 1 then
|
||||
button:SetPoint("TOPLEFT", "AtlasLoot_PopupFrame", 9, -8)
|
||||
@@ -303,7 +365,10 @@ function AtlasLoot:PopoupItemFrame(frame, data)
|
||||
self:ItemsLoading(-1)
|
||||
end)
|
||||
end
|
||||
button.icon:SetTexture(GetItemIcon(itemID))
|
||||
local itemData = {GetItemInfo(itemID)}
|
||||
SetItemButtonTexture(button, itemData[10])
|
||||
SetItemButtonQuality(button, itemData[3])
|
||||
|
||||
button.itemID = itemID
|
||||
button.itemTexture = frame.itemTexture
|
||||
local recipe = self:GetRecipeData(itemID, "item")
|
||||
@@ -311,10 +376,9 @@ function AtlasLoot:PopoupItemFrame(frame, data)
|
||||
button.craftingData = self:RecipeSource(recipe.spellID)
|
||||
end
|
||||
if item[2] then
|
||||
button.name:SetText(WHITE..item[2])
|
||||
button.name:Show()
|
||||
SetItemButtonCount(button, item[2])
|
||||
else
|
||||
button.name:Hide()
|
||||
SetItemButtonCount(button)
|
||||
end
|
||||
button:Show()
|
||||
end
|
||||
@@ -402,7 +466,7 @@ end
|
||||
|
||||
function AtlasLoot:ItemFrameRefresh()
|
||||
if refreshTimer then return end
|
||||
self:ScheduleTimer("ItemRefreshTimer", 5)
|
||||
self:ScheduleTimer("ItemRefreshTimer", .5)
|
||||
refreshTimer = true
|
||||
end
|
||||
-----------------------------------------------------
|
||||
@@ -453,4 +517,40 @@ function AtlasLoot:BatchRequestVanity(itemList)
|
||||
end
|
||||
end
|
||||
return nextItem()
|
||||
end
|
||||
end
|
||||
|
||||
local function CheckTooltipForDuplicate(tooltip, text)
|
||||
-- Check if we already added to this tooltip.
|
||||
for i = 1,15 do
|
||||
local frame = _G[tooltip:GetName() .. "TextLeft" .. i]
|
||||
local textOld
|
||||
if frame then textOld = frame:GetText() end
|
||||
if textOld and textOld == text then return true end
|
||||
end
|
||||
end
|
||||
|
||||
-- finds and sets the tooltip for the itemID that it is sent
|
||||
local function SetTooltip(itemID, tooltip)
|
||||
local self = AtlasLoot
|
||||
if not self.db.profile.showUnknownRecipeTooltip or UnitAffectingCombat("player") then return end
|
||||
local text = self:IsRecipeUnknown(itemID)
|
||||
if not text then return end
|
||||
text = "Recipe could be learned by: "..GREEN..text
|
||||
if not CheckTooltipForDuplicate(tooltip, text) then
|
||||
tooltip:AddLine(text)
|
||||
end
|
||||
end
|
||||
|
||||
-- item tooltip handler
|
||||
local function TooltipHandlerItem(tooltip)
|
||||
--checks for combat less likley to cause a lag spike
|
||||
if UnitAffectingCombat("player") then return end
|
||||
--get item link and itemID
|
||||
local link = select(2, tooltip:GetItem())
|
||||
if not link then return end
|
||||
local itemID = GetItemInfoFromHyperlink(link)
|
||||
if not itemID then return end
|
||||
SetTooltip(itemID, tooltip)
|
||||
end
|
||||
|
||||
GameTooltip:HookScript("OnTooltipSetItem", TooltipHandlerItem)
|
||||
Reference in New Issue
Block a user