mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Fix so isAi properly set for the sake of random deck generation
This commit is contained in:
@@ -406,7 +406,7 @@ public class ConstructedScreen extends LaunchScreen {
|
|||||||
index = index0;
|
index = index0;
|
||||||
playerIsArchenemy = index == 0;
|
playerIsArchenemy = index == 0;
|
||||||
btnDeck.setEnabled(false); //disable deck button until done loading decks
|
btnDeck.setEnabled(false); //disable deck button until done loading decks
|
||||||
boolean isAi = isPlayerAI();
|
boolean isAi = index != 0;
|
||||||
deckChooser = new FDeckChooser(GameType.Constructed, isAi, new FEventHandler() {
|
deckChooser = new FDeckChooser(GameType.Constructed, isAi, new FEventHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void handleEvent(FEvent e) {
|
public void handleEvent(FEvent e) {
|
||||||
@@ -450,7 +450,7 @@ public class ConstructedScreen extends LaunchScreen {
|
|||||||
nameRandomiser = createNameRandomizer();
|
nameRandomiser = createNameRandomizer();
|
||||||
add(nameRandomiser);
|
add(nameRandomiser);
|
||||||
|
|
||||||
humanAiSwitch.setToggled(index != 0);
|
humanAiSwitch.setToggled(isAi);
|
||||||
humanAiSwitch.setChangedHandler(humanAiSwitched);
|
humanAiSwitch.setChangedHandler(humanAiSwitched);
|
||||||
add(humanAiSwitch);
|
add(humanAiSwitch);
|
||||||
|
|
||||||
@@ -598,7 +598,12 @@ public class ConstructedScreen extends LaunchScreen {
|
|||||||
private final FEventHandler humanAiSwitched = new FEventHandler() {
|
private final FEventHandler humanAiSwitched = new FEventHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void handleEvent(FEvent e) {
|
public void handleEvent(FEvent e) {
|
||||||
lstVanguardAvatars.setIsAi(isPlayerAI());
|
boolean isAi = isPlayerAI();
|
||||||
|
deckChooser.setIsAi(isAi);
|
||||||
|
lstCommanderDecks.setIsAi(isAi);
|
||||||
|
lstPlanarDecks.setIsAi(isAi);
|
||||||
|
lstSchemeDecks.setIsAi(isAi);
|
||||||
|
lstVanguardAvatars.setIsAi(isAi);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user