mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Fix so inventory updated when cards added/removed from deck
This commit is contained in:
@@ -700,7 +700,7 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canAddCards() {
|
protected boolean canAddCards() {
|
||||||
return false;
|
return !cardManager.isInfinite();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getItemManagerCaption() {
|
protected String getItemManagerCaption() {
|
||||||
@@ -726,9 +726,9 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void refresh() {
|
public void refresh() {
|
||||||
if (!isVisible()) {
|
if (!isVisible() && cardManager.isInfinite()) {
|
||||||
needRefreshWhenShown = true;
|
needRefreshWhenShown = true;
|
||||||
return; //delay refreshing while hidden
|
return; //delay refreshing while hidden for infinite card managers
|
||||||
}
|
}
|
||||||
switch (parentScreen.getEditorType()) {
|
switch (parentScreen.getEditorType()) {
|
||||||
case Archenemy:
|
case Archenemy:
|
||||||
@@ -754,6 +754,9 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCardActivated(PaperCard card) {
|
protected void onCardActivated(PaperCard card) {
|
||||||
|
if (!cardManager.isInfinite()) {
|
||||||
|
removeCard(card);
|
||||||
|
}
|
||||||
parentScreen.getMainDeckPage().addCard(card);
|
parentScreen.getMainDeckPage().addCard(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -764,6 +767,9 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
|||||||
public void run(Integer result) {
|
public void run(Integer result) {
|
||||||
if (result == null || result <= 0) { return; }
|
if (result == null || result <= 0) { return; }
|
||||||
|
|
||||||
|
if (!cardManager.isInfinite()) {
|
||||||
|
removeCard(card, result);
|
||||||
|
}
|
||||||
parentScreen.getMainDeckPage().addCard(card, result);
|
parentScreen.getMainDeckPage().addCard(card, result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -773,6 +779,9 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
|||||||
public void run(Integer result) {
|
public void run(Integer result) {
|
||||||
if (result == null || result <= 0) { return; }
|
if (result == null || result <= 0) { return; }
|
||||||
|
|
||||||
|
if (!cardManager.isInfinite()) {
|
||||||
|
removeCard(card, result);
|
||||||
|
}
|
||||||
parentScreen.getSideboardPage().addCard(card, result);
|
parentScreen.getSideboardPage().addCard(card, result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -784,6 +793,9 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
|||||||
public void run(Integer result) {
|
public void run(Integer result) {
|
||||||
if (result == null || result <= 0) { return; }
|
if (result == null || result <= 0) { return; }
|
||||||
|
|
||||||
|
if (!cardManager.isInfinite()) {
|
||||||
|
removeCard(card);
|
||||||
|
}
|
||||||
CardPool newPool = new CardPool();
|
CardPool newPool = new CardPool();
|
||||||
newPool.add(card);
|
newPool.add(card);
|
||||||
parentScreen.getCommanderPage().setCards(newPool);
|
parentScreen.getCommanderPage().setCards(newPool);
|
||||||
|
|||||||
Reference in New Issue
Block a user