Cleanup continues

This commit is contained in:
Anuken
2020-02-04 18:00:32 -05:00
parent 012421afcb
commit a7b39e56bd
106 changed files with 2266 additions and 4543 deletions

View File

@@ -41,7 +41,7 @@ public class AdminsDialog extends FloatingDialog{
res.addImageButton(Icon.cancel, () -> {
ui.showConfirm("$confirm", "$confirmunadmin", () -> {
netServer.admins.unAdminPlayer(info.id);
playerGroup.all().each(player -> {
Groups.player.all().each(player -> {
if(player != null && player.uuid != null && player.uuid.equals(info.id)){
player.isAdmin = false;
}

View File

@@ -253,7 +253,7 @@ public class JoinDialog extends FloatingDialog{
Core.settings.save();
}).grow().pad(8).get().setMaxLength(maxNameLength);
}else{
t.add(player.name).update(l -> l.setColor(player.color)).grow().pad(8);
t.add(player.name()).update(l -> l.setColor(player.color)).grow().pad(8);
}
ImageButton button = t.addImageButton(Tex.whiteui, Styles.clearFulli, 40, () -> {

View File

@@ -2,7 +2,7 @@ package mindustry.ui.dialogs;
import arc.Core;
import arc.scene.ui.layout.Table;
import mindustry.entities.type.Player;
import mindustry.gen.*;
import mindustry.gen.*;
import mindustry.net.Administration.TraceInfo;
@@ -15,7 +15,7 @@ public class TraceDialog extends FloatingDialog{
setFillParent(false);
}
public void show(Player player, TraceInfo info){
public void show(Playerc player, TraceInfo info){
cont.clear();
Table table = new Table(Tex.clear);
@@ -23,7 +23,7 @@ public class TraceDialog extends FloatingDialog{
table.defaults().pad(1);
table.defaults().left();
table.add(Core.bundle.format("trace.playername", player.name));
table.add(Core.bundle.format("trace.playername", player.name()));
table.row();
table.add(Core.bundle.format("trace.ip", info.ip));
table.row();

View File

@@ -16,7 +16,7 @@ import arc.util.*;
import mindustry.annotations.Annotations.*;
import mindustry.core.GameState.*;
import mindustry.entities.*;
import mindustry.entities.type.*;
import mindustry.gen.*;
import mindustry.game.EventType.*;
import mindustry.gen.*;
import mindustry.net.Administration.*;
@@ -37,7 +37,7 @@ public class BlockInventoryFragment extends Fragment{
private Item lastItem;
@Remote(called = Loc.server, targets = Loc.both, forward = true)
public static void requestItem(Player player, Tile tile, Item item, int amount){
public static void requestItem(Playerc player, Tile tile, Item item, int amount){
if(player == null || tile == null || !tile.interactable(player.team())) return;
amount = Mathf.clamp(amount, 0, player.ttemCapacity());
int fa = amount;

View File

@@ -20,7 +20,7 @@ import mindustry.core.GameState.*;
import mindustry.ctype.ContentType;
import mindustry.ctype.UnlockableContent;
import mindustry.entities.*;
import mindustry.entities.type.*;
import mindustry.gen.*;
import mindustry.game.*;
import mindustry.game.EventType.*;
import mindustry.gen.*;
@@ -209,9 +209,9 @@ public class HudFragment extends Fragment{
if(e == null){
Vec2 world = Core.input.mouseWorld();
Units.nearby(world.x, world.y, 1f, 1f, unit -> {
if(!found[0] && unit instanceof BaseUnit){
if(!found[0] && unit instanceof Unitc){
if(Core.input.keyTap(KeyCode.MOUSE_LEFT)){
Call.removeUnitEditor(player, (BaseUnit)unit);
Call.removeUnitEditor(player, (Unitc)unit);
}
found[0] = true;
unit.hitbox(Tmp.r1);
@@ -344,16 +344,16 @@ public class HudFragment extends Fragment{
}
@Remote(targets = Loc.both, forward = true, called = Loc.both)
public static void setPlayerTeamEditor(Player player, Team team){
public static void setPlayerTeamEditor(Playerc player, Team team){
if(state.isEditor() && player != null){
player.team(team);
}
}
@Remote(targets = Loc.both, called = Loc.server)
public static void spawnUnitEditor(Player player, UnitType type){
public static void spawnUnitEditor(Playerc player, UnitType type){
if(state.isEditor()){
BaseUnit unit = type.create(player.team());
Unitc unit = type.create(player.team());
unit.set(player.x, player.y);
unit.rotation = player.rotation;
unit.add();
@@ -361,7 +361,7 @@ public class HudFragment extends Fragment{
}
@Remote(targets = Loc.both, called = Loc.server, forward = true)
public static void removeUnitEditor(Player player, BaseUnit unit){
public static void removeUnitEditor(Playerc player, Unitc unit){
if(state.isEditor() && unit != null){
unit.remove();
}

View File

@@ -41,7 +41,7 @@ public class PlayerListFragment extends Fragment{
});
cont.table(Tex.buttonTrans, pane -> {
pane.label(() -> Core.bundle.format(playerGroup.size() == 1 ? "players.single" : "players", playerGroup.size()));
pane.label(() -> Core.bundle.format(Groups.player.size() == 1 ? "players.single" : "players", Groups.player.size()));
pane.row();
pane.pane(content).grow().get().setScrollingDisabled(true, false);
pane.row();
@@ -65,8 +65,8 @@ public class PlayerListFragment extends Fragment{
float h = 74f;
playerGroup.all().sort(Structs.comparing(Unitc::team));
playerGroup.all().each(user -> {
Groups.player.all().sort(Structs.comparing(Unitc::team));
Groups.player.all().each(user -> {
NetConnection connection = user.con;
if(connection == null && net.server() && !user.isLocal) return;
@@ -129,7 +129,7 @@ public class PlayerListFragment extends Fragment{
t.addImageButton(Icon.zoom, Styles.clearPartiali, () -> Call.onAdminRequest(user, AdminAction.trace));
}).padRight(12).size(bs + 10f, bs);
}else if(!user.isLocal && !user.isAdmin && net.client() && playerGroup.size() >= 3 && player.team() == user.getTeam()){ //votekick
}else if(!user.isLocal && !user.isAdmin && net.client() && Groups.player.size() >= 3 && player.team() == user.getTeam()){ //votekick
button.add().growY();
button.addImageButton(Icon.hammer, Styles.clearPartiali,