package eu.theunitry.fabula.UNGameEngine.launcher;

import eu.theunitry.fabula.UNGameEngine.graphics.UNGameScreen;
import eu.theunitry.fabula.UNGameEngine.graphics.UNColor;
import eu.theunitry.fabula.UNGameEngine.graphics.UNView;
import eu.theunitry.fabula.UNGameEngine.objects.UNButtonListener;
import eu.theunitry.fabula.levels.Level6;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;

/**
 * UNLauncher is the main menu which loads levels & settings.
 * Later, we will add support to switch between levels.
 */
public class UNLauncher extends JPanel
{
    private JLabel label;
    private JButton startBtn;

    public UNLauncher(UNGameScreen gameScreen)
    {
        UNGameScreen gameScreen1 = gameScreen;
        this.label = new JLabel("Fabula");
        this.startBtn = new JButton("Start");

        this.setStyling();
        startBtn.addActionListener(new UNButtonListener(){
            @Override
            public void actionPerformed(ActionEvent e)
            {
                gameScreen.resetProgress();
                UNView panel = new Level6(gameScreen, true);
                gameScreen.switchMusic(1, true);
                gameScreen.getMusic().get(1).setVolume(0.1);

                gameScreen.switchPanel(panel);
            }
        });
        
        this.add(label, BorderLayout.CENTER);
        this.add(startBtn, BorderLayout.SOUTH);
    }

    public JPanel getPanel() {
        return this;
    }

    private void setStyling()
    {
        /**
         * Panel Styling
         */
        this.setBackground(UNColor.PRIMARY_COLOR);
        this.setLayout(new BorderLayout());
        this.setBorder(new EmptyBorder(20, 20, 20, 20));

        /**
         * Label Styling
         */
        this.label.setForeground(Color.white);
        this.label.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 40));
        this.label.setHorizontalAlignment(JLabel.CENTER);

        /**
         * Button Styling
         */
        this.startBtn.setPreferredSize(new Dimension(200,100));
        this.startBtn.setBackground(Color.white);
        this.startBtn.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 20));
        this.startBtn.setForeground(UNColor.PRIMARY_COLOR);
        this.startBtn.setOpaque(true);

        /**
         * Default Styling Reset
         */
        this.startBtn.setFocusPainted(false);
        this.startBtn.setBorderPainted(false);
    }

}

@@ -670,16 +670,55 @@
 tartBtn;
+%0A    private UNLevelLoader levelLoader;
 %0A%0A    pu
@@ -1098,252 +1098,50 @@
     
-gameScreen.resetProgress();%0A                UNView panel
+levelLoader
  = new 
+UN
 Level
-6(gameScreen, true);%0A                gameScreen.switchMusic(1, true);%0A                gameScreen.getMusic().get(1).setVolume(0.1);%0A%0A                gameScreen.switchPanel(panel
+Loader(gameScreen
 );%0A 

Move level loading to UNLevelLoader