mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38: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
|
@Override
|
||||||
public void showPromptMessage(final PlayerView player, final String message, final CardView card) {
|
public void showPromptMessage(final PlayerView player, final String message, final CardView card) {
|
||||||
view.getPrompt(player).setMessage(message);
|
view.getPrompt(player).setMessage(message, card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import forge.assets.FSkinColor;
|
|||||||
import forge.assets.FSkinFont;
|
import forge.assets.FSkinFont;
|
||||||
import forge.assets.FSkinColor.Colors;
|
import forge.assets.FSkinColor.Colors;
|
||||||
import forge.assets.TextRenderer;
|
import forge.assets.TextRenderer;
|
||||||
|
import forge.card.CardZoom;
|
||||||
|
import forge.game.card.CardView;
|
||||||
import forge.menu.FMagnifyView;
|
import forge.menu.FMagnifyView;
|
||||||
import forge.toolbox.FButton;
|
import forge.toolbox.FButton;
|
||||||
import forge.toolbox.FButton.Corner;
|
import forge.toolbox.FButton.Corner;
|
||||||
@@ -29,6 +31,11 @@ public class VPrompt extends FContainer {
|
|||||||
private final FButton btnOk, btnCancel;
|
private final FButton btnOk, btnCancel;
|
||||||
private final MessageLabel lblMessage;
|
private final MessageLabel lblMessage;
|
||||||
private String message;
|
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) {
|
public VPrompt(String okText, String cancelText, FEventHandler okCommand, FEventHandler cancelCommand) {
|
||||||
lblMessage = add(new MessageLabel());
|
lblMessage = add(new MessageLabel());
|
||||||
@@ -57,6 +64,11 @@ public class VPrompt extends FContainer {
|
|||||||
}
|
}
|
||||||
public void setMessage(String message0) {
|
public void setMessage(String message0) {
|
||||||
message = 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. */
|
/** Flashes animation on input panel if play is currently waiting on input. */
|
||||||
@@ -90,6 +102,22 @@ public class VPrompt extends FContainer {
|
|||||||
return true;
|
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
|
@Override
|
||||||
public void draw(Graphics g) {
|
public void draw(Graphics g) {
|
||||||
if (!StringUtils.isEmpty(message)) {
|
if (!StringUtils.isEmpty(message)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user