From a92f0f8c0b1e8784620ec2a98f040c3962691f05 Mon Sep 17 00:00:00 2001 From: airylsuaidi Date: Thu, 17 Oct 2024 13:32:57 +1000 Subject: [PATCH 1/2] #670 --- .../components/tutorial/TutorialScreenDisplay.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/core/src/main/com/csse3200/game/components/tutorial/TutorialScreenDisplay.java b/source/core/src/main/com/csse3200/game/components/tutorial/TutorialScreenDisplay.java index 0683f4e2..2b56bab7 100644 --- a/source/core/src/main/com/csse3200/game/components/tutorial/TutorialScreenDisplay.java +++ b/source/core/src/main/com/csse3200/game/components/tutorial/TutorialScreenDisplay.java @@ -270,13 +270,13 @@ public void update() { private void handleMovementKeys() { if (Gdx.input.isKeyJustPressed(Input.Keys.W) || Gdx.input.isKeyJustPressed(Input.Keys.A) || - Gdx.input.isKeyJustPressed(Input.Keys.S) || Gdx.input.isKeyJustPressed(Input.Keys.D)) { + Gdx.input.isKeyJustPressed(Input.Keys.S) || Gdx.input.isKeyJustPressed(Input.Keys.D) || Gdx.input.isKeyJustPressed(Input.Keys.ENTER)) { advanceTutorialStep(); } } private void handleInteractionKey() { - if (Gdx.input.isKeyJustPressed(Input.Keys.E)) { + if (Gdx.input.isKeyJustPressed(Input.Keys.E) || Gdx.input.isKeyJustPressed(Input.Keys.ENTER)) { advanceTutorialStep(); } } @@ -284,7 +284,7 @@ private void handleInteractionKey() { private void handleDocketSwitch() { textDisplay.setText("Now use [ and ] keys to switch dockets."); - if (Gdx.input.isKeyJustPressed(Input.Keys.LEFT_BRACKET) || Gdx.input.isKeyJustPressed(Input.Keys.RIGHT_BRACKET)) { + if (Gdx.input.isKeyJustPressed(Input.Keys.LEFT_BRACKET) || Gdx.input.isKeyJustPressed(Input.Keys.RIGHT_BRACKET) || Gdx.input.isKeyJustPressed(Input.Keys.ENTER)) { docketsShifted = true; logger.debug("Dockets shifted"); } @@ -295,25 +295,25 @@ private void handleDocketSwitch() { } private void handleReloadKey() { - if (Gdx.input.isKeyJustPressed(Input.Keys.R)) { + if (Gdx.input.isKeyJustPressed(Input.Keys.R) || Gdx.input.isKeyJustPressed(Input.Keys.ENTER)) { advanceTutorialStep(); } } private void handleWeaponChangeKey() { - if (Gdx.input.isKeyJustPressed(Input.Keys.Q)) { + if (Gdx.input.isKeyJustPressed(Input.Keys.Q) || Gdx.input.isKeyJustPressed(Input.Keys.ENTER)) { advanceTutorialStep(); } } private void handleSpecialActionKey() { - if (Gdx.input.isKeyJustPressed(Input.Keys.K)) { + if (Gdx.input.isKeyJustPressed(Input.Keys.K) || Gdx.input.isKeyJustPressed(Input.Keys.ENTER)) { advanceTutorialStep(); } } private void handleSecondaryActionKey() { - if (Gdx.input.isKeyJustPressed(Input.Keys.J)) { + if (Gdx.input.isKeyJustPressed(Input.Keys.J) || Gdx.input.isKeyJustPressed(Input.Keys.ENTER)) { advanceTutorialStep(); } } From b7d0938946849d8e6dfa77ebd8e97b7a560bd561 Mon Sep 17 00:00:00 2001 From: airylsuaidi Date: Thu, 17 Oct 2024 14:40:46 +1000 Subject: [PATCH 2/2] cleaningups for Tutorials Screen #670 --- .../MainGameOrderTicketDisplay.java | 8 ++++ .../csse3200/game/screens/TutorialScreen.java | 44 +------------------ 2 files changed, 9 insertions(+), 43 deletions(-) diff --git a/source/core/src/main/com/csse3200/game/components/ordersystem/MainGameOrderTicketDisplay.java b/source/core/src/main/com/csse3200/game/components/ordersystem/MainGameOrderTicketDisplay.java index a7c4f38f..2e2b4921 100644 --- a/source/core/src/main/com/csse3200/game/components/ordersystem/MainGameOrderTicketDisplay.java +++ b/source/core/src/main/com/csse3200/game/components/ordersystem/MainGameOrderTicketDisplay.java @@ -251,6 +251,14 @@ public void addActors() { updateDocketSizes(); table.setZIndex((int)getZIndex()); + printOrderList(); + } + + private void printOrderList() { + logger.info("Current List of Orders:"); + for (int i = 0; i < stringArrayList.size(); i++) { + logger.info("Order {}: {}", i + 1, stringArrayList.get(i)); + } } /** diff --git a/source/core/src/main/com/csse3200/game/screens/TutorialScreen.java b/source/core/src/main/com/csse3200/game/screens/TutorialScreen.java index 1b85570f..e1ada7f6 100644 --- a/source/core/src/main/com/csse3200/game/screens/TutorialScreen.java +++ b/source/core/src/main/com/csse3200/game/screens/TutorialScreen.java @@ -106,50 +106,17 @@ public class TutorialScreen extends MainGameScreen { private static final Vector2 CAMERA_POSITION = new Vector2(7f, 4.5f); - //private final GdxGame game; -// private final Renderer renderer; -// private final PhysicsEngine physicsEngine; -// private boolean isPaused = false; -// private ResourceService resourceService; - public TutorialScreen(GdxGame game) { super(game); - // this.game = game; - -// if (this.game == null) { -// logger.error("TutGame null"); -// } else { -// logger.info("TutGame object initialized successfully: " + this.game); -// } MainGameOrderTicketDisplay.resetOrderNumb(); logger.debug("Initialising main game screen services"); ServiceLocator.registerTimeSource(new GameTime()); -// PhysicsService physicsService = new PhysicsService(); -// ServiceLocator.registerPhysicsService(physicsService); -// physicsEngine = physicsService.getPhysics(); -// - //ServiceLocator.registerInputService(new InputService()); - //ServiceLocator.registerResourceService(new ResourceService()); - //ServiceLocator.registerPlayerService(new PlayerService()); -// -// ServiceLocator.registerEntityService(new EntityService()); -// ServiceLocator.registerRenderService(new RenderService()); -// ServiceLocator.registerDocketService(new DocketService()); -// -// ServiceLocator.registerDayNightService(new DayNightService()); -// ServiceLocator.registerRandomComboService(new RandomComboService()); -// ServiceLocator.registerLevelService(new LevelService()); -// ServiceLocator.registerMapLayout(new MapLayout()); - logger.warn("Is SaveService null? " + (ServiceLocator.getSaveLoadService() == null)); - //ServiceLocator.registerSaveLoadService(new SaveLoadService()); ServiceLocator.registerGameScreen(this); - //ServiceLocator.registerTicketDetails(new TicketDetails()); - renderer = RenderFactory.createRenderer(); renderer.getCamera().getEntity().setPosition(CAMERA_POSITION); renderer.getDebug().renderPhysicsWorld(physicsEngine.getWorld()); @@ -241,25 +208,16 @@ void createUI() { ui.addComponent(new GameBackgroundDisplay()) .addComponent(new InputDecorator(stage, 10)) .addComponent(docketLineDisplay = new DocketLineDisplay()) - .addComponent(new DocketLineDisplay()) .addComponent(new PerformanceDisplay()) .addComponent(new MainGameActions(game, UIFactory.createDocketUI())) .addComponent(new KeybindsButtonDisplay()) .addComponent(new MainGameExitDisplay()) - //.addComponent(new MainGameExitDisplay()) .addComponent(new Terminal()) .addComponent(inputComponent) .addComponent(new TerminalDisplay()) .addComponent(new OrderActions()) - //.addComponent(inputComponent) -// .addComponent(new TerminalDisplay()) - //.addComponent(new OrderActions()) -// .addComponent(new PauseMenuActions(this.game)) + .addComponent(new OrderActions()) .addComponent(new RageUpgrade()) -// .addComponent(new LoanUpgrade()) -// .addComponent(new SpeedBootsUpgrade()) -// .addComponent(new ExtortionUpgrade()) -// .addComponent(new DancePartyUpgrade()) .addComponent(new TutorialScreenDisplay(game)) .addComponent(new TextDisplay(this));