diff --git a/source/core/assets/images/ui/buttons/glass.json b/source/core/assets/images/ui/buttons/glass.json index f76bad834..648881aac 100644 --- a/source/core/assets/images/ui/buttons/glass.json +++ b/source/core/assets/images/ui/buttons/glass.json @@ -192,7 +192,6 @@ com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: { background: UI_Glass_Frame_Standard_01a titleFont: font_small titleFontColor: White - stageBackground: UI_Glass_Frame_Standard_01a } } } \ No newline at end of file diff --git a/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuButtonComponent.java b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuButtonComponent.java index 620cc07aa..b936a2794 100644 --- a/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuButtonComponent.java +++ b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuButtonComponent.java @@ -1,11 +1,11 @@ package com.csse3200.game.components.pausemenu; import com.badlogic.gdx.Gdx; + import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Touchable; import com.badlogic.gdx.scenes.scene2d.ui.Skin; -import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.ui.Window; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; @@ -20,6 +20,7 @@ public class PauseMenuButtonComponent extends UIComponent { private static final Logger logger = LoggerFactory.getLogger(PauseMenuButtonComponent.class); private static final float Z_INDEX = 2f; private Window window; + private final GdxGame game; private static final float windowSizeX = 300; private static final float windowSizeY = 400; @@ -39,7 +40,7 @@ public void create() { /** * Initialises the pause menu buttons - * Positions them on the stage using a table + * Positions them on the stage using a window */ private void addActors() { @@ -86,7 +87,6 @@ public void changed(ChangeEvent changeEvent, Actor actor) { game.setScreen(GdxGame.ScreenType.MAIN_MENU); } }); - window.setKeepWithinStage(true); window.setResizable(true); window.setModal(true); @@ -121,8 +121,8 @@ public float getZIndex() { @Override public void dispose() { - window.clear(); window.remove(); + window.clear(); super.dispose(); } } diff --git a/source/core/src/main/com/csse3200/game/entities/factories/PauseMenuFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/PauseMenuFactory.java index 5179b415c..8dacb0f60 100644 --- a/source/core/src/main/com/csse3200/game/entities/factories/PauseMenuFactory.java +++ b/source/core/src/main/com/csse3200/game/entities/factories/PauseMenuFactory.java @@ -3,7 +3,6 @@ import com.csse3200.game.GdxGame; import com.csse3200.game.components.pausemenu.*; import com.csse3200.game.entities.Entity; -import com.csse3200.game.rendering.TextureRenderComponent; import com.csse3200.game.services.ServiceLocator; import com.badlogic.gdx.utils.Array; @@ -23,10 +22,6 @@ public static Entity createPauseMenu(GdxGame game) { Entity pauseMenu = new Entity() .addComponent(new PauseMenuTimeStopComponent()) -// .addComponent(new PauseMenuContinueButton()) -// .addComponent(new PauseMenuSettingsButton(game)) -// .addComponent(new PauseMenuPlanetSelectButton(game)) -// .addComponent(new PauseMenuMainMenuButton(game)) .addComponent(new PauseMenuButtonComponent(game)); pauseMenu.setScale(8, 8); pauseMenu.setPosition(6f, 2f); diff --git a/source/core/src/test/com/csse3200/game/entities/factories/PauseMenuFactoryTest.java b/source/core/src/test/com/csse3200/game/entities/factories/PauseMenuFactoryTest.java index 9144aad7f..e62fe61cc 100644 --- a/source/core/src/test/com/csse3200/game/entities/factories/PauseMenuFactoryTest.java +++ b/source/core/src/test/com/csse3200/game/entities/factories/PauseMenuFactoryTest.java @@ -47,11 +47,6 @@ void createsEntity() { @Test void entityHasRequiredComponents() { assertNotNull(entity.getComponent(PauseMenuTimeStopComponent.class)); -// assertNotNull(entity.getComponent(PauseMenuButtonComponent.class)); -// assertNotNull(entity.getComponent(PauseMenuContinueButton.class)); -// assertNotNull(entity.getComponent(PauseMenuSettingsButton.class)); -// assertNotNull(entity.getComponent(PauseMenuPlanetSelectButton.class)); -// assertNotNull(entity.getComponent(PauseMenuMainMenuButton.class)); assertNotNull(entity.getComponent(PauseMenuButtonComponent.class)); }