diff --git a/BagSync.lua b/BagSync.lua index 8fd5cb7..2626483 100644 --- a/BagSync.lua +++ b/BagSync.lua @@ -109,6 +109,7 @@ local function StartupDB() if BagSyncOpt.enableMinimap == nil then BagSyncOpt.enableMinimap = true end if BagSyncOpt.enableFaction == nil then BagSyncOpt.enableFaction = true end if BagSyncOpt.enableAuction == nil then BagSyncOpt.enableAuction = true end + if BagSyncOpt.tooltipOnlySearch == nil then BagSyncOpt.tooltipOnlySearch = false end BagSyncGUILD_DB = BagSyncGUILD_DB or {} BagSyncGUILD_DB[currentRealm] = BagSyncGUILD_DB[currentRealm] or {} @@ -933,12 +934,18 @@ end local function AddOwners(frame, link) frame.BagSyncShowOnce = nil + --only show tooltips in search frame if the option is enabled + if BagSyncOpt.tooltipOnlySearch and frame:GetOwner() and frame:GetOwner():GetName() and string.sub(frame:GetOwner():GetName(), 1, 16) ~= "BagSyncSearchRow" then + frame:Show() + return + end + local itemLink = ToShortLink(link) if not itemLink then frame:Show() return end - + --ignore the hearthstone if itemLink and tonumber(itemLink) and tonumber(itemLink) == 6948 then frame:Show() diff --git a/BagSync_Config.lua b/BagSync_Config.lua index 07a0f27..580ca09 100644 --- a/BagSync_Config.lua +++ b/BagSync_Config.lua @@ -183,3 +183,23 @@ end) local bgs_AuctionInfo_OptText = bgs_AuctionInfo_Opt:CreateFontString(nil, "ARTWORK", "GameFontHighlight") bgs_AuctionInfo_OptText:SetPoint("LEFT", bgs_AuctionInfo_Opt, "RIGHT", 0, 1) bgs_AuctionInfo_OptText:SetText(L["Enable auction house items."]) + +--[[ Display tooltips only in the BagSync Search window ]]-- +local bgs_TooltipSearchOnly_Opt = CreateFrame("CheckButton", "BagSyncConfig_TooltipSearchOnly", bgsOpt, "OptionsBaseCheckButtonTemplate") +bgs_TooltipSearchOnly_Opt:SetPoint("TOPLEFT", 16, -269) +bgs_TooltipSearchOnly_Opt:SetScript("OnClick", function(frame) + if BagSyncOpt then + if frame:GetChecked() then + PlaySound("igMainMenuOptionCheckBoxOn") + BagSyncOpt["tooltipOnlySearch"] = true + if BagSync then BagSync:resetTooltip() end + else + PlaySound("igMainMenuOptionCheckBoxOff") + BagSyncOpt["tooltipOnlySearch"] = false + if BagSync then BagSync:resetTooltip() end + end + end +end) +local bgs_TooltipSearchOnly_OptText = bgs_TooltipSearchOnly_Opt:CreateFontString(nil, "ARTWORK", "GameFontHighlight") +bgs_TooltipSearchOnly_OptText:SetPoint("LEFT", bgs_TooltipSearchOnly_Opt, "RIGHT", 0, 1) +bgs_TooltipSearchOnly_OptText:SetText(L["Display modified tooltips ONLY in the BagSync Search window."]) diff --git a/BagSync_Search.lua b/BagSync_Search.lua index 6dea010..c0a3a2b 100644 --- a/BagSync_Search.lua +++ b/BagSync_Search.lua @@ -25,7 +25,7 @@ local function LoadSlider() for i=1, totalRows do if not rows[i] then - local row = CreateFrame("Button", nil, bgSearch) + local row = CreateFrame("Button", "BagSyncSearchRow"..i, bgSearch) if not anchor then row:SetPoint("BOTTOMLEFT", bgSearch, "TOPLEFT", 0, SCROLL_TOP_POSITION) else row:SetPoint("TOP", anchor, "BOTTOM", 0, -ROWGAP) end row:SetPoint("LEFT", EDGEGAP, 0) diff --git a/localization/localization.lua b/localization/localization.lua index f2ab3a1..dcbd8e9 100644 --- a/localization/localization.lua +++ b/localization/localization.lua @@ -57,7 +57,7 @@ -- ["Display BagSync minimap button."] = "", -- ["Display items for both factions (Alliance/Horde)."] = "", -- ["Display class colors for characters."] = "", - +-- ["Display modified tooltips ONLY in the BagSync Search window."] = "", BAGSYNC_L = GetLocale() == "zhCN" and { ["Bags: %d"] = "背包: %d",