Selecting build plans moves them to front

This commit is contained in:
Anuken
2024-10-04 22:39:43 -04:00
parent aab27d1b56
commit cd3847a323
3 changed files with 13 additions and 0 deletions

View File

@@ -674,6 +674,15 @@ public class DesktopInput extends InputHandler{
tappedOne = false;
BuildPlan plan = getPlan(cursorX, cursorY);
if(plan != null){
//move selected to front
int index = player.unit().plans.indexOf(plan, true);
if(index != -1){
player.unit().plans.removeIndex(index);
player.unit().plans.addFirst(plan);
}
}
if(Core.input.keyDown(Binding.break_block)){
mode = none;
}else if(!selectPlans.isEmpty()){