mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 08:59:44 +02:00
added Menu to the actual game, some fixes are required
This commit is contained in:
@@ -26,6 +26,7 @@ import de.heatup.objects.StaticObject;
|
||||
import de.heatup.timers.HardwareResetTimers;
|
||||
import de.heatup.ui.actionPanel.ActionControl;
|
||||
import de.heatup.ui.actionPanel.ActionWatcher;
|
||||
import de.heatup.ui.menu.MenuPanel;
|
||||
|
||||
|
||||
public class Main extends JFrame implements Runnable {
|
||||
@@ -47,11 +48,12 @@ public class Main extends JFrame implements Runnable {
|
||||
private static JPanel outerPanel;
|
||||
private static JPanel statusPanel;
|
||||
private static JPanel gamePanel;
|
||||
private static JPanel menuPanel;
|
||||
private static JPanel leftPanel;
|
||||
private static JPanel rightPanel;
|
||||
private static JPanel actionPanel;
|
||||
|
||||
private static JPanel menuPanel;
|
||||
|
||||
public Main(){
|
||||
setTitle("HeatUP!");
|
||||
setDefaultCloseOperation(EXIT_ON_CLOSE);
|
||||
@@ -79,13 +81,6 @@ public class Main extends JFrame implements Runnable {
|
||||
gamePanel.setFocusable(false);
|
||||
gamePanel.setBackground(Color.black);
|
||||
|
||||
menuPanel = new JPanel();
|
||||
menuPanel.setLayout(null);
|
||||
menuPanel.setPreferredSize(new Dimension(800,600));
|
||||
menuPanel.setFocusable(false);
|
||||
menuPanel.setBackground(Color.black);
|
||||
|
||||
|
||||
actionPanel = new JPanel();
|
||||
actionPanel.setLayout(new GridLayout(1,1));
|
||||
actionPanel.setPreferredSize(new Dimension(800,80));
|
||||
@@ -99,12 +94,17 @@ public class Main extends JFrame implements Runnable {
|
||||
rightPanel.setLayout(null);
|
||||
rightPanel.setBackground(Color.black);
|
||||
|
||||
MenuPanel.setMenuPanel();
|
||||
menuPanel = MenuPanel.getMenuPanel();
|
||||
|
||||
outerPanel.add(statusPanel,BorderLayout.NORTH);
|
||||
outerPanel.add(leftPanel, BorderLayout.WEST);
|
||||
outerPanel.add(rightPanel, BorderLayout.EAST);
|
||||
outerPanel.add(gamePanel,BorderLayout.CENTER);
|
||||
outerPanel.add(actionPanel,BorderLayout.SOUTH);
|
||||
|
||||
outerPanel.add(menuPanel, BorderLayout.CENTER);
|
||||
|
||||
add(outerPanel);
|
||||
pack();
|
||||
setVisible(true);
|
||||
|
||||
@@ -7,7 +7,10 @@ import java.awt.event.MouseEvent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import de.heatup.logging.Logger;
|
||||
import de.heatup.ui.FontLoader;
|
||||
import de.heatup.ui.Main;
|
||||
import de.heatup.ui.PanelBuilder;
|
||||
|
||||
public class MenuPanel {
|
||||
|
||||
@@ -33,6 +36,9 @@ public class MenuPanel {
|
||||
|
||||
public static void setMenuPanel() {
|
||||
|
||||
menuPanel.setPreferredSize(new Dimension(800,600));
|
||||
menuPanel.setFocusable(false);
|
||||
|
||||
GridLayout menuGrid = new GridLayout(5, 1);
|
||||
menuPanel.setBackground(Color.BLACK);
|
||||
menuPanel.setLayout(menuGrid);
|
||||
@@ -68,7 +74,9 @@ public class MenuPanel {
|
||||
startGame.addMouseListener(new MouseAdapter() {
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
// @TODO: implement start game
|
||||
System.out.println("game started");
|
||||
|
||||
//PanelBuilder.createGame(1);
|
||||
Logger.write("Game Started via menu");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user