From d6073201bb981b0d5e2ff4e160033952e6b832fc Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 11 Oct 2024 21:54:41 -0400 Subject: [PATCH] Unit factory command UI cleanup --- core/src/mindustry/world/blocks/units/UnitFactory.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/world/blocks/units/UnitFactory.java b/core/src/mindustry/world/blocks/units/UnitFactory.java index c6369a0bfe..4120ac278d 100644 --- a/core/src/mindustry/world/blocks/units/UnitFactory.java +++ b/core/src/mindustry/world/blocks/units/UnitFactory.java @@ -197,7 +197,9 @@ public class UnitFactory extends UnitBlock{ public boolean canSetCommand(){ var output = unit(); - return output != null && output.commands.length > 1 && output.allowChangeCommands; + return output != null && output.commands.length > 1 && output.allowChangeCommands && + //to avoid cluttering UI, don't show command selection for "standard" units that only have two commands. + !(output.commands.length == 2 && output.commands[1] == UnitCommand.enterPayloadCommand); } @Override @@ -247,12 +249,13 @@ public class UnitFactory extends UnitBlock{ Table commands = new Table(); commands.top().left(); - commands.background(Styles.black6); Runnable rebuildCommands = () -> { commands.clear(); + commands.background(null); var unit = unit(); if(unit != null && canSetCommand()){ + commands.background(Styles.black6); var group = new ButtonGroup(); group.setMinCheckCount(0); int i = 0, columns = Mathf.clamp(units.size, 2, selectionColumns);