package eu.jonahbauer.wizard.client.libgdx.screens;

import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup;
import eu.jonahbauer.wizard.client.libgdx.WizardGame;

public class LoadingScreen extends MenuScreen {
    private final String key;
    
    @Deprecated
    public LoadingScreen(WizardGame game) {
        this(game, "menu.loading.loading");
    }
    
    public LoadingScreen(WizardGame game, String key) {
        super(game);
        this.key = key;
    }
    
    @Override
    public void show() {
        super.show();
        
        var label = new Label(messages.get(key), skin);
        
        var content = new VerticalGroup();
        content.setPosition(WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT*0.5f);
        content.addActor(label);
        
        stage.addActor(content);
    }
    
}
