mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Merge branch 'newBranch' into 'master'
[Mobile] Prevent Conceding while on Mulligan Closes #1376 See merge request core-developers/forge!3287
This commit is contained in:
@@ -116,6 +116,14 @@ public class GameView extends TrackableObject {
|
|||||||
public boolean isMatchOver() {
|
public boolean isMatchOver() {
|
||||||
return get(TrackableProperty.MatchOver);
|
return get(TrackableProperty.MatchOver);
|
||||||
}
|
}
|
||||||
|
public boolean isMulligan() {
|
||||||
|
if (get(TrackableProperty.Mulligan) == null)
|
||||||
|
return false;
|
||||||
|
return get(TrackableProperty.Mulligan);
|
||||||
|
}
|
||||||
|
public void updateIsMulligan(boolean value) {
|
||||||
|
set(TrackableProperty.Mulligan, value);
|
||||||
|
}
|
||||||
public String getWinningPlayerName() {
|
public String getWinningPlayerName() {
|
||||||
return get(TrackableProperty.WinningPlayerName);
|
return get(TrackableProperty.WinningPlayerName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,6 +206,7 @@ public enum TrackableProperty {
|
|||||||
WinningPlayerName(TrackableTypes.StringType),
|
WinningPlayerName(TrackableTypes.StringType),
|
||||||
WinningTeam(TrackableTypes.IntegerType),
|
WinningTeam(TrackableTypes.IntegerType),
|
||||||
MatchOver(TrackableTypes.BooleanType),
|
MatchOver(TrackableTypes.BooleanType),
|
||||||
|
Mulligan(TrackableTypes.BooleanType),
|
||||||
NumGamesInMatch(TrackableTypes.IntegerType),
|
NumGamesInMatch(TrackableTypes.IntegerType),
|
||||||
NumPlayedGamesInMatch(TrackableTypes.IntegerType),
|
NumPlayedGamesInMatch(TrackableTypes.IntegerType),
|
||||||
Stack(TrackableTypes.StackItemViewListType),
|
Stack(TrackableTypes.StackItemViewListType),
|
||||||
|
|||||||
@@ -358,10 +358,10 @@ public class MatchScreen extends FScreen {
|
|||||||
if(gameMenu!=null) {
|
if(gameMenu!=null) {
|
||||||
if(gameMenu.getChildCount()>3){
|
if(gameMenu.getChildCount()>3){
|
||||||
if(viewWinLose == null) {
|
if(viewWinLose == null) {
|
||||||
gameMenu.getChildAt(0).setEnabled(true);
|
gameMenu.getChildAt(0).setEnabled(!game.isMulligan());
|
||||||
gameMenu.getChildAt(1).setEnabled(true);
|
gameMenu.getChildAt(1).setEnabled(!game.isMulligan());
|
||||||
gameMenu.getChildAt(2).setEnabled(true);
|
gameMenu.getChildAt(2).setEnabled(!game.isMulligan());
|
||||||
gameMenu.getChildAt(3).setEnabled(true);
|
gameMenu.getChildAt(3).setEnabled(!game.isMulligan());
|
||||||
gameMenu.getChildAt(4).setEnabled(false);
|
gameMenu.getChildAt(4).setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
gameMenu.getChildAt(0).setEnabled(false);
|
gameMenu.getChildAt(0).setEnabled(false);
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public class InputLondonMulligan extends InputSyncronizedBase {
|
|||||||
public final void showMessage() {
|
public final void showMessage() {
|
||||||
final Localizer localizer = Localizer.getInstance();
|
final Localizer localizer = Localizer.getInstance();
|
||||||
final Game game = player.getGame();
|
final Game game = player.getGame();
|
||||||
|
game.getView().updateIsMulligan(true);
|
||||||
int cardsLeft = toReturn - selected.size();
|
int cardsLeft = toReturn - selected.size();
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
@@ -79,6 +80,7 @@ public class InputLondonMulligan extends InputSyncronizedBase {
|
|||||||
|
|
||||||
private void done() {
|
private void done() {
|
||||||
resetCardHighlights();
|
resetCardHighlights();
|
||||||
|
getController().getGame().getView().updateIsMulligan(false);
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user