From 5fb3182b246b007959dd1d991e2365e3dab7f139 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Sun, 28 Jan 2024 18:26:34 +0800 Subject: [PATCH] Fix: Detect Huohuo by avatar (#289) --- assets/share/character/switch/Huohuo.png | Bin 0 -> 6641 bytes .../assets/assets_character_switch.py | 10 +++++++ tasks/character/switch.py | 25 +++++++++++++----- 3 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 assets/share/character/switch/Huohuo.png diff --git a/assets/share/character/switch/Huohuo.png b/assets/share/character/switch/Huohuo.png new file mode 100644 index 0000000000000000000000000000000000000000..75757d1dafc2d49f5790ab5934fd08894d8c28b7 GIT binary patch literal 6641 zcmeI0_fykP^T6Nqq7-QnkS=^wno<-I0tS#EAiZ~xPUtOkMQlhfF+k`=Bp@IVq^lrc z=v}(BNDV!N`pxJ2{0+}9&v-L8dowq;v-{fJo7;P%`$V0Ao{Js;00s@Hsy+Zvk(T5G zwB#hA%=eg#BUB`rVu#5a|A~wW5~pI6~f~gASi^U?P4~|XHEv}UNEyLcf`D=H)dnMk_9zt ze?CeNMZI3gy;1M{@a=2!SR+fhExzfJ+VBwk=H|)xNfRy$ciIQFxR5KM27;l=$q-+aB zAt7Qt0KXhLpu)@AOTn*2k$Zcnb-vWbJEk5=2DD+*dJ&pK(roo<16)D7+w%(o3*S7d zAanOow@U- zcjS}+^OJu3q|Ng37=?EyS!F=0d#MF5X$-i`5v`=B=yJ{J2SSLkaJf@u-t0WxE(M-z z^p`Ge3ft#3-(HLbUr7J7xekb)=wI0O?d4Tel z4}4s2f8_cN`pYm`MWyGv4|3J;Dn`}imketD3GfHP-^M#c4c=jNdiTrD^4%*n+c&0M zBApx#%cio%39=46ruPEbx!bbs@U+*-W20C%Xsur`fAe^rn5b^5WvcQ)ctfa$rGeIj zF8altZ~q9Ue9);84q+j-2iwb6C7M1$i);z-3SI zhC6f$Dqd(%2p(c~&C(KCPlR>PF40y;q4^O>m_(*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o7( zvwfyx-iiIgB20BcvCXxUOn*^04JplX2N~+pSLi!PrSr~XjgOBn(%bu_!m1G*X OcrResultButton | None: + def _iter_character_by_avatar(self) -> t.Iterable[OcrResultButton]: + """ + Detect characters that can't be found by OCR + """ dict_template = { KEYWORD_CHARACTER_LIST.TrailblazerDestruction: [ TrailblazerDestructionMale, @@ -86,17 +95,19 @@ class CharacterSwitch(UI): TrailblazerPreservationFemale, ], + KEYWORD_CHARACTER_LIST.Huohuo: [ + Huohuo, + ], } for character, templates in dict_template.items(): for template in templates: template.load_search(TRAILBLAZER_SEARCH.area) if template.match_template(self.device.image): - logger.info(f'Found trailblazer: {template}') + logger.info(f'Found avatar {template}') # Create a fake OcrResultButton object box = BoxedResult(box=template.button, text_img=None, ocr_text='', score=1.0) button = OcrResultButton(boxed_result=box, matched_keyword=character) - return button - return None + yield button def _update_current_character(self) -> list[int]: """