mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-04 23:38:10 +07:00
Remove labels from minimap, keep on larger map
This commit is contained in:
@ -72,7 +72,7 @@ public class MinimapRenderer implements Disposable{
|
|||||||
region = new TextureRegion(texture);
|
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();
|
updateUnitArray();
|
||||||
|
|
||||||
float sz = baseSize * zoom;
|
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;
|
float rx = (unit.x - rect.x) / rect.width * w, ry = (unit.y - rect.y) / rect.width * h;
|
||||||
Draw.color(unit.getTeam().color);
|
Draw.color(unit.getTeam().color);
|
||||||
|
|
||||||
if (unit.getTypeID() == TypeIDs.player) {
|
if (withLabels && unit instanceof Player) {
|
||||||
Player pl = (Player) unit;
|
Player pl = (Player) unit;
|
||||||
if (!pl.isLocal) {
|
if (!pl.isLocal) {
|
||||||
// Only display names for other players.
|
// Only display names for other players.
|
||||||
@ -101,6 +101,10 @@ public class MinimapRenderer implements Disposable{
|
|||||||
Draw.color();
|
Draw.color();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void drawEntities(float x, float y, float w, float h){
|
||||||
|
drawEntities(x, y, w, h, true);
|
||||||
|
}
|
||||||
|
|
||||||
public TextureRegion getRegion(){
|
public TextureRegion getRegion(){
|
||||||
if(texture == null) return null;
|
if(texture == null) return null;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public class Minimap extends Table{
|
|||||||
Draw.rect(renderer.minimap.getRegion(), x + width / 2f, y + height / 2f, width, height);
|
Draw.rect(renderer.minimap.getRegion(), x + width / 2f, y + height / 2f, width, height);
|
||||||
|
|
||||||
if(renderer.minimap.getTexture() != null){
|
if(renderer.minimap.getTexture() != null){
|
||||||
renderer.minimap.drawEntities(x, y, width, height);
|
renderer.minimap.drawEntities(x, y, width, height, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).size(140f);
|
}).size(140f);
|
||||||
|
Reference in New Issue
Block a user