Changed too many things to fit in commit log
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package io.anuke.mindustry.ui.dialogs;
|
||||
|
||||
import io.anuke.mindustry.net.NetEvents;
|
||||
import io.anuke.ucore.scene.ui.TextField;
|
||||
import io.anuke.ucore.util.Strings;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
import static io.anuke.mindustry.Vars.gwt;
|
||||
|
||||
public class RollbackDialog extends FloatingDialog {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class RollbackDialog extends FloatingDialog {
|
||||
buttons().addButton("$text.cancel", this::hide);
|
||||
|
||||
buttons().addButton("$text.ok", () -> {
|
||||
NetEvents.handleRollbackRequest(Integer.valueOf(field.getText()));
|
||||
//NetEvents.handleRollbackRequest(Integer.valueOf(field.getText()));
|
||||
hide();
|
||||
}).disabled(b -> field.getText().isEmpty() || !Strings.canParsePostiveInt(field.getText()));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.core.Platform;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.net.NetEvents;
|
||||
import io.anuke.ucore.core.Core;
|
||||
import io.anuke.ucore.core.Inputs;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
@@ -22,7 +21,6 @@ import io.anuke.ucore.scene.ui.layout.Table;
|
||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
import static io.anuke.mindustry.Vars.players;
|
||||
import static io.anuke.mindustry.Vars.state;
|
||||
import static io.anuke.ucore.core.Core.scene;
|
||||
import static io.anuke.ucore.core.Core.skin;
|
||||
@@ -168,7 +166,7 @@ public class ChatFragment extends Table implements Fragment{
|
||||
if(message.replaceAll(" ", "").isEmpty()) return;
|
||||
|
||||
history.insert(1, message);
|
||||
NetEvents.handleSendMessage(players[0], message);
|
||||
//TODO send the message
|
||||
}
|
||||
|
||||
public void toggle(){
|
||||
|
||||
@@ -7,7 +7,7 @@ import io.anuke.mindustry.content.bullets.TurretBullets;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.bullet.Bullet;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.entities.units.BaseUnit;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.scene.Group;
|
||||
@@ -55,13 +55,13 @@ public class DebugFragment implements Fragment {
|
||||
row();
|
||||
new button("noclip", "toggle", () -> noclip = !noclip);
|
||||
row();
|
||||
new button("team", "toggle", () -> player.team = (player.team == Team.blue ? Team.red : Team.blue));
|
||||
new button("team", "toggle", () -> player.toggleTeam());
|
||||
row();
|
||||
new button("blocks", "toggle", () -> showBlockDebug = !showBlockDebug);
|
||||
row();
|
||||
new button("effect", () -> {
|
||||
for(int i = 0; i < 20; i ++){
|
||||
Bullet.create(TurretBullets.fireball, player, player.team, player.x, player.y, Mathf.random(360f));
|
||||
Bullet.create(TurretBullets.fireball, player, player.getTeam(), player.x, player.y, Mathf.random(360f));
|
||||
}
|
||||
});
|
||||
row();
|
||||
@@ -69,9 +69,17 @@ public class DebugFragment implements Fragment {
|
||||
row();
|
||||
new button("death", () -> player.damage(99999, false));
|
||||
row();
|
||||
new button("spawnf", () -> UnitTypes.vtol.create(player.team).set(player.x, player.y).add());
|
||||
new button("spawnf", () -> {
|
||||
BaseUnit unit = UnitTypes.vtol.create(player.getTeam());
|
||||
unit.set(player.x, player.y);
|
||||
unit.add();
|
||||
});
|
||||
row();
|
||||
new button("spawng", () -> UnitTypes.scout.create(player.team).set(player.x, player.y).add());
|
||||
new button("spawng", () ->{
|
||||
BaseUnit unit = UnitTypes.scout.create(player.getTeam());
|
||||
unit.set(player.x, player.y);
|
||||
unit.add();
|
||||
});
|
||||
row();
|
||||
}}.end();
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@ import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.net.EditLog;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.net.NetConnection;
|
||||
import io.anuke.mindustry.net.NetEvents;
|
||||
import io.anuke.mindustry.net.Packets.AdminAction;
|
||||
import io.anuke.mindustry.net.Packets.KickReason;
|
||||
import io.anuke.mindustry.ui.BorderImage;
|
||||
import io.anuke.mindustry.ui.dialogs.FloatingDialog;
|
||||
@@ -137,6 +135,7 @@ public class PlayerListFragment implements Fragment{
|
||||
|
||||
button.table(t -> {
|
||||
t.defaults().size(bs - 1, bs + 3);
|
||||
//TODO requests.
|
||||
|
||||
t.addImageButton("icon-ban", 14*2, () -> {
|
||||
ui.showConfirm("$text.confirm", "$text.confirmban", () -> {
|
||||
@@ -144,7 +143,7 @@ public class PlayerListFragment implements Fragment{
|
||||
netServer.admins.banPlayerIP(connection.address);
|
||||
netServer.kick(player.clientid, KickReason.banned);
|
||||
}else{
|
||||
NetEvents.handleAdministerRequest(player, AdminAction.ban);
|
||||
//NetEvents.handleAdministerRequest(player, AdminAction.ban);
|
||||
}
|
||||
});
|
||||
}).padBottom(-5.1f);
|
||||
@@ -153,7 +152,7 @@ public class PlayerListFragment implements Fragment{
|
||||
if(Net.server()) {
|
||||
netServer.kick(player.clientid, KickReason.kick);
|
||||
}else{
|
||||
NetEvents.handleAdministerRequest(player, AdminAction.kick);
|
||||
//NetEvents.handleAdministerRequest(player, AdminAction.kick);
|
||||
}
|
||||
}).padBottom(-5.1f);
|
||||
|
||||
@@ -180,7 +179,7 @@ public class PlayerListFragment implements Fragment{
|
||||
b.setDisabled(Net.client());
|
||||
}).get().setTouchable(() -> Net.client() ? Touchable.disabled : Touchable.enabled);
|
||||
|
||||
t.addImageButton("icon-zoom-small", 14*2, () -> NetEvents.handleTraceRequest(player));
|
||||
t.addImageButton("icon-zoom-small", 14*2, () -> {}/*NetEvents.handleTraceRequest(player)*/);
|
||||
|
||||
}).padRight(12).padTop(-5).padLeft(0).padBottom(-10).size(bs + 10f, bs);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user