Skip to content

Commit 254c2c4

Browse files
committed
Retail: Search: New keyword "active" for current season gear
1 parent 1d854fc commit 254c2c4

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

Locales.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ L["KEYWORD_CATALYST_UPGRADE"] = "catalyst upgrade"
142142
L["KEYWORD_ENSEMBLE"] = "ensemble"
143143
L["KEYWORD_ARSENAL"] = "arsenal"
144144
L["KEYWORD_CONJURED"] = "conjured"
145+
L["KEYWORD_ACTIVE"] = "active"
145146

146147
L["GROUP_ARMOR_TYPE"] = "Armor Type"
147148
L["GROUP_BATTLE_PET"] = "Battle Pet Type"

Search/CheckItem.lua

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,33 @@ local function UsableCheck(details)
653653
end
654654
end
655655

656+
local function ActiveCheck(details)
657+
if not C_Item.IsItemDataCachedByID(details.itemID) then
658+
C_Item.RequestLoadItemDataByID(details.itemID)
659+
return
660+
end
661+
if not Syndicator.Utilities.IsEquipment(details.itemLink) then
662+
return false
663+
end
664+
local upgradeInfo = C_Item.GetItemUpgradeInfo(details.itemLink)
665+
if not upgradeInfo or not upgradeInfo.trackString then
666+
return false
667+
end
668+
669+
GetTooltipInfoSpell(details)
670+
671+
if details.tooltipInfoSpell then
672+
for index = 1, math.min(#details.tooltipInfoSpell.lines, 4) do
673+
local row = details.tooltipInfoSpell.lines[index]
674+
local r, g, b = math.floor(row.leftColor.r * 100), math.floor(row.leftColor.g * 100), math.floor(row.leftColor.b * 100)
675+
if r == g and g == b and r < 60 then
676+
return false
677+
end
678+
end
679+
return true
680+
end
681+
end
682+
656683
local function OpenCheck(details)
657684
if not details.itemLink:find("item:", nil, true) then
658685
return false
@@ -1022,6 +1049,7 @@ if Syndicator.Constants.IsRetail then
10221049
AddKeywordLocalised("KEYWORD_SET_BONUS", SetBonusCheck, Syndicator.Locales.GROUP_ITEM_DETAIL)
10231050
AddKeywordLocalised("KEYWORD_CATALYST", CatalystCheck, Syndicator.Locales.GROUP_ITEM_DETAIL)
10241051
AddKeywordLocalised("KEYWORD_CATALYST_UPGRADE", CatalystUpgradeCheck, Syndicator.Locales.GROUP_ITEM_DETAIL)
1052+
AddKeywordLocalised("KEYWORD_ACTIVE", ActiveCheck, Syndicator.Locales.GROUP_ITEM_DETAIL)
10251053
if Syndicator.Constants.WarbandBankActive then
10261054
AddKeywordManual(ITEM_ACCOUNTBOUND:lower(), "warbound", BindOnAccountCheck, Syndicator.Locales.GROUP_BINDING_TYPE)
10271055
AddKeywordManual(ITEM_ACCOUNTBOUND_UNTIL_EQUIP:lower(), "warbound until equipped", WarboundUntilEquippedCheck, Syndicator.Locales.GROUP_BINDING_TYPE)

0 commit comments

Comments
 (0)