Bugfixes for 3.3 beta
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="io.anuke.mindustry"
|
package="io.anuke.mindustry"
|
||||||
android:versionCode="48"
|
android:versionCode="49"
|
||||||
android:versionName="3.2.1" >
|
android:versionName="3.3b1" >
|
||||||
|
|
||||||
<uses-permission android:name="com.android.vending.BILLING" />
|
<uses-permission android:name="com.android.vending.BILLING" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ public class NetClient extends Module {
|
|||||||
Player player = Vars.control.playerGroup.getByID(packet.playerid);
|
Player player = Vars.control.playerGroup.getByID(packet.playerid);
|
||||||
|
|
||||||
Weapon weapon = (Weapon) Upgrade.getByID(packet.weaponid);
|
Weapon weapon = (Weapon) Upgrade.getByID(packet.weaponid);
|
||||||
weapon.shoot(player, packet.x, packet.y, packet.rotation);
|
Gdx.app.postRunnable(() -> weapon.shoot(player, packet.x, packet.y, packet.rotation));
|
||||||
});
|
});
|
||||||
|
|
||||||
Net.handle(PlacePacket.class, packet -> {
|
Net.handle(PlacePacket.class, packet -> {
|
||||||
@@ -183,14 +183,16 @@ public class NetClient extends Module {
|
|||||||
Net.handle(BulletPacket.class, packet -> {
|
Net.handle(BulletPacket.class, packet -> {
|
||||||
//TODO shoot effects for enemies, clientside as well as serverside
|
//TODO shoot effects for enemies, clientside as well as serverside
|
||||||
BulletType type = (BulletType) BaseBulletType.getByID(packet.type);
|
BulletType type = (BulletType) BaseBulletType.getByID(packet.type);
|
||||||
Entity owner = Vars.control.enemyGroup.getByID(packet.owner);
|
Gdx.app.postRunnable(() -> {
|
||||||
new Bullet(type, owner, packet.x, packet.y, packet.angle).add();
|
Entity owner = Vars.control.enemyGroup.getByID(packet.owner);
|
||||||
|
new Bullet(type, owner, packet.x, packet.y, packet.angle).add();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Net.handle(BlockDestroyPacket.class, packet -> {
|
Net.handle(BlockDestroyPacket.class, packet -> {
|
||||||
Tile tile = Vars.world.tile(packet.position % Vars.world.width(), packet.position / Vars.world.width());
|
Tile tile = Vars.world.tile(packet.position % Vars.world.width(), packet.position / Vars.world.width());
|
||||||
if(tile.entity != null){
|
if(tile.entity != null){
|
||||||
tile.entity.onDeath(true);
|
Gdx.app.postRunnable(() -> tile.entity.onDeath(true));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -227,7 +229,7 @@ public class NetClient extends Module {
|
|||||||
Player player = Vars.control.playerGroup.getByID(packet.playerid);
|
Player player = Vars.control.playerGroup.getByID(packet.playerid);
|
||||||
|
|
||||||
if(player != null){
|
if(player != null){
|
||||||
player.remove();
|
Gdx.app.postRunnable(player::remove);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -87,8 +87,7 @@ public class NetServer extends Module{
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendMessage("[accent]"+Bundles.format("text.server.disconnected", player.name));
|
sendMessage("[accent]"+Bundles.format("text.server.disconnected", player.name));
|
||||||
|
Gdx.app.postRunnable(player::remove);
|
||||||
player.remove();
|
|
||||||
|
|
||||||
DisconnectPacket dc = new DisconnectPacket();
|
DisconnectPacket dc = new DisconnectPacket();
|
||||||
dc.playerid = player.id;
|
dc.playerid = player.id;
|
||||||
@@ -112,7 +111,7 @@ public class NetServer extends Module{
|
|||||||
});
|
});
|
||||||
|
|
||||||
Net.handleServer(PlacePacket.class, packet -> {
|
Net.handleServer(PlacePacket.class, packet -> {
|
||||||
Vars.control.input.placeBlockInternal(packet.x, packet.y, Block.getByID(packet.block), packet.rotation, true, false);
|
Gdx.app.postRunnable(() -> Vars.control.input.placeBlockInternal(packet.x, packet.y, Block.getByID(packet.block), packet.rotation, true, false));
|
||||||
packet.playerid = connections.get(Net.getLastConnection()).id;
|
packet.playerid = connections.get(Net.getLastConnection()).id;
|
||||||
|
|
||||||
Recipe recipe = Recipes.getByResult(Block.getByID(packet.block));
|
Recipe recipe = Recipes.getByResult(Block.getByID(packet.block));
|
||||||
@@ -126,7 +125,7 @@ public class NetServer extends Module{
|
|||||||
});
|
});
|
||||||
|
|
||||||
Net.handleServer(BreakPacket.class, packet -> {
|
Net.handleServer(BreakPacket.class, packet -> {
|
||||||
Vars.control.input.breakBlockInternal(packet.x, packet.y, false);
|
Gdx.app.postRunnable(() -> Vars.control.input.breakBlockInternal(packet.x, packet.y, false));
|
||||||
packet.playerid = connections.get(Net.getLastConnection()).id;
|
packet.playerid = connections.get(Net.getLastConnection()).id;
|
||||||
|
|
||||||
Net.sendExcept(Net.getLastConnection(), packet, SendMode.tcp);
|
Net.sendExcept(Net.getLastConnection(), packet, SendMode.tcp);
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class Player extends DestructibleEntity implements Syncable{
|
|||||||
angle = Mathf.lerpAngDelta(angle, targetAngle, 0.2f);
|
angle = Mathf.lerpAngDelta(angle, targetAngle, 0.2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((Vars.debug && (!Vars.showPlayer || !Vars.showUI)) || (isAndroid && isLocal)) return;
|
if((Vars.debug && (!Vars.showPlayer || !Vars.showUI)) || (isAndroid && isLocal) ) return;
|
||||||
boolean snap = Vars.snapCamera && Settings.getBool("smoothcam") && Settings.getBool("pixelate") && isLocal;
|
boolean snap = Vars.snapCamera && Settings.getBool("smoothcam") && Settings.getBool("pixelate") && isLocal;
|
||||||
|
|
||||||
String part = isAndroid ? "ship" : "mech";
|
String part = isAndroid ? "ship" : "mech";
|
||||||
@@ -116,7 +116,7 @@ public class Player extends DestructibleEntity implements Syncable{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
if(!isLocal || isAndroid){
|
if(!isLocal || isAndroid || Vars.ui.chatfrag.chatOpen()){
|
||||||
if(!isDead() && !isLocal) inter.update(this);
|
if(!isDead() && !isLocal) inter.update(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,14 +209,14 @@ public class EnemyType {
|
|||||||
public void onShoot(Enemy enemy, BulletType type, float rotation){}
|
public void onShoot(Enemy enemy, BulletType type, float rotation){}
|
||||||
|
|
||||||
public void onDeath(Enemy enemy){
|
public void onDeath(Enemy enemy){
|
||||||
Effects.effect(Fx.explosion, enemy);
|
|
||||||
Effects.shake(3f, 4f, enemy);
|
|
||||||
Effects.sound("bang2", enemy);
|
|
||||||
enemy.remove();
|
|
||||||
enemy.dead = true;
|
|
||||||
|
|
||||||
if(Net.active() && Net.server()){
|
if(Net.active() && Net.server()){
|
||||||
Vars.netServer.handleEnemyDeath(enemy);
|
Vars.netServer.handleEnemyDeath(enemy);
|
||||||
|
}else if(!Net.active()){ //must be client
|
||||||
|
Effects.effect(Fx.explosion, enemy);
|
||||||
|
Effects.shake(3f, 4f, enemy);
|
||||||
|
Effects.sound("bang2", enemy);
|
||||||
|
enemy.remove();
|
||||||
|
enemy.dead = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.badlogic.gdx.utils.Array;
|
|||||||
import com.badlogic.gdx.utils.Pools;
|
import com.badlogic.gdx.utils.Pools;
|
||||||
import io.anuke.mindustry.Mindustry;
|
import io.anuke.mindustry.Mindustry;
|
||||||
import io.anuke.ucore.core.Core;
|
import io.anuke.ucore.core.Core;
|
||||||
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.function.Consumer;
|
import io.anuke.ucore.function.Consumer;
|
||||||
import io.anuke.ucore.function.Predicate;
|
import io.anuke.ucore.function.Predicate;
|
||||||
import io.anuke.ucore.scene.event.Touchable;
|
import io.anuke.ucore.scene.event.Touchable;
|
||||||
@@ -38,9 +39,6 @@ public class FileChooser extends FloatingDialog {
|
|||||||
this.open = open;
|
this.open = open;
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
this.selectListener = result;
|
this.selectListener = result;
|
||||||
setupWidgets();
|
|
||||||
|
|
||||||
Mindustry.platforms.requestWritePerms();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupWidgets(){
|
private void setupWidgets(){
|
||||||
@@ -253,8 +251,13 @@ public class FileChooser extends FloatingDialog {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dialog show(){
|
public Dialog show(){
|
||||||
super.show();
|
Mindustry.platforms.requestWritePerms();
|
||||||
Core.scene.setScrollFocus(pane);
|
Timers.runTask(2f, () -> {
|
||||||
|
content().clear();
|
||||||
|
setupWidgets();
|
||||||
|
super.show();
|
||||||
|
Core.scene.setScrollFocus(pane);
|
||||||
|
});
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ public class ChatFragment extends Table implements Fragment{
|
|||||||
if(sender == null){ //no sender, this is a server message?
|
if(sender == null){ //no sender, this is a server message?
|
||||||
formattedMessage = message;
|
formattedMessage = message;
|
||||||
}else{
|
}else{
|
||||||
formattedMessage = "[ROYAL]["+sender+"]: [YELLOW]"+message;
|
formattedMessage = "[CORAL]["+sender+"]: [YELLOW]"+message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import io.anuke.ucore.scene.ui.ButtonGroup;
|
|||||||
import io.anuke.ucore.scene.ui.ImageButton;
|
import io.anuke.ucore.scene.ui.ImageButton;
|
||||||
import io.anuke.ucore.scene.ui.Label;
|
import io.anuke.ucore.scene.ui.Label;
|
||||||
import io.anuke.ucore.scene.ui.layout.Table;
|
import io.anuke.ucore.scene.ui.layout.Table;
|
||||||
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
import io.anuke.ucore.util.Bundles;
|
import io.anuke.ucore.util.Bundles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@ public class PlacementFragment implements Fragment{
|
|||||||
InputHandler input = control.getInput();
|
InputHandler input = control.getInput();
|
||||||
|
|
||||||
float s = 50f;
|
float s = 50f;
|
||||||
float translation = 54f;
|
float translation = Unit.dp.scl(54f);
|
||||||
|
|
||||||
new table(){{
|
new table(){{
|
||||||
visible(() -> !GameState.is(State.menu));
|
visible(() -> !GameState.is(State.menu));
|
||||||
|
|||||||
Reference in New Issue
Block a user