Proper player icons
This commit is contained in:
@@ -64,7 +64,6 @@ public class UI implements ApplicationListener, Loadable{
|
||||
public ContentInfoDialog content;
|
||||
public PlanetDialog planet;
|
||||
public TechTreeDialog tech;
|
||||
//public MinimapDialog minimap;
|
||||
public SchematicsDialog schematics;
|
||||
public ModsDialog mods;
|
||||
public ColorPicker picker;
|
||||
|
||||
@@ -9,6 +9,7 @@ import arc.util.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import arc.util.pooling.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.game.*;
|
||||
@@ -20,6 +21,7 @@ import mindustry.net.*;
|
||||
import mindustry.net.Packets.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.storage.*;
|
||||
import mindustry.world.blocks.storage.CoreBlock.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
@@ -58,6 +60,12 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
|
||||
return team.core();
|
||||
}
|
||||
|
||||
public TextureRegion icon(){
|
||||
if(dead()) return core() == null ? UnitTypes.alpha.icon(Cicon.full) : ((CoreBlock)core().block).unitType.icon(Cicon.full);
|
||||
|
||||
return unit.type().icon(Cicon.full);
|
||||
}
|
||||
|
||||
public void reset(){
|
||||
team = state.rules.defaultTeam;
|
||||
admin = typing = false;
|
||||
|
||||
@@ -99,7 +99,7 @@ public class PlayerListFragment extends Fragment{
|
||||
};
|
||||
table.margin(8);
|
||||
//TODO dead players should have no region
|
||||
table.add(new Image(user.unit().type().region).setScaling(Scaling.none)).grow();
|
||||
table.add(new Image(user.icon()).setScaling(Scaling.none)).grow();
|
||||
|
||||
button.add(table).size(h);
|
||||
button.labelWrap("[#" + user.color().toString().toUpperCase() + "]" + user.name()).width(170f).pad(10);
|
||||
|
||||
Reference in New Issue
Block a user