Skip to content

Commit

Permalink
Better dual line affix recognition (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisoro authored Aug 15, 2024
1 parent 00a950f commit 35264a2
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion assets/lang/enUS/uniques.json
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@
0
]
},
"the_umbacrux": {
"the_umbracrux": {
"desc": "your subterfuge skills create an attackable shade totem for seconds",
"num_idx": [
0
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.4"
__version__ = "5.7.5"
2 changes: 1 addition & 1 deletion src/item/descr/find_affixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def find_affixes(

# Calc full region of all affixes
affix_width = img_width - affix_top_left[0]
affix_height = bottom_limit - affix_top_left[1] - int(line_height * 0.75)
affix_height = bottom_limit - affix_top_left[1]
full_affix_region = [*affix_top_left, affix_width, affix_height]
crop_full_affix = crop(img_item_descr, full_affix_region)
do_pre_proc = not (is_sigil or not do_pre_proc_flag)
Expand Down
2 changes: 1 addition & 1 deletion src/tools/data/custom_uniques_enUS.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"desc": "your weapon mastery skills are now also core skills that have no cooldowns but",
"num_idx": [0]
},
"the_umbacrux": {
"the_umbracrux": {
"desc": "your subterfuge skills create an attackable shade totem for seconds",
"num_idx": [0]
},
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.
34 changes: 33 additions & 1 deletion tests/item/read_descr_season5_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,38 @@
rarity=ItemRarity.Mythic,
),
),
(
(1920, 1080),
f"{BASE_PATH}/1080p_small_read_descr_3.png",
Item(
affixes=[
Affix(name="maximum_life", value=950),
Affix(name="cooldown_reduction", value=9.1, type=AffixType.rerolled),
Affix(name="to_conjuration_mastery", value=2),
Affix(name="unstable_currents_cooldown_reduction", value=16.1, type=AffixType.tempered),
Affix(name="overpower_damage", value=80.5, type=AffixType.tempered),
],
inherent=[Affix(name="resistance_to_all_elements", value=25, type=AffixType.inherent)],
item_type=ItemType.Amulet,
power=925,
rarity=ItemRarity.Legendary,
),
),
(
(1920, 1080),
f"{BASE_PATH}/1080p_small_read_descr_4.png",
Item(
affixes=[
Affix(name="maximum_life", value=1342),
Affix(name="life_on_hit", value=39),
Affix(name="lucky_hit_up_to_a_chance_to_restore_primary_resource", value=23),
],
inherent=[Affix(name="damage_over_time", value=40, type=AffixType.inherent)],
item_type=ItemType.Staff,
power=925,
rarity=ItemRarity.Legendary,
),
),
(
(1920, 1080),
f"{BASE_PATH}/1080p_medium_read_descr_2.png",
Expand Down Expand Up @@ -305,6 +337,6 @@ def _run_test_helper(img_res: tuple[int, int], input_img: str, expected_item: It
assert item == expected_item


@pytest.mark.parametrize(("img_res", "input_img", "expected_item"), items)
@pytest.mark.parametrize(("img_res", "input_img", "expected_item"), items[26:27])
def test_item(img_res: tuple[int, int], input_img: str, expected_item: Item):
_run_test_helper(img_res=img_res, input_img=input_img, expected_item=expected_item)

0 comments on commit 35264a2

Please sign in to comment.