Skip to content

Commit

Permalink
Fixed issue where a warning for advanced tooltip information was inco…
Browse files Browse the repository at this point in the history
…rrectly being shown when your inventory was all rares (#458)
  • Loading branch information
cjshrader authored Mar 3, 2025
1 parent ae9df0a commit 87a531f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
18 changes: 9 additions & 9 deletions src/item/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,31 @@ def __eq__(self, other):
return False
res = True
if self.affixes != other.affixes:
LOGGER.debug("Affixes do not match")
# LOGGER.debug("Affixes do not match")
res = False
if self.aspect != other.aspect:
LOGGER.debug("Aspect not the same")
# LOGGER.debug("Aspect not the same")
res = False
if self.codex_upgrade != other.codex_upgrade:
LOGGER.debug("Codex upgrade not the same")
# LOGGER.debug("Codex upgrade not the same")
res = False
if self.cosmetic_upgrade != other.cosmetic_upgrade:
LOGGER.debug("Cosmetic upgrade not the same")
# LOGGER.debug("Cosmetic upgrade not the same")
res = False
if self.inherent != other.inherent:
LOGGER.debug("Inherent affixes do not match")
# LOGGER.debug("Inherent affixes do not match")
res = False
if self.item_type != other.item_type:
LOGGER.debug("Type not the same")
# LOGGER.debug("Type not the same")
res = False
if self.power != other.power:
LOGGER.debug("Power not the same")
# LOGGER.debug("Power not the same")
res = False
if self.name != other.name:
LOGGER.debug("Names do not match")
# LOGGER.debug("Names do not match")
res = False
if self.rarity != other.rarity:
LOGGER.debug("Rarity not the same")
# LOGGER.debug("Rarity not the same")
res = False
return res

Expand Down
13 changes: 7 additions & 6 deletions src/scripts/loot_filter_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from src.config.models import ItemRefreshType, UnfilteredUniquesType
from src.item.data.affix import AffixType
from src.item.data.item_type import ItemType
from src.item.data.rarity import ItemRarity
from src.item.data.rarity import ItemRarity, is_junk_rarity
from src.item.filter import Filter
from src.scripts.common import is_ignored_item, mark_as_favorite, mark_as_junk, reset_item_status
from src.ui.inventory_base import InventoryBase
Expand Down Expand Up @@ -58,9 +58,10 @@ def check_items(inv: InventoryBase, force_refresh: ItemRefreshType):
if is_ignored_item(item_descr):
continue

num_of_affixed_items_checked += 1
if all(affix.type == AffixType.greater for affix in item_descr.affixes):
num_of_items_with_all_ga += 1
if not is_junk_rarity(item_descr.rarity):
num_of_affixed_items_checked += 1
if item_descr.affixes and all(affix.type == AffixType.greater for affix in item_descr.affixes):
num_of_items_with_all_ga += 1

# Check if we want to keep the item
res = Filter().should_keep(item_descr)
Expand Down Expand Up @@ -103,7 +104,7 @@ def check_items(inv: InventoryBase, force_refresh: ItemRefreshType):
LOGGER.debug(f" Time to filter all items in stash/inventory tab: {time.time() - start_checking_items:.2f}s")

# If more than 80% of the items had all greater affixes that means something is probably wrong
if num_of_affixed_items_checked > 1 and (num_of_items_with_all_ga / num_of_affixed_items_checked > 0.8):
if num_of_affixed_items_checked > 2 and (num_of_items_with_all_ga / num_of_affixed_items_checked > 0.8):
LOGGER.warning(
f"{num_of_items_with_all_ga} out of {num_of_affixed_items_checked} items checked had all greater affixes. You are either exceptionally lucky or have not enabled Advanced Tooltip Information in Options > Gameplay"
f"{num_of_items_with_all_ga} out of {num_of_affixed_items_checked} non-junk rarity items checked had all greater affixes. You are either exceptionally lucky or have not enabled Advanced Tooltip Information in Options > Gameplay"
)

0 comments on commit 87a531f

Please sign in to comment.