Fixed commanded unit UI refresh
This commit is contained in:
@@ -48,6 +48,7 @@ public class PlacementFragment{
|
||||
Table blockTable, toggler, topTable, blockCatTable, commandTable;
|
||||
Stack mainStack;
|
||||
ScrollPane blockPane;
|
||||
Runnable rebuildCommand;
|
||||
boolean blockSelectEnd, wasCommandMode;
|
||||
int blockSelectSeq;
|
||||
long blockSelectSeqMillis;
|
||||
@@ -77,6 +78,12 @@ public class PlacementFragment{
|
||||
});
|
||||
});
|
||||
|
||||
Events.run(Trigger.unitCommandChange, () -> {
|
||||
if(rebuildCommand != null){
|
||||
rebuildCommand.run();
|
||||
}
|
||||
});
|
||||
|
||||
Events.on(UnlockEvent.class, event -> {
|
||||
if(event.content instanceof Block){
|
||||
rebuild();
|
||||
@@ -425,7 +432,7 @@ public class PlacementFragment{
|
||||
UnitCommand[] currentCommand = {null};
|
||||
var commands = new Seq<UnitCommand>();
|
||||
|
||||
Runnable rebuildCommand = () -> {
|
||||
rebuildCommand = () -> {
|
||||
u.clearChildren();
|
||||
var units = control.input.selectedUnits;
|
||||
if(units.size > 0){
|
||||
|
||||
Reference in New Issue
Block a user