Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Commit

Permalink
game: try to get mode while selecting
Browse files Browse the repository at this point in the history
  • Loading branch information
tmarenko committed Oct 6, 2021
1 parent 432cb9c commit b91f3a7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/game/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,10 @@ def select_mode(self, name):
:param str name: game mode's name.
"""
mode = self.get_mode(name=name)
if not self.go_to_content_status_board():
logger.error("Failed to open Content Status board.")
return False
mode = self._modes[name]
if mode.ui_board == ui.CONTENT_STATUS_BOARD_2.button_rect.value:
logger.debug(f"Mode {name} is on second board. Dragging")
self.emulator.drag(ui.CONTENT_STATUS_DRAG_FROM, ui.CONTENT_STATUS_DRAG_TO, duration=0.4)
Expand Down
1 change: 0 additions & 1 deletion lib/game/missions/danger_room.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def close_notifications():

def open_danger_room(self):
"""Opens Danger Room missions lobby."""
self.game.get_mode(name=self.mode_name)
self.game.select_mode(self.mode_name)
self._close_rewards_notifications()
return wait_until(self.emulator.is_ui_element_on_screen, ui_element=ui.DANGER_ROOM_LABEL)
Expand Down
1 change: 0 additions & 1 deletion lib/game/missions/shadowland.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def try_again():

def open_shadowland(self):
"""Opens Shadowland gamemode."""
self.game.get_mode(self.mode_name)
self.game.select_mode(self.mode_name)
if wait_until(self.emulator.is_ui_element_on_screen, ui_element=ui.SL_KING_OF_THE_HILL_REWARD):
logger.debug("Closing `King of the Hill` rewards notification.")
Expand Down
3 changes: 1 addition & 2 deletions lib/game/missions/world_boss.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ def do_missions(self, times=None, mode=MODE.ULTIMATE, difficulty=0, boss=BOSS.TO

def open_world_boss(self):
"""Opens World Boss mission lobby."""
if self.game.get_mode(self.mode_name):
self.game.select_mode(self.mode_name)
if self.game.select_mode(self.mode_name):
return wait_until(self.emulator.is_ui_element_on_screen, ui_element=ui.WB_MISSION_BUTTON)

def start_missions(self, mode=MODE.ULTIMATE, difficulty=0, boss=BOSS.TODAYS_BOSS):
Expand Down

0 comments on commit b91f3a7

Please sign in to comment.