64 lines
1.3 KiB
Java
64 lines
1.3 KiB
Java
package projectzombie.menu;
|
|
|
|
import gl_engine.matrix.Matrix4;
|
|
import gl_engine.vec.Vec3d;
|
|
import projectzombie.Main;
|
|
import projectzombie.init.Models;
|
|
import projectzombie.input.types.InputGUI;
|
|
import projectzombie.menu.gui.GUI;
|
|
import projectzombie.menu.gui.GUIAlignment;
|
|
import projectzombie.menu.gui.GUILabel;
|
|
import projectzombie.util.gl.GlHelpers;
|
|
import projectzombie.worker.WorkerTasks;
|
|
import projectzombie.world.chunk.ChunkEventHandler;
|
|
|
|
public class MenuSavingWorld extends Menu
|
|
{
|
|
private GUI gui;
|
|
|
|
public MenuSavingWorld()
|
|
{
|
|
doGameloop = true;
|
|
doGameRender = true;
|
|
keepMouse = false;
|
|
showIngameGUI = false;
|
|
|
|
GUILabel label = new GUILabel();
|
|
label.setText("Saving world...");
|
|
label.setAlign(GUIAlignment.CENTRE);
|
|
|
|
gui = new GUI();
|
|
input = new InputGUI(gui);
|
|
|
|
gui.add(label);
|
|
}
|
|
|
|
@Override
|
|
public void render()
|
|
{
|
|
double a = GlHelpers.getAspectRatio();
|
|
|
|
for(int x = 0; x < 16; x ++) {
|
|
for(int y = 0; y < 16; y ++)
|
|
{
|
|
Models.UI_STONE_BG.setModel(Matrix4.multiply(
|
|
Matrix4.scale(new Vec3d(1.25 * a, 1.25 * a, 1)),
|
|
Matrix4.translate(new Vec3d(-10 * a + 1.25 * a * x, -10 * a + 1.25 * a * y, 0))));
|
|
Models.UI_STONE_BG.render();
|
|
}
|
|
}
|
|
|
|
gui.render();
|
|
}
|
|
|
|
@Override
|
|
public void update()
|
|
{
|
|
super.update();
|
|
|
|
if(WorkerTasks.isDone()) {
|
|
Main.menu = new MenuMain();
|
|
}
|
|
}
|
|
}
|