mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-09 04:09:07 +07:00
Unit factory command UI cleanup
This commit is contained in:
parent
d9d5c8733b
commit
d6073201bb
@ -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<ImageButton>();
|
||||
group.setMinCheckCount(0);
|
||||
int i = 0, columns = Mathf.clamp(units.size, 2, selectionColumns);
|
||||
|
Loading…
Reference in New Issue
Block a user