Fixed most main menu bugs
This commit is contained in:
@@ -11,7 +11,6 @@ import io.anuke.arc.function.Consumer;
|
|||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.graphics.Colors;
|
import io.anuke.arc.graphics.Colors;
|
||||||
import io.anuke.arc.graphics.g2d.BitmapFont;
|
import io.anuke.arc.graphics.g2d.BitmapFont;
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
|
||||||
import io.anuke.arc.input.KeyCode;
|
import io.anuke.arc.input.KeyCode;
|
||||||
import io.anuke.arc.math.Interpolation;
|
import io.anuke.arc.math.Interpolation;
|
||||||
import io.anuke.arc.scene.Group;
|
import io.anuke.arc.scene.Group;
|
||||||
@@ -144,7 +143,6 @@ public class UI implements ApplicationListener{
|
|||||||
|
|
||||||
Core.scene.act();
|
Core.scene.act();
|
||||||
Core.scene.draw();
|
Core.scene.draw();
|
||||||
Draw.flush();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -324,6 +324,8 @@ public class MapView extends Element implements GestureListener{
|
|||||||
Lines.stroke(Unit.dp.scl(3f));
|
Lines.stroke(Unit.dp.scl(3f));
|
||||||
Lines.rect(x, y, width, height);
|
Lines.rect(x, y, width, height);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|
||||||
|
ScissorStack.popScissors();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean active(){
|
private boolean active(){
|
||||||
@@ -337,7 +339,7 @@ public class MapView extends Element implements GestureListener{
|
|||||||
public boolean pan(float x, float y, float deltaX, float deltaY){
|
public boolean pan(float x, float y, float deltaX, float deltaY){
|
||||||
if(!active()) return false;
|
if(!active()) return false;
|
||||||
offsetx += deltaX / zoom;
|
offsetx += deltaX / zoom;
|
||||||
offsety -= deltaY / zoom;
|
offsety += deltaY / zoom;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.graphics;
|
|||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.Core;
|
||||||
import io.anuke.arc.graphics.*;
|
import io.anuke.arc.graphics.*;
|
||||||
import io.anuke.arc.graphics.VertexAttributes.Usage;
|
import io.anuke.arc.graphics.VertexAttributes.Usage;
|
||||||
|
import io.anuke.arc.graphics.g2d.BatchShader;
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||||
import io.anuke.arc.graphics.glutils.Shader;
|
import io.anuke.arc.graphics.glutils.Shader;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
@@ -63,7 +64,7 @@ public class IndexedRenderer implements Disposable{
|
|||||||
|
|
||||||
texture.bind();
|
texture.bind();
|
||||||
|
|
||||||
program.setUniformMatrix("u_projTrans", combined);
|
program.setUniformMatrix4("u_projTrans", BatchShader.copyTransform(combined));
|
||||||
program.setUniformi("u_texture", 0);
|
program.setUniformi("u_texture", 0);
|
||||||
|
|
||||||
mesh.render(program, GL20.GL_TRIANGLES, 0, vertices.length / 5);
|
mesh.render(program, GL20.GL_TRIANGLES, 0, vertices.length / 5);
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ public class BackgroundFragment extends Fragment{
|
|||||||
public void build(Group parent){
|
public void build(Group parent){
|
||||||
Core.scene.table().addRect((a, b, w, h) -> {
|
Core.scene.table().addRect((a, b, w, h) -> {
|
||||||
Draw.colorl(0.1f);
|
Draw.colorl(0.1f);
|
||||||
Fill.rect(0, 0, w, h);
|
Fill.crect(0, 0, w, h);
|
||||||
Draw.shader(Shaders.menu);
|
Draw.shader(Shaders.menu);
|
||||||
Fill.rect(0, 0, w, h);
|
Fill.crect(0, 0, w, h);
|
||||||
Draw.shader();
|
Draw.shader();
|
||||||
|
|
||||||
boolean portrait = Core.graphics.getWidth() < Core.graphics.getHeight();
|
boolean portrait = Core.graphics.getWidth() < Core.graphics.getHeight();
|
||||||
@@ -29,7 +29,7 @@ public class BackgroundFragment extends Fragment{
|
|||||||
float logoh = logo.getHeight() * logoscl;
|
float logoh = logo.getHeight() * logoscl;
|
||||||
|
|
||||||
Draw.color();
|
Draw.color();
|
||||||
Draw.rect(logo, (int) (w / 2 - logow / 2), (int) (h - logoh + 15 - Unit.dp.scl(portrait ? 30f : 0)), logow, logoh);
|
Draw.rect(logo, (int) (w / 2), (int) (h - logoh + 15 - Unit.dp.scl(portrait ? 30f : 0)) + logoh/2, logow, logoh);
|
||||||
}).visible(() -> state.is(State.menu)).grow();
|
}).visible(() -> state.is(State.menu)).grow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class MindustryServer implements ApplicationListener{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(){
|
public void init(){
|
||||||
|
Core.settings.setDataDirectory(Core.files.local("config"));
|
||||||
Vars.init();
|
Vars.init();
|
||||||
|
|
||||||
headless = true;
|
headless = true;
|
||||||
|
|||||||
@@ -2,12 +2,11 @@ package io.anuke.mindustry.server;
|
|||||||
|
|
||||||
|
|
||||||
import io.anuke.arc.ApplicationListener;
|
import io.anuke.arc.ApplicationListener;
|
||||||
import io.anuke.arc.Core;
|
|
||||||
import io.anuke.arc.backends.headless.HeadlessApplication;
|
import io.anuke.arc.backends.headless.HeadlessApplication;
|
||||||
import io.anuke.arc.backends.headless.HeadlessApplicationConfiguration;
|
import io.anuke.arc.backends.headless.HeadlessApplicationConfiguration;
|
||||||
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.net.KryoClient;
|
import io.anuke.net.KryoClient;
|
||||||
import io.anuke.net.KryoServer;
|
import io.anuke.net.KryoServer;
|
||||||
import io.anuke.mindustry.net.Net;
|
|
||||||
|
|
||||||
public class ServerLauncher extends HeadlessApplication{
|
public class ServerLauncher extends HeadlessApplication{
|
||||||
|
|
||||||
@@ -22,8 +21,6 @@ public class ServerLauncher extends HeadlessApplication{
|
|||||||
Net.setServerProvider(new KryoServer());
|
Net.setServerProvider(new KryoServer());
|
||||||
|
|
||||||
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
|
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
|
||||||
Core.settings.setDataDirectory(Core.files.local("config"));
|
|
||||||
|
|
||||||
new ServerLauncher(new MindustryServer(args), config);
|
new ServerLauncher(new MindustryServer(args), config);
|
||||||
}catch(Throwable t){
|
}catch(Throwable t){
|
||||||
CrashHandler.handle(t);
|
CrashHandler.handle(t);
|
||||||
|
|||||||
Reference in New Issue
Block a user