Skip to content

Commit e76bccb

Browse files
authored
Vision Mode with Highlighting will now check shops as well, which is mostly only useful for the shop in The Den. This juice was not worth the squeeze. (d4lfteam#495)
1 parent 624645e commit e76bccb

17 files changed

Lines changed: 70 additions & 34 deletions
19.7 KB
Loading
6.39 KB
Loading
-310 KB
Binary file not shown.

src/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
TP = concurrent.futures.ThreadPoolExecutor()
44

5-
__version__ = "7.1.7"
5+
__version__ = "7.1.8"

src/config/data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@
5353
rel_descr_search_left=np.array([-900, 0, 150, 1760]),
5454
rel_descr_search_right=np.array([60, 0, 120, 1760]),
5555
rel_fav_flag=np.array([8, 6, 16, 20]),
56+
slots_8x1=np.array([1166, 165, 125, 1462]),
5657
slots_3x11=np.array([2536, 1444, 1214, 486]),
5758
slots_5x10=np.array([92, 538, 1224, 972]),
5859
sort_icon=np.array([2440, 1332, 126, 124]),
5960
stash_menu_icon=np.array([592, 144, 218, 96]),
6061
tab_slots_6=np.array([300, 284, 800, 102]),
61-
vendor_text=np.array([200, 782, 188, 44]),
62+
vendor_menu_icon=np.array([182, 757, 220, 90]),
6263
),
6364
)
6465

src/config/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,10 @@ class UiRoiModel(NumpyModel):
561561
rel_descr_search_left: np_array_pydantic_annotated_typing(dimensions=1)
562562
rel_descr_search_right: np_array_pydantic_annotated_typing(dimensions=1)
563563
rel_fav_flag: np_array_pydantic_annotated_typing(dimensions=1)
564+
slots_8x1: np_array_pydantic_annotated_typing(dimensions=1)
564565
slots_3x11: np_array_pydantic_annotated_typing(dimensions=1)
565566
slots_5x10: np_array_pydantic_annotated_typing(dimensions=1)
566567
sort_icon: np_array_pydantic_annotated_typing(dimensions=1)
567568
stash_menu_icon: np_array_pydantic_annotated_typing(dimensions=1)
568569
tab_slots_6: np_array_pydantic_annotated_typing(dimensions=1)
569-
vendor_text: np_array_pydantic_annotated_typing(dimensions=1)
570+
vendor_menu_icon: np_array_pydantic_annotated_typing(dimensions=1)

