예제 #1
0
class PopupFleetSelectionArbitrate(PopupFleetSelection):
    name = Namespace.popup_fleet_selection_arbitrate
    map_fleet_no = dict(
        zip(range(1, 7),
            (f"Button_Fleet{x}"
             for x in ("One", "Two", "Three", "Four", "Five", "Six"))))

    is_fleet_fixed = False

    @classmethod
    def at_this_scene_impl(cls, window) -> bool:
        return (not cls._is_fixed_fleet(window)
                ) and super().at_this_scene_impl(window)

    @classmethod
    def choose_team(cls, window, team_one=None, team_two=None):
        btn = "PopupFleetSelect.Formation"

        if (key := cls.map_fleet_no.get(team_one)) is not None:
            window.left_click(am.rect(f"{btn}.Button_ChooseTeamOne"), sleep=.5)
            window.left_click(am.rect(f"{btn}.Button_ChooseTeamOne.{key}"),
                              sleep=.5)

        if (key := cls.map_fleet_no.get(team_two)) is not None:
            window.left_click(am.rect(f"{btn}.Button_ChooseTeamTwo"), sleep=.5)
            window.left_click(am.rect(f"{btn}.Button_ChooseTeamTwo.{key}"),
                              sleep=1)
예제 #2
0
    def choose_team(cls, window, team_one=None, team_two=None):
        btn = "PopupFleetSelect.Formation"

        if (key := cls.map_fleet_no.get(team_one)) is not None:
            window.left_click(am.rect(f"{btn}.Button_ChooseTeamOne"), sleep=.5)
            window.left_click(am.rect(f"{btn}.Button_ChooseTeamOne.{key}"),
                              sleep=.5)
예제 #3
0
    def set_auto_submarine(cls, window, turn_on=False):
        if not cls.is_automation(window):
            return turn_on is False

        if cls.is_auto_submarine_off(window) is turn_on:
            window.left_click(am.rect(
                "BeforeBattle.Formation.Automation.Button_AutoSubmarine"),
                              sleep=1)
        return cls.is_auto_submarine_off(window) is turn_on
예제 #4
0
 def open_stage_popup(cls, window, chapter_no=None):
     window.left_click(
         am.rect(f"CampaignChapter.Chapters.Stages.{chapter_no}"))
예제 #5
0
 def goto_scene_chapter03(cls, window):
     window.left_click(am.rect(
         "AnchorAweigh.Button_RescueSOS.Popup_RescueSOS.Button_Chapter03"),
                       sleep=1.5)
예제 #6
0
 def goto_battle(cls, window):
     window.left_click(am.rect("BeforeBattle.Formation.Button_WeighAnchor"),
                       sleep=2.5)
예제 #7
0
 def goto_scene_anchor_aweigh(cls, window):
     window.left_click(am.rect("Main.Button_AnchorAweigh"), sleep=1.5)
예제 #8
0
 def open_popup_living_area(cls, window):
     window.left_click(am.rect("Main.Button_LivingArea"))
예제 #9
0
 def set_automation(cls, window, turn_on=True, sleep=1):
     if turn_on is not cls.is_automation(window):
         window.left_click(am.rect("PopupStageInfo.Button_Automation"),
                           sleep=1)
     time.sleep(sleep)
예제 #10
0
 def goto_scene_campaign_chapter(cls, window):
     window.left_click(am.rect("AnchorAweigh.Button_MainBattleLine"), sleep=1)
예제 #11
0
 def close_popup(window):
     window.left_click(am.rect("PopupStageInfo.Button_Close"), sleep=1)
예제 #12
0
    def is_automation(cls, window) -> bool:
        lt, rb = am.rect("PopupStageInfo.Button_Automation")
        mid = tuple(int((lt[i] + rb[i]) / 2) for i in range(2))
        rgb_tuple = window.pixel_from_window(*mid, as_int=False)

        return rgb_tuple[0] > 100
예제 #13
0
 def goto_popup_get_items(cls, window):
     window.left_click(am.rect(
         "Main.Button_Commission.Popup_Commission.Delegation.Popup_DelegationSuccess.Button_ExitScene"
     ),
                       sleep=1)
예제 #14
0
파일: base.py 프로젝트: ShaoyenYu/JustCode
def goto_scene_main(window):
    window.left_click(am.rect("AnchorAweigh.Button_BackToMain"), sleep=1)
예제 #15
0
 def quit_scene(cls, window):
     window.left_click(
         am.rect("AfterBattle.Checkpoint_00.Button_EmptySpace"), sleep=.75)
예제 #16
0
 def go_back_to_anchor_aweigh(cls, window):
     window.left_click(
         am.rect("CampaignChapter.Chapters.Button_BackToAnchorAweigh"))
예제 #17
0
 def goto_fleet_duty(cls, window):
     window.left_click(am.rect("PopupFleetSelect.Button_ChangeDuty"),
                       sleep=1)
예제 #18
0
 def goto_immediate_start(cls, window):
     window.left_click(am.rect("PopupStageInfo.Button_ImmediateStart"),
                       sleep=1)
예제 #19
0
 def close(cls, window):
     window.left_click(am.rect("PopupFleetSelect.Button_Close"), sleep=1)
예제 #20
0
 def open_popup_rescue_sos(cls, window):
     window.left_click(am.rect("AnchorAweigh.Button_RescueSOS"), sleep=1)
예제 #21
0
 def goto_campaign(cls, window):
     window.left_click(am.rect("Campaign.Popup_Information.Button_Exit"),
                       sleep=.75)
예제 #22
0
 def goto_popup_commission(cls, window):
     window.left_click(am.rect("Main.Button_Commission.Popup_Commission"), sleep=1.5)
예제 #23
0
 def goto_campaign(cls, window):
     window.left_click(am.rect("Campaign.Popup_GetShip.Button_Exit"),
                       sleep=2)
예제 #24
0
 def open_delegation_popup(cls, window):
     window.left_drag((280, 340), (280, 940), duration=.25, interval=.025, sleep=.5)
     window.left_click(am.rect("Popup_Commission.Popup_Delegation"), sleep=.5)
     window.left_drag((490, 900), (490, 700), duration=.25, interval=.025, sleep=1)
예제 #25
0
 def set_automation(cls, window, turn_on=True):
     if cls.is_automation(window) is not turn_on:
         window.left_click(
             am.rect("BeforeBattle.Formation.Automation.Button_Automation"),
             sleep=1)
     return cls.is_automation(window) is turn_on
예제 #26
0
 def go_back(cls, window):
     window.left_click(
         am.rect("Popup_Information.AutoBattle.Button_Ensure"), sleep=.75)
예제 #27
0
 def goto_scene_anchor_aweigh(cls, window):
     window.left_click(am.rect(
         "AnchorAweigh.Button_RescueSOS.Popup_RescueSOS.Button_GoBack"),
                       sleep=1)
예제 #28
0
 def is_automation_off(cls, window) -> bool:
     button = "Campaign.Button_Automation"
     return cls.compare_with_template(window,
                                      am.rect(button),
                                      am.template(f"{button}.State_Off"),
                                      threshold=.999)
예제 #29
0
 def goto_campaign(cls, window):
     window.left_click(am.rect("AfterBattle.BattleResult.Button_Ensure"))