import Panel from "./Panel";
import SceneCtrl from "../ctrls/sceneCtrl";
import { ModuleTypes } from "../types/sceneTypes";
import StartScene from "../../../src/startScene/StartScene";
export default class Alert extends Panel {
    start(data) {
        super.start(data);
        const { message, btnTxt } = data;
        this.data.message = message;
        this.data.btnTxt = btnTxt || '确定';
    }

    get skinKey() { return 'Alert' }

    get skinResKey() { return 'common' }

    protected get closeBtns(): eui.Button[] {
        return [this['closeBtn']]
    }

    hidePanel() {
        super.hidePanel();
        if (!(SceneCtrl.instance.currentScene instanceof StartScene))
            SceneCtrl.instance.change(ModuleTypes.START_SCENE);
    }
}