1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-09-22 13:57:46 +03:00

Fixed bugs with player list, rturret description and deserialization

This commit is contained in:
Anuken 2018-01-30 22:11:54 -05:00
parent 9a5ac76850
commit 0c4f3dc612
10 changed files with 240 additions and 210 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

View File

@ -188,7 +188,7 @@ text.blocks.output=Output
text.blocks.secondsitem=Seconds/item
text.blocks.maxpowertransfersecond=Max power transfer/second
text.blocks.explosive=Highly explosive!
text.blocks.repairssecond=Repairs/second
text.blocks.repairssecond=Repaired/second
text.blocks.health=Health
text.blocks.inaccuracy=Inaccuracy
text.blocks.shots=Shots

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

@ -226,7 +226,7 @@ public class Renderer extends RendererModule{
Draw.tscl(0.25f/2);
for(Player player : playerGroup.all()){
if(!player.isLocal){
if(!player.isLocal && !player.isDead()){
layout.setText(Core.font, player.name);
Draw.color(0f, 0f, 0f, 0.3f);
Draw.rect("blank", player.x, player.y + 8 - layout.height/2, layout.width + 2, layout.height + 2);

View File

@ -62,7 +62,7 @@ public class Player extends SyncEntity{
return false;
}
}
return super.collides(other) && !isAndroid;
return !isDead() && super.collides(other) && !isAndroid;
}
@Override
@ -92,6 +92,7 @@ public class Player extends SyncEntity{
Timers.run(respawnduration + 5f, () -> {
heal();
set(world.getSpawnX(), world.getSpawnY());
interpolator.target.set(x, y);
});
}

View File

@ -145,12 +145,12 @@ public class MapEditorDialog extends Dialog{
build.end();
tapped(() -> {
Element e = getScene().hit(Graphics.mouse().x, Graphics.mouse().y, true);
if(e == null || !e.isDescendantOf(pane)) getScene().setScrollFocus(null);
Element e = Core.scene.hit(Graphics.mouse().x, Graphics.mouse().y, true);
if(e == null || !e.isDescendantOf(pane)) Core.scene.setScrollFocus(null);
});
update(() -> {
if(getScene().getKeyboardFocus() == this){
if(Core.scene != null && Core.scene.getKeyboardFocus() == this){
doInput();
}
});
@ -189,7 +189,7 @@ public class MapEditorDialog extends Dialog{
}
public boolean hasPane(){
return getScene().getScrollFocus() == pane;
return Core.scene.getScrollFocus() == pane;
}
public void build(){

View File

@ -265,6 +265,7 @@ public class Packets {
entity = (SyncEntity) ClassReflection.newInstance(group.getType());
entity.id = id;
entity.readSpawn(buffer);
entity.interpolator.target.set(entity.x, entity.y);
}catch (ReflectionException e){
throw new RuntimeException(e);
}

View File

@ -8,11 +8,14 @@ import io.anuke.mindustry.net.Packets.KickReason;
import io.anuke.mindustry.ui.BorderImage;
import io.anuke.ucore.core.Inputs;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.scene.Element;
import io.anuke.ucore.scene.builders.label;
import io.anuke.ucore.scene.builders.table;
import io.anuke.ucore.scene.ui.ScrollPane;
import io.anuke.ucore.scene.ui.layout.Stack;
import io.anuke.ucore.scene.ui.layout.Table;
import io.anuke.ucore.util.Bundles;
import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.*;
@ -72,9 +75,27 @@ public class PlayerListFragment implements Fragment{
Table button = new Table("button");
button.left();
button.margin(5).marginBottom(10);
BorderImage image = new BorderImage(Draw.region(player.isAndroid ? "ship-standard" : "mech-standard"), 3f);
button.add(image).size(h);
button.add(player.name).pad(10);
Stack stack = new Stack();
BorderImage image = new BorderImage(Draw.region(player.isAndroid ? "ship-standard" : "mech-standard-icon"), 3f);
stack.add(image);
if(!player.isAndroid) {
stack.add(new Element(){
public void draw(){
float s = getWidth() / 12f;
for(int i : Mathf.signs){
Draw.rect((i < 0 ? player.weaponLeft.name : player.weaponRight.name)
+ "-equip", x + s * 6 + i * 3*s, y + s*6 + 2*s, -8*s*i, 8*s);
}
}
});
}
button.add(stack).size(h);
button.add("[#" + player.getColor().toString().toUpperCase() + "]" + player.name).pad(10);
button.add().grow();
if(Net.server() && !player.isLocal){

View File

@ -30,7 +30,7 @@ public class RepairTurret extends PowerTurret{
list.add("[powerinfo]Power Capacity: " + (int)powerCapacity);
list.add("[powerinfo]Power/shot: " + Strings.toFixed(powerUsed, 1));
list.add("[turretinfo]Range: " + (int)range);
list.add("[turretinfo]Repairs/Second: " + Strings.toFixed(60f/reload, 1));
list.add("[turretinfo]Repairs/Second: " + Strings.toFixed(60f/reload * repairFrac * 100, 1) + "%");
}
@Override