mirror of
https://github.com/yawaflua/Informatis.git
synced 2026-02-04 10:24:21 +02:00
player track
This commit is contained in:
@@ -14,6 +14,7 @@ import arc.struct.*;
|
|||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.Pal;
|
import mindustry.graphics.Pal;
|
||||||
|
import mindustry.input.DesktopInput;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
@@ -22,6 +23,7 @@ import static mindustry.Vars.*;
|
|||||||
public class PlayerDisplay extends WindowTable implements Updatable {
|
public class PlayerDisplay extends WindowTable implements Updatable {
|
||||||
Vec2 scrollPos = new Vec2(0, 0);
|
Vec2 scrollPos = new Vec2(0, 0);
|
||||||
TextField search;
|
TextField search;
|
||||||
|
@Nullable Player target;
|
||||||
float heat;
|
float heat;
|
||||||
|
|
||||||
public PlayerDisplay() {
|
public PlayerDisplay() {
|
||||||
@@ -54,6 +56,11 @@ public class PlayerDisplay extends WindowTable implements Updatable {
|
|||||||
ScrollPane pane = find("player-pane");
|
ScrollPane pane = find("player-pane");
|
||||||
pane.setWidget(rebuild());
|
pane.setWidget(rebuild());
|
||||||
}
|
}
|
||||||
|
if(target!=null) {
|
||||||
|
if(control.input instanceof DesktopInput)
|
||||||
|
((DesktopInput) control.input).panning = true;
|
||||||
|
Core.camera.position.set(target.x, target.y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Table rebuild(){
|
public Table rebuild(){
|
||||||
@@ -97,10 +104,14 @@ public class PlayerDisplay extends WindowTable implements Updatable {
|
|||||||
};
|
};
|
||||||
table1.margin(8);
|
table1.margin(8);
|
||||||
table1.add(new Image(user.icon()).setScaling(Scaling.bounded)).grow();
|
table1.add(new Image(user.icon()).setScaling(Scaling.bounded)).grow();
|
||||||
|
table1.clicked(() -> {
|
||||||
|
if(target==user) target = null;
|
||||||
|
else target = user;
|
||||||
|
});
|
||||||
|
|
||||||
userTable.add(table1).size(h).name(user.name()); //unit icon
|
userTable.add(table1).size(h).name(user.name()); //unit icon
|
||||||
userTable.labelWrap(user.name()).color(user.color()).width(170f).pad(10); //name
|
userTable.labelWrap(user.name()).color(user.color()).width(170f).pad(10); //name
|
||||||
userTable.image(Icon.admin).padRight(5).visible(()->user.admin);; //admin
|
userTable.image(Icon.admin).padRight(5).visible(()->user.admin); //admin
|
||||||
userTable.button(Icon.hammer, ustyle, () -> { //vote kick
|
userTable.button(Icon.hammer, ustyle, () -> { //vote kick
|
||||||
ui.showConfirm("@confirm", Core.bundle.format("confirmvotekick", user.name()), () -> {
|
ui.showConfirm("@confirm", Core.bundle.format("confirmvotekick", user.name()), () -> {
|
||||||
Call.sendChatMessage("/votekick " + user.name());
|
Call.sendChatMessage("/votekick " + user.name());
|
||||||
|
|||||||
Reference in New Issue
Block a user