From a975da543b105778ef1220c230f652d6dab51964 Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Sun, 11 Oct 2020 14:58:53 +0200 Subject: [PATCH 1/3] Add a connections bar to powernodes Bundle entry in next commit. --- core/src/mindustry/world/blocks/power/PowerNode.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/mindustry/world/blocks/power/PowerNode.java b/core/src/mindustry/world/blocks/power/PowerNode.java index 245c3d4f7e..8654d8d802 100644 --- a/core/src/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/mindustry/world/blocks/power/PowerNode.java @@ -112,6 +112,12 @@ public class PowerNode extends PowerBlock{ (UI.formatAmount((int)entity.power.graph.getLastPowerStored())), UI.formatAmount((int)entity.power.graph.getLastCapacity())), () -> Pal.powerBar, () -> Mathf.clamp(entity.power.graph.getLastPowerStored() / entity.power.graph.getLastCapacity()))); + + bars.add("connections", entity -> new Bar(() -> + Core.bundle.format("bar.powerlines", entity.power.links.size, maxNodes), + () -> Pal.ammo, + () -> (float)entity.power.links.size / (float)maxNodes + )); } @Override From 6d632fc53223d1c3dd0ac7868c2863f6f65b23d5 Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Sun, 11 Oct 2020 14:59:44 +0200 Subject: [PATCH 2/3] Update bundle.properties --- core/assets/bundles/bundle.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 6d1aafb54f..1c50a6a408 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -628,6 +628,7 @@ bar.powerbalance = Power: {0}/s bar.powerstored = Stored: {0}/{1} bar.poweramount = Power: {0} bar.poweroutput = Power Output: {0} +bar.powerlines = Connections: {0}/{1} bar.items = Items: {0} bar.capacity = Capacity: {0} bar.unitcap = {0} {1}/{2} From 62baf5cab2b815aedc0e2668b8fba868a1714462 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 11 Oct 2020 09:24:27 -0400 Subject: [PATCH 3/3] Update core/src/mindustry/world/blocks/power/PowerNode.java Co-authored-by: Patrick 'Quezler' Mounier --- core/src/mindustry/world/blocks/power/PowerNode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/world/blocks/power/PowerNode.java b/core/src/mindustry/world/blocks/power/PowerNode.java index 8654d8d802..5d033c99b7 100644 --- a/core/src/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/mindustry/world/blocks/power/PowerNode.java @@ -115,7 +115,7 @@ public class PowerNode extends PowerBlock{ bars.add("connections", entity -> new Bar(() -> Core.bundle.format("bar.powerlines", entity.power.links.size, maxNodes), - () -> Pal.ammo, + () -> Pal.items, () -> (float)entity.power.links.size / (float)maxNodes )); }