diff --git a/overcooked_simulator/gui_2d_vis/continue.drawio.png b/overcooked_simulator/gui_2d_vis/continue.drawio.png new file mode 100644 index 0000000000000000000000000000000000000000..8a249e36fbab58f15550227268228b84d0e58099 Binary files /dev/null and b/overcooked_simulator/gui_2d_vis/continue.drawio.png differ diff --git a/overcooked_simulator/gui_2d_vis/overcooked_gui.py b/overcooked_simulator/gui_2d_vis/overcooked_gui.py index 0e24286b2363c3f17132bb9426d99320d4b406d6..cf00dd78bfea8bfc32f46114e45f479240ab4764 100644 --- a/overcooked_simulator/gui_2d_vis/overcooked_gui.py +++ b/overcooked_simulator/gui_2d_vis/overcooked_gui.py @@ -437,18 +437,18 @@ class PyGameGUI: ) img = pygame.image.load( - ROOT_DIR / "gui_2d_vis" / "press_a.drawio.png" + ROOT_DIR / "gui_2d_vis" / "continue.drawio.png" ).convert_alpha() image_rect = img.get_rect() - image_rect.centery += 60 + image_rect.centery += 80 self.press_a_image = pygame_gui.elements.UIImage( image_rect, img, manager=self.manager, anchors={"centerx": "centerx", "centery": "centery"}, ) - img_width = self.buttons_width + img_width = self.buttons_width * 1.5 img_height = img_width * (image_rect.height / image_rect.width) new_dims = (img_width, img_height) self.press_a_image.set_dimensions(new_dims) @@ -467,7 +467,7 @@ class PyGameGUI: (0, 0), ( self.window_width * 0.9, - (self.window_height // 3), + (self.window_height // 4), ), ) player_selection_rect.bottom = -10 @@ -803,7 +803,7 @@ class PyGameGUI: self.tutorial_image, self.quit_button, self.continue_button, - self.fullscreen_button + self.fullscreen_button, ] self.pregame_screen_elements = [ @@ -826,8 +826,7 @@ class PyGameGUI: self.conclusion_label, self.quit_button, self.next_game_button, - self.finish_study_button - + self.finish_study_button, ] self.end_screen_elements = [ @@ -865,7 +864,6 @@ class PyGameGUI: if self.CONNECT_WITH_STUDY_SERVER: self.bot_number_container.hide() - self.update_selection_elements() case MenuStates.ControllerTutorial: self.show_screen_elements(self.tutorial_screen_elements) @@ -1083,7 +1081,6 @@ class PyGameGUI: self.player_ids = [str(list(self.player_info.keys())[0])] def get_game_connection(self, tutorial): - if self.menu_state == MenuStates.ControllerTutorial: self.player_info = requests.post( f"http://localhost:8080/connect_to_tutorial/{self.participant_id}" @@ -1185,8 +1182,6 @@ class PyGameGUI: self.state_player_id = player_id def setup_game(self, tutorial=False): - - if self.CONNECT_WITH_STUDY_SERVER: self.get_game_connection(tutorial) else: @@ -1422,7 +1417,6 @@ class PyGameGUI: case self.continue_button: self.exit_tutorial() - ############################################ case MenuStates.PreGame: @@ -1518,7 +1512,17 @@ class PyGameGUI: # Press key instead of mouse button press if ( - event.type == pygame.JOYBUTTONDOWN and any([self.joysticks and self.joysticks[i].get_button(7) for i in range(len(self.joysticks))]) or event.type == pygame.KEYDOWN and event.key == pygame.K_RETURN + event.type == pygame.JOYBUTTONDOWN + and any( + [ + self.joysticks and self.joysticks[i].get_button(7) + for i in range(len(self.joysticks)) + ] + ) + or ( + event.type == pygame.KEYDOWN + and event.key == pygame.K_RETURN + ) ): match self.menu_state: case MenuStates.Start: @@ -1586,7 +1590,6 @@ class PyGameGUI: self.disconnect_websockets() - def main( url: str, port: int,