v2.0.0: max games in progress are now tied to hero class count
This commit is contained in:
@@ -36,7 +36,7 @@ import java.util.HashMap;
|
||||
|
||||
public class GamesInProgress {
|
||||
|
||||
public static final int MAX_SLOTS = 4;
|
||||
public static final int MAX_SLOTS = HeroClass.values().length;
|
||||
|
||||
//null means we have loaded info and it is empty, no entry means unknown.
|
||||
private static HashMap<Integer, Info> slotStates = new HashMap<>();
|
||||
|
||||
@@ -78,12 +78,16 @@ public class StartScene extends PixelScene {
|
||||
|
||||
ArrayList<GamesInProgress.Info> games = GamesInProgress.checkAll();
|
||||
|
||||
int slotGap = landscape() ? 5 : 10;
|
||||
int slotCount = Math.min(GamesInProgress.MAX_SLOTS, games.size()+1);
|
||||
int slotGap = 10 - slotCount;
|
||||
int slotsHeight = slotCount*SLOT_HEIGHT + (slotCount-1)* slotGap;
|
||||
|
||||
while (slotsHeight > (h-title.bottom()-2)){
|
||||
slotGap--;
|
||||
slotsHeight -= slotCount-1;
|
||||
}
|
||||
|
||||
float yPos = (h - slotsHeight)/2f;
|
||||
if (landscape()) yPos += 8;
|
||||
float yPos = (h - slotsHeight + title.bottom() + 2)/2f;
|
||||
|
||||
for (GamesInProgress.Info game : games) {
|
||||
SaveSlotButton existingGame = new SaveSlotButton();
|
||||
|
||||
Reference in New Issue
Block a user