Skip to content

Commit

Permalink
more tests, some sigil improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisoro committed Aug 19, 2024
1 parent 41a8960 commit 8a67ce6
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ feature request or issue reports join the [discord](https://discord.gg/YyzaPhAN6

- Font size can be small or medium in the Gameplay Settings
- Game Language must be English
- The tool does not play well with HDR as it makes everything super bright
- The advanced item comparison feature might cause incorrect classifications
- Stuttering has been reported on some machines with V-Sync, G-Sync, Active Sync or similar enabled in the settings.
- **The tool does not play well with HDR as it makes everything super bright**
- **The advanced item comparison feature might cause incorrect classifications**
- **Stuttering has been reported on some machines with V-Sync, G-Sync, Active Sync or similar enabled in the settings**

### Quick start guide

Expand Down
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

TP = concurrent.futures.ThreadPoolExecutor()

__version__ = "5.7.6"
__version__ = "5.7.7"
11 changes: 8 additions & 3 deletions src/item/descr/find_affixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def find_affixes(
for error, correction in Dataloader().error_map.items():
combined_lines = combined_lines.replace(error, correction)
cleaned_str = clean_str(combined_lines)
if len(cleaned_str) < 4:
continue

if is_sigil:
# A bit of a hack to match the locations...
Expand All @@ -117,11 +119,14 @@ def find_affixes(
found_key = closest_match(cleaned_str, adapted_search_dict)
else:
found_key = closest_match(cleaned_str, Dataloader().affix_dict)
found_value = find_number(combined_lines)
if found_key is not None:
affixes.append(Affix(name=found_key, value=found_value, text=combined_lines))
if is_sigil:
affixes.append(Affix(name=found_key, value=None, text=combined_lines))
else:
affixes.append(Affix(name=found_key, value=find_number(combined_lines), text=combined_lines))
else:
LOGGER.warning(f"Affix does not exist: {cleaned_str=} ||| {combined_lines=}")
if not is_sigil:
LOGGER.warning(f"Affix does not exist: {cleaned_str=} ||| {combined_lines=}")

# Add location to the found_values
affix_x = affix_bullets[0].center[0]
Expand Down
2 changes: 1 addition & 1 deletion src/item/descr/texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def find_affix_bullets(img_item_descr: np.ndarray, sep_short_match: TemplateMatc
def find_aspect_bullet(img_item_descr: np.ndarray, sep_short_match: TemplateMatch) -> TemplateMatch | None:
template_list = ["legendary_bullet_point", "unique_bullet_point", "mythic_bullet_point"]
all_templates = [f"{x}_medium" for x in template_list] + template_list
if ResManager().resolution == "1920x1080":
if ResManager().resolution.endswith("1080"):
all_templates += ["mythic_bullet_point_1080p_special", "mythic_bullet_point_medium_1080p_special"]
aspect_bullets = _find_bullets(
img_item_descr=img_item_descr,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 84 additions & 3 deletions tests/item/read_descr_season5_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,21 @@
rarity=ItemRarity.Unique,
),
),
(
(3840, 2160),
f"{BASE_PATH}/2160p_small_read_descr_14.png",
Item(
affixes=[
Affix(name="attack_speed", value=8),
Affix(name="lightning_resistance", value=37),
Affix(name="to_shocking_impact", value=1),
],
inherent=[Affix(name="resistance_to_all_elements", value=25, type=AffixType.inherent)],
item_type=ItemType.Amulet,
power=925,
rarity=ItemRarity.Legendary,
),
),
(
(2160, 1440),
f"{BASE_PATH}/1440p_small_read_descr_1.png",
Expand All @@ -265,7 +280,7 @@
),
),
(
(3840, 1440),
(3440, 1440),
f"{BASE_PATH}/1440p_small_read_descr_2.png",
Item(
affixes=[
Expand All @@ -278,6 +293,62 @@
rarity=ItemRarity.Legendary,
),
),
(
(3440, 1440),
f"{BASE_PATH}/1440p_small_read_descr_3.png",
Item(
affixes=[
Affix(name="intelligence", value=80),
Affix(name="fire_resistance", value=34),
Affix(name="to_basic_skills", value=2),
],
item_type=ItemType.Legs,
power=925,
rarity=ItemRarity.Legendary,
),
),
(
(3440, 1440),
f"{BASE_PATH}/1440p_small_read_descr_4.png",
Item(
affixes=[
Affix(name="life_per_second", value=114),
Affix(name="shadow_resistance", value=39),
Affix(name="to_curse_skills", value=1),
],
item_type=ItemType.Helm,
power=925,
rarity=ItemRarity.Legendary,
),
),
(
(3440, 1440),
f"{BASE_PATH}/1440p_small_read_descr_5.png",
Item(
affixes=[
Affix(name="life_per_second", value=121),
Affix(name="healing_received", value=11.5),
Affix(name="to_curse_skills", value=2),
],
item_type=ItemType.Helm,
power=925,
rarity=ItemRarity.Legendary,
),
),
(
(3440, 1440),
f"{BASE_PATH}/1440p_small_read_descr_6.png",
Item(
affixes=[
Affix(name="intelligence", value=77),
Affix(name="maximum_life", value=794),
Affix(name="damage_over_time", value=51),
],
item_type=ItemType.Gloves,
power=925,
rarity=ItemRarity.Legendary,
),
),
(
(1920, 1080),
f"{BASE_PATH}/1080p_small_read_descr_1.png",
Expand Down Expand Up @@ -330,7 +401,6 @@
),
),
(
# TODO fix multi line detection via bottom limit / find_affixes
(1920, 1080),
f"{BASE_PATH}/1080p_small_read_descr_4.png",
Item(
Expand Down Expand Up @@ -399,13 +469,24 @@
(2560, 1440),
f"{BASE_PATH}/1440p_small_sigil_1.png",
Item(
affixes=[Affix(name="quick_killer", value=2), Affix(name="empowered_elites_poison_enchanted")],
affixes=[Affix(name="quick_killer"), Affix(name="empowered_elites_poison_enchanted")],
inherent=[Affix(name="sanguine_chapel", type=AffixType.inherent)],
item_type=ItemType.Sigil,
power=41,
rarity=ItemRarity.Common,
),
),
(
(2560, 1440),
f"{BASE_PATH}/1440p_small_sigil_2.png",
Item(
affixes=[Affix(name="extra_shrines"), Affix(name="stormbanes_wrath")],
inherent=[Affix(name="buried_halls", type=AffixType.inherent)],
item_type=ItemType.Sigil,
power=23,
rarity=ItemRarity.Common,
),
),
]


Expand Down

0 comments on commit 8a67ce6

Please sign in to comment.