From 79bf77f4becd473b7f9f187e7caba5dbaa1404f9 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 31 Jul 2021 18:23:22 -0400 Subject: [PATCH] WIP team icons --- core/assets-raw/sprites/teams/team-crux.png | Bin 0 -> 479 bytes core/assets-raw/sprites/teams/team-derelict.png | Bin 0 -> 608 bytes core/assets-raw/sprites/teams/team-sharded.png | Bin 0 -> 404 bytes core/assets/bundles/bundle.properties | 2 +- core/assets/icons/icons.properties | 3 +++ .../src/mindustry/entities/comp/BuildingComp.java | 5 +++-- core/src/mindustry/game/Team.java | 1 + core/src/mindustry/ui/Fonts.java | 7 +++++++ tools/src/mindustry/tools/Generators.java | 13 +++++++++++++ tools/src/mindustry/tools/ImagePacker.java | 4 ++++ 10 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 core/assets-raw/sprites/teams/team-crux.png create mode 100644 core/assets-raw/sprites/teams/team-derelict.png create mode 100644 core/assets-raw/sprites/teams/team-sharded.png 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 0000000000000000000000000000000000000000..4fb6783a5b49b3fdced9de4860670f644459bb28 GIT binary patch literal 479 zcmeAS@N?(olHy`uVBq!ia0y~yV6X#W4mJh`hT?-OTo@P_7>k44ofy`glX=O&z&O*> z#W5tK@$Kw`lMWkjI8Xiizy4j^sinrbJkwfscfVu1r?Qc?wDDrbk}Ho_uKN@2ekuIH z>s@b3ZwT+JK9yIIy=iy&ZO(k}Ex&AcKhX8uGdOMls$pt(;cH_g9ge>k;Ez4Ppe&&hUsCMkWnQ$PV{l%*dWe>NDm2aDRK(3}T z(Y#~@SA0|nSIG*d`EdnOB^uoS7i&E!IlFq^Rm~6A&gx#_yGzkHFxfWEr@bE z%x(ETYyaJ={>|wQ%-zRtYJSkkP$=vxKWx0PaY^ILrgUd!*5}XK!X21hPrqskcVw21 zi{)M4!e%yGM0AgoR763Zj>WV7ww_tj=CyI(W93!ZvrFn8C$9=fT3Sk=cb<`g?1hE` zro%>tntm0b`S`}6Cu}Qs87$Gb@X<{6yX>uB4R;w7-434fyJhyVZp literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..38ac90dcb1ad7df85191e10d4c509c68634ec97e GIT binary patch literal 608 zcmeAS@N?(olHy`uVBq!ia0y~yV6X#W4mJh`hT?-OTo@P_7>k44ofy`glX=O&z$E4A z;uw)8o)g?97uM?D2#RR(=`=GlTXgZ>iW9XVDymhT z{}hU3R>pX>^t)LG|LI>UY-BtCSDIh-S7E!!m-{A!L>xPD_{dU~bRpj*0{>j*C|l3Y zP+C~PSr}6DZQZ%Nyh|6IT6=%F=T_(ie^FlW_=K{wW_#iWu8YqtPPl2Ey7+rjkjX6f zu6I)PT=#zKdT&YB5q)^?*J%;kM@g^Fn@-@Wc_q#2QgdT>aoR-}$3yAjz9}W?6Cb!# zzI_$!`}N|(rQfZ)HV9syv}fCMyZD8*7aksCFtu2_b(x@U?E}p|j*VNU-Iz2ZGt40A ztP;P;Rp#nlx+R=D^YVgD&s3b1{oL%)#Cw%f+`HCooTT=sEY8zN{Ix-8?yE_@UX%9({n7aT_H-mSyRE|1yC&t+_CE7vpW$IY z*YMMYiKU?*_0&>LKd$-{)0{8*zUpYUQh>_6r?Vu~0u}6@$n&Zxd42TQJD=l^c8B>A zC7t!_qxF0rOS)$N{=ap)*__BNW_%Z&c3Wk6<-Oe_6!kziO1S*jIsmV&bz1P+a7$u}S8sCHL97nCQ~0Lfw72O8T5Js&;4kvrnXT zm)jm#V6GDRXsh9kB;~66qM4S0c}uS!ap4wGvU!lGKHar?@vP&=j@cj7KbUtU^6mBy SR~Q%=7(8A5T-G@yGywo5Di!qr literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..a3643d4bba12a305b8a598ff702df49f65d5a6d9 GIT binary patch literal 404 zcmeAS@N?(olHy`uVBq!ia0y~yV6X#W4mJh`hT?-OTo@P_7>k44ofy`glX=O&!06}c z;uw7oEM_ zw)*|u-S@A?Ezf?hC-XEsgSE2j$2^a%HM@SybXZ!mYDfA9t)C_zPc#}o2|nV^c9%`@ zbbI&xiDolCEqr8riOt*2$HwVa!in|{cQ5IipDsU=yd;IyZ@O!`nA?bL?F4zPb21Zj-|NNb&bjk;Q_VGxY3F}KhX4Qo literal 0 HcmV?d00001 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();