diff --git a/assets/jp/cafe/INVENTORY.BUTTON.png b/assets/jp/cafe/INVENTORY.BUTTON.png new file mode 100644 index 0000000..adf6372 Binary files /dev/null and b/assets/jp/cafe/INVENTORY.BUTTON.png differ diff --git a/assets/jp/cafe/INVENTORY.png b/assets/jp/cafe/INVENTORY.png new file mode 100644 index 0000000..88a2d8b Binary files /dev/null and b/assets/jp/cafe/INVENTORY.png differ diff --git a/assets/jp/cafe/MOMOTALK_CLOSE.png b/assets/jp/cafe/MOMOTALK_CLOSE.png new file mode 100644 index 0000000..6a220ac Binary files /dev/null and b/assets/jp/cafe/MOMOTALK_CLOSE.png differ diff --git a/tasks/cafe/assets/assets_cafe.py b/tasks/cafe/assets/assets_cafe.py index 11220ae..ead271e 100644 --- a/tasks/cafe/assets/assets_cafe.py +++ b/tasks/cafe/assets/assets_cafe.py @@ -103,6 +103,26 @@ GOT_REWARD = ButtonWrapper( button=(561, 501, 718, 556), ), ) +INVENTORY = ButtonWrapper( + name='INVENTORY', + jp=Button( + file='./assets/jp/cafe/INVENTORY.png', + area=(553, 94, 725, 122), + search=(533, 74, 745, 142), + color=(198, 205, 213), + button=(1130, 94, 1156, 120), + ), +) +MOMOTALK_CLOSE = ButtonWrapper( + name='MOMOTALK_CLOSE', + jp=Button( + file='./assets/jp/cafe/MOMOTALK_CLOSE.png', + area=(824, 82, 850, 108), + search=(804, 62, 870, 128), + color=(252, 182, 194), + button=(824, 82, 850, 108), + ), +) OCR_CAFE = ButtonWrapper( name='OCR_CAFE', jp=Button( diff --git a/tasks/cafe/cafe.py b/tasks/cafe/cafe.py index 7c465a9..e434095 100644 --- a/tasks/cafe/cafe.py +++ b/tasks/cafe/cafe.py @@ -120,6 +120,13 @@ class Cafe(UI): logger.attr('Reward', num) return num + def _cafe_additional(self) -> bool: + if self.appear_then_click(INVENTORY): + return True + if self.appear_then_click(MOMOTALK_CLOSE): + return True + return False + def _handle_cafe(self, status): match status: case CafeStatus.STUDENT_LIST: @@ -206,7 +213,7 @@ class Cafe(UI): self.device.screenshot() - if self.ui_additional(): + if self.ui_additional() or self._cafe_additional(): continue if not loading_timer.reached():