Search in sources :

Example 1 with LanguageSelectionScreen

use of io.xol.chunkstories.gui.layer.config.LanguageSelectionScreen in project chunkstories by Hugobros3.

the class LoginPrompt method render.

@Override
public void render(RenderingInterface renderer) {
    parentLayer.render(renderer);
    float scale = this.getGuiScale();
    if (Client.getInstance().getConfiguration().getStringOption("client.game.language").equals("undefined")) {
        gameWindow.setLayer(new LanguageSelectionScreen(gameWindow, this, false));
    // this.mainScene.changeOverlay(new LanguageSelectionScreen(mainScene, this, false));
    }
    if (can_next)
        gameWindow.setLayer(new MainMenu(gameWindow, parentLayer));
    ObjectRenderer.renderTexturedRect(renderer.getWindow().getWidth() / 2, renderer.getWindow().getHeight() / 2 + 90 * scale, 256 * scale, 256 * scale, "./textures/logo.png");
    usernameForm.setPosition(renderer.getWindow().getWidth() / 2 - 125 * scale, renderer.getWindow().getHeight() / 2 + 16 * scale);
    usernameForm.render(renderer);
    passwordForm.setPosition(usernameForm.getPositionX(), usernameForm.getPositionY() - usernameForm.getHeight() - (20 + 4) * scale);
    passwordForm.render(renderer);
    loginButton.setPosition(usernameForm.getPositionX(), passwordForm.getPositionY() - 30 * scale);
    renderer.getFontRenderer().drawStringWithShadow(renderer.getFontRenderer().defaultFont(), usernameForm.getPositionX(), usernameForm.getPositionY() + usernameForm.getHeight() + 4 * scale, Client.getInstance().getContent().localization().localize("#{login.username}"), scale, scale, new Vector4f(1.0f));
    renderer.getFontRenderer().drawStringWithShadow(renderer.getFontRenderer().defaultFont(), passwordForm.getPositionX(), passwordForm.getPositionY() + usernameForm.getHeight() + 4 * scale, Client.getInstance().getContent().localization().localize("#{login.password}"), scale, scale, new Vector4f(1.0f));
    if (logging_in) {
        renderer.getFontRenderer().drawStringWithShadow(renderer.getFontRenderer().defaultFont(), renderer.getWindow().getWidth() / 2 - 230, renderer.getWindow().getHeight() / 2 - 90, Client.getInstance().getContent().localization().localize("#{login.loggingIn}"), scale, scale, new Vector4f(1.0f));
    } else {
        float decal_lb = loginButton.getWidth();
        loginButton.render(renderer);
        renderer.getFontRenderer().drawStringWithShadow(renderer.getFontRenderer().defaultFont(), loginButton.getPositionX() + 4 * scale + decal_lb, loginButton.getPositionY() + 2 * scale, Client.getInstance().getContent().localization().localize("#{login.register}"), scale, scale, new Vector4f(1.0f));
        if (failed_login)
            renderer.getFontRenderer().drawStringWithShadow(renderer.getFontRenderer().defaultFont(), renderer.getWindow().getWidth() / 2 - 250, renderer.getWindow().getHeight() / 2 - 160, message, scale, scale, new Vector4f(1.0f, 0.0f, 0.0f, 1.0f));
    }
    if (autologin) {
        int seconds = 10;
        String autologin2 = Client.getInstance().getContent().localization().localize("#{login.auto1} " + (seconds - (System.currentTimeMillis() - startCounter) / 1000) + " #{login.auto2}");
        float autologinLength = renderer.getFontRenderer().defaultFont().getWidth(autologin2) * 2.0f;
        renderer.getFontRenderer().drawStringWithShadow(renderer.getFontRenderer().defaultFont(), renderer.getWindow().getWidth() / 2 - autologinLength / 2, renderer.getWindow().getHeight() / 2 - 170, autologin2, 2, 2, new Vector4f(0.0f, 1.0f, 0.0f, 1.0f));
        if ((System.currentTimeMillis() - startCounter) / 1000 > seconds) {
            connect();
            autologin = false;
        }
    }
    renderer.getFontRenderer().drawStringWithShadow(renderer.getFontRenderer().defaultFont(), 12, 12, "2015-2018 XolioWare Interactive", scale, scale, new Vector4f(1.0f, 1.0f, 1.0f, 1.0f));
}
Also used : Vector4f(org.joml.Vector4f) LanguageSelectionScreen(io.xol.chunkstories.gui.layer.config.LanguageSelectionScreen)

Aggregations

LanguageSelectionScreen (io.xol.chunkstories.gui.layer.config.LanguageSelectionScreen)1 Vector4f (org.joml.Vector4f)1