WIP team icons

This commit is contained in:
Anuken
2021-07-31 18:23:22 -04:00
parent 78c35221be
commit 79bf77f4be
10 changed files with 32 additions and 3 deletions

View File

@@ -1072,9 +1072,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
}
public String getDisplayName(){
//derelict team icon currently doesn't display
return team == Team.derelict ?
block.localizedName + "\n" + Core.bundle.get("block.derelict"):
block.localizedName;
block.localizedName + "\n" + Core.bundle.get("block.derelict") :
block.localizedName + (team == player.team() || team.emoji.isEmpty() ? "" : " " + team.emoji);
}
public TextureRegion getDisplayIcon(){

View File

@@ -17,6 +17,7 @@ public class Team implements Comparable<Team>{
public final int id;
public final Color color;
public final Color[] palette;
public String emoji = "";
public boolean hasPalette;
public String name;

View File

@@ -21,6 +21,7 @@ import arc.util.*;
import mindustry.*;
import mindustry.core.*;
import mindustry.ctype.*;
import mindustry.game.*;
import mindustry.gen.*;
import java.util.*;
@@ -155,6 +156,12 @@ public class Fonts{
}
}
});
for(Team team : Team.baseTeams){
if(Core.atlas.has("team-" + team.name)){
team.emoji = stringIcons.get(team.name, "");
}
}
}
/** Called from a static context for use in the loading screen.*/