src/config/ui.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,13 @@ def fromUHD(self) -> tuple[UiOffsetsModel, UiPosModel, UiRoiModel, dict[str, Tem
8484
rel_descr_search_left=self._transform_array(value=POSITIONS[3].rel_descr_search_left, scale_only=True),
8585
rel_descr_search_right=self._transform_array(value=POSITIONS[3].rel_descr_search_right, scale_only=True),
8686
rel_fav_flag=self._transform_array(value=POSITIONS[3].rel_fav_flag, scale_only=True),
87+
slots_8x1=self._transform_array(value=POSITIONS[3].slots_8x1),
8788
slots_3x11=self._transform_array(value=POSITIONS[3].slots_3x11),
8889
slots_5x10=self._transform_array(value=POSITIONS[3].slots_5x10),
8990
sort_icon=self._transform_array(value=POSITIONS[3].sort_icon),
9091
stash_menu_icon=self._transform_array(value=POSITIONS[3].stash_menu_icon),
9192
tab_slots_6=self._transform_array(value=POSITIONS[3].tab_slots_6),
92-
vendor_text=self._transform_array(value=POSITIONS[3].vendor_text),
93+
vendor_menu_icon=self._transform_array(value=POSITIONS[3].vendor_menu_icon),
9394
)
9495
templates = self._transform_templates(load_templates())
9596
return offsets, pos, roi, templates

src/item/descr/read_descr_tts.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ def _create_base_item_from_tts(tts_item: list[str]) -> Item | None:
177177
return Item(item_type=ItemType.Material)
178178
if any(tts_item[1].lower().endswith(x) for x in ["gem"]):
179179
return Item(item_type=ItemType.Gem)
180-
if any(tts_item[1].lower().endswith(x) for x in ["cache"]):
181-
return Item(item_type=ItemType.Cache)
182180
if any(tts_item[1].lower().endswith(x) for x in ["whispering wood"]):
183181
return Item(item_type=ItemType.WhisperingWood)
184182
if any(tts_item[1].lower().startswith(x) for x in ["cosmetic"]):
@@ -191,6 +189,11 @@ def _create_base_item_from_tts(tts_item: list[str]) -> Item | None:
191189
item.rarity = _get_item_rarity(search_string_split[0])
192190
return item
193191
item = Item()
192+
if any("Cost : " in value for value in tts_item):
193+
item.is_in_shop = True
194+
if any(tts_item[1].lower().endswith(x) for x in ["cache"]):
195+
item.item_type = ItemType.Cache
196+
return item
194197
if tts_item[1].lower().endswith("elixir"):
195198
item.item_type = ItemType.Elixir
196199
elif tts_item[1].lower().endswith("incense"):

src/item/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class Item:
1717
codex_upgrade: bool = False
1818
cosmetic_upgrade: bool = False
1919
inherent: list[Affix] = field(default_factory=list)
20+
is_in_shop: bool = False
2021
item_type: ItemType | None = None
2122
name: str | None = None
2223
power: int | None = None
@@ -53,6 +54,8 @@ def __eq__(self, other):
5354
if self.rarity != other.rarity:
5455
# LOGGER.debug("Rarity not the same")
5556
res = False
57+
if self.is_in_shop != other.is_in_shop:
58+
res = False
5659
return res
5760

5861

src/loot_mover.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from src.config.loader import IniConfigLoader
55
from src.config.models import MoveItemsType
66
from src.ui.char_inventory import CharInventory
7-
from src.ui.chest import Chest
87
from src.ui.inventory_base import ItemSlot
8+
from src.ui.stash import Stash
99
from src.utils.custom_mouse import mouse
1010

1111
LOGGER = logging.getLogger(__name__)
@@ -15,9 +15,9 @@ def move_items_to_stash():
1515
LOGGER.info("Move inventory items to stash")
1616

1717
inv = CharInventory()
18-
chest = Chest()
18+
stash = Stash()
1919

20-
if not chest.is_open():
20+
if not stash.is_open():
2121
LOGGER.error("Moving items only works if stash is open")
2222
return
2323

@@ -28,9 +28,9 @@ def move_items_to_stash():
2828
return
2929

3030
for i in IniConfigLoader().general.check_chest_tabs:
31-
chest.switch_to_tab(i)
31+
stash.switch_to_tab(i)
3232

33-
_, empty_chest = chest.get_item_slots()
33+
_, empty_chest = stash.get_item_slots()
3434

3535
if not empty_chest:
3636
continue
@@ -48,9 +48,9 @@ def move_items_to_inventory():
4848
LOGGER.info("Move stash items to inventory")
4949

5050
inv = CharInventory()
51-
chest = Chest()
51+
stash = Stash()
5252

53-
if not chest.is_open():
53+
if not stash.is_open():
5454
LOGGER.error("Moving items only works if stash is open")
5555
return
5656

@@ -62,8 +62,8 @@ def move_items_to_inventory():
6262
return
6363

6464
for i in IniConfigLoader().general.check_chest_tabs:
65-
chest.switch_to_tab(i)
66-
unhandled_slots, _ = chest.get_item_slots()
65+
stash.switch_to_tab(i)
66+
unhandled_slots, _ = stash.get_item_slots()
6767

6868
LOGGER.debug(
6969
f"Stash tab {i} - Number of stash items: {len(unhandled_slots)} - Number of empty inventory spaces: {empty_slot_count}"

0 commit comments

Comments
 (0)