|
| 1 | +package com.khomsi.game.main.tools.ui; |
| 2 | + |
| 3 | +import com.khomsi.game.main.GameManager; |
| 4 | + |
| 5 | +public class Settings extends UI { |
| 6 | + public Settings(GameManager gameManager) { |
| 7 | + super(gameManager); |
| 8 | + } |
| 9 | + |
| 10 | + void fullScreenNotification(int frameX, int frameY) { |
| 11 | + int textX = frameX + GameManager.TILE_SIZE; |
| 12 | + int textY = frameY + GameManager.TILE_SIZE * 3; |
| 13 | + currentDialog = "The changes will be \napplied after restarting \nthe game."; |
| 14 | + splitTextInDialog(currentDialog, textX, textY); |
| 15 | + //Back text |
| 16 | + textY = frameY + GameManager.TILE_SIZE * 9; |
| 17 | + graphics2D.drawString("Back", textX, textY); |
| 18 | + //Draw cursor |
| 19 | + if (commandNum == 0) { |
| 20 | + showChooseCursor(textX, textY, 25); |
| 21 | + if (gameManager.keyHandler.isEnterPressed) subState = 0; |
| 22 | + } |
| 23 | + } |
| 24 | + |
| 25 | + void showControl(int frameX, int frameY) { |
| 26 | + int textX; |
| 27 | + int textY; |
| 28 | + String text = "Control"; |
| 29 | + textX = getXCenterText(text); |
| 30 | + textY = frameY + GameManager.TILE_SIZE; |
| 31 | + graphics2D.drawString(text, textX, textY); |
| 32 | + textX = frameX + GameManager.TILE_SIZE; |
| 33 | + textY += GameManager.TILE_SIZE; |
| 34 | + graphics2D.drawString("Move", textX, textY); |
| 35 | + textY += GameManager.TILE_SIZE; |
| 36 | + graphics2D.drawString("Confirm/Attack", textX, textY); |
| 37 | + textY += GameManager.TILE_SIZE; |
| 38 | + graphics2D.drawString("Shoot/Cast", textX, textY); |
| 39 | + textY += GameManager.TILE_SIZE; |
| 40 | + graphics2D.drawString("Inventory", textX, textY); |
| 41 | + textY += GameManager.TILE_SIZE; |
| 42 | + graphics2D.drawString("Pause", textX, textY); |
| 43 | + textY += GameManager.TILE_SIZE; |
| 44 | + graphics2D.drawString("Settings", textX, textY); |
| 45 | + textY += GameManager.TILE_SIZE; |
| 46 | + graphics2D.drawString("Map/MiniMap", textX, textY); |
| 47 | + textX = frameX + GameManager.TILE_SIZE * 6; |
| 48 | + textY = frameY + GameManager.TILE_SIZE * 2; |
| 49 | + |
| 50 | + graphics2D.drawString("WASD", textX, textY); |
| 51 | + textY += GameManager.TILE_SIZE; |
| 52 | + graphics2D.drawString("ENTER", textX, textY); |
| 53 | + textY += GameManager.TILE_SIZE; |
| 54 | + graphics2D.drawString("CTRL", textX, textY); |
| 55 | + textY += GameManager.TILE_SIZE; |
| 56 | + graphics2D.drawString("E", textX, textY); |
| 57 | + textY += GameManager.TILE_SIZE; |
| 58 | + graphics2D.drawString("P", textX, textY); |
| 59 | + textY += GameManager.TILE_SIZE; |
| 60 | + graphics2D.drawString("ESC", textX, textY); |
| 61 | + textY += GameManager.TILE_SIZE; |
| 62 | + graphics2D.drawString("M/X", textX, textY); |
| 63 | + |
| 64 | + //Back button |
| 65 | + textX = frameX + GameManager.TILE_SIZE; |
| 66 | + textY = frameY + GameManager.TILE_SIZE * 9; |
| 67 | + graphics2D.drawString("Back", textX, textY); |
| 68 | + if (commandNum == 0) { |
| 69 | + showChooseCursor(textX, textY, 25); |
| 70 | + if (gameManager.keyHandler.isEnterPressed) { |
| 71 | + subState = 0; |
| 72 | + commandNum = 3; |
| 73 | + } |
| 74 | + } |
| 75 | + } |
| 76 | +} |
0 commit comments