Browse Source

Add DarkSoulsBtn to Gui

master
Leon Montag 2 years ago
parent
commit
8b63085575
  1. 5
      src/main/java/Gui/StartGameGui.java
  2. 5
      src/main/java/Gui/gui.java
  3. 5
      src/main/java/game/StartDarkSoulsGame.java
  4. 2
      src/test/java/Gui/guiTest.java
  5. 19
      target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  6. 10
      target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst

5
src/main/java/Gui/StartGameGui.java

@ -3,6 +3,7 @@ package Gui;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import game.StartDarkSoulsGame;
import game.runGame;
public class StartGameGui implements ActionListener {
@ -10,7 +11,11 @@ public class StartGameGui implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
gui.Panel.setVisible(false);
if(e.getSource() == gui.StartBtn) {
startGame();
} else {
new StartDarkSoulsGame();
}
}
public void startGame() {

5
src/main/java/Gui/gui.java

@ -12,7 +12,7 @@ import javax.swing.JPanel;
public class gui implements GuiInterface {
public static JFrame Frame;
public static JButton StartBtn, CloseBtn;
public static JButton StartBtn, CloseBtn, StartDarkSoulsBtn;
public static JPanel Panel;
public static JLabel Label;
public static int width = 800, height = 600;
@ -37,6 +37,8 @@ public class gui implements GuiInterface {
public void createButtons() {
StartBtn = new JButton("Starte Spiel");
StartBtn.addActionListener(new StartGameGui());
StartDarkSoulsBtn = new JButton("Starte Dark Souls 4");
StartDarkSoulsBtn.addActionListener(new StartGameGui());
CloseBtn = new JButton("Schliessen");
CloseBtn.addActionListener(new ActionHandler());
@ -58,6 +60,7 @@ public class gui implements GuiInterface {
Label.setFont(new Font("Serif", Font.BOLD, 28));
Panel.add(Label, gbc);
Panel.add(StartBtn, gbc);
Panel.add(StartDarkSoulsBtn, gbc);
Panel.add(CloseBtn, gbc);
Frame.add(Panel);
Frame.setVisible(true);

5
src/main/java/game/StartDarkSoulsGame.java

@ -0,0 +1,5 @@
package game;
public class StartDarkSoulsGame {
}

2
src/test/java/Gui/guiTest.java

@ -42,7 +42,7 @@ class guiTest {
@Test
public void testCreatePanel() {
// arrange
int NumPanels = 3;
int NumPanels = 4;
// act
int TargetNumPanels = gui.Panel.getComponents().length;

19
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@ -1,9 +1,10 @@
C:\Users\ozan_\MiniGameProject\src\main\java\Gui\GuiInterface.java
C:\Users\ozan_\MiniGameProject\src\main\java\Gui\GameGuiInterface.java
C:\Users\ozan_\MiniGameProject\src\main\java\Gui\gui.java
C:\Users\ozan_\MiniGameProject\src\main\java\game\loadNextQuestion.java
C:\Users\ozan_\MiniGameProject\src\main\java\Gui\ActionHandler.java
C:\Users\ozan_\MiniGameProject\src\main\java\main.java
C:\Users\ozan_\MiniGameProject\src\main\java\game\runGame.java
C:\Users\ozan_\MiniGameProject\src\main\java\Gui\StartGameGui.java
C:\Users\ozan_\MiniGameProject\src\main\java\Gui\GameGui.java
C:\Users\Leon\MiniGameProject\src\main\java\Gui\ActionHandler.java
C:\Users\Leon\MiniGameProject\src\main\java\game\loadNextQuestion.java
C:\Users\Leon\MiniGameProject\src\main\java\Gui\GameGuiInterface.java
C:\Users\Leon\MiniGameProject\src\main\java\Gui\gui.java
C:\Users\Leon\MiniGameProject\src\main\java\game\runGame.java
C:\Users\Leon\MiniGameProject\src\main\java\game\StartDarkSoulsGame.java
C:\Users\Leon\MiniGameProject\src\main\java\main.java
C:\Users\Leon\MiniGameProject\src\main\java\Gui\StartGameGui.java
C:\Users\Leon\MiniGameProject\src\main\java\Gui\GameGui.java
C:\Users\Leon\MiniGameProject\src\main\java\Gui\GuiInterface.java

10
target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst

@ -1,5 +1,5 @@
C:\Users\ozan_\MiniGameProject\src\test\java\Gui\ActionHandlerTest.java
C:\Users\ozan_\MiniGameProject\src\test\java\Gui\GameGuiTest.java
C:\Users\ozan_\MiniGameProject\src\test\java\game\loadNextQuestionTest.java
C:\Users\ozan_\MiniGameProject\src\test\java\game\runGameTest.java
C:\Users\ozan_\MiniGameProject\src\test\java\Gui\guiTest.java
C:\Users\Leon\MiniGameProject\src\test\java\Gui\guiTest.java
C:\Users\Leon\MiniGameProject\src\test\java\game\loadNextQuestionTest.java
C:\Users\Leon\MiniGameProject\src\test\java\Gui\ActionHandlerTest.java
C:\Users\Leon\MiniGameProject\src\test\java\Gui\GameGuiTest.java
C:\Users\Leon\MiniGameProject\src\test\java\game\runGameTest.java
Loading…
Cancel
Save