diff --git a/core/assets-raw/sprites/teams/team-crux.png b/core/assets-raw/sprites/teams/team-crux.png new file mode 100644 index 0000000000..4fb6783a5b Binary files /dev/null and b/core/assets-raw/sprites/teams/team-crux.png differ diff --git a/core/assets-raw/sprites/teams/team-derelict.png b/core/assets-raw/sprites/teams/team-derelict.png new file mode 100644 index 0000000000..38ac90dcb1 Binary files /dev/null and b/core/assets-raw/sprites/teams/team-derelict.png differ diff --git a/core/assets-raw/sprites/teams/team-sharded.png b/core/assets-raw/sprites/teams/team-sharded.png new file mode 100644 index 0000000000..a3643d4bba Binary files /dev/null and b/core/assets-raw/sprites/teams/team-sharded.png differ diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 91efc5028d..0c01f876a8 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1405,7 +1405,7 @@ liquid.slag.description = Refined in separators into constituent metals, or spra liquid.oil.description = Used in advanced material production and as incendiary ammunition. liquid.cryofluid.description = Used as coolant in reactors, turrets and factories. -block.derelict = [lightgray] Derelict +block.derelict =  [lightgray]Derelict block.armored-conveyor.description = Moves items forward. Does not accept inputs from the sides. block.illuminator.description = Emits light. block.message.description = Stores a message for communication between allies. diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index 51373139a6..fd80526784 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -353,3 +353,6 @@ 63353=silicon-arc-furnace|block-silicon-arc-furnace-ui 63352=metal-floor-4|block-metal-floor-4-ui 63351=invincible|status-invincible-ui +63356=sharded|team-sharded +63357=crux|team-crux +63358=derelict|team-derelict diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index d5bedacc3e..fb40d72eb1 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -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(){ diff --git a/core/src/mindustry/game/Team.java b/core/src/mindustry/game/Team.java index c7c70cda01..e331ce1255 100644 --- a/core/src/mindustry/game/Team.java +++ b/core/src/mindustry/game/Team.java @@ -17,6 +17,7 @@ public class Team implements Comparable{ public final int id; public final Color color; public final Color[] palette; + public String emoji = ""; public boolean hasPalette; public String name; diff --git a/core/src/mindustry/ui/Fonts.java b/core/src/mindustry/ui/Fonts.java index 7beff27396..bbd55bbd95 100644 --- a/core/src/mindustry/ui/Fonts.java +++ b/core/src/mindustry/ui/Fonts.java @@ -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.*/ diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index c78e7dbb5f..dd2867172a 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -390,6 +390,19 @@ public class Generators{ } }); + generate("team-icons", () -> { + for(Team team : Team.all){ + if(has("team-" + team.name)){ + int rgba = team == Team.derelict ? Color.valueOf("b7b8c9").rgba() : team.color.rgba(); + Pixmap base = get("team-" + team.name); + base.each((x, y) -> base.setRaw(x, y, Color.muli(base.getRaw(x, y), rgba))); + + delete("team-" + team.name); + save(base.outline(Pal.gray, 3), "../ui/team-" + team.name); + } + } + }); + generate("unit-icons", () -> content.units().each(type -> { if(type.isHidden()) return; //hidden units don't generate diff --git a/tools/src/mindustry/tools/ImagePacker.java b/tools/src/mindustry/tools/ImagePacker.java index 0df257f52f..68a06a2f66 100644 --- a/tools/src/mindustry/tools/ImagePacker.java +++ b/tools/src/mindustry/tools/ImagePacker.java @@ -236,6 +236,10 @@ public class ImagePacker{ base.draw(image, 0, 0, image.width, image.height, base.width/2 - wx/2, base.height/2 - wy/2, wx, wy, true, true); } + static void delete(String name){ + ((GenRegion)Core.atlas.find(name)).path.delete(); + } + static void replace(String name, Pixmap image){ Fi.get(name + ".png").writePng(image); ((GenRegion)Core.atlas.find(name)).path.delete();