Checking unlocked status of blocks from getByCategory() is no longer necessary

This commit is contained in:
joshuaptfan 2019-11-03 00:04:15 -07:00
parent 258670e0b5
commit abd76fe89f

View File

@ -125,7 +125,7 @@ public class PlacementFragment extends Fragment{
case 13: //down
j = (j < blocks.size - 4 ? j + 4 : j % 4);
}
input.block = (unlocked(blocks.get(j))) ? blocks.get(j) : null;
input.block = blocks.get(j);
selectedBlocks.put(currentCategory, input.block);
break;
}
@ -147,7 +147,7 @@ public class PlacementFragment extends Fragment{
blockSelectEnd = true;
}
Array<Block> blocks = getByCategory(currentCategory);
input.block = (i < blocks.size && unlocked(blocks.get(i))) ? blocks.get(i) : null;
input.block = (i < blocks.size) ? blocks.get(i) : null;
selectedBlocks.put(currentCategory, input.block);
blockSelectSeqMillis = Time.millis();
}
@ -197,11 +197,6 @@ public class PlacementFragment extends Fragment{
blockTable.row();
}
if(!unlocked(block)){
blockTable.add().size(46);
continue;
}
ImageButton button = blockTable.addImageButton(Icon.lockedSmall, Styles.selecti, () -> {
if(unlocked(block)){
control.input.block = control.input.block == block ? null : block;
@ -353,7 +348,7 @@ public class PlacementFragment extends Fragment{
//update category empty values
for(Category cat : Category.all){
Array<Block> blocks = getByCategory(cat);
categoryEmpty[cat.ordinal()] = blocks.isEmpty() || !unlocked(blocks.first());
categoryEmpty[cat.ordinal()] = blocks.isEmpty();
}
int f = 0;