Remove labels from minimap, keep on larger map

This commit is contained in:
Max O'Cull 2019-10-12 12:41:26 -04:00
parent 23b7176d5a
commit 243862804a
No known key found for this signature in database
GPG Key ID: 30EB58207505DB17
2 changed files with 7 additions and 3 deletions

View File

@ -72,7 +72,7 @@ public class MinimapRenderer implements Disposable{
region = new TextureRegion(texture);
}
public void drawEntities(float x, float y, float w, float h){
public void drawEntities(float x, float y, float w, float h, boolean withLabels){
updateUnitArray();
float sz = baseSize * zoom;
@ -87,7 +87,7 @@ public class MinimapRenderer implements Disposable{
float rx = (unit.x - rect.x) / rect.width * w, ry = (unit.y - rect.y) / rect.width * h;
Draw.color(unit.getTeam().color);
if (unit.getTypeID() == TypeIDs.player) {
if (withLabels && unit instanceof Player) {
Player pl = (Player) unit;
if (!pl.isLocal) {
// Only display names for other players.
@ -101,6 +101,10 @@ public class MinimapRenderer implements Disposable{
Draw.color();
}
public void drawEntities(float x, float y, float w, float h){
drawEntities(x, y, w, h, true);
}
public TextureRegion getRegion(){
if(texture == null) return null;

View File

@ -36,7 +36,7 @@ public class Minimap extends Table{
Draw.rect(renderer.minimap.getRegion(), x + width / 2f, y + height / 2f, width, height);
if(renderer.minimap.getTexture() != null){
renderer.minimap.drawEntities(x, y, width, height);
renderer.minimap.drawEntities(x, y, width, height, false);
}
}
}).size(140f);