Fixed empty category

This commit is contained in:
Anuken
2022-01-24 12:42:27 -05:00
parent a70b28ea12
commit 39f59b8040
3 changed files with 12 additions and 1 deletions

View File

@@ -87,7 +87,7 @@ public class PlacementFragment extends Fragment{
}
void rebuild(){
currentCategory = Category.turret;
currentCategory = Category.distribution;
Group group = toggler.parent;
int index = toggler.getZIndex();
toggler.remove();
@@ -400,6 +400,8 @@ public class PlacementFragment extends Fragment{
Seq<Block> blocks = getUnlockedByCategory(cat);
categoryEmpty[cat.ordinal()] = blocks.isEmpty();
}
boolean needsAssign = categoryEmpty[currentCategory.ordinal()];
int f = 0;
for(Category cat : getCategories()){
@@ -409,6 +411,11 @@ public class PlacementFragment extends Fragment{
categories.image(Styles.black6);
continue;
}
if(needsAssign){
currentCategory = cat;
needsAssign = false;
}
categories.button(ui.getIcon(cat.name()), Styles.clearToggleTransi, () -> {
currentCategory = cat;