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

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
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(game.messages.get(key), game.data.skin);
        
        var content = new VerticalGroup();
        content.setPosition(WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT*0.5f);
        content.addActor(label);
        
        game.data.stage.addActor(content);
        
        Gdx.input.setInputProcessor(game.data.stage);
    }
    
}
