Multithreading cleanup

This commit is contained in:
Anuken
2018-10-10 23:43:48 -04:00
parent 67db5e9dfc
commit 52bd079c0a
18 changed files with 50 additions and 359 deletions

View File

@@ -17,12 +17,14 @@ import io.anuke.ucore.scene.ui.Image;
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.Timer;
import static io.anuke.mindustry.Vars.*;
public class PlayerListFragment extends Fragment{
private boolean visible = false;
private Table content = new Table().marginRight(13f).marginLeft(13f);
private Timer timer = new Timer();
@Override
public void build(Group parent){
@@ -34,7 +36,7 @@ public class PlayerListFragment extends Fragment{
return;
}
if(visible && Timers.get("player-list-rebuild", 20)){
if(visible && timer.get(20)){
rebuild();
}
});
@@ -42,8 +44,7 @@ public class PlayerListFragment extends Fragment{
cont.table("pane", pane -> {
pane.label(() -> Bundles.format(playerGroup.size() == 1 ? "text.players.single" : "text.players", playerGroup.size()));
pane.row();
pane.pane("clear", content)
.grow().get().setScrollingDisabled(true, false);
pane.pane("clear", content).grow().get().setScrollingDisabled(true, false);
pane.row();
pane.table("pane", menu -> {