continued options menu
This commit is contained in:
@@ -31,6 +31,7 @@ public class GamePanel extends JPanel implements Runnable {
|
|||||||
int fScreenHeight = screenHeight;
|
int fScreenHeight = screenHeight;
|
||||||
BufferedImage tempScreen;
|
BufferedImage tempScreen;
|
||||||
Graphics2D fg2;
|
Graphics2D fg2;
|
||||||
|
public boolean fullscreen;
|
||||||
|
|
||||||
// WORLD SETTINGS
|
// WORLD SETTINGS
|
||||||
public final int maxWorldCol = 50;
|
public final int maxWorldCol = 50;
|
||||||
|
|||||||
@@ -330,11 +330,14 @@ public class UI {
|
|||||||
textY = frameY + panel.tileSize;
|
textY = frameY + panel.tileSize;
|
||||||
graphics2d.drawString(title, textX, textY);
|
graphics2d.drawString(title, textX, textY);
|
||||||
|
|
||||||
// FULLSCREEN
|
// FULLSCREEN ON/OFF
|
||||||
textX = frameX + panel.tileSize;
|
textX = frameX + panel.tileSize;
|
||||||
textY += panel.tileSize;
|
textY += panel.tileSize;
|
||||||
graphics2d.drawString("Full Screen", textX, textY);
|
graphics2d.drawString("Full Screen", textX, textY);
|
||||||
if(commandNum == 0) graphics2d.drawString(">", textX-25, textY);
|
if(commandNum == 0) {
|
||||||
|
graphics2d.drawString(">", textX-25, textY);
|
||||||
|
if(panel.keyH.spacePressed) panel.fullscreen = !panel.fullscreen;
|
||||||
|
}
|
||||||
|
|
||||||
// MUSIC
|
// MUSIC
|
||||||
textY += panel.tileSize;
|
textY += panel.tileSize;
|
||||||
@@ -343,7 +346,7 @@ public class UI {
|
|||||||
|
|
||||||
// SOUND EFFECTS
|
// SOUND EFFECTS
|
||||||
textY += panel.tileSize;
|
textY += panel.tileSize;
|
||||||
graphics2d.drawString("Sound Effects (SFX)", textX, textY);
|
graphics2d.drawString("SFX", textX, textY);
|
||||||
if(commandNum == 2) graphics2d.drawString(">", textX-25, textY);
|
if(commandNum == 2) graphics2d.drawString(">", textX-25, textY);
|
||||||
|
|
||||||
// CONTROL
|
// CONTROL
|
||||||
@@ -360,6 +363,20 @@ public class UI {
|
|||||||
textY += panel.tileSize*2;
|
textY += panel.tileSize*2;
|
||||||
graphics2d.drawString("Back to Game", textX, textY);
|
graphics2d.drawString("Back to Game", textX, textY);
|
||||||
if(commandNum == 5) graphics2d.drawString(">", textX-25, textY);
|
if(commandNum == 5) graphics2d.drawString(">", textX-25, textY);
|
||||||
|
|
||||||
|
// FULL SCREEN CHECKBOX
|
||||||
|
textX = frameX + (int)(panel.tileSize*4.5);
|
||||||
|
textY = frameY + panel.tileSize*2 - panel.tileSize/2;
|
||||||
|
graphics2d.setStroke(new BasicStroke(3));
|
||||||
|
graphics2d.drawRect(textX, textY, panel.tileSize/2, panel.tileSize/2);
|
||||||
|
|
||||||
|
// MUSIC VOLUME
|
||||||
|
textY += panel.tileSize;
|
||||||
|
graphics2d.drawRect(textX, textY, 120, panel.tileSize/2);
|
||||||
|
|
||||||
|
// SFX VOLUME
|
||||||
|
textY += panel.tileSize;
|
||||||
|
graphics2d.drawRect(textX, textY, 120, panel.tileSize/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum OptionState {
|
public enum OptionState {
|
||||||
|
|||||||
@@ -67,6 +67,25 @@ public class KeyHandler implements KeyListener {
|
|||||||
public void handlePause(int code) {
|
public void handlePause(int code) {
|
||||||
if(code == KeyEvent.VK_SPACE) spacePressed = true;
|
if(code == KeyEvent.VK_SPACE) spacePressed = true;
|
||||||
|
|
||||||
|
int maxCommandNum = 0;
|
||||||
|
|
||||||
|
switch (panel.ui.optionState) {
|
||||||
|
case OVERVIEW -> maxCommandNum = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(code) {
|
||||||
|
case KeyEvent.VK_UP:
|
||||||
|
if(panel.ui.commandNum <= 0) break;
|
||||||
|
panel.ui.commandNum--;
|
||||||
|
panel.playSE(9);
|
||||||
|
break;
|
||||||
|
case KeyEvent.VK_DOWN:
|
||||||
|
if(panel.ui.commandNum >= maxCommandNum) break;
|
||||||
|
panel.ui.commandNum++;
|
||||||
|
panel.playSE(9);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// EXIT STATE
|
// EXIT STATE
|
||||||
if(code == KeyEvent.VK_ESCAPE) panel.gameState = GameState.PLAY;
|
if(code == KeyEvent.VK_ESCAPE) panel.gameState = GameState.PLAY;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user