mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Restore misunderstood functionality to desktop card viewer (#3985)
This commit is contained in:
@@ -62,6 +62,7 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
|||||||
private Point hoverScrollPos;
|
private Point hoverScrollPos;
|
||||||
private ItemInfo hoveredItem;
|
private ItemInfo hoveredItem;
|
||||||
private ItemInfo focalItem;
|
private ItemInfo focalItem;
|
||||||
|
private InventoryItem lastAltCard = null;
|
||||||
private boolean panelOptionsCreated = false;
|
private boolean panelOptionsCreated = false;
|
||||||
|
|
||||||
private final List<ItemInfo> orderedItems = new ArrayList<>();
|
private final List<ItemInfo> orderedItems = new ArrayList<>();
|
||||||
@@ -1109,9 +1110,19 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
|||||||
InventoryItem item = itemInfo.item;
|
InventoryItem item = itemInfo.item;
|
||||||
itemInfo.alt = false;
|
itemInfo.alt = false;
|
||||||
if (!FModel.getPreferences().getPref(FPref.UI_SWITCH_STATES_DECKVIEW).equals(ForgeConstants.SWITCH_CARDSTATES_DECK_NEVER)) {
|
if (!FModel.getPreferences().getPref(FPref.UI_SWITCH_STATES_DECKVIEW).equals(ForgeConstants.SWITCH_CARDSTATES_DECK_NEVER)) {
|
||||||
if (hoveredItem != null && hoveredItem.item.equals(item)) {
|
if ((hoveredItem == null || !hoveredItem.item.equals(item)) || (FModel.getPreferences().getPref(FPref.UI_SWITCH_STATES_DECKVIEW).equals(ForgeConstants.SWITCH_CARDSTATES_DECK_ALWAYS))) {
|
||||||
if (item instanceof PaperCard && ((PaperCard)item).hasBackFace())
|
if (item instanceof PaperCard) {
|
||||||
itemInfo.alt = true;
|
if (((PaperCard)item).hasBackFace()) {
|
||||||
|
if (item.equals(lastAltCard)) {
|
||||||
|
itemInfo.alt = true;
|
||||||
|
lastAltCard = null;
|
||||||
|
} else {
|
||||||
|
lastAltCard = item;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
lastAltCard = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -573,7 +573,7 @@ public enum CSubmenuPreferences implements ICDoc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initializeSwitchStatesCombobox() {
|
private void initializeSwitchStatesCombobox() {
|
||||||
final String[] elems = {ForgeConstants.SWITCH_CARDSTATES_DECK_NEVER, ForgeConstants.SWITCH_CARDSTATES_DECK_HOVER};
|
final String[] elems = {ForgeConstants.SWITCH_CARDSTATES_DECK_NEVER, ForgeConstants.SWITCH_CARDSTATES_DECK_HOVER, ForgeConstants.SWITCH_CARDSTATES_DECK_ALWAYS};
|
||||||
final FPref userSetting = FPref.UI_SWITCH_STATES_DECKVIEW;
|
final FPref userSetting = FPref.UI_SWITCH_STATES_DECKVIEW;
|
||||||
final FComboBoxPanel<String> panel = this.view.getSwitchStates();
|
final FComboBoxPanel<String> panel = this.view.getSwitchStates();
|
||||||
final FComboBox<String> comboBox = createComboBox(elems, userSetting);
|
final FComboBox<String> comboBox = createComboBox(elems, userSetting);
|
||||||
|
|||||||
@@ -465,8 +465,8 @@ public final class ForgeConstants {
|
|||||||
public static final String LAND_PLAYED_NOTIFICATION_AI = "Lands entering a battlefield because of an action of a AI player";
|
public static final String LAND_PLAYED_NOTIFICATION_AI = "Lands entering a battlefield because of an action of a AI player";
|
||||||
public static final String LAND_PLAYED_NOTIFICATION_AI_FOR_NONBASIC_LANDS = "Nonbasic lands entering a battlefield because of an action of a AI player";
|
public static final String LAND_PLAYED_NOTIFICATION_AI_FOR_NONBASIC_LANDS = "Nonbasic lands entering a battlefield because of an action of a AI player";
|
||||||
|
|
||||||
// Constants for Land played notification policy
|
|
||||||
public static final String SWITCH_CARDSTATES_DECK_NEVER = "Never";
|
public static final String SWITCH_CARDSTATES_DECK_NEVER = "Never";
|
||||||
|
public static final String SWITCH_CARDSTATES_DECK_ALWAYS = "Always";
|
||||||
public static final String SWITCH_CARDSTATES_DECK_HOVER = "Switch back on hover";
|
public static final String SWITCH_CARDSTATES_DECK_HOVER = "Switch back on hover";
|
||||||
|
|
||||||
// Set boolean constant for landscape mode for gdx port
|
// Set boolean constant for landscape mode for gdx port
|
||||||
|
|||||||
Reference in New Issue
Block a user