1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2026-01-20 03:15:14 +00:00

Compare commits

..

No commits in common. "34c5323df3eea6021d5089ca3d6b529a47893a71" and "be3fdb09884b22e81c5dfc015e9ab637a3d9f178" have entirely different histories.

8 changed files with 54 additions and 77 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -69,6 +69,28 @@ MENU = ButtonWrapper(
button=(1156, 15, 1251, 63), button=(1156, 15, 1251, 63),
), ),
) )
MESSAGE_OFF = ButtonWrapper(
name='MESSAGE_OFF',
jp=None,
en=Button(
file='./assets/en/momotalk/MESSAGE_OFF.png',
area=(143, 273, 203, 298),
search=(123, 253, 223, 318),
color=(93, 105, 122),
button=(143, 273, 203, 298),
),
)
MESSAGE_ON = ButtonWrapper(
name='MESSAGE_ON',
jp=None,
en=Button(
file='./assets/en/momotalk/MESSAGE_ON.png',
area=(143, 271, 203, 301),
search=(123, 251, 223, 321),
color=(160, 168, 182),
button=(143, 271, 203, 301),
),
)
NOTIFICATION_BADGE = ButtonWrapper( NOTIFICATION_BADGE = ButtonWrapper(
name='NOTIFICATION_BADGE', name='NOTIFICATION_BADGE',
jp=None, jp=None,
@ -113,26 +135,26 @@ SKIP = ButtonWrapper(
button=(1192, 103, 1229, 141), button=(1192, 103, 1229, 141),
), ),
) )
SORT_ASCENDING = ButtonWrapper( SORT_OFF = ButtonWrapper(
name='SORT_ASCENDING', name='SORT_OFF',
jp=None, jp=None,
en=Button( en=Button(
file='./assets/en/momotalk/SORT_ASCENDING.png', file='./assets/en/momotalk/SORT_OFF.png',
area=(631, 166, 648, 188), area=(591, 158, 662, 199),
search=(611, 146, 668, 208), search=(571, 138, 682, 219),
color=(221, 228, 233), color=(235, 237, 238),
button=(631, 166, 648, 188), button=(591, 158, 662, 199),
), ),
) )
SORT_DESCENDING = ButtonWrapper( SORT_ON = ButtonWrapper(
name='SORT_DESCENDING', name='SORT_ON',
jp=None, jp=None,
en=Button( en=Button(
file='./assets/en/momotalk/SORT_DESCENDING.png', file='./assets/en/momotalk/SORT_ON.png',
area=(631, 166, 648, 189), area=(594, 159, 658, 196),
search=(611, 146, 668, 209), search=(574, 139, 678, 216),
color=(221, 228, 234), color=(233, 235, 236),
button=(631, 166, 648, 189), button=(594, 159, 658, 196),
), ),
) )
STORY = ButtonWrapper( STORY = ButtonWrapper(
@ -146,50 +168,6 @@ STORY = ButtonWrapper(
button=(790, 529, 979, 557), button=(790, 529, 979, 557),
), ),
) )
SWITCH_MESSAGE = ButtonWrapper(
name='SWITCH_MESSAGE',
jp=None,
en=Button(
file='./assets/en/momotalk/SWITCH_MESSAGE.png',
area=(147, 271, 194, 297),
search=(127, 251, 214, 317),
color=(187, 191, 201),
button=(147, 271, 194, 297),
),
)
SWITCH_MESSAGE_CHECK = ButtonWrapper(
name='SWITCH_MESSAGE_CHECK',
jp=None,
en=Button(
file='./assets/en/momotalk/SWITCH_MESSAGE_CHECK.png',
area=(228, 165, 391, 194),
search=(208, 145, 411, 214),
color=(211, 215, 217),
button=(228, 165, 391, 194),
),
)
SWITCH_STUDENT = ButtonWrapper(
name='SWITCH_STUDENT',
jp=None,
en=Button(
file='./assets/en/momotalk/SWITCH_STUDENT.png',
area=(148, 167, 194, 217),
search=(128, 147, 214, 237),
color=(157, 166, 179),
button=(148, 167, 194, 217),
),
)
SWITCH_STUDENT_CHECK = ButtonWrapper(
name='SWITCH_STUDENT_CHECK',
jp=None,
en=Button(
file='./assets/en/momotalk/SWITCH_STUDENT_CHECK.png',
area=(229, 166, 320, 192),
search=(209, 146, 340, 212),
color=(199, 203, 205),
button=(229, 166, 320, 192),
),
)
UNREAD = ButtonWrapper( UNREAD = ButtonWrapper(
name='UNREAD', name='UNREAD',
jp=None, jp=None,

View File

@ -1,33 +1,32 @@
from module.base.timer import Timer
from module.base.base import ModuleBase
from module.logger import logger
from module.ui.switch import Switch
from module.base.utils import point_in_area, area_size
from tasks.base.ui import UI
from tasks.base.page import page_main, page_momo_talk
from tasks.momotalk.assets.assets_momotalk import *
import cv2 import cv2
import numpy as np import numpy as np
from module.base.base import ModuleBase """None of the switches works"""
from module.base.timer import Timer SWITCH_MESSAGE = Switch("Message_switch")
from module.base.utils import point_in_area, area_size SWITCH_MESSAGE.add_state("on", MESSAGE_ON)
from module.logger import logger SWITCH_MESSAGE.add_state("off", MESSAGE_OFF)
from module.ui.switch import Switch
from tasks.base.page import page_main, page_momo_talk
from tasks.base.ui import UI
from tasks.momotalk.assets.assets_momotalk import *
SWITCH_SIDEBAR = Switch("Sidebar_switch", is_selector=True)
SWITCH_SIDEBAR.add_state("student", SWITCH_STUDENT_CHECK, SWITCH_STUDENT)
SWITCH_SIDEBAR.add_state("message", SWITCH_MESSAGE_CHECK, SWITCH_MESSAGE)
SWITCH_UNREAD = Switch("Unread_switch") SWITCH_UNREAD = Switch("Unread_switch")
SWITCH_UNREAD.add_state("on", UNREAD_ON) SWITCH_UNREAD.add_state("on", UNREAD_ON)
SWITCH_UNREAD.add_state("off", UNREAD_OFF) SWITCH_UNREAD.add_state("off", UNREAD_OFF)
SWITCH_SORT = Switch("Sort_switch") SWITCH_SORT = Switch("Sort_switch")
SWITCH_SORT.add_state("ascending", SORT_ASCENDING) SWITCH_SORT.add_state("on", SORT_ON)
SWITCH_SORT.add_state("descending", SORT_DESCENDING) SWITCH_SORT.add_state("off", SORT_OFF)
"""Required for template matching as reply and story """Required for template matching as reply and story
button can be found in different locations""" button can be found in different locations"""
REPLY_TEMPLATE = REPLY.matched_button.image REPLY_TEMPLATE = REPLY.matched_button.image
STORY_TEMPLATE = STORY.matched_button.image STORY_TEMPLATE = STORY.matched_button.image
class MomoTalkUI(UI): class MomoTalkUI(UI):
def __init__(self, config, device): def __init__(self, config, device):
super().__init__(config, device) super().__init__(config, device)
@ -122,10 +121,10 @@ class MomoTalkUI(UI):
self.ui_ensure(page_main) self.ui_ensure(page_main)
if self.match_color(NOTIFICATION_BADGE, threshold=80): if self.match_color(NOTIFICATION_BADGE, threshold=80):
self.ui_ensure(page_momo_talk) self.ui_ensure(page_momo_talk)
while SWITCH_SIDEBAR.get(self) != "message": while not self.select_then_check(MESSAGE_OFF, MESSAGE_ON):
SWITCH_SIDEBAR.set("message", self) pass
return True return True
logger.warning("No students available for interaction") logger.warn("No students available for interaction")
return False return False
def sort_messages(self): def sort_messages(self):
@ -145,7 +144,7 @@ class MomoTalkUI(UI):
""" """
if self.match_color(FIRST_UNREAD, threshold=80) and self.select_then_disappear(FIRST_UNREAD, SELECT_STUDENT, force_select=True): if self.match_color(FIRST_UNREAD, threshold=80) and self.select_then_disappear(FIRST_UNREAD, SELECT_STUDENT, force_select=True):
return True return True
logger.warning("No students available for interaction") logger.warn("No students available for interaction")
return False return False
def chat(self): def chat(self):