Multiple UI changes, new logo, other misc. changes
This commit is contained in:
@@ -10,7 +10,7 @@ import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Colors;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.math.Interpolation;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
@@ -20,9 +20,10 @@ import io.anuke.mindustry.entities.Weapon;
|
||||
import io.anuke.mindustry.input.AndroidInput;
|
||||
import io.anuke.mindustry.resource.*;
|
||||
import io.anuke.mindustry.ui.*;
|
||||
import io.anuke.ucore.core.*;
|
||||
import io.anuke.ucore.core.Core;
|
||||
import io.anuke.ucore.core.Draw;
|
||||
import io.anuke.ucore.core.Settings;
|
||||
import io.anuke.ucore.function.VisibilityProvider;
|
||||
import io.anuke.ucore.graphics.Hue;
|
||||
import io.anuke.ucore.graphics.Textures;
|
||||
import io.anuke.ucore.modules.SceneModule;
|
||||
import io.anuke.ucore.scene.actions.Actions;
|
||||
@@ -42,8 +43,9 @@ public class UI extends SceneModule{
|
||||
VisibilityProvider nplay = () -> GameState.is(State.menu);
|
||||
|
||||
public UI() {
|
||||
Dialog.setShowAction(()-> sequence(Actions.moveToAligned(Gdx.graphics.getWidth()/2, Gdx.graphics.getHeight(), Align.center),
|
||||
parallel(Actions.moveToAligned(Gdx.graphics.getWidth()/2, Gdx.graphics.getHeight()/2, Align.center, 0.09f, Interpolation.fade),
|
||||
Dialog.setShowAction(()-> sequence(Actions.moveToAligned(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), Align.center),
|
||||
parallel(Actions.moveToAligned(Gdx.graphics.getWidth()/2,
|
||||
Gdx.graphics.getHeight()/2, Align.center, 0.09f, Interpolation.fade),
|
||||
|
||||
Actions.fadeIn(0.09f, Interpolation.fade))));
|
||||
|
||||
@@ -56,10 +58,10 @@ public class UI extends SceneModule{
|
||||
TooltipManager.getInstance().animations = false;
|
||||
|
||||
Dialog.closePadR = -1;
|
||||
Dialog.closePadT = 4;
|
||||
Dialog.closePadT = 5;
|
||||
|
||||
Textures.load("sprites/");
|
||||
Textures.repeatWrap("conveyort", Gdx.app.getType() == ApplicationType.WebGL ? "back-web" : "back");
|
||||
Textures.repeatWrap("conveyort", Gdx.app.getType() == ApplicationType.WebGL ? "back-web" : "back", "background");
|
||||
|
||||
Colors.put("description", Color.WHITE);
|
||||
Colors.put("turretinfo", Color.ORANGE);
|
||||
@@ -68,12 +70,18 @@ public class UI extends SceneModule{
|
||||
}
|
||||
|
||||
void drawBackground(){
|
||||
|
||||
Batch batch = scene.getBatch();
|
||||
Draw.color();
|
||||
int w = (int)screen.x;
|
||||
int h = (int)screen.y;
|
||||
|
||||
Draw.color();
|
||||
|
||||
Texture back = Textures.get("background");
|
||||
int backscl = 5;
|
||||
|
||||
Draw.batch().draw(back, w/2 - back.getWidth()*backscl/2, h/2 - back.getHeight()*backscl/2,
|
||||
back.getWidth()*backscl, back.getHeight()*backscl);
|
||||
|
||||
/*
|
||||
Draw.color(Hue.lightness(0.6f));
|
||||
|
||||
int tw = w/64+1;
|
||||
@@ -89,15 +97,19 @@ public class UI extends SceneModule{
|
||||
float offset = (Timers.time()*2*(x%2-0.5f))/32f;
|
||||
batch.draw(Textures.get("conveyort"), x*64*scale, 0, 32*scale, h*scale, 0, offset, 1, h/32 + offset);
|
||||
}
|
||||
*/
|
||||
|
||||
int logoscl = 7;
|
||||
TextureRegion logo = skin.getRegion("logotext");
|
||||
int logow = logo.getRegionWidth()*logoscl;
|
||||
int logoh = logo.getRegionHeight()*logoscl;
|
||||
|
||||
Draw.color();
|
||||
//Draw.color(Color.CORAL);
|
||||
Draw.batch().draw(logo, w/2 - logow/2, h - logoh + 10, logow, logoh);
|
||||
|
||||
Draw.color();
|
||||
|
||||
Draw.tscl(Unit.dp.inPixels(1.5f));
|
||||
|
||||
Draw.text("[#111111]-( Mindustry )-", w/2, h-Unit.dp.inPixels(16));
|
||||
Draw.text("[#f1de60]-( Mindustry )-", w/2, h-Unit.dp.inPixels(10));
|
||||
|
||||
Draw.tscl(Unit.dp.inPixels(0.5f));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -188,7 +200,7 @@ public class UI extends SceneModule{
|
||||
|
||||
row();
|
||||
|
||||
new table("button"){{
|
||||
new table("pane"){{
|
||||
|
||||
int rows = 4;
|
||||
int maxcol = 0;
|
||||
@@ -368,8 +380,8 @@ public class UI extends SceneModule{
|
||||
//menu table
|
||||
new table(){{
|
||||
|
||||
new table("button"){{
|
||||
defaults().size(220, 50);
|
||||
new table("pane"){{
|
||||
defaults().size(220, 50).pad(3);
|
||||
|
||||
new button("Play", () -> {
|
||||
levels.show();
|
||||
@@ -419,10 +431,9 @@ public class UI extends SceneModule{
|
||||
|
||||
if(debug){
|
||||
new table(){{
|
||||
atop();
|
||||
new table("button"){{
|
||||
new label("[red]DEBUG MODE").scale(1);
|
||||
}}.end();
|
||||
abottom();
|
||||
aleft();
|
||||
new label("[red]DEBUG MODE").scale(0.5f);
|
||||
}}.end();
|
||||
}
|
||||
|
||||
@@ -532,7 +543,7 @@ public class UI extends SceneModule{
|
||||
Label label = new Label("[health]health: " + recipe.result.health + (recipe.result.description() == null ?
|
||||
"" : ("\n[]" + recipe.result.description())));
|
||||
label.setWrap(true);
|
||||
desctable.add(label).width(200).padTop(4);
|
||||
desctable.add(label).width(200).padTop(4).padBottom(2);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
||||
shell = new BulletType(1.1f, 110){
|
||||
{
|
||||
lifetime = 110f;
|
||||
hitsize = 8f;
|
||||
}
|
||||
public void draw(Bullet b){
|
||||
float rad = 8f;
|
||||
@@ -68,13 +69,13 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
||||
Effects.effect("shellsmoke", b);
|
||||
Effects.effect("shellexplosion", b);
|
||||
|
||||
Angles.circle(20, f->{
|
||||
Angles.circle(25, f->{
|
||||
Angles.translation(f, 5f);
|
||||
new Bullet(shellshot, b.owner, b.x + Angles.x(), b.y + Angles.y(), f).add();
|
||||
});
|
||||
}
|
||||
},
|
||||
shellshot = new BulletType(1.5f, 5){
|
||||
shellshot = new BulletType(1.5f, 6){
|
||||
{
|
||||
lifetime = 7f;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class Player extends DestructibleEntity{
|
||||
float speed = this.speed;
|
||||
|
||||
if(Vars.debug)
|
||||
speed = 3f;
|
||||
speed = 2f;
|
||||
|
||||
if(health < maxhealth && Timers.get(this, 50))
|
||||
health ++;
|
||||
|
||||
@@ -35,12 +35,12 @@ public class LoadDialog extends Dialog{
|
||||
for(int i = 0; i < Vars.saveSlots; i ++){
|
||||
final int slot = i;
|
||||
|
||||
TextButton button = new TextButton("[yellow]Slot " + (i+1));
|
||||
TextButton button = new TextButton("[orange]Slot " + (i+1));
|
||||
button.getLabelCell().top().left().growX();
|
||||
button.row();
|
||||
button.pad(Unit.dp.inPixels(10));
|
||||
button.add("[gray]" + (!SaveIO.isSaveValid(i) ? "<empty>" : "Last Saved: " + SaveIO.getTimeString(i)));
|
||||
button.getLabel().setFontScale(1f);
|
||||
button.add("[gray]" + (!SaveIO.isSaveValid(i) ? "<empty>" : "Last Saved: " + SaveIO.getTimeString(i))).padBottom(2);
|
||||
button.getLabel().setFontScale(0.75f);
|
||||
button.setDisabled(!SaveIO.isSaveValid(i) );
|
||||
|
||||
button.clicked(()->{
|
||||
@@ -59,7 +59,7 @@ public class LoadDialog extends Dialog{
|
||||
}
|
||||
});
|
||||
|
||||
content().add(button).size(400, 75).units(Unit.dp).pad(2);
|
||||
content().add(button).size(400, 78).units(Unit.dp).pad(2);
|
||||
content().row();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,12 +35,12 @@ public class SaveDialog extends Dialog{
|
||||
for(int i = 0; i < Vars.saveSlots; i ++){
|
||||
final int slot = i;
|
||||
|
||||
TextButton button = new TextButton("[yellow]Slot " + (i+1));
|
||||
TextButton button = new TextButton("[orange]Slot " + (i+1));
|
||||
button.getLabelCell().top().left().growX();
|
||||
button.row();
|
||||
button.pad(Unit.dp.inPixels(10));
|
||||
button.add((!SaveIO.isSaveValid(i) ? "[gray]<empty>" : "[LIGHT_GRAY]Last Saved: " + SaveIO.getTimeString(i)));
|
||||
button.getLabel().setFontScale(1f);
|
||||
button.add((!SaveIO.isSaveValid(i) ? "[gray]<empty>" : "[LIGHT_GRAY]Last Saved: " + SaveIO.getTimeString(i))).padBottom(2);
|
||||
button.getLabel().setFontScale(0.75f);
|
||||
|
||||
button.clicked(()->{
|
||||
if(SaveIO.isSaveValid(slot)){
|
||||
@@ -56,7 +56,7 @@ public class SaveDialog extends Dialog{
|
||||
}
|
||||
});
|
||||
|
||||
content().add(button).size(400, 75).units(Unit.dp).pad(2);
|
||||
content().add(button).size(400, 78).units(Unit.dp).pad(2);
|
||||
content().row();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ public class Block{
|
||||
|
||||
public void drawOver(Tile tile){}
|
||||
public void drawPixelOverlay(Tile tile){}
|
||||
@Deprecated
|
||||
public void drawOverlay(Tile tile){}
|
||||
public void drawPlace(int x, int y, boolean valid){}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import io.anuke.ucore.core.Draw;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
|
||||
public class Pump extends Conduit{
|
||||
protected float pumpspeed = 2f;
|
||||
|
||||
public Pump(String name) {
|
||||
super(name);
|
||||
@@ -26,9 +27,9 @@ public class Pump extends Conduit{
|
||||
public void update(Tile tile){
|
||||
ConduitEntity entity = tile.entity();
|
||||
|
||||
if(Timers.get(tile, "pump", 10) && entity.amount < capacity){
|
||||
if(Timers.get(tile, "pump", 8) && entity.amount < capacity){
|
||||
entity.liquid = Liquid.water;
|
||||
entity.amount += 10f;
|
||||
entity.amount += pumpspeed;
|
||||
}
|
||||
|
||||
if(Timers.get(tile, "dump", 1)){
|
||||
|
||||
Reference in New Issue
Block a user