Fixed zoom/web save export/liquid crafter/menu button scale bugs

This commit is contained in:
Anuken 2018-01-26 14:01:16 -05:00
parent 493af5e653
commit c0a9cfc6b2
12 changed files with 255 additions and 254 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 B

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 B

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 705 B

After

Width:  |  Height:  |  Size: 687 B

View File

@ -22,7 +22,8 @@ text.server.mismatch=Packet error: possible client/server version mismatch.\nMak
text.server.closing=[accent]Closing server...
text.server.kicked.kick=You have been kicked from the server!
text.server.kicked.invalidPassword=Invalid password!
text.server.kicked.outdated=Outdated client! Update your game!
text.server.kicked.clientOutdated=Outdated client! Update your game!
text.server.kicked.serverOutdated=Outdated client! Update your game!
text.server.connected={0} has joined.
text.server.disconnected={0} has disconnected.
text.nohost=Can't host server on a custom map!

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

@ -47,7 +47,7 @@ public class NetServer extends Module{
Net.handleServer(ConnectPacket.class, (id, packet) -> {
if(packet.version != Net.version){
Net.kickConnection(id, KickReason.outdated);
Net.kickConnection(id, packet.version > Net.version ? KickReason.serverOutdated : KickReason.clientOutdated);
return;
}

View File

@ -96,6 +96,8 @@ public class Renderer extends RendererModule{
Graphics.setCameraScale(targetscale);
control.input.resetCursor();
}
}else{
camera.zoom = Mathf.lerp(camera.zoom, 1f, 0.2f * Timers.delta());
}
if(GameState.is(State.menu)){

View File

@ -398,7 +398,7 @@ public class Packets {
}
public enum KickReason{
kick, invalidPassword, outdated
kick, invalidPassword, clientOutdated, serverOutdated
}
public static class UpgradePacket implements Packet{

View File

@ -74,36 +74,25 @@ public class LoadDialog extends FloatingDialog{
});
}).size(14*3).right();
t.addImageButton("icon-dots", "empty", 14*3, () -> {
FloatingDialog dialog = new FloatingDialog("Save Options");
dialog.addCloseButton();
dialog.content().defaults().left().uniformX().size(230f, 60f);
dialog.content().addImageTextButton("$text.save.rename", "icon-rename", 14*3, () -> {
t.addImageButton("icon-pencil-small", "empty", 14*3, () -> {
Vars.ui.showTextInput("$text.save.rename", "$text.save.rename.text", slot.getName(), text -> {
slot.setName(text);
dialog.hide();
setup();
});
});
}).size(14*3).right();
dialog.content().row();
dialog.content().addImageTextButton("$text.save.export", "icon-load", 14*3, () -> {
if(!Vars.gwt) {
t.addImageButton("icon-save", "empty", 14 * 3, () -> {
new FileChooser("$text.save.export", false, file -> {
try{
try {
slot.exportFile(file);
setup();
}catch (IOException e){
} catch (IOException e) {
Vars.ui.showError(Bundles.format("text.save.export.fail", Strings.parseException(e, false)));
}
dialog.hide();
}).show();
});
dialog.show();
}).size(14*3).right();
}).size(14 * 3).right();
}
}).padRight(-10).growX();

View File

@ -1,8 +1,8 @@
package io.anuke.mindustry.world.blocks.types.production;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.graphics.Fx;
@ -10,9 +10,9 @@ import io.anuke.mindustry.resource.Item;
import io.anuke.mindustry.resource.Liquid;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.util.Strings;
public class LiquidCrafter extends LiquidBlock{
@ -50,14 +50,16 @@ public class LiquidCrafter extends LiquidBlock{
@Override
public void draw(Tile tile){
Vector2 v = getPlaceOffset();
LiquidEntity entity = tile.entity();
Draw.rect(name(), tile.worldx(), tile.worldy());
Draw.rect(name(), tile.worldx() + v.x, tile.worldy() + v.y);
if(entity.liquid == null) return;
Draw.color(entity.liquid.color);
Draw.alpha(entity.liquidAmount / liquidCapacity);
Draw.rect("blank", tile.worldx(), tile.worldy(), 2, 2);
Draw.rect("blank", tile.worldx() + v.x, tile.worldy() + v.y, 2, 2);
Draw.color();
}