package fr.monkhanny.dorfromantik.listeners;

import fr.monkhanny.dorfromantik.gui.MainMenu;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.*;

public class SettingsWindowListener extends WindowAdapter {

    private MainMenu mainMenu;
    private JFrame settingsFrame;

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

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