added unfinished fullscreen option
This commit is contained in:
@@ -234,7 +234,9 @@ public class UI {
|
|||||||
|
|
||||||
switch(optionState) {
|
switch(optionState) {
|
||||||
case OVERVIEW -> optionsTop(frameX, frameY);
|
case OVERVIEW -> optionsTop(frameX, frameY);
|
||||||
|
case SCREENNF -> optionsFSNotify(frameX, frameY);
|
||||||
}
|
}
|
||||||
|
panel.keyH.spacePressed = false;
|
||||||
}
|
}
|
||||||
public void drawDialogueScreen() {
|
public void drawDialogueScreen() {
|
||||||
drawPlayerLife();
|
drawPlayerLife();
|
||||||
@@ -323,6 +325,7 @@ public class UI {
|
|||||||
messageCounter.add(0);
|
messageCounter.add(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OPTIONS UI
|
||||||
public void optionsTop(int frameX, int frameY) {
|
public void optionsTop(int frameX, int frameY) {
|
||||||
int textX, textY;
|
int textX, textY;
|
||||||
String title = "Options";
|
String title = "Options";
|
||||||
@@ -336,7 +339,10 @@ public class UI {
|
|||||||
graphics2d.drawString("Full Screen", textX, textY);
|
graphics2d.drawString("Full Screen", textX, textY);
|
||||||
if(commandNum == 0) {
|
if(commandNum == 0) {
|
||||||
graphics2d.drawString(">", textX-25, textY);
|
graphics2d.drawString(">", textX-25, textY);
|
||||||
if(panel.keyH.spacePressed) panel.fullscreen = !panel.fullscreen;
|
if(panel.keyH.spacePressed) {
|
||||||
|
optionState = OptionState.SCREENNF;
|
||||||
|
panel.fullscreen = !panel.fullscreen;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MUSIC
|
// MUSIC
|
||||||
@@ -369,6 +375,9 @@ public class UI {
|
|||||||
textY = frameY + panel.tileSize*2 - panel.tileSize/2;
|
textY = frameY + panel.tileSize*2 - panel.tileSize/2;
|
||||||
graphics2d.setStroke(new BasicStroke(3));
|
graphics2d.setStroke(new BasicStroke(3));
|
||||||
graphics2d.drawRect(textX, textY, panel.tileSize/2, panel.tileSize/2);
|
graphics2d.drawRect(textX, textY, panel.tileSize/2, panel.tileSize/2);
|
||||||
|
if(panel.fullscreen) {
|
||||||
|
graphics2d.fillRect(textX, textY, panel.tileSize/2, panel.tileSize/2);
|
||||||
|
}
|
||||||
|
|
||||||
// MUSIC VOLUME
|
// MUSIC VOLUME
|
||||||
textY += panel.tileSize;
|
textY += panel.tileSize;
|
||||||
@@ -378,10 +387,29 @@ public class UI {
|
|||||||
textY += panel.tileSize;
|
textY += panel.tileSize;
|
||||||
graphics2d.drawRect(textX, textY, 120, panel.tileSize/2);
|
graphics2d.drawRect(textX, textY, 120, panel.tileSize/2);
|
||||||
}
|
}
|
||||||
|
public void optionsFSNotify(int frameX, int frameY) {
|
||||||
|
int textX = frameX + panel.tileSize;
|
||||||
|
int textY = frameY + panel.tileSize*3;
|
||||||
|
|
||||||
|
currentDialogue = "The change will take \neffect after restarting \nthe game";
|
||||||
|
for(String line : currentDialogue.split("\n")) {
|
||||||
|
graphics2d.drawString(line, textX, textY);
|
||||||
|
textY += 40;
|
||||||
|
}
|
||||||
|
|
||||||
|
// BACK
|
||||||
|
textY =frameY + panel.tileSize*9;
|
||||||
|
graphics2d.drawString("Back", textX, textY);
|
||||||
|
if(commandNum == 0) {
|
||||||
|
graphics2d.drawString(">", textX-25, textY);
|
||||||
|
if(panel.keyH.spacePressed) optionState = OptionState.OVERVIEW;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public enum OptionState {
|
public enum OptionState {
|
||||||
OVERVIEW,
|
OVERVIEW,
|
||||||
SCREEN,
|
SCREENNF,
|
||||||
MUSIC,
|
MUSIC,
|
||||||
SFX,
|
SFX,
|
||||||
CONTROLS,
|
CONTROLS,
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ public class KeyHandler implements KeyListener {
|
|||||||
case KeyEvent.VK_ESCAPE -> {
|
case KeyEvent.VK_ESCAPE -> {
|
||||||
panel.gameState = GameState.PAUSE;
|
panel.gameState = GameState.PAUSE;
|
||||||
panel.ui.optionState = UI.OptionState.OVERVIEW;
|
panel.ui.optionState = UI.OptionState.OVERVIEW;
|
||||||
|
panel.ui.commandNum = 0;
|
||||||
}
|
}
|
||||||
case KeyEvent.VK_C -> panel.gameState = GameState.CHARACTER;
|
case KeyEvent.VK_C -> panel.gameState = GameState.CHARACTER;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user