File tree 5 files changed +14
-85
lines changed
src/main/java/tbooop/view
5 files changed +14
-85
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,11 @@ public void handleInput(final Optional<Keybinds> keybind) {
85
85
case SHOOT_LEFT -> sendCommand (new ShootCommand (CardinalDirection .LEFT ));
86
86
case SHOOT_RIGHT -> sendCommand (new ShootCommand (CardinalDirection .RIGHT ));
87
87
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
+ }
88
93
case ZOOM_IN -> resizeWindow (true );
89
94
case ZOOM_OUT -> resizeWindow (false );
90
95
default -> {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ public class RoomRenderer extends ViewComponentImpl {
32
32
private static final ImageView COMMANDS_TOOLTIP = new ImageView (new Image ("tileset/commands.png" ));
33
33
34
34
private final Map <DoorUnmodifiable , ImageView > doorsSpriteMap = new HashMap <>();
35
- private final MusicPlayer musicPlayer = new MusicPlayer ();
36
35
37
36
private final ViewElements view ;
38
37
@@ -105,10 +104,8 @@ private void updateTooltipVisibility(final RoomUnmodifiable newRoom) {
105
104
106
105
private void playRoomMusic (final RoomUnmodifiable newRoom ) {
107
106
if (newRoom .isSpecial ()) {
108
- musicPlayer .playSpecialRoomMusic ();
109
107
return ;
110
108
}
111
- musicPlayer .playDefaultMusic ();
112
109
}
113
110
114
111
private void rotateDoor (final ImageView imgView , final CardinalDirection dir ) {
Original file line number Diff line number Diff line change @@ -182,6 +182,6 @@ private synchronized Point2d worldToScreenPos(final Point2d worldPos) {
182
182
@ Override
183
183
public void showDeathScreen () {
184
184
super .getStage ().setScene (new DeathScreen ().getDeathScene (getStage ().getWidth (), getStage ().getHeight ()));
185
- }
185
+ }
186
186
187
187
}
Original file line number Diff line number Diff line change @@ -61,7 +61,12 @@ public enum Keybinds {
61
61
/**
62
62
* Keybind for toggling fullscreen mode.
63
63
*/
64
- FULLSCREEN (KeyCode .F11 );
64
+ FULLSCREEN (KeyCode .F11 ),
65
+
66
+ /**
67
+ * Keybind for exiting fullscreen mode.
68
+ */
69
+ EXIT_FULLSCREEN (KeyCode .ESCAPE );
65
70
66
71
private final KeyCode keyCode ;
67
72
@@ -92,7 +97,8 @@ public KeyCode getKeyCode() {
92
97
public static boolean isGui (final Keybinds keybind ) {
93
98
return keybind == Keybinds .FULLSCREEN
94
99
|| keybind == Keybinds .ZOOM_IN
95
- || keybind == Keybinds .ZOOM_OUT ;
100
+ || keybind == Keybinds .ZOOM_OUT
101
+ || keybind == Keybinds .EXIT_FULLSCREEN ;
96
102
}
97
103
98
104
/**
You can’t perform that action at this time.
0 commit comments