diff --git a/Libs/DF/auras.lua b/Libs/DF/auras.lua index efbca2fb..c5d6b17a 100644 --- a/Libs/DF/auras.lua +++ b/Libs/DF/auras.lua @@ -215,7 +215,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t f.OnProfileChanged = on_profile_changed f.LocTexts = texts options = options or {} - self.table.deploy (options, aura_panel_defaultoptions) + self.table.deploy(options, aura_panel_defaultoptions) local f_auto = CreateFrame("frame", "$parent_Automatic", f, "BackdropTemplate") local f_manual = CreateFrame("frame", "$parent_Manual", f, "BackdropTemplate") @@ -228,7 +228,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t --check if the texts table is valid and also deploy default values into the table in case some value is nil texts = (type(texts == "table") and texts) or default_text_for_aura_frame - DF.table.deploy (texts, default_text_for_aura_frame) + DF.table.deploy(texts, default_text_for_aura_frame) ------------- @@ -815,7 +815,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local icon = line:CreateTexture("$parentIcon", "overlay") icon:SetSize(lineHeight - 2, lineHeight - 2) - local name = line:CreateFontString ("$parentName", "overlay", "GameFontNormal") + local name = line:CreateFontString("$parentName", "overlay", "GameFontNormal") DF:SetFontSize (name, 10) local remove_button = CreateFrame("button", "$parentRemoveButton", line, "UIPanelCloseButton") @@ -995,7 +995,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t local icon = line:CreateTexture("$parentIcon", "overlay") icon:SetSize(scroll_line_height - 2, scroll_line_height - 2) - local name = line:CreateFontString ("$parentName", "overlay", "GameFontNormal") + local name = line:CreateFontString("$parentName", "overlay", "GameFontNormal") local remove_button = CreateFrame("button", "$parentRemoveButton", line, "UIPanelCloseButton") remove_button:SetSize(16, 16) @@ -1085,7 +1085,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t if (text ~= "") then --check for more than one spellname if (text:find (";")) then - for _, spellName in ipairs({strsplit (";", text)}) do + for _, spellName in ipairs({strsplit(";", text)}) do spellName = self:trim (spellName) local spellID = get_spellID_from_string (spellName) @@ -1132,7 +1132,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t if (text ~= "") then --check for more than one spellname if (text:find (";")) then - for _, spellName in ipairs({strsplit (";", text)}) do + for _, spellName in ipairs({strsplit(";", text)}) do spellName = self:trim (spellName) local spellID = get_spellID_from_string (spellName) diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 021cca1a..6c92c65f 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -107,15 +107,6 @@ function DF.IsShadowlandsWow() end end -function DF.GetContainerItemInfo(containerIndex, slotIndex) - if (DF.IsDragonflightAndBeyond()) then - local itemInfo = C_Container.GetContainerItemInfo(containerIndex, slotIndex) - return itemInfo.iconFileID, itemInfo.stackCount, itemInfo.isLocked, itemInfo.quality, itemInfo.isReadable, itemInfo.hasLoot, itemInfo.hyperlink, itemInfo.isFiltered, itemInfo.hasNoValue, itemInfo.itemID, itemInfo.isBound - else - return GetContainerItemInfo(containerIndex, slotIndex) - end -end - local roleBySpecTextureName = { DruidBalance = "DAMAGER", DruidFeralCombat = "DAMAGER", diff --git a/Libs/DF/iteminfo.lua b/Libs/DF/iteminfo.lua new file mode 100644 index 00000000..0cd4b9c0 --- /dev/null +++ b/Libs/DF/iteminfo.lua @@ -0,0 +1,27 @@ + +local detailsFramework = _G["DetailsFramework"] +if (not detailsFramework or not DetailsFrameworkCanLoad) then + return +end + +--namespace +detailsFramework.Items = {} + +local containerAPIVersion = 1 +if (detailsFramework.IsDragonflightAndBeyond()) then + containerAPIVersion = 2 +end + +function detailsFramework.Items.GetContainerItemInfo(containerIndex, slotIndex) + if (containerAPIVersion == 2) then + local itemInfo = C_Container.GetContainerItemInfo(containerIndex, slotIndex) + return itemInfo.iconFileID, itemInfo.stackCount, itemInfo.isLocked, itemInfo.quality, itemInfo.isReadable, itemInfo.hasLoot, itemInfo.hyperlink, itemInfo.isFiltered, itemInfo.hasNoValue, itemInfo.itemID, itemInfo.isBound + else + return GetContainerItemInfo(containerIndex, slotIndex) + end +end + +function detailsFramework.Items.IsItemSoulbound(containerIndex, slotIndex) + local bIsBound = select(11, detailsFramework.Items.GetContainerItemInfo(containerIndex, slotIndex)) + return bIsBound +end diff --git a/Libs/DF/load.xml b/Libs/DF/load.xml index 54d7feaf..404ef22b 100644 --- a/Libs/DF/load.xml +++ b/Libs/DF/load.xml @@ -4,6 +4,7 @@