Fix for broken variants with new android multiplayer code

This commit is contained in:
austinio7116
2018-03-19 12:52:49 +00:00
committed by maustin
parent 35245d5268
commit 94e255b198
2 changed files with 6 additions and 3 deletions

View File

@@ -815,6 +815,10 @@ public class FDeckChooser extends FScreen {
/*if(selectedDeckType.equals(DeckType.STANDARD_CARDGEN_DECK)){ /*if(selectedDeckType.equals(DeckType.STANDARD_CARDGEN_DECK)){
return DeckgenUtil.buildCardGenDeck(lstDecks.getSelectedItem().getName()); return DeckgenUtil.buildCardGenDeck(lstDecks.getSelectedItem().getName());
}*/ }*/
//ensure a deck is selected first
if(lstDecks.getSelectedIndex() == -1){
lstDecks.setSelectedIndex(0);
}
DeckProxy proxy = lstDecks.getSelectedItem(); DeckProxy proxy = lstDecks.getSelectedItem();
if (proxy == null) { return null; } if (proxy == null) { return null; }
return proxy.getDeck(); return proxy.getDeck();

View File

@@ -223,7 +223,7 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
} }
void updateLayoutForVariants() { void updateLayoutForVariants() {
for (int i = 0; i < MAX_PLAYERS; i++) { for (int i = 0; i < cbPlayerCount.getSelectedItem(); i++) {
playerPanels.get(i).updateVariantControlsVisibility(); playerPanels.get(i).updateVariantControlsVisibility();
} }
playersScroll.revalidate(); playersScroll.revalidate();
@@ -461,12 +461,11 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
@Override @Override
public void update(final boolean fullUpdate) { public void update(final boolean fullUpdate) {
int playerCount = lobby.getNumberOfSlots(); int playerCount = lobby.getNumberOfSlots();
//cbPlayerCount.setSelectedItem(playerCount);
updateVariantSelection(); updateVariantSelection();
final boolean allowNetworking = lobby.isAllowNetworking(); final boolean allowNetworking = lobby.isAllowNetworking();
for (int i = 0; i < MAX_PLAYERS; i++) { for (int i = 0; i < cbPlayerCount.getSelectedItem(); i++) {
final boolean hasPanel = i < playerPanels.size(); final boolean hasPanel = i < playerPanels.size();
if (i < playerCount) { if (i < playerCount) {
// visible panels // visible panels