mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
- Do not go through the process of adding items to a card pool if it's already infinite (fixes slowdown when removing a card from the deck in the Constructed deck editor)
This commit is contained in:
@@ -719,6 +719,9 @@ public abstract class ItemManager<T extends InventoryItem> extends JPanel implem
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void addItem(final T item, final int qty) {
|
public void addItem(final T item, final int qty) {
|
||||||
|
if (this.isInfinite()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.pool.add(item, qty);
|
this.pool.add(item, qty);
|
||||||
if (this.isUnfiltered()) {
|
if (this.isUnfiltered()) {
|
||||||
this.model.addItem(item, qty);
|
this.model.addItem(item, qty);
|
||||||
@@ -736,6 +739,9 @@ public abstract class ItemManager<T extends InventoryItem> extends JPanel implem
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void addItems(final Iterable<Entry<T, Integer>> itemsToAdd) {
|
public void addItems(final Iterable<Entry<T, Integer>> itemsToAdd) {
|
||||||
|
if (this.isInfinite()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.pool.addAll(itemsToAdd);
|
this.pool.addAll(itemsToAdd);
|
||||||
if (this.isUnfiltered()) {
|
if (this.isUnfiltered()) {
|
||||||
this.model.addItems(itemsToAdd);
|
this.model.addItems(itemsToAdd);
|
||||||
|
|||||||
Reference in New Issue
Block a user