package fr.monkhanny.dorfromantik.listeners;

import fr.monkhanny.dorfromantik.gui.MainMenu;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class CloseButtonListener implements ActionListener {
    private MainMenu mainMenu;
    private JFrame settingsFrame;

    public CloseButtonListener(MainMenu mainMenu, JFrame settingsFrame) {
        this.mainMenu = mainMenu;
        this.settingsFrame = settingsFrame;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        // Réafficher la fenêtre du menu principal
        mainMenu.setVisible(true);
        settingsFrame.setVisible(false);  // Fermer la fenêtre des paramètres
    }
}