Skip to content

Commit 513ee9c

Browse files
committed
Merge branch 'gio-dev' of https://github.com/GioeleBucci/TBOOOP into simo-dev
2 parents 62ba8dc + c636420 commit 513ee9c

File tree

5 files changed

+14
-85
lines changed

5 files changed

+14
-85
lines changed

src/main/java/tbooop/view/InputManagerImpl.java

+5
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ public void handleInput(final Optional<Keybinds> keybind) {
8585
case SHOOT_LEFT -> sendCommand(new ShootCommand(CardinalDirection.LEFT));
8686
case SHOOT_RIGHT -> sendCommand(new ShootCommand(CardinalDirection.RIGHT));
8787
case FULLSCREEN -> view.getStage().setFullScreen(!view.getStage().isFullScreen());
88+
case EXIT_FULLSCREEN -> {
89+
System.out.println("Exiting fullscreen");
90+
view.getStage().setWidth(view.getStage().getWidth() / 2);
91+
resizeWindow(false);
92+
}
8893
case ZOOM_IN -> resizeWindow(true);
8994
case ZOOM_OUT -> resizeWindow(false);
9095
default -> {

src/main/java/tbooop/view/MusicPlayer.java

-79
This file was deleted.

src/main/java/tbooop/view/RoomRenderer.java

-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public class RoomRenderer extends ViewComponentImpl {
3232
private static final ImageView COMMANDS_TOOLTIP = new ImageView(new Image("tileset/commands.png"));
3333

3434
private final Map<DoorUnmodifiable, ImageView> doorsSpriteMap = new HashMap<>();
35-
private final MusicPlayer musicPlayer = new MusicPlayer();
3635

3736
private final ViewElements view;
3837

@@ -105,10 +104,8 @@ private void updateTooltipVisibility(final RoomUnmodifiable newRoom) {
105104

106105
private void playRoomMusic(final RoomUnmodifiable newRoom) {
107106
if (newRoom.isSpecial()) {
108-
musicPlayer.playSpecialRoomMusic();
109107
return;
110108
}
111-
musicPlayer.playDefaultMusic();
112109
}
113110

114111
private void rotateDoor(final ImageView imgView, final CardinalDirection dir) {

src/main/java/tbooop/view/ViewImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,6 @@ private synchronized Point2d worldToScreenPos(final Point2d worldPos) {
182182
@Override
183183
public void showDeathScreen() {
184184
super.getStage().setScene(new DeathScreen().getDeathScene(getStage().getWidth(), getStage().getHeight()));
185-
}
185+
}
186186

187187
}

src/main/java/tbooop/view/api/Keybinds.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ public enum Keybinds {
6161
/**
6262
* Keybind for toggling fullscreen mode.
6363
*/
64-
FULLSCREEN(KeyCode.F11);
64+
FULLSCREEN(KeyCode.F11),
65+
66+
/**
67+
* Keybind for exiting fullscreen mode.
68+
*/
69+
EXIT_FULLSCREEN(KeyCode.ESCAPE);
6570

6671
private final KeyCode keyCode;
6772

@@ -92,7 +97,8 @@ public KeyCode getKeyCode() {
9297
public static boolean isGui(final Keybinds keybind) {
9398
return keybind == Keybinds.FULLSCREEN
9499
|| keybind == Keybinds.ZOOM_IN
95-
|| keybind == Keybinds.ZOOM_OUT;
100+
|| keybind == Keybinds.ZOOM_OUT
101+
|| keybind == Keybinds.EXIT_FULLSCREEN;
96102
}
97103

98104
/**

0 commit comments

Comments
 (0)