mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Merge branch 'backport-rightclick' into 'master'
Implement right clicking to zoom in mobile backport (desktop use only). See merge request core-developers/forge!5752
This commit is contained in:
@@ -85,6 +85,7 @@ public class Forge implements ApplicationListener {
|
||||
public static String CJK_Font = "";
|
||||
public static int hoveredCount = 0;
|
||||
public static boolean afterDBloaded = false;
|
||||
public static int mouseButtonID = 0;
|
||||
|
||||
public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0, boolean value, boolean androidOrientation, int totalRAM, boolean isTablet, int AndroidAPI, String AndroidRelease, String deviceName) {
|
||||
if (GuiBase.getInterface() == null) {
|
||||
@@ -771,6 +772,7 @@ public class Forge implements ApplicationListener {
|
||||
}
|
||||
}
|
||||
}
|
||||
mouseButtonID = button;
|
||||
return super.touchDown(x, y, pointer, button);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.Input;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
import forge.card.CardRenderer.CardStackPosition;
|
||||
import forge.card.CardZoom;
|
||||
@@ -324,7 +326,15 @@ public abstract class VCardDisplayArea extends VDisplayArea implements ActivateH
|
||||
ThreadUtil.invokeInGameThread(new Runnable() { //must invoke in game thread in case a dialog needs to be shown
|
||||
@Override
|
||||
public void run() {
|
||||
if (!selectCard(false)) {
|
||||
if (GuiBase.getInterface().isRunningOnDesktop() && Forge.mouseButtonID == Input.Buttons.RIGHT) {
|
||||
FThreads.invokeInEdtLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showZoom();
|
||||
}
|
||||
});
|
||||
return;
|
||||
} else if (!selectCard(false)) {
|
||||
//if no cards in stack can be selected, just show zoom/details for card
|
||||
FThreads.invokeInEdtLater(new Runnable() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user