mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Show card when swiping or long-pressing in mobile prompt message area
This commit is contained in:
@@ -158,7 +158,7 @@ public class MatchController extends AbstractGuiGame {
|
||||
|
||||
@Override
|
||||
public void showPromptMessage(final PlayerView player, final String message, final CardView card) {
|
||||
view.getPrompt(player).setMessage(message);
|
||||
view.getPrompt(player).setMessage(message, card);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,8 @@ import forge.assets.FSkinColor;
|
||||
import forge.assets.FSkinFont;
|
||||
import forge.assets.FSkinColor.Colors;
|
||||
import forge.assets.TextRenderer;
|
||||
import forge.card.CardZoom;
|
||||
import forge.game.card.CardView;
|
||||
import forge.menu.FMagnifyView;
|
||||
import forge.toolbox.FButton;
|
||||
import forge.toolbox.FButton.Corner;
|
||||
@@ -29,6 +31,11 @@ public class VPrompt extends FContainer {
|
||||
private final FButton btnOk, btnCancel;
|
||||
private final MessageLabel lblMessage;
|
||||
private String message;
|
||||
private CardView card = null ;
|
||||
|
||||
public void setCardView(final CardView card) {
|
||||
this.card = card ;
|
||||
}
|
||||
|
||||
public VPrompt(String okText, String cancelText, FEventHandler okCommand, FEventHandler cancelCommand) {
|
||||
lblMessage = add(new MessageLabel());
|
||||
@@ -57,6 +64,11 @@ public class VPrompt extends FContainer {
|
||||
}
|
||||
public void setMessage(String message0) {
|
||||
message = message0;
|
||||
card = null ;
|
||||
}
|
||||
public void setMessage(String message0, CardView card0) {
|
||||
message = message0;
|
||||
card = card0;
|
||||
}
|
||||
|
||||
/** Flashes animation on input panel if play is currently waiting on input. */
|
||||
@@ -90,6 +102,22 @@ public class VPrompt extends FContainer {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean fling(float x, float y) {
|
||||
if ( card != null ) {
|
||||
CardZoom.show(card);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean longPress(float x, float y) {
|
||||
if ( card != null ) {
|
||||
CardZoom.show(card);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Graphics g) {
|
||||
if (!StringUtils.isEmpty(message)) {
|
||||
|
||||
Reference in New Issue
Block a